[rhq] Branch 'feature/gwt-upgrade' - modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java | 45 ++++++----
1 file changed, 30 insertions(+), 15 deletions(-)
New commits:
commit c88234e57e3d97601bcc4750f6800a644a734d40
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jan 16 10:55:05 2012 -0500
Fix clipped title for category in group list views. This icon field
does not need a column title.
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 a6740c0..d3d7ed2 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,11 +18,29 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups;
+import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.AVAIL_CHILDREN;
+import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.AVAIL_DESCENDANTS;
+import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.CATEGORY;
+import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.DESCRIPTION;
+import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.NAME;
+import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.PLUGIN;
+import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.TYPE;
+
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.widgets.events.*;
-import com.smartgwt.client.widgets.grid.*;
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.events.CloseClickEvent;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+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.HoverCustomizer;
+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.authz.Permission;
import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.search.SearchSubsystem;
@@ -32,6 +50,7 @@ import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.PopupWindow;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.AuthorizedTableAction;
+import org.rhq.enterprise.gui.coregui.client.components.table.IconField;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -42,8 +61,6 @@ 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.SeleniumUtility;
-import static org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField.*;
-
/**
* @author Greg Hinkle
* @author Joseph Marques
@@ -90,9 +107,7 @@ public class ResourceGroupListView extends Table<ResourceGroupCompositeDataSourc
ListGridField idField = new ListGridField("id", MSG.common_title_id());
idField.setWidth(50);
- ListGridField categoryField = new ListGridField(CATEGORY.propertyName(), CATEGORY.title());
- categoryField.setWidth(25);
- categoryField.setAlign(Alignment.CENTER);
+ IconField categoryField = new IconField(CATEGORY.propertyName());
categoryField.setCellFormatter(new CellFormatter() {
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
String categoryName = (String) value;
@@ -108,14 +123,14 @@ public class ResourceGroupListView extends Table<ResourceGroupCompositeDataSourc
GroupCategory category = GroupCategory.valueOf(categoryName);
String displayName;
switch (category) {
- case COMPATIBLE:
- displayName = MSG.view_group_summary_compatible();
- break;
- case MIXED:
- displayName = MSG.view_group_summary_mixed();
- break;
- default:
- throw new IllegalStateException("Unknown group category: " + category);
+ case COMPATIBLE:
+ displayName = MSG.view_group_summary_compatible();
+ break;
+ case MIXED:
+ displayName = MSG.view_group_summary_mixed();
+ break;
+ default:
+ throw new IllegalStateException("Unknown group category: " + category);
}
return displayName;
}
12 years, 5 months
[rhq] Branch 'feature/gwt-upgrade' - 5 commits - modules/core modules/enterprise
by Jay Shaughnessy
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/core/client/RHQDomain.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleLdapGroupSelector.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java | 30
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/EnhancedListGrid.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java | 23
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 60 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/IsLongValidator.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/sorter/ReorderableList.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/EscapedHtmlCellFormatter.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java | 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java | 515 ++++------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletHelpWindow.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMetricGraphView.java | 18
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationMembers.java | 35
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationMembers.java | 35
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/ResourceGroupMetricGraphView.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/traits/TraitsView.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceErrorsView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java | 42
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java | 12
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryPackageStep.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java | 29
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReportResourceSearchView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java | 48
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/GwtRelativeDurationConverter.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/CompoundAsyncOperationException.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/measurement/GwtMeasurementConverter.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java | 29
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java | 11
66 files changed, 536 insertions(+), 574 deletions(-)
New commits:
commit bfc85777e412cc6fe91522b78893f9d07e29230c
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jan 16 09:58:23 2012 -0500
trivial, add default serialVersionUID to Serializable class
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/CompoundAsyncOperationException.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/CompoundAsyncOperationException.java
index ef7dfd3..8990901 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/CompoundAsyncOperationException.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/CompoundAsyncOperationException.java
@@ -26,11 +26,13 @@ import java.util.Map;
*/
public class CompoundAsyncOperationException extends Exception {
- private Map<AsyncOperation,Object> successResults;
- private Map<AsyncOperation,Throwable> failureThrowables;
+ private static final long serialVersionUID = 1L;
+
+ private Map<AsyncOperation, Object> successResults;
+ private Map<AsyncOperation, Throwable> failureThrowables;
public CompoundAsyncOperationException(Map<AsyncOperation, Object> successResults,
- Map<AsyncOperation, Throwable> failureThrowables) {
+ Map<AsyncOperation, Throwable> failureThrowables) {
super("One or more child operations failed.");
this.successResults = successResults;
this.failureThrowables = failureThrowables;
commit dcdeed05468b6170e8abde0b9cc8c8a473e8b63e
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jan 16 09:57:59 2012 -0500
Fix deprecations after gwt/smartgwt upgrade
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 d331365..a59f6ef 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
@@ -344,7 +344,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
}
public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) {
- currentView = URL.decodeComponent(stringValueChangeEvent.getValue());
+ currentView = URL.decodeQueryString(stringValueChangeEvent.getValue());
Log.debug("Handling history event for view: " + currentView);
currentViewPath = new ViewPath(currentView);
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 74d11e3..f52b06d 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
@@ -521,8 +521,8 @@ public class LoginView extends LocatableCanvas {
requestBuilder.setHeader("Content-Type", "application/x-www-form-urlencoded");
// URL-encode the username and password in case they contain URL special characters ('?', '&', '%', '+',
// etc.), which would corrupt the request if not encoded.
- String encodedUsername = URL.encodeComponent(username);
- String encodedPassword = URL.encodeComponent(password);
+ String encodedUsername = URL.encodeQueryString(username);
+ String encodedPassword = URL.encodeQueryString(password);
String requestData = "j_username=" + encodedUsername + "&j_password=" + encodedPassword;
requestBuilder.setRequestData(requestData);
requestBuilder.setCallback(new RequestCallback() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java
index 85bb9e9..e9030d9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java
@@ -3,6 +3,7 @@ package org.rhq.enterprise.gui.coregui.client.components.table;
import java.util.Date;
import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.HoverCustomizer;
import com.smartgwt.client.widgets.grid.ListGridField;
@@ -15,10 +16,14 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
*/
public class TimestampCellFormatter implements CellFormatter {
- public static final DateTimeFormat DATE_TIME_FORMAT_FULL = DateTimeFormat.getFullDateTimeFormat();
- public static final DateTimeFormat DATE_TIME_FORMAT_LONG = DateTimeFormat.getLongDateTimeFormat();
- public static final DateTimeFormat DATE_TIME_FORMAT_MEDIUM = DateTimeFormat.getMediumDateTimeFormat();
- public static final DateTimeFormat DATE_TIME_FORMAT_SHORT = DateTimeFormat.getShortDateTimeFormat();
+ public static final DateTimeFormat DATE_TIME_FORMAT_FULL = DateTimeFormat
+ .getFormat(PredefinedFormat.DATE_TIME_FULL);
+ public static final DateTimeFormat DATE_TIME_FORMAT_LONG = DateTimeFormat
+ .getFormat(PredefinedFormat.DATE_TIME_LONG);
+ public static final DateTimeFormat DATE_TIME_FORMAT_MEDIUM = DateTimeFormat
+ .getFormat(PredefinedFormat.DATE_TIME_MEDIUM);
+ public static final DateTimeFormat DATE_TIME_FORMAT_SHORT = DateTimeFormat
+ .getFormat(PredefinedFormat.DATE_TIME_SHORT);
private DateTimeFormat dateTimeFormat;
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 1d386b5..40614fc 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
@@ -20,10 +20,10 @@ package org.rhq.enterprise.gui.coregui.client.components.upload;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
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 org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
@@ -104,7 +104,7 @@ public class DynamicCallbackForm extends LocatableDynamicForm implements Dynamic
// because clients that detach the form panel when submission is
// complete can cause some browsers (i.e. Mozilla) to go into an
// 'infinite loading' state. See issue 916.
- DeferredCommand.addCommand(new Command() {
+ Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
formHandlers.fireOnComplete(DynamicCallbackForm.this, impl.getContents(synthesizedFrame));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
index 69ed9f5..1a2893b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
@@ -98,8 +98,8 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
protected void onDraw() {
ArrayList<ListGridField> fields = new ArrayList<ListGridField>(5);
- ListGridField nameField = new ListGridField(ResourceDataSourceField.NAME.propertyName(), MSG
- .common_title_name());
+ ListGridField nameField = new ListGridField(ResourceDataSourceField.NAME.propertyName(),
+ MSG.common_title_name());
nameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
return "<a href=\"" + LinkManager.getResourceLink(listGridRecord.getAttributeAsInt("id")) + "\">" + o
@@ -108,8 +108,8 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
});
fields.add(nameField);
- ListGridField versionField = new ListGridField(ResourceDataSourceField.VERSION.propertyName(), MSG
- .common_title_version());
+ ListGridField versionField = new ListGridField(ResourceDataSourceField.VERSION.propertyName(),
+ MSG.common_title_version());
fields.add(versionField);
ListGridField cpuField = new ListGridField("cpu", MSG.dataSource_platforms_field_cpu());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java
index 934030b..cae65ef 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java
@@ -93,35 +93,35 @@ public class InventorySummaryPortlet extends LocatableVLayout implements AutoRef
summary.getPlatformCount(), "Inventory/Resources/Platforms");
formItems.add(platformTotal);
- StaticTextItem serverTotal = createSummaryRow("serverTotal", MSG.common_title_server_total(), summary
- .getServerCount(), "Inventory/Resources/Servers");
+ StaticTextItem serverTotal = createSummaryRow("serverTotal", MSG.common_title_server_total(),
+ summary.getServerCount(), "Inventory/Resources/Servers");
formItems.add(serverTotal);
StaticTextItem serviceTotal = createSummaryRow("serviceTotal", MSG.common_title_service_total(),
summary.getServiceCount(), "Inventory/Resources/Services");
formItems.add(serviceTotal);
- StaticTextItem compatibleGroupTotal = createSummaryRow("compatibleGroupTotal", MSG
- .common_title_compatibleGroups_total(), summary.getCompatibleGroupCount(),
+ StaticTextItem compatibleGroupTotal = createSummaryRow("compatibleGroupTotal",
+ MSG.common_title_compatibleGroups_total(), summary.getCompatibleGroupCount(),
"Inventory/Groups/CompatibleGroups");
formItems.add(compatibleGroupTotal);
- StaticTextItem mixedGroupTotal = createSummaryRow("mixedGroupTotal", MSG
- .common_title_mixedGroups_total(), summary.getMixedGroupCount(), "Inventory/Groups/MixedGroups");
+ StaticTextItem mixedGroupTotal = createSummaryRow("mixedGroupTotal",
+ MSG.common_title_mixedGroups_total(), summary.getMixedGroupCount(), "Inventory/Groups/MixedGroups");
formItems.add(mixedGroupTotal);
- StaticTextItem groupDefinitionTotal = createSummaryRow("groupDefinitionTotal", MSG
- .common_title_group_def_total(), summary.getGroupDefinitionCount(),
+ StaticTextItem groupDefinitionTotal = createSummaryRow("groupDefinitionTotal",
+ MSG.common_title_group_def_total(), summary.getGroupDefinitionCount(),
"Inventory/Groups/DynagroupDefinitions");
formItems.add(groupDefinitionTotal);
- StaticTextItem avergeMetricsTotal = createSummaryRow("averageMetricsTotal", MSG
- .common_title_average_metrics(), summary.getScheduledMeasurementsPerMinute(), null);
+ StaticTextItem avergeMetricsTotal = createSummaryRow("averageMetricsTotal",
+ MSG.common_title_average_metrics(), summary.getScheduledMeasurementsPerMinute(), null);
formItems.add(avergeMetricsTotal);
form.setItems(formItems.toArray(new FormItem[formItems.size()]));
form.setWrapItemTitles(false);
- form.setCellSpacing(5);
+ form.setCellPadding(5);
addMember(form);
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages.java
index 6ffba7c..9bf4676 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages.java
@@ -18,8 +18,8 @@
*/
package org.rhq.enterprise.gui.coregui.client.i18n;
-import com.google.gwt.i18n.client.Messages;
import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;
+import com.google.gwt.i18n.client.Messages;
/*
* @PluralText takes an array of strings. The even indexes represent plural form names, while the odd indexes
@@ -52,6 +52,6 @@ public interface TestMessages extends Messages {
* @return a message specifying the number of items in the user's cart
*/
@DefaultMessage("{0}, there are {1,number} items in your cart")
- @PluralText( { "one", "{0}, there is {1,number} item in your cart" })
+ @AlternateMessage({ "one", "{0}, there is {1,number} item in your cart" })
String cartLabel(String subject, @PluralCount int cartItems);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMetricGraphView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMetricGraphView.java
index 6c9b167..01f350f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMetricGraphView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMetricGraphView.java
@@ -38,6 +38,7 @@ import ca.nanometrics.gflot.client.options.PointsSeriesOptions;
import ca.nanometrics.gflot.client.options.TickFormatter;
import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
import com.smartgwt.client.types.AnimationEffect;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.Img;
@@ -215,8 +216,8 @@ public abstract class AbstractMetricGraphView extends LocatableVLayout {
// create the plot
SimplePlot plot = new SimplePlot(model, plotOptions);
- plot.setSize(String.valueOf(getInnerContentWidth()), String.valueOf(getInnerContentHeight()
- - titleHLayout.getHeight() - 50));
+ plot.setSize(String.valueOf(getInnerContentWidth()),
+ String.valueOf(getInnerContentHeight() - titleHLayout.getHeight() - 50));
// "80%","80%");
// add hover listener
@@ -267,8 +268,8 @@ public abstract class AbstractMetricGraphView extends LocatableVLayout {
addMember(new LocatableWidgetCanvas(extendLocatorId("Plot"), plot));
- plot.setSize(String.valueOf(getInnerContentWidth()), String.valueOf(getInnerContentHeight()
- - titleHLayout.getHeight() - 50));
+ plot.setSize(String.valueOf(getInnerContentWidth()),
+ String.valueOf(getInnerContentHeight() - titleHLayout.getHeight() - 50));
}
@@ -294,7 +295,7 @@ public abstract class AbstractMetricGraphView extends LocatableVLayout {
protected String getHover(PlotItem item) {
if (definition != null) {
- com.google.gwt.i18n.client.DateTimeFormat df = DateTimeFormat.getMediumDateTimeFormat();
+ com.google.gwt.i18n.client.DateTimeFormat df = DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM);
return definition.getDisplayName() + ": "
+ MeasurementConverterClient.format(item.getDataPoint().getY(), definition.getUnits(), true) + "<br/>"
+ df.format(new Date((long) item.getDataPoint().getX()));
@@ -310,8 +311,8 @@ public abstract class AbstractMetricGraphView extends LocatableVLayout {
handler.add(new DataPoint(d.getTimestamp(), d.getValue()));
}
- plotOptions.setYAxisOptions(new AxisOptions().setTicks(5).setLabelWidth(70).setTickFormatter(
- new TickFormatter() {
+ plotOptions.setYAxisOptions(new AxisOptions().setTicks(5).setLabelWidth(70)
+ .setTickFormatter(new TickFormatter() {
public String formatTickValue(double v, Axis axis) {
return MeasurementConverterClient.format(v, definition.getUnits(), true);
}
@@ -325,7 +326,8 @@ public abstract class AbstractMetricGraphView extends LocatableVLayout {
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();
+ com.google.gwt.i18n.client.DateTimeFormat dateFormat = DateTimeFormat
+ .getFormat(PredefinedFormat.DATE_TIME_SHORT);
return dateFormat.format(new Date((long) tickValue));
// return String.valueOf(new Date((long) tickValue));
// return MONTH_NAMES[(int) (tickValue - 1)];
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java
index 0fa6245..04883bf 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionDataSource.java
@@ -85,13 +85,13 @@ public class GroupDefinitionDataSource extends RPCDataSource<GroupDefinition, Re
fields.add(expressionField);
// it is a Long, but there is no DataSourceLongField and I've seen problems trying to use anything other than text field
- DataSourceTextField lastCalculationTimeIntervalField = new DataSourceTextField("lastCalculationTime", MSG
- .view_dynagroup_lastCalculationTime());
+ DataSourceTextField lastCalculationTimeIntervalField = new DataSourceTextField("lastCalculationTime",
+ MSG.view_dynagroup_lastCalculationTime());
fields.add(lastCalculationTimeIntervalField);
// it is a Long, but there is no DataSourceLongField and I've seen problems trying to use anything other than text field
- DataSourceTextField nextCalculationTimeField = new DataSourceTextField("nextCalculationTime", MSG
- .view_dynagroup_nextCalculationTime());
+ DataSourceTextField nextCalculationTimeField = new DataSourceTextField("nextCalculationTime",
+ MSG.view_dynagroup_nextCalculationTime());
fields.add(nextCalculationTimeField);
return fields;
@@ -108,8 +108,7 @@ public class GroupDefinitionDataSource extends RPCDataSource<GroupDefinition, Re
}
public void onSuccess(PageList<GroupDefinition> result) {
- populateSuccessResponse(result, response);
- processResponse(request.getRequestId(), response);
+ sendSuccessResponse(request, response, result);
}
});
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
index 2346465..edc1611 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
@@ -18,11 +18,29 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring;
-import ca.nanometrics.gflot.client.*;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Set;
+
+import ca.nanometrics.gflot.client.Axis;
+import ca.nanometrics.gflot.client.DataPoint;
+import ca.nanometrics.gflot.client.PlotItem;
+import ca.nanometrics.gflot.client.PlotModel;
+import ca.nanometrics.gflot.client.PlotModelStrategy;
+import ca.nanometrics.gflot.client.PlotPosition;
+import ca.nanometrics.gflot.client.SeriesHandler;
+import ca.nanometrics.gflot.client.SimplePlot;
import ca.nanometrics.gflot.client.event.PlotHoverListener;
import ca.nanometrics.gflot.client.jsni.Plot;
-import ca.nanometrics.gflot.client.options.*;
+import ca.nanometrics.gflot.client.options.AxisOptions;
+import ca.nanometrics.gflot.client.options.GridOptions;
+import ca.nanometrics.gflot.client.options.LineSeriesOptions;
+import ca.nanometrics.gflot.client.options.PlotOptions;
+import ca.nanometrics.gflot.client.options.PointsSeriesOptions;
+import ca.nanometrics.gflot.client.options.TickFormatter;
+
import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.AnimationEffect;
@@ -30,7 +48,13 @@ import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.Window;
-import com.smartgwt.client.widgets.events.*;
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.events.CloseClickEvent;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.MouseOutEvent;
+import com.smartgwt.client.widgets.events.MouseOutHandler;
+
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementDefinition;
@@ -42,10 +66,6 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWidgetCanvas;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.Set;
-
/**
* @author Greg Hinkle
*/
@@ -188,7 +208,7 @@ public class LiveGraphView extends LocatableVLayout {
private String getHover(PlotItem item) {
if (definition != null) {
- DateTimeFormat df = DateTimeFormat.getMediumDateTimeFormat();
+ DateTimeFormat df = DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM);
return definition.getDisplayName() + ": "
+ MeasurementConverterClient.format(item.getDataPoint().getY(), definition.getUnits(), true) + "<br/>"
+ df.format(new Date((long) item.getDataPoint().getX()));
@@ -238,8 +258,8 @@ public class LiveGraphView extends LocatableVLayout {
dataLoader.scheduleRepeating(1000);
- plotOptions.setYAxisOptions(new AxisOptions().setLabelWidth(70).setTicks(5).setTickFormatter(
- new TickFormatter() {
+ plotOptions.setYAxisOptions(new AxisOptions().setLabelWidth(70).setTicks(5)
+ .setTickFormatter(new TickFormatter() {
public String formatTickValue(double v, Axis axis) {
return MeasurementConverterClient.format(v, definition.getUnits(), true);
}
@@ -250,7 +270,7 @@ public class LiveGraphView extends LocatableVLayout {
plotOptions.setXAxisOptions(new AxisOptions().setTicks(8).setTickFormatter(new TickFormatter() {
public String formatTickValue(double tickValue, Axis axis) {
- DateTimeFormat dateFormat = DateTimeFormat.getMediumTimeFormat();
+ DateTimeFormat dateFormat = DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM);
return dateFormat.format(new Date((long) tickValue));
}
}));
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 9daf6d5..0cc7f40 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
@@ -53,12 +53,12 @@ import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.SuggestOracle;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.TextBoxBase;
import com.google.gwt.user.client.ui.SuggestOracle.Callback;
import com.google.gwt.user.client.ui.SuggestOracle.Request;
import com.google.gwt.user.client.ui.SuggestOracle.Response;
import com.google.gwt.user.client.ui.SuggestOracle.Suggestion;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.TextBoxBase;
import org.rhq.core.domain.search.SearchSuggestion;
import org.rhq.core.domain.search.SearchSuggestion.Kind;
@@ -665,32 +665,32 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus
String expression = suggestionRequest.getQuery();
int caretPosition = suggestionRequest.getCursorPosition();
- 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()]));
- }
+ searchService.getTabAwareSuggestions(searchBar.getSearchSubsystem(), expression, caretPosition,
+ searchBar.getSelectedTab(), new AsyncCallback<List<SearchSuggestion>>() {
- public void onFailure(Throwable caught) {
- SearchSuggestion errorInform = new SearchSuggestion(Kind.InstructionalTextComment, MSG
- .view_searchBar_instructional_failSuggest());
- adaptAndHandle(errorInform);
- }
+ public void onSuccess(List<SearchSuggestion> results) {
+ adaptAndHandle(results.toArray(new SearchSuggestion[results.size()]));
+ }
- private void adaptAndHandle(SearchSuggestion... searchSuggestionResults) {
- List<SearchSuggestionOracleAdapter> adaptedResults = new java.util.ArrayList<SearchSuggestionOracleAdapter>();
- for (SearchSuggestion next : searchSuggestionResults) {
- adaptedResults.add(new SearchSuggestionOracleAdapter(next));
+ public void onFailure(Throwable caught) {
+ SearchSuggestion errorInform = new SearchSuggestion(Kind.InstructionalTextComment, MSG
+ .view_searchBar_instructional_failSuggest());
+ adaptAndHandle(errorInform);
}
- if (adaptedResults.isEmpty()) {
- adaptedResults.add(new SearchSuggestionOracleAdapter(new SearchSuggestion(
- Kind.InstructionalTextComment, MSG.view_searchBar_instructional_noSuggest())));
+
+ private void adaptAndHandle(SearchSuggestion... searchSuggestionResults) {
+ List<SearchSuggestionOracleAdapter> adaptedResults = new java.util.ArrayList<SearchSuggestionOracleAdapter>();
+ for (SearchSuggestion next : searchSuggestionResults) {
+ adaptedResults.add(new SearchSuggestionOracleAdapter(next));
+ }
+ if (adaptedResults.isEmpty()) {
+ adaptedResults.add(new SearchSuggestionOracleAdapter(new SearchSuggestion(
+ Kind.InstructionalTextComment, MSG.view_searchBar_instructional_noSuggest())));
+ }
+ SuggestOracle.Response response = new SuggestOracle.Response(adaptedResults);
+ callback.onSuggestionsReady(request, response);
}
- 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/client/util/message/MessageCenterView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java
index 9bfd7c3..16304dc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java
@@ -18,10 +18,19 @@
*/
package org.rhq.enterprise.gui.coregui.client.util.message;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.Timer;
import com.smartgwt.client.data.SortSpecifier;
-import com.smartgwt.client.types.*;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.types.SelectionStyle;
+import com.smartgwt.client.types.SortDirection;
+import com.smartgwt.client.types.TimeDisplayFormat;
+import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.CloseClickEvent;
import com.smartgwt.client.widgets.events.CloseClickHandler;
@@ -30,7 +39,12 @@ import com.smartgwt.client.widgets.events.DoubleClickHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.FormItemIcon;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.grid.*;
+import com.smartgwt.client.widgets.grid.HoverCustomizer;
+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 org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
@@ -40,10 +54,6 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-
/**
* Message Center view that shows the latest messages generated by the app.
* This is a Table and can therefore be a member to any layout. However, it can
@@ -128,7 +138,8 @@ public class MessageCenterView extends Table implements MessageCenter.MessageLis
protected void configureTable() {
getListGrid().setEmptyMessage(MSG.view_messageCenter_noRecentMessages());
- updateTitleCanvas(MSG.view_messageCenter_lastNMessages(String.valueOf(CoreGUI.getMessageCenter().getMaxMessages())));
+ updateTitleCanvas(MSG.view_messageCenter_lastNMessages(String.valueOf(CoreGUI.getMessageCenter()
+ .getMaxMessages())));
ListGridField severityField = new ListGridField(FIELD_SEVERITY);
severityField.setType(ListGridFieldType.ICON);
@@ -178,7 +189,7 @@ public class MessageCenterView extends Table implements MessageCenter.MessageLis
ListGridField timeField = new ListGridField(FIELD_TIME, MSG.view_messageCenter_messageTime());
timeField.setType(ListGridFieldType.TIME);
- timeField.setAttribute("displayFormat", TimeFormatter.TOPADDEDTIME);
+ timeField.setAttribute("displayFormat", TimeDisplayFormat.TOPADDEDTIME);
timeField.setAlign(Alignment.LEFT);
timeField.setShowHover(true);
timeField.setHoverCustomizer(TimestampCellFormatter.getHoverCustomizer(FIELD_TIME));
commit b0155c8cd39adb08b9e252c890d0673ec2391e92
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jan 16 09:52:51 2012 -0500
trivial - clean up a bunch of unused imports
** Use your IDE settings to clean these up on file save! **
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/client/RHQDomain.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/client/RHQDomain.java
index 9669149..3140784 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/client/RHQDomain.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/client/RHQDomain.java
@@ -23,7 +23,6 @@
package org.rhq.core.client;
import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.user.client.ui.*;
public class RHQDomain implements EntryPoint {
public void onModuleLoad() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/EnhancedListGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/EnhancedListGrid.java
index 596c7db..2edc60e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/EnhancedListGrid.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/EnhancedListGrid.java
@@ -18,13 +18,8 @@
*/
package org.rhq.enterprise.gui.coregui.client.components;
-import com.google.gwt.core.client.JavaScriptObject;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.grid.ListGrid;
-import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.layout.VStack;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
/**
@@ -32,7 +27,6 @@ import com.smartgwt.client.widgets.toolbar.ToolStrip;
*/
public class EnhancedListGrid extends VLayout {
-
ListGrid grid;
ToolStrip footer;
@@ -44,7 +38,6 @@ public class EnhancedListGrid extends VLayout {
addMember(footer);
}
-
public ListGrid getGrid() {
return grid;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java
index 2052702..fed6efd 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java
@@ -18,9 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.components;
-
import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.Label;
/**
* @author Greg Hinkle
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 c1fb328..28bd22d 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
@@ -62,7 +62,6 @@ import com.smartgwt.client.widgets.form.fields.PasswordItem;
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.SpinnerItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.form.fields.TextAreaItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
@@ -402,8 +401,8 @@ public class ConfigurationEditor extends LocatableVLayout {
if (groupDefinitions.isEmpty()) {
// No prop groups, so we just need a single form for the non-grouped props.
- List<PropertyDefinition> propertyDefinitions = new ArrayList<PropertyDefinition>(configurationDefinition
- .getNonGroupedProperties());
+ List<PropertyDefinition> propertyDefinitions = new ArrayList<PropertyDefinition>(
+ configurationDefinition.getNonGroupedProperties());
DynamicForm form = buildPropertiesForm(layout.extendLocatorId("Props"), propertyDefinitions, configuration);
form.setBorder("1px solid #AAA");
@@ -515,8 +514,8 @@ public class ConfigurationEditor extends LocatableVLayout {
}
List<PropertyDefinition> propertyDefinitions = new ArrayList<PropertyDefinition>(
- ((group == null) ? configurationDefinition.getNonGroupedProperties() : configurationDefinition
- .getPropertiesInGroup(group.getName())));
+ ((group == null) ? configurationDefinition.getNonGroupedProperties()
+ : configurationDefinition.getPropertiesInGroup(group.getName())));
DynamicForm form = buildPropertiesForm(locatorId, propertyDefinitions, configuration);
@@ -745,8 +744,8 @@ public class ConfigurationEditor extends LocatableVLayout {
invalidPropertySetChanged = (this.invalidPropertyNameToDisplayNameMap.remove(topLevelPropertyDefinition
.getName()) != null);
} else {
- invalidPropertySetChanged = (this.invalidPropertyNameToDisplayNameMap.put(topLevelPropertyDefinition
- .getName(), topLevelPropertyDefinition.getDisplayName()) == null);
+ invalidPropertySetChanged = (this.invalidPropertyNameToDisplayNameMap.put(
+ topLevelPropertyDefinition.getName(), topLevelPropertyDefinition.getDisplayName()) == null);
}
PropertyValueChangeEvent event = new PropertyValueChangeEvent(property, propertyDefinition,
@@ -768,8 +767,9 @@ public class ConfigurationEditor extends LocatableVLayout {
final PropertyMap propertyMap) {
boolean isDynamic = isDynamic(propertyDefinitionMap);
if (isDynamic) {
- PropertyDefinitionMap propertyDefinitionMapClone = new PropertyDefinitionMap(propertyDefinitionMap
- .getName(), propertyDefinitionMap.getDescription(), propertyDefinitionMap.isRequired());
+ PropertyDefinitionMap propertyDefinitionMapClone = new PropertyDefinitionMap(
+ propertyDefinitionMap.getName(), propertyDefinitionMap.getDescription(),
+ propertyDefinitionMap.isRequired());
propertyDefinitionMapClone.setConfigurationDefinition(propertyDefinitionMap.getConfigurationDefinition());
propertyDefinitionMapClone.setReadOnly(propertyDefinitionMap.isReadOnly());
addMemberPropertyDefinitionsToDynamicPropertyMap(propertyDefinitionMapClone, propertyMap);
@@ -830,8 +830,8 @@ public class ConfigurationEditor extends LocatableVLayout {
buttonBar.addMember(deleteControlsLayout);
final SelectItem selectItem = new SelectItem();
- selectItem.setValueMap(propertyDefinitionMap.getPropertyDefinitions().keySet().toArray(
- new String[propertyDefinitionMap.getPropertyDefinitions().size()]));
+ selectItem.setValueMap(propertyDefinitionMap.getPropertyDefinitions().keySet()
+ .toArray(new String[propertyDefinitionMap.getPropertyDefinitions().size()]));
selectItem.setMultiple(true);
selectItem.setMultipleAppearance(MultipleAppearance.GRID);
selectItem.setTitle(MSG.common_button_delete());
@@ -1050,18 +1050,18 @@ public class ConfigurationEditor extends LocatableVLayout {
PropertyDefinitionSimple defSimple = (PropertyDefinitionSimple) summaryPropDef;
PropertySimpleType propSimpleType = defSimple.getType();
switch (propSimpleType) {
- case BOOLEAN:
- field.setType(ListGridFieldType.BOOLEAN);
- break;
- case INTEGER:
- field.setType(ListGridFieldType.INTEGER);
- break;
- case FLOAT:
- case DOUBLE:
- field.setType(ListGridFieldType.FLOAT);
- break;
- default:
- field.setType(ListGridFieldType.TEXT);
+ case BOOLEAN:
+ field.setType(ListGridFieldType.BOOLEAN);
+ break;
+ case INTEGER:
+ field.setType(ListGridFieldType.INTEGER);
+ break;
+ case FLOAT:
+ case DOUBLE:
+ field.setType(ListGridFieldType.FLOAT);
+ break;
+ default:
+ field.setType(ListGridFieldType.TEXT);
}
return field;
}
@@ -1348,9 +1348,8 @@ public class ConfigurationEditor extends LocatableVLayout {
List<Validator> validators = buildValidators(propertyDefinitionSimple, propertySimple);
valueItem.setValidators(validators.toArray(new Validator[validators.size()]));
- if ((propertySimple.getConfiguration() != null) ||
- (propertySimple.getParentMap() != null) ||
- (propertySimple.getParentList() != null)) {
+ if ((propertySimple.getConfiguration() != null) || (propertySimple.getParentMap() != null)
+ || (propertySimple.getParentList() != null)) {
valueItem.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent changedEvent) {
updatePropertySimpleValue(changedEvent.getItem(), changedEvent.getValue(), propertySimple,
@@ -1407,7 +1406,7 @@ public class ConfigurationEditor extends LocatableVLayout {
}
protected void updatePropertySimpleValue(FormItem formItem, Object value, PropertySimple propertySimple,
- PropertyDefinitionSimple propertyDefinitionSimple) {
+ PropertyDefinitionSimple propertyDefinitionSimple) {
propertySimple.setErrorMessage(null);
propertySimple.setValue(value);
}
@@ -1461,8 +1460,7 @@ public class ConfigurationEditor extends LocatableVLayout {
if (isUnset) {
if (valueItem.getValue() != null) {
setValue(valueItem, null);
- updatePropertySimpleValue(unsetItem, null, propertySimple,
- propertyDefinitionSimple);
+ updatePropertySimpleValue(unsetItem, null, propertySimple, propertyDefinitionSimple);
firePropertyChangedEvent(propertySimple, propertyDefinitionSimple, true);
}
} else {
@@ -1668,8 +1666,8 @@ public class ConfigurationEditor extends LocatableVLayout {
buttonBar.addMember(okButton);
if (!mapReadOnly) {
- final IButton cancelButton = new LocatableIButton(buttonBar.extendLocatorId("Cancel"), MSG
- .common_button_cancel());
+ final IButton cancelButton = new LocatableIButton(buttonBar.extendLocatorId("Cancel"),
+ MSG.common_button_cancel());
cancelButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
public void onClick(ClickEvent clickEvent) {
layout.destroy();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/EscapedHtmlCellFormatter.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/EscapedHtmlCellFormatter.java
index c60236c..27db60f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/EscapedHtmlCellFormatter.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/EscapedHtmlCellFormatter.java
@@ -2,7 +2,7 @@ package org.rhq.enterprise.gui.coregui.client.components.table;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import org.rhq.enterprise.gui.coregui.client.ImageManager;
+
import org.rhq.enterprise.gui.coregui.client.util.StringUtility;
/**
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
index d359e6b..e312b85 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
@@ -24,12 +24,10 @@ import static org.rhq.core.domain.drift.DriftFileStatus.LOADED;
import static org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter.DATE_TIME_FORMAT_FULL;
import java.util.LinkedHashMap;
-import java.util.List;
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.CanvasItem;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.SpacerItem;
@@ -175,8 +173,8 @@ public class DriftDetailsView extends LocatableVLayout {
category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
oldFileLink = createViewFileLink(driftDetails.getDrift().getOldDriftFile().getHashId(), driftDetails
- .getDrift().getPath(), driftDetails.getPreviousChangeSet().getVersion(), driftDetails
- .getOldFileStatus());
+ .getDrift().getPath(), driftDetails.getPreviousChangeSet().getVersion(),
+ driftDetails.getOldFileStatus());
newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
newFileLink = createViewFileLink(driftDetails.getDrift().getNewDriftFile().getHashId(), driftDetails
.getDrift().getPath(), driftDetails.getChangeSet().getVersion(), driftDetails.getNewFileStatus());
@@ -213,8 +211,8 @@ public class DriftDetailsView extends LocatableVLayout {
changeSetCategory.setValue(changeSet.getCategory().name());
StaticTextItem changeSetVersion = new StaticTextItem("changeSetVersion", MSG.common_title_version());
changeSetVersion.setValue(changeSet.getVersion());
- StaticTextItem changeSetDriftHandling = new StaticTextItem("changeSetDriftHandling", MSG
- .view_drift_table_driftHandlingMode());
+ StaticTextItem changeSetDriftHandling = new StaticTextItem("changeSetDriftHandling",
+ MSG.view_drift_table_driftHandlingMode());
changeSetDriftHandling.setValue(DriftDefinitionDataSource.getDriftHandlingModeDisplayName(changeSet
.getDriftHandlingMode()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/ResourceGroupMetricGraphView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/ResourceGroupMetricGraphView.java
index 5725fb7..23f84ea 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/ResourceGroupMetricGraphView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/ResourceGroupMetricGraphView.java
@@ -24,7 +24,6 @@ import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.HTMLFlow;
-import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
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
index 35b97a0..c56638d 100644
--- 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
@@ -19,7 +19,6 @@
package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.traits;
import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.types.GroupStartOpen;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.HoverCustomizer;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java
index 37e93ce..9e7f94d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java
@@ -26,11 +26,8 @@ import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.criteria.GroupOperationHistoryCriteria;
import org.rhq.core.domain.operation.GroupOperationHistory;
-import org.rhq.core.domain.operation.OperationDefinition;
-import org.rhq.core.domain.operation.ResourceOperationHistory;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDataSource;
commit a979e1be7391cc2239ad2ee268bce64f9dd0d5fc
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jan 16 09:50:35 2012 -0500
trivial - clean up a bunch of unused/unnecessary variable compiler warnings
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java
index f628b83..242de00 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java
@@ -34,7 +34,6 @@ import org.rhq.core.domain.util.PageOrdering;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
-@SuppressWarnings("unused")
public abstract class AbstractConfigurationUpdateCriteria extends Criteria {
private static final long serialVersionUID = 1L;
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 9317bab..2f9eb13 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
@@ -61,7 +61,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
* @author Ian Springer
*/
public class RoleEditView extends AbstractRecordEditor<RolesDataSource> implements BookmarkableView {
-
+
private static final String HEADER_ICON = "global/Role_24.png";
private LocatableTab permissionsTab;
@@ -95,7 +95,8 @@ public class RoleEditView extends AbstractRecordEditor<RolesDataSource> implemen
public void onPermissionsLoaded(Set<Permission> perms) {
if (perms == null) {
// TODO: i18n
- CoreGUI.getErrorHandler().handleError("Failed to load global permissions for current user. Perhaps the Server is down.");
+ CoreGUI.getErrorHandler().handleError(
+ "Failed to load global permissions for current user. Perhaps the Server is down.");
return;
}
RoleEditView.this.hasManageSecurityPermission = perms.contains(Permission.MANAGE_SECURITY);
@@ -210,7 +211,6 @@ public class RoleEditView extends AbstractRecordEditor<RolesDataSource> implemen
@Override
protected Record createNewRecord() {
Role role = new Role();
- @SuppressWarnings( { "UnnecessaryLocalVariable" })
Record roleRecord = RolesDataSource.getInstance().copyValues(role);
return roleRecord;
}
@@ -234,15 +234,14 @@ public class RoleEditView extends AbstractRecordEditor<RolesDataSource> implemen
if (this.hasManageSecurityPermission || isMemberOfRole) {
// Create the permission editor and selectors and add them to the corresponding tabs.
- this.permissionsEditor = new PermissionsEditor(this, !hasManageSecurityPermission ||
- this.isSystemRole);
+ this.permissionsEditor = new PermissionsEditor(this, !hasManageSecurityPermission || this.isSystemRole);
updateTab(this.permissionsTab, this.permissionsEditor);
if (!this.isSystemRole) {
Record[] groupRecords = record.getAttributeAsRecordArray(RolesDataSource.Field.RESOURCE_GROUPS);
ListGridRecord[] groupListGridRecords = toListGridRecordArray(groupRecords);
- this.resourceGroupSelector = new RoleResourceGroupSelector(this.extendLocatorId("Groups"), groupListGridRecords,
- !this.hasManageSecurityPermission);
+ this.resourceGroupSelector = new RoleResourceGroupSelector(this.extendLocatorId("Groups"),
+ groupListGridRecords, !this.hasManageSecurityPermission);
this.resourceGroupSelector.addAssignedItemsChangedHandler(new AssignedItemsChangedHandler() {
public void onSelectionChanged(AssignedItemsChangedEvent event) {
onItemChanged();
@@ -265,7 +264,8 @@ public class RoleEditView extends AbstractRecordEditor<RolesDataSource> implemen
filteredSubjectRecords.add(subjectListGridRecord);
}
}
- subjectListGridRecords = filteredSubjectRecords.toArray(new ListGridRecord[filteredSubjectRecords.size()]);
+ subjectListGridRecords = filteredSubjectRecords.toArray(new ListGridRecord[filteredSubjectRecords
+ .size()]);
}
this.subjectSelector = new RoleSubjectSelector(this.extendLocatorId("Subjects"), subjectListGridRecords,
!this.hasManageSecurityPermission);
@@ -279,7 +279,7 @@ public class RoleEditView extends AbstractRecordEditor<RolesDataSource> implemen
if (this.isLdapConfigured) {
Record[] ldapGroupRecords = record.getAttributeAsRecordArray(RolesDataSource.Field.LDAP_GROUPS);
ListGridRecord[] ldapGroupListGridRecords = toListGridRecordArray(ldapGroupRecords);
- this.ldapGroupSelector = new RoleLdapGroupSelector(this.extendLocatorId("LdapGroups"),
+ this.ldapGroupSelector = new RoleLdapGroupSelector(this.extendLocatorId("LdapGroups"),
ldapGroupListGridRecords, !this.hasManageSecurityPermission);
this.ldapGroupSelector.addAssignedItemsChangedHandler(new AssignedItemsChangedHandler() {
public void onSelectionChanged(AssignedItemsChangedEvent event) {
@@ -293,8 +293,8 @@ public class RoleEditView extends AbstractRecordEditor<RolesDataSource> implemen
Label label = new Label("<b>"
+ MSG.common_msg_emphasizedNotePrefix()
+ "</b> "
- + MSG.view_adminRoles_noLdap("href='#Administration/Configuration/SystemSettings'", MSG
- .view_adminConfig_systemSettings()));
+ + MSG.view_adminRoles_noLdap("href='#Administration/Configuration/SystemSettings'",
+ MSG.view_adminConfig_systemSettings()));
label.setWidth100();
label.setHeight(20);
label.setPadding(10);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleLdapGroupSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleLdapGroupSelector.java
index d3583ac..ee000a4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleLdapGroupSelector.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleLdapGroupSelector.java
@@ -188,7 +188,7 @@ public class RoleLdapGroupSelector extends AbstractSelector<LdapGroup, org.rhq.c
} else {//return full list .. as no filtering done.
locatedGroupMaps = cachedLdapGroupsAvailable;
}
- @SuppressWarnings( { "UnnecessaryLocalVariable" })
+
PageList<LdapGroup> ldapGroups = convertToPageList(locatedGroupMaps);
return ldapGroups;
}
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 fd0c203..eed499f 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,28 +18,37 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.users;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.Record;
-import com.smartgwt.client.widgets.form.fields.*;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.PasswordItem;
+import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
+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.grid.ListGridRecord;
+
import org.rhq.core.domain.auth.Principal;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
-import org.rhq.enterprise.gui.coregui.client.*;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.PermissionsLoadedListener;
+import org.rhq.enterprise.gui.coregui.client.PermissionsLoader;
+import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.components.form.AbstractRecordEditor;
import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm;
import org.rhq.enterprise.gui.coregui.client.components.selector.AssignedItemsChangedEvent;
import org.rhq.enterprise.gui.coregui.client.components.selector.AssignedItemsChangedHandler;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
/**
* A form for viewing and/or editing an RHQ user (i.e. a {@link Subject}, and if the user is authenticated via RHQ and
* not LDAP, the password of the associated {@link Principal}).
@@ -70,11 +79,13 @@ public class UserEditView extends AbstractRecordEditor<UsersDataSource> {
public void onPermissionsLoaded(Set<Permission> permissions) {
if (permissions == null) {
// TODO: i18n
- CoreGUI.getErrorHandler().handleError("Failed to load global permissions for current user. Perhaps the Server is down.");
+ CoreGUI.getErrorHandler().handleError(
+ "Failed to load global permissions for current user. Perhaps the Server is down.");
return;
}
- UserEditView.this.loggedInUserHasManageSecurityPermission = permissions.contains(Permission.MANAGE_SECURITY);
+ UserEditView.this.loggedInUserHasManageSecurityPermission = permissions
+ .contains(Permission.MANAGE_SECURITY);
Subject sessionSubject = UserSessionManager.getSessionSubject();
boolean isEditingSelf = (sessionSubject.getId() == getRecordId());
final boolean isReadOnly = (!UserEditView.this.loggedInUserHasManageSecurityPermission && !isEditingSelf);
@@ -105,7 +116,6 @@ public class UserEditView extends AbstractRecordEditor<UsersDataSource> {
protected Record createNewRecord() {
Subject subject = new Subject();
subject.setFactive(true);
- @SuppressWarnings( { "UnnecessaryLocalVariable" })
Record userRecord = UsersDataSource.getInstance().copyUserValues(subject, false);
return userRecord;
}
@@ -162,7 +172,7 @@ public class UserEditView extends AbstractRecordEditor<UsersDataSource> {
nameItem = new TextItem(UsersDataSource.Field.NAME);
} else {
nameItem = new StaticTextItem(UsersDataSource.Field.NAME);
- ((StaticTextItem)nameItem).setEscapeHTML(true);
+ ((StaticTextItem) nameItem).setEscapeHTML(true);
}
items.add(nameItem);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java
index a0e3392..0526c07 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java
@@ -18,6 +18,11 @@
*/
package org.rhq.enterprise.gui.coregui.client.components.configuration;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.List;
+
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.CloseClickEvent;
import com.smartgwt.client.widgets.events.CloseClickHandler;
@@ -28,7 +33,12 @@ import com.smartgwt.client.widgets.tree.Tree;
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.configuration.*;
+
+import org.rhq.core.domain.configuration.AbstractPropertyMap;
+import org.rhq.core.domain.configuration.AbstractResourceConfigurationUpdate;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
@@ -39,11 +49,6 @@ import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.List;
-
/**
* @author Greg Hinkle
*/
@@ -227,16 +232,10 @@ public class ConfigurationComparisonView extends VLayout {
private static class ComparisonTreeNode extends TreeNode {
- PropertyDefinitionSimple definition;
- List<PropertySimple> properties;
-
private ComparisonTreeNode(PropertyDefinitionSimple definition, List<PropertySimple> properties,
List<String> titles) {
super(definition.getDisplayName());
- this.definition = definition;
- this.properties = properties;
-
setAttribute("type", definition.getType().name());
int i = 0;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/IsLongValidator.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/IsLongValidator.java
index 2b25e73..fb66787 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/IsLongValidator.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/IsLongValidator.java
@@ -29,7 +29,6 @@ import com.smartgwt.client.widgets.form.validator.CustomValidator;
*
* @author Ian Springer
*/
-@SuppressWarnings({"UnnecessaryLocalVariable"})
public class IsLongValidator extends CustomValidator {
public IsLongValidator() {
@@ -84,11 +83,13 @@ public class IsLongValidator extends CustomValidator {
if (baseStringValue.length() == 19 && baseStringValue.charAt(0) == '9') {
if (isNegative) {
// must be <= 9223372036854775808
- boolean isValid = baseStringValue.matches("[9][0-2][0-2][0-3][0-3][0-7][0-2][0][0-3][0-6][0-8][0-5][0-4][0-7][0-7][0-5][0-8][0][0-8]");
+ boolean isValid = baseStringValue
+ .matches("[9][0-2][0-2][0-3][0-3][0-7][0-2][0][0-3][0-6][0-8][0-5][0-4][0-7][0-7][0-5][0-8][0][0-8]");
return isValid;
} else {
// must be <= 9223372036854775807
- boolean isValid = baseStringValue.matches("[9][0-2][0-2][0-3][0-3][0-7][0-2][0][0-3][0-6][0-8][0-5][0-4][0-7][0-7][0-5][0-8][0][0-7]");
+ boolean isValid = baseStringValue
+ .matches("[9][0-2][0-2][0-3][0-3][0-7][0-2][0][0-3][0-6][0-8][0-5][0-4][0-7][0-7][0-5][0-8][0][0-7]");
return isValid;
}
}
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 1d3e13f..a8e81ea 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
@@ -12,7 +12,8 @@ import org.rhq.enterprise.gui.coregui.client.ImageManager;
*/
public class BooleanCellFormatter implements CellFormatter {
- private static String ICON_URL_NULL = ImageManager.getFullImagePath("subsystems/availability/availability_grey_16.png");
+ private static String ICON_URL_NULL = ImageManager
+ .getFullImagePath("subsystems/availability/availability_grey_16.png");
private static String ICON_URL_TRUE = ImageManager.getFullImagePath("global/permission_enabled_11.png");
private static String ICON_URL_FALSE = ImageManager.getFullImagePath("global/permission_disabled_11.png");
@@ -25,7 +26,6 @@ public class BooleanCellFormatter implements CellFormatter {
} else {
throw new IllegalArgumentException("value parameter is not a Boolean.");
}
- @SuppressWarnings({"UnnecessaryLocalVariable"})
String result = "<img src=\"" + imageUrl + "\" width=\"11\" height=\"11\"/>";
return result;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
index 47f9014..3cde889 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
@@ -40,9 +40,9 @@ 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.IconClickEvent;
import com.smartgwt.client.widgets.form.fields.events.IconClickHandler;
-
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;
+
import org.rhq.core.domain.common.JobTrigger;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.form.DurationItem;
@@ -85,7 +85,6 @@ public class JobTriggerEditor extends LocatableVLayout {
private LocatableDynamicForm cronForm;
// These flags allow us to determine the trigger type.
- private boolean isCronMode;
private boolean isStartLater;
private boolean isRecurring;
private boolean isRepeatDuration;
@@ -212,7 +211,7 @@ public class JobTriggerEditor extends LocatableVLayout {
calendarTypeItem.setValue("now");
this.calendarTypeForm.setFields(calendarTypeItem);
-
+
this.calendarModeLayout.addMember(this.calendarTypeForm);
addMember(this.calendarModeLayout);
@@ -222,7 +221,7 @@ public class JobTriggerEditor extends LocatableVLayout {
this.cronForm = new LocatableDynamicForm(this.cronModeLayout.extendLocatorId("Form"));
TextItem cronExpressionItem = new TextItem(FIELD_CRON_EXPRESSION,
- MSG.widget_jobTriggerEditor_field_cronExpression());
+ MSG.widget_jobTriggerEditor_field_cronExpression());
cronExpressionItem.setRequired(true);
cronExpressionItem.setWidth(340);
@@ -244,279 +243,213 @@ public class JobTriggerEditor extends LocatableVLayout {
Tab formatTab = new Tab(MSG.widget_jobTriggerEditor_tab_format());
HTMLFlow formatPane = new HTMLFlow();
formatPane.setWidth100();
- formatPane.setContents("<p>A cron expression is a string comprised of 6 or 7 fields separated by white space. Fields can contain any of the\n" +
- "allowed values, along with various combinations of the allowed special characters for that field. The fields are as\n" +
- "follows:</p>\n" +
- "<table cellpadding=\"3\" cellspacing=\"1\">\n" +
- " <tbody>\n" +
- "\n" +
- " <tr>\n" +
- " <th>Field Name</th>\n" +
- " <th>Mandatory</th>\n" +
- " <th>Allowed Values</th>\n" +
- " <th>Allowed Special Characters</th>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td>Seconds</td>\n" +
- " <td>YES</td>\n" +
- "\n" +
- " <td>0-59</td>\n" +
- " <td>, - * /</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td>Minutes</td>\n" +
- " <td>YES</td>\n" +
- " <td>0-59</td>\n" +
- "\n" +
- " <td>, - * /</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td>Hours</td>\n" +
- " <td>YES</td>\n" +
- " <td>0-23</td>\n" +
- " <td>, - * /</td>\n" +
- "\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td>Day of month</td>\n" +
- " <td>YES</td>\n" +
- " <td>1-31</td>\n" +
- " <td>, - * ? / L W<br clear=\"all\" />\n" +
- " </td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td>Month</td>\n" +
- " <td>YES</td>\n" +
- " <td>1-12 or JAN-DEC</td>\n" +
- " <td>, - * /</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td>Day of week</td>\n" +
- "\n" +
- " <td>YES</td>\n" +
- " <td>1-7 or SUN-SAT</td>\n" +
- " <td>, - * ? / L #</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td>Year</td>\n" +
- " <td>NO</td>\n" +
- "\n" +
- " <td>empty, 1970-2099</td>\n" +
- " <td>, - * /</td>\n" +
- " </tr>\n" +
- " </tbody>\n" +
- "\n" +
- "</table>\n" +
- "<p>So cron expressions can be as simple as this: <tt>* * * * ? *</tt><br />\n" +
- "or more complex, like this: <tt>0/5 14,18,3-39,52 * ? JAN,MAR,SEP MON-FRI 2002-2010</tt></p>\n" +
- "\n" +
- "<h2><a name=\"CronTriggersTutorial-Specialcharacters\"></a>Special Characters</h2>\n" +
- "\n" +
- "<ul>\n" +
- " <li><tt><b>*</b></tt> (<em>\"all values\"</em>) - used to select all values within a field. For example, \"*\"\n" +
- " in the minute field means <em>\"every minute\"</em>.</li>\n" +
- "\n" +
- "</ul>\n" +
- "\n" +
- "\n" +
- "<ul>\n" +
- " <li><tt><b>?</b></tt> (<em>\"no specific value\"</em>) - useful when you need to specify something in one of the\n" +
- " two fields in which the character is allowed, but not the other. For example, if I want my trigger to fire on a\n" +
- " particular day of the month (say, the 10th), but don't care what day of the week that happens to be, I would put\n" +
- " \"10\" in the day-of-month field, and \"?\" in the day-of-week field. See the examples below for clarification.</li>\n" +
- "\n" +
- "</ul>\n" +
- "\n" +
- "\n" +
- "<ul>\n" +
- " <li><tt><b>-</b></tt> - used to specify ranges. For example, \"10-12\" in the hour field means <em>\"the\n" +
- " hours 10, 11 and 12\"</em>.</li>\n" +
- "\n" +
- "</ul>\n" +
- "\n" +
- "\n" +
- "<ul>\n" +
- " <li><tt><b>,</b></tt> - used to specify additional values. For example, \"MON,WED,FRI\" in the day-of-week\n" +
- " field means <em>\"the days Monday, Wednesday, and Friday\"</em>.</li>\n" +
- "\n" +
- "</ul>\n" +
- "\n" +
- "\n" +
- "<ul>\n" +
- "\n" +
- " <li><tt><b>/</b></tt> - used to specify increments. For example, \"0/15\" in the seconds field means <em>\"the\n" +
- " seconds 0, 15, 30, and 45\"</em>. And \"5/15\" in the seconds field means <em>\"the seconds 5, 20, 35, and 50\"</em>. You can\n" +
- " also specify '/' after the '<b>' character - in this case '</b>' is equivalent to having '0' before the '/'. '1/3'\n" +
- " in the day-of-month field means <em>\"fire every 3 days starting on the first day of the month\"</em>.</li>\n" +
- "\n" +
- "</ul>\n" +
- "\n" +
- "<ul>\n" +
- " <li><tt><b>L</b></tt> (<em>\"last\"</em>) - has different meaning in each of the two fields in which it is\n" +
- " allowed. For example, the value \"L\" in the day-of-month field means <em>\"the last day of the month\"</em> - day\n" +
- " 31 for January, day 28 for February on non-leap years. If used in the day-of-week field by itself, it simply means\n" +
- " \"7\" or \"SAT\". But if used in the day-of-week field after another value, it means <em>\"the last xxx day of the\n" +
- " month\"</em> - for example \"6L\" means <em>\"the last friday of the month\"</em>. When using the 'L' option, it is\n" +
- " important not to specify lists, or ranges of values, as you'll get confusing results.</li>\n" +
- "\n" +
- "</ul>\n" +
- "\n" +
- "\n" +
- "<ul>\n" +
- " <li><tt><b>W</b></tt> (<em>\"weekday\"</em>) - used to specify the weekday (Monday-Friday) nearest the given day.\n" +
- " As an example, if you were to specify \"15W\" as the value for the day-of-month field, the meaning is: <em>\"the\n" +
- " nearest weekday to the 15th of the month\"</em>. So if the 15th is a Saturday, the trigger will fire on Friday the 14th.\n" +
- " If the 15th is a Sunday, the trigger will fire on Monday the 16th. If the 15th is a Tuesday, then it will fire on\n" +
- " Tuesday the 15th. However if you specify \"1W\" as the value for day-of-month, and the 1st is a Saturday, the trigger\n" +
- " will fire on Monday the 3rd, as it will not 'jump' over the boundary of a month's days. The 'W' character can only\n" +
- " be specified when the day-of-month is a single day, not a range or list of days.\n" +
- " <div class=\"tip\">\n" +
- " The 'L' and 'W' characters can also be combined in the day-of-month field to yield 'LW', which\n" +
- " translates to <em>\"last weekday of the month\"</em>.\n" +
- " </div>\n" +
- "\n" +
- " </li>\n" +
- "\n" +
- " <li><tt><b>#</b></tt> - used to specify \"the nth\" XXX day of the month. For example, the value of \"6#3\"\n" +
- " in the day-of-week field means <em>\"the third Friday of the month\"</em> (day 6 = Friday and \"#3\" = the 3rd one in\n" +
- " the month). Other examples: \"2#1\" = the first Monday of the month and \"4#5\" = the fifth Wednesday of the month. Note\n" +
- " that if you specify \"#5\" and there is not 5 of the given day-of-week in the month, then no firing will occur that\n" +
- " month.\n" +
- " <div class=\"tip\">\n" +
- " The legal characters and the names of months and days of the week are not case sensitive. <tt>MON</tt>\n" +
- " is the same as <tt>mon</tt>.\n" +
- " </div>\n" +
- "\n" +
- " </li>\n" +
- "</ul>" +
- "<h2><a name=\"CronTriggersTutorial-Notes\"></a>Notes</h2>\n" +
- "\n" +
- "<ul>\n" +
- " <li>Support for specifying both a day-of-week and a day-of-month value is not complete (you must currently use\n" +
- " the '?' character in one of these fields).</li>\n" +
- " <li>Be careful when setting fire times between mid-night and 1:00 AM - \"daylight savings\" can cause a skip or a\n" +
- " repeat depending on whether the time moves back or jumps forward.</li>\n" +
- "\n" +
- "</ul>");
+ formatPane
+ .setContents("<p>A cron expression is a string comprised of 6 or 7 fields separated by white space. Fields can contain any of the\n"
+ + "allowed values, along with various combinations of the allowed special characters for that field. The fields are as\n"
+ + "follows:</p>\n"
+ + "<table cellpadding=\"3\" cellspacing=\"1\">\n"
+ + " <tbody>\n"
+ + "\n"
+ + " <tr>\n"
+ + " <th>Field Name</th>\n"
+ + " <th>Mandatory</th>\n"
+ + " <th>Allowed Values</th>\n"
+ + " <th>Allowed Special Characters</th>\n"
+ + " </tr>\n"
+ + " <tr>\n"
+ + "\n"
+ + " <td>Seconds</td>\n"
+ + " <td>YES</td>\n"
+ + "\n"
+ + " <td>0-59</td>\n"
+ + " <td>, - * /</td>\n"
+ + " </tr>\n"
+ + " <tr>\n"
+ + "\n"
+ + " <td>Minutes</td>\n"
+ + " <td>YES</td>\n"
+ + " <td>0-59</td>\n"
+ + "\n"
+ + " <td>, - * /</td>\n"
+ + " </tr>\n"
+ + " <tr>\n"
+ + "\n"
+ + " <td>Hours</td>\n"
+ + " <td>YES</td>\n"
+ + " <td>0-23</td>\n"
+ + " <td>, - * /</td>\n"
+ + "\n"
+ + " </tr>\n"
+ + " <tr>\n"
+ + "\n"
+ + " <td>Day of month</td>\n"
+ + " <td>YES</td>\n"
+ + " <td>1-31</td>\n"
+ + " <td>, - * ? / L W<br clear=\"all\" />\n"
+ + " </td>\n"
+ + " </tr>\n"
+ + " <tr>\n"
+ + "\n"
+ + " <td>Month</td>\n"
+ + " <td>YES</td>\n"
+ + " <td>1-12 or JAN-DEC</td>\n"
+ + " <td>, - * /</td>\n"
+ + " </tr>\n"
+ + " <tr>\n"
+ + "\n"
+ + " <td>Day of week</td>\n"
+ + "\n"
+ + " <td>YES</td>\n"
+ + " <td>1-7 or SUN-SAT</td>\n"
+ + " <td>, - * ? / L #</td>\n"
+ + " </tr>\n"
+ + " <tr>\n"
+ + "\n"
+ + " <td>Year</td>\n"
+ + " <td>NO</td>\n"
+ + "\n"
+ + " <td>empty, 1970-2099</td>\n"
+ + " <td>, - * /</td>\n"
+ + " </tr>\n"
+ + " </tbody>\n"
+ + "\n"
+ + "</table>\n"
+ + "<p>So cron expressions can be as simple as this: <tt>* * * * ? *</tt><br />\n"
+ + "or more complex, like this: <tt>0/5 14,18,3-39,52 * ? JAN,MAR,SEP MON-FRI 2002-2010</tt></p>\n"
+ + "\n"
+ + "<h2><a name=\"CronTriggersTutorial-Specialcharacters\"></a>Special Characters</h2>\n"
+ + "\n"
+ + "<ul>\n"
+ + " <li><tt><b>*</b></tt> (<em>\"all values\"</em>) - used to select all values within a field. For example, \"*\"\n"
+ + " in the minute field means <em>\"every minute\"</em>.</li>\n"
+ + "\n"
+ + "</ul>\n"
+ + "\n"
+ + "\n"
+ + "<ul>\n"
+ + " <li><tt><b>?</b></tt> (<em>\"no specific value\"</em>) - useful when you need to specify something in one of the\n"
+ + " two fields in which the character is allowed, but not the other. For example, if I want my trigger to fire on a\n"
+ + " particular day of the month (say, the 10th), but don't care what day of the week that happens to be, I would put\n"
+ + " \"10\" in the day-of-month field, and \"?\" in the day-of-week field. See the examples below for clarification.</li>\n"
+ + "\n"
+ + "</ul>\n"
+ + "\n"
+ + "\n"
+ + "<ul>\n"
+ + " <li><tt><b>-</b></tt> - used to specify ranges. For example, \"10-12\" in the hour field means <em>\"the\n"
+ + " hours 10, 11 and 12\"</em>.</li>\n"
+ + "\n"
+ + "</ul>\n"
+ + "\n"
+ + "\n"
+ + "<ul>\n"
+ + " <li><tt><b>,</b></tt> - used to specify additional values. For example, \"MON,WED,FRI\" in the day-of-week\n"
+ + " field means <em>\"the days Monday, Wednesday, and Friday\"</em>.</li>\n"
+ + "\n"
+ + "</ul>\n"
+ + "\n"
+ + "\n"
+ + "<ul>\n"
+ + "\n"
+ + " <li><tt><b>/</b></tt> - used to specify increments. For example, \"0/15\" in the seconds field means <em>\"the\n"
+ + " seconds 0, 15, 30, and 45\"</em>. And \"5/15\" in the seconds field means <em>\"the seconds 5, 20, 35, and 50\"</em>. You can\n"
+ + " also specify '/' after the '<b>' character - in this case '</b>' is equivalent to having '0' before the '/'. '1/3'\n"
+ + " in the day-of-month field means <em>\"fire every 3 days starting on the first day of the month\"</em>.</li>\n"
+ + "\n"
+ + "</ul>\n"
+ + "\n"
+ + "<ul>\n"
+ + " <li><tt><b>L</b></tt> (<em>\"last\"</em>) - has different meaning in each of the two fields in which it is\n"
+ + " allowed. For example, the value \"L\" in the day-of-month field means <em>\"the last day of the month\"</em> - day\n"
+ + " 31 for January, day 28 for February on non-leap years. If used in the day-of-week field by itself, it simply means\n"
+ + " \"7\" or \"SAT\". But if used in the day-of-week field after another value, it means <em>\"the last xxx day of the\n"
+ + " month\"</em> - for example \"6L\" means <em>\"the last friday of the month\"</em>. When using the 'L' option, it is\n"
+ + " important not to specify lists, or ranges of values, as you'll get confusing results.</li>\n"
+ + "\n"
+ + "</ul>\n"
+ + "\n"
+ + "\n"
+ + "<ul>\n"
+ + " <li><tt><b>W</b></tt> (<em>\"weekday\"</em>) - used to specify the weekday (Monday-Friday) nearest the given day.\n"
+ + " As an example, if you were to specify \"15W\" as the value for the day-of-month field, the meaning is: <em>\"the\n"
+ + " nearest weekday to the 15th of the month\"</em>. So if the 15th is a Saturday, the trigger will fire on Friday the 14th.\n"
+ + " If the 15th is a Sunday, the trigger will fire on Monday the 16th. If the 15th is a Tuesday, then it will fire on\n"
+ + " Tuesday the 15th. However if you specify \"1W\" as the value for day-of-month, and the 1st is a Saturday, the trigger\n"
+ + " will fire on Monday the 3rd, as it will not 'jump' over the boundary of a month's days. The 'W' character can only\n"
+ + " be specified when the day-of-month is a single day, not a range or list of days.\n"
+ + " <div class=\"tip\">\n"
+ + " The 'L' and 'W' characters can also be combined in the day-of-month field to yield 'LW', which\n"
+ + " translates to <em>\"last weekday of the month\"</em>.\n"
+ + " </div>\n"
+ + "\n"
+ + " </li>\n"
+ + "\n"
+ + " <li><tt><b>#</b></tt> - used to specify \"the nth\" XXX day of the month. For example, the value of \"6#3\"\n"
+ + " in the day-of-week field means <em>\"the third Friday of the month\"</em> (day 6 = Friday and \"#3\" = the 3rd one in\n"
+ + " the month). Other examples: \"2#1\" = the first Monday of the month and \"4#5\" = the fifth Wednesday of the month. Note\n"
+ + " that if you specify \"#5\" and there is not 5 of the given day-of-week in the month, then no firing will occur that\n"
+ + " month.\n"
+ + " <div class=\"tip\">\n"
+ + " The legal characters and the names of months and days of the week are not case sensitive. <tt>MON</tt>\n"
+ + " is the same as <tt>mon</tt>.\n"
+ + " </div>\n"
+ + "\n"
+ + " </li>\n"
+ + "</ul>"
+ + "<h2><a name=\"CronTriggersTutorial-Notes\"></a>Notes</h2>\n"
+ + "\n"
+ + "<ul>\n"
+ + " <li>Support for specifying both a day-of-week and a day-of-month value is not complete (you must currently use\n"
+ + " the '?' character in one of these fields).</li>\n"
+ + " <li>Be careful when setting fire times between mid-night and 1:00 AM - \"daylight savings\" can cause a skip or a\n"
+ + " repeat depending on whether the time moves back or jumps forward.</li>\n" + "\n" + "</ul>");
formatTab.setPane(formatPane);
Tab examplesTab = new Tab(MSG.widget_jobTriggerEditor_tab_examples());
HTMLFlow examplesPane = new HTMLFlow();
examplesPane.setWidth100();
- examplesPane.setContents("<table cellpadding=\"3\" cellspacing=\"1\">\n" +
- " <tbody>\n" +
- " <tr>\n" +
- " <th>Expression</th>\n" +
- "\n" +
- " <th>Meaning</th>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 0 12 * * ?</tt></td>\n" +
- "\n" +
- " <td>Fire at 12pm (noon) every day</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td><tt>0 15 10 ? * *</tt></td>\n" +
- " <td>Fire at 10:15am every day</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 15 10 * * ?</tt></td>\n" +
- "\n" +
- " <td>Fire at 10:15am every day</td>\n" +
- "\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 15 10 * * ? *</tt></td>\n" +
- " <td>Fire at 10:15am every day</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 15 10 * * ? 2005</tt></td>\n" +
- "\n" +
- " <td>Fire at 10:15am every day during the year 2005</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 * 14 * * ?</tt></td>\n" +
- " <td>Fire every minute starting at 2pm and ending at 2:59pm, every day</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td><tt>0 0/5 14 * * ?</tt></td>\n" +
- "\n" +
- " <td>Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 0/5 14,18 * * ?</tt></td>\n" +
- " <td>Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5\n" +
- " minutes starting at 6pm and ending at 6:55pm, every day</td>\n" +
- "\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 0-5 14 * * ?</tt></td>\n" +
- "\n" +
- " <td>Fire every minute starting at 2pm and ending at 2:05pm, every day</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 10,44 14 ? 3 WED</tt></td>\n" +
- "\n" +
- " <td>Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 15 10 ? * MON-FRI</tt></td>\n" +
- "\n" +
- " <td>Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td><tt>0 15 10 15 * ?</tt></td>\n" +
- " <td>Fire at 10:15am on the 15th day of every month</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 15 10 L * ?</tt></td>\n" +
- "\n" +
- " <td>Fire at 10:15am on the last day of every month</td>\n" +
- "\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 15 10 ? * 6L</tt></td>\n" +
- " <td>Fire at 10:15am on the last Friday of every month</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 15 10 ? * 6L</tt></td>\n" +
- "\n" +
- " <td>Fire at 10:15am on the last Friday of every month</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 15 10 ? * 6L 2002-2005</tt></td>\n" +
- " <td>Fire at 10:15am on every last friday of every month during the years 2002,\n" +
- " 2003, 2004 and 2005</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- "\n" +
- " <td><tt>0 15 10 ? * 6#3</tt></td>\n" +
- "\n" +
- " <td>Fire at 10:15am on the third Friday of every month</td>\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 0 12 1/5 * ?</tt></td>\n" +
- " <td>Fire at 12pm (noon) every 5 days every month, starting on the first day of the\n" +
- " month.</td>\n" +
- "\n" +
- " </tr>\n" +
- " <tr>\n" +
- " <td><tt>0 11 11 11 11 ?</tt></td>\n" +
- "\n" +
- " <td>Fire every November 11th at 11:11am.</td>\n" +
- " </tr>\n" +
- " </tbody>\n" +
- "</table>");
+ examplesPane.setContents("<table cellpadding=\"3\" cellspacing=\"1\">\n" + " <tbody>\n" + " <tr>\n"
+ + " <th>Expression</th>\n" + "\n" + " <th>Meaning</th>\n" + " </tr>\n"
+ + " <tr>\n" + " <td><tt>0 0 12 * * ?</tt></td>\n" + "\n"
+ + " <td>Fire at 12pm (noon) every day</td>\n" + " </tr>\n" + " <tr>\n" + "\n"
+ + " <td><tt>0 15 10 ? * *</tt></td>\n" + " <td>Fire at 10:15am every day</td>\n"
+ + " </tr>\n" + " <tr>\n" + " <td><tt>0 15 10 * * ?</tt></td>\n" + "\n"
+ + " <td>Fire at 10:15am every day</td>\n" + "\n" + " </tr>\n" + " <tr>\n"
+ + " <td><tt>0 15 10 * * ? *</tt></td>\n" + " <td>Fire at 10:15am every day</td>\n"
+ + " </tr>\n" + " <tr>\n" + " <td><tt>0 15 10 * * ? 2005</tt></td>\n" + "\n"
+ + " <td>Fire at 10:15am every day during the year 2005</td>\n" + " </tr>\n"
+ + " <tr>\n" + " <td><tt>0 * 14 * * ?</tt></td>\n"
+ + " <td>Fire every minute starting at 2pm and ending at 2:59pm, every day</td>\n"
+ + " </tr>\n" + " <tr>\n" + "\n" + " <td><tt>0 0/5 14 * * ?</tt></td>\n" + "\n"
+ + " <td>Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day</td>\n"
+ + " </tr>\n" + " <tr>\n" + " <td><tt>0 0/5 14,18 * * ?</tt></td>\n"
+ + " <td>Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5\n"
+ + " minutes starting at 6pm and ending at 6:55pm, every day</td>\n" + "\n" + " </tr>\n"
+ + " <tr>\n" + " <td><tt>0 0-5 14 * * ?</tt></td>\n" + "\n"
+ + " <td>Fire every minute starting at 2pm and ending at 2:05pm, every day</td>\n"
+ + " </tr>\n" + " <tr>\n" + " <td><tt>0 10,44 14 ? 3 WED</tt></td>\n" + "\n"
+ + " <td>Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.</td>\n"
+ + " </tr>\n" + " <tr>\n" + " <td><tt>0 15 10 ? * MON-FRI</tt></td>\n" + "\n"
+ + " <td>Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday</td>\n"
+ + " </tr>\n" + " <tr>\n" + "\n" + " <td><tt>0 15 10 15 * ?</tt></td>\n"
+ + " <td>Fire at 10:15am on the 15th day of every month</td>\n" + " </tr>\n"
+ + " <tr>\n" + " <td><tt>0 15 10 L * ?</tt></td>\n" + "\n"
+ + " <td>Fire at 10:15am on the last day of every month</td>\n" + "\n" + " </tr>\n"
+ + " <tr>\n" + " <td><tt>0 15 10 ? * 6L</tt></td>\n"
+ + " <td>Fire at 10:15am on the last Friday of every month</td>\n" + " </tr>\n"
+ + " <tr>\n" + " <td><tt>0 15 10 ? * 6L</tt></td>\n" + "\n"
+ + " <td>Fire at 10:15am on the last Friday of every month</td>\n" + " </tr>\n"
+ + " <tr>\n" + " <td><tt>0 15 10 ? * 6L 2002-2005</tt></td>\n"
+ + " <td>Fire at 10:15am on every last friday of every month during the years 2002,\n"
+ + " 2003, 2004 and 2005</td>\n" + " </tr>\n" + " <tr>\n" + "\n"
+ + " <td><tt>0 15 10 ? * 6#3</tt></td>\n" + "\n"
+ + " <td>Fire at 10:15am on the third Friday of every month</td>\n" + " </tr>\n"
+ + " <tr>\n" + " <td><tt>0 0 12 1/5 * ?</tt></td>\n"
+ + " <td>Fire at 12pm (noon) every 5 days every month, starting on the first day of the\n"
+ + " month.</td>\n" + "\n" + " </tr>\n" + " <tr>\n"
+ + " <td><tt>0 11 11 11 11 ?</tt></td>\n" + "\n"
+ + " <td>Fire every November 11th at 11:11am.</td>\n" + " </tr>\n" + " </tbody>\n"
+ + "</table>");
examplesTab.setPane(examplesPane);
cronHelpTabSet.addTab(formatTab);
@@ -551,7 +484,7 @@ public class JobTriggerEditor extends LocatableVLayout {
calendarTypeItem.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent event) {
- String calendarType = (String)event.getValue();
+ String calendarType = (String) event.getValue();
changeCalendarType(calendarType);
}
});
@@ -588,12 +521,10 @@ public class JobTriggerEditor extends LocatableVLayout {
private void changeMode(String mode) {
if (mode.equals("calendar")) {
- this.isCronMode = false;
calendarModeLayout.show();
cronModeLayout.hide();
} else {
// cron expression mode
- this.isCronMode = true;
calendarModeLayout.hide();
cronModeLayout.show();
}
@@ -613,8 +544,7 @@ public class JobTriggerEditor extends LocatableVLayout {
supportedUnits.add(TimeUnit.MONTHS);
supportedUnits.add(TimeUnit.YEARS);
DurationItem repeatIntervalItem = new DurationItem(FIELD_REPEAT_INTERVAL,
- MSG.widget_jobTriggerEditor_field_repeatInterval_now(),
- supportedUnits, false, this.isReadOnly, repeatForm);
+ MSG.widget_jobTriggerEditor_field_repeatInterval_now(), supportedUnits, false, this.isReadOnly, repeatForm);
repeatIntervalItem.setRequired(true);
repeatIntervalItem.setContextualHelp(MSG.widget_jobTriggerEditor_fieldHelp_repeatInterval());
@@ -635,8 +565,8 @@ public class JobTriggerEditor extends LocatableVLayout {
supportedUnits.add(TimeUnit.WEEKS);
supportedUnits.add(TimeUnit.MONTHS);
supportedUnits.add(TimeUnit.YEARS);
- final DurationItem repeatDurationItem = new DurationItem(FIELD_REPEAT_DURATION, null,
- supportedUnits, true, this.isReadOnly, repeatForm);
+ final DurationItem repeatDurationItem = new DurationItem(FIELD_REPEAT_DURATION, null, supportedUnits, true,
+ this.isReadOnly, repeatForm);
repeatDurationItem.setShowTitle(false);
repeatDurationItem.setVisible(false);
repeatDurationItem.setContextualHelp(MSG.widget_jobTriggerEditor_fieldHelp_repeatDuration());
@@ -649,7 +579,7 @@ public class JobTriggerEditor extends LocatableVLayout {
recurrenceTypeItem.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent event) {
- String recurrenceType = (String)event.getValue();
+ String recurrenceType = (String) event.getValue();
changeRecurrenceType(recurrenceType, endTimeItem, repeatDurationItem);
}
});
@@ -692,7 +622,8 @@ public class JobTriggerEditor extends LocatableVLayout {
laterForm.setNumCols(4);
laterForm.setColWidths(140, 130, 130);
- RadioGroupItem startTypeItem = new RadioGroupItem(FIELD_START_TYPE, MSG.widget_jobTriggerEditor_field_startType());
+ RadioGroupItem startTypeItem = new RadioGroupItem(FIELD_START_TYPE,
+ MSG.widget_jobTriggerEditor_field_startType());
LinkedHashMap<String, String> startTypeValueMap = new LinkedHashMap<String, String>();
startTypeValueMap.put("on", MSG.widget_jobTriggerEditor_value_on());
startTypeValueMap.put("in", MSG.widget_jobTriggerEditor_value_in());
@@ -709,8 +640,8 @@ public class JobTriggerEditor extends LocatableVLayout {
supportedUnits.add(TimeUnit.WEEKS);
supportedUnits.add(TimeUnit.MONTHS);
supportedUnits.add(TimeUnit.YEARS);
- final DurationItem startDelayItem = new DurationItem(FIELD_START_DELAY, null,
- supportedUnits, false, this.isReadOnly, laterForm);
+ final DurationItem startDelayItem = new DurationItem(FIELD_START_DELAY, null, supportedUnits, false,
+ this.isReadOnly, laterForm);
startDelayItem.setShowTitle(false);
startDelayItem.setVisible(false);
startDelayItem.setContextualHelp(MSG.widget_jobTriggerEditor_fieldHelp_startDelay());
@@ -719,7 +650,7 @@ public class JobTriggerEditor extends LocatableVLayout {
startTypeItem.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent event) {
- String startType = (String)event.getValue();
+ String startType = (String) event.getValue();
changeStartType(startType, startDelayItem, startTimeItem);
}
});
@@ -771,7 +702,7 @@ public class JobTriggerEditor extends LocatableVLayout {
startTime = new Date(startTimestamp);
} else {
// start time
- DateTimeItem startTimeItem = (DateTimeItem)this.laterForm.getField(FIELD_START_TIME);
+ DateTimeItem startTimeItem = (DateTimeItem) this.laterForm.getField(FIELD_START_TIME);
startTime = startTimeItem.getValueAsDate();
}
return startTime;
@@ -824,7 +755,7 @@ public class JobTriggerEditor extends LocatableVLayout {
endTime = new Date(endTimestamp);
}
} else if (this.isEndTime) {
- DateTimeItem endTimeItem = (DateTimeItem)this.repeatForm.getField(FIELD_END_TIME);
+ DateTimeItem endTimeItem = (DateTimeItem) this.repeatForm.getField(FIELD_END_TIME);
endTime = endTimeItem.getValueAsDate();
} else {
endTime = null;
@@ -852,16 +783,15 @@ public class JobTriggerEditor extends LocatableVLayout {
if (startTime != null) {
if (startTime.before(currentTime)) {
Message message = new Message(MSG.widget_jobTriggerEditor_message_startTimeMustBeInFuture(),
- Message.Severity.Error,
- EnumSet.of(Message.Option.Transient));
+ Message.Severity.Error, EnumSet.of(Message.Option.Transient));
CoreGUI.getMessageCenter().notify(message);
isValid = false;
}
if (this.isRecurring && endTime != null) {
if (endTime.before(startTime)) {
- Message message = new Message(MSG.widget_jobTriggerEditor_message_endTimeMustBeAfterStartTime(),
- Message.Severity.Error,
- EnumSet.of(Message.Option.Transient));
+ Message message = new Message(
+ MSG.widget_jobTriggerEditor_message_endTimeMustBeAfterStartTime(), Message.Severity.Error,
+ EnumSet.of(Message.Option.Transient));
CoreGUI.getMessageCenter().notify(message);
isValid = false;
}
@@ -873,8 +803,7 @@ public class JobTriggerEditor extends LocatableVLayout {
if (endTime != null) {
if (endTime.before(currentTime)) {
Message message = new Message(MSG.widget_jobTriggerEditor_message_endTimeMustBeAfterStartTime(),
- Message.Severity.Error,
- EnumSet.of(Message.Option.Transient));
+ Message.Severity.Error, EnumSet.of(Message.Option.Transient));
CoreGUI.getMessageCenter().notify(message);
isValid = false;
}
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
index 04e92f5..08e4d75 100644
--- 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
@@ -46,6 +46,7 @@ import org.rhq.enterprise.gui.coregui.client.Messages;
*/
public class PortletHelpWindow extends Window {
private static Messages MSG = CoreGUI.getMessages();
+ @SuppressWarnings("unused")
private DashboardPortlet storedPortlet;
private Portlet view;
@@ -86,7 +87,5 @@ public class PortletHelpWindow extends Window {
}
addItem(layout);
-
}
-
}
\ 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/configuration/HistoryGroupResourceConfigurationMembers.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationMembers.java
index 4985158..1ba63bc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationMembers.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationMembers.java
@@ -70,6 +70,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
*/
public class HistoryGroupResourceConfigurationMembers extends LocatableVLayout {
private final ResourceGroup group;
+ @SuppressWarnings("unused")
private final ResourcePermission groupPerms;
private final int groupUpdateId;
@@ -82,7 +83,8 @@ public class HistoryGroupResourceConfigurationMembers extends LocatableVLayout {
setMargin(5);
setMembersMargin(5);
- String backPath = LinkManager.getGroupResourceConfigurationUpdateHistoryLink(EntityContext.forGroup(this.group), null);
+ String backPath = LinkManager.getGroupResourceConfigurationUpdateHistoryLink(
+ EntityContext.forGroup(this.group), null);
BackButton backButton = new BackButton(extendLocatorId("BackButton"), MSG.view_tableSection_backButton(),
backPath);
addMember(backButton);
@@ -107,8 +109,7 @@ public class HistoryGroupResourceConfigurationMembers extends LocatableVLayout {
ListGridField fieldResource = new ListGridField(AncestryUtil.RESOURCE_NAME, MSG.common_title_resource());
fieldResource.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
- String url = LinkManager
- .getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
+ String url = LinkManager.getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
return SeleniumUtility.getLocatableHref(url, o.toString(), null);
}
});
@@ -121,11 +122,11 @@ public class HistoryGroupResourceConfigurationMembers extends LocatableVLayout {
});
ListGridField fieldAncestry = AncestryUtil.setupAncestryListGridField();
- ListGridField fieldDateCreated = new ListGridField(DataSource.Field.DATECREATED, MSG
- .common_title_dateCreated());
+ ListGridField fieldDateCreated = new ListGridField(DataSource.Field.DATECREATED,
+ MSG.common_title_dateCreated());
TimestampCellFormatter.prepareDateField(fieldDateCreated);
- ListGridField fieldLastUpdated = new ListGridField(DataSource.Field.LASTUPDATED, MSG
- .common_title_lastUpdated());
+ ListGridField fieldLastUpdated = new ListGridField(DataSource.Field.LASTUPDATED,
+ MSG.common_title_lastUpdated());
TimestampCellFormatter.prepareDateField(fieldLastUpdated);
ListGridField fieldStatus = new ListGridField(DataSource.Field.STATUS, MSG.common_title_status());
ListGridField fieldUser = new ListGridField(DataSource.Field.USER, MSG.common_title_user());
@@ -142,14 +143,14 @@ public class HistoryGroupResourceConfigurationMembers extends LocatableVLayout {
fieldStatus.setType(ListGridFieldType.ICON);
HashMap<String, String> statusIcons = new HashMap<String, String>(4);
- statusIcons.put(ConfigurationUpdateStatus.SUCCESS.name(), ImageManager
- .getResourceConfigurationIcon(ConfigurationUpdateStatus.SUCCESS));
- statusIcons.put(ConfigurationUpdateStatus.FAILURE.name(), ImageManager
- .getResourceConfigurationIcon(ConfigurationUpdateStatus.FAILURE));
- statusIcons.put(ConfigurationUpdateStatus.INPROGRESS.name(), ImageManager
- .getResourceConfigurationIcon(ConfigurationUpdateStatus.INPROGRESS));
- statusIcons.put(ConfigurationUpdateStatus.NOCHANGE.name(), ImageManager
- .getResourceConfigurationIcon(ConfigurationUpdateStatus.NOCHANGE));
+ statusIcons.put(ConfigurationUpdateStatus.SUCCESS.name(),
+ ImageManager.getResourceConfigurationIcon(ConfigurationUpdateStatus.SUCCESS));
+ statusIcons.put(ConfigurationUpdateStatus.FAILURE.name(),
+ ImageManager.getResourceConfigurationIcon(ConfigurationUpdateStatus.FAILURE));
+ statusIcons.put(ConfigurationUpdateStatus.INPROGRESS.name(),
+ ImageManager.getResourceConfigurationIcon(ConfigurationUpdateStatus.INPROGRESS));
+ statusIcons.put(ConfigurationUpdateStatus.NOCHANGE.name(),
+ ImageManager.getResourceConfigurationIcon(ConfigurationUpdateStatus.NOCHANGE));
fieldStatus.setValueIcons(statusIcons);
fieldStatus.addRecordClickHandler(new RecordClickHandler() {
@Override
@@ -280,8 +281,8 @@ public class HistoryGroupResourceConfigurationMembers extends LocatableVLayout {
record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_TYPES, typesWrapper);
// Build the decoded ancestry Strings now for display
- record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_VALUE, AncestryUtil
- .getAncestryValue(record));
+ record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_VALUE,
+ AncestryUtil.getAncestryValue(record));
}
response.setData(records);
response.setTotalRows(result.getTotalSize()); // for paging to work we have to specify size of full result set
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationMembers.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationMembers.java
index 569e819..d473398 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationMembers.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationMembers.java
@@ -70,6 +70,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
*/
public class HistoryGroupPluginConfigurationMembers extends LocatableVLayout {
private final ResourceGroup group;
+ @SuppressWarnings("unused")
private final ResourcePermission groupPerms;
private final int groupUpdateId;
@@ -81,7 +82,8 @@ public class HistoryGroupPluginConfigurationMembers extends LocatableVLayout {
setMargin(5);
setMembersMargin(5);
- String backPath = LinkManager.getGroupPluginConfigurationUpdateHistoryLink(EntityContext.forGroup(this.group), null);
+ String backPath = LinkManager.getGroupPluginConfigurationUpdateHistoryLink(EntityContext.forGroup(this.group),
+ null);
BackButton backButton = new BackButton(extendLocatorId("BackButton"), MSG.view_tableSection_backButton(),
backPath);
addMember(backButton);
@@ -106,8 +108,7 @@ public class HistoryGroupPluginConfigurationMembers extends LocatableVLayout {
ListGridField fieldResource = new ListGridField(AncestryUtil.RESOURCE_NAME, MSG.common_title_resource());
fieldResource.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
- String url = LinkManager
- .getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
+ String url = LinkManager.getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
return SeleniumUtility.getLocatableHref(url, o.toString(), null);
}
});
@@ -120,11 +121,11 @@ public class HistoryGroupPluginConfigurationMembers extends LocatableVLayout {
});
ListGridField fieldAncestry = AncestryUtil.setupAncestryListGridField();
- ListGridField fieldDateCreated = new ListGridField(DataSource.Field.DATECREATED, MSG
- .common_title_dateCreated());
+ ListGridField fieldDateCreated = new ListGridField(DataSource.Field.DATECREATED,
+ MSG.common_title_dateCreated());
TimestampCellFormatter.prepareDateField(fieldDateCreated);
- ListGridField fieldLastUpdated = new ListGridField(DataSource.Field.LASTUPDATED, MSG
- .common_title_lastUpdated());
+ ListGridField fieldLastUpdated = new ListGridField(DataSource.Field.LASTUPDATED,
+ MSG.common_title_lastUpdated());
TimestampCellFormatter.prepareDateField(fieldLastUpdated);
ListGridField fieldStatus = new ListGridField(DataSource.Field.STATUS, MSG.common_title_status());
ListGridField fieldUser = new ListGridField(DataSource.Field.USER, MSG.common_title_user());
@@ -141,14 +142,14 @@ public class HistoryGroupPluginConfigurationMembers extends LocatableVLayout {
fieldStatus.setType(ListGridFieldType.ICON);
HashMap<String, String> statusIcons = new HashMap<String, String>(4);
- statusIcons.put(ConfigurationUpdateStatus.SUCCESS.name(), ImageManager
- .getPluginConfigurationIcon(ConfigurationUpdateStatus.SUCCESS));
- statusIcons.put(ConfigurationUpdateStatus.FAILURE.name(), ImageManager
- .getPluginConfigurationIcon(ConfigurationUpdateStatus.FAILURE));
- statusIcons.put(ConfigurationUpdateStatus.INPROGRESS.name(), ImageManager
- .getPluginConfigurationIcon(ConfigurationUpdateStatus.INPROGRESS));
- statusIcons.put(ConfigurationUpdateStatus.NOCHANGE.name(), ImageManager
- .getPluginConfigurationIcon(ConfigurationUpdateStatus.NOCHANGE));
+ statusIcons.put(ConfigurationUpdateStatus.SUCCESS.name(),
+ ImageManager.getPluginConfigurationIcon(ConfigurationUpdateStatus.SUCCESS));
+ statusIcons.put(ConfigurationUpdateStatus.FAILURE.name(),
+ ImageManager.getPluginConfigurationIcon(ConfigurationUpdateStatus.FAILURE));
+ statusIcons.put(ConfigurationUpdateStatus.INPROGRESS.name(),
+ ImageManager.getPluginConfigurationIcon(ConfigurationUpdateStatus.INPROGRESS));
+ statusIcons.put(ConfigurationUpdateStatus.NOCHANGE.name(),
+ ImageManager.getPluginConfigurationIcon(ConfigurationUpdateStatus.NOCHANGE));
fieldStatus.setValueIcons(statusIcons);
fieldStatus.addRecordClickHandler(new RecordClickHandler() {
@Override
@@ -279,8 +280,8 @@ public class HistoryGroupPluginConfigurationMembers extends LocatableVLayout {
record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_TYPES, typesWrapper);
// Build the decoded ancestry Strings now for display
- record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_VALUE, AncestryUtil
- .getAncestryValue(record));
+ record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_VALUE,
+ AncestryUtil.getAncestryValue(record));
}
response.setData(records);
response.setTotalRows(result.getTotalSize()); // for paging to work we have to specify size of full result set
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
index c8e6ee7..dcd450c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
@@ -92,4 +92,9 @@ public class GroupMembersHealthView extends MembersView {
}
});
}
+
+ public boolean isCanModifyMembers() {
+ return canModifyMembers;
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
index 9a2f729..d7c118a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
@@ -51,6 +51,7 @@ public class ResourceOperationHistoryDetailsView extends AbstractOperationHistor
private String disambiguatedResourceName;
private boolean showResourceField;
+ @SuppressWarnings("unused")
private ResourceComposite resourceComposite;
public ResourceOperationHistoryDetailsView(String locatorId) {
@@ -83,7 +84,8 @@ public class ResourceOperationHistoryDetailsView extends AbstractOperationHistor
if (groupOperationHistory != null) {
StaticTextItem groupOperationHistoryItem = new StaticTextItem(
ResourceOperationHistoryDataSource.Field.GROUP_OPERATION_HISTORY, "Parent Group Execution");
- String groupOperationHistoryUrl = LinkManager.getGroupOperationHistoryLink(groupOperationHistory.getGroup(), groupOperationHistory.getId());
+ String groupOperationHistoryUrl = LinkManager.getGroupOperationHistoryLink(
+ groupOperationHistory.getGroup(), groupOperationHistory.getId());
String value = "<a href=\"" + groupOperationHistoryUrl + "\">" + groupOperationHistory.getId()
+ "</a> (on group '" + groupOperationHistory.getGroup().getName() + "')";
groupOperationHistoryItem.setValue(value);
@@ -115,8 +117,8 @@ public class ResourceOperationHistoryDetailsView extends AbstractOperationHistor
if (showResourceField) {
Resource resource = resourceOperationHistory.getResource();
String url = LinkManager.getResourceLink(resource.getId());
- disambiguatedResourceName = SeleniumUtility.getLocatableHref(url, resource.getName(), String
- .valueOf(resource.getId()));
+ disambiguatedResourceName = SeleniumUtility.getLocatableHref(url, resource.getName(),
+ String.valueOf(resource.getId()));
}
displayDetails(resourceOperationHistory);
@@ -139,8 +141,8 @@ public class ResourceOperationHistoryDetailsView extends AbstractOperationHistor
.getResultsConfigurationDefinition();
if (resultsConfigurationDefinition != null
&& !resultsConfigurationDefinition.getPropertyDefinitions().isEmpty()) {
- ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("results"), operationDefinition
- .getResultsConfigurationDefinition(), operationHistory.getResults());
+ ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("results"),
+ operationDefinition.getResultsConfigurationDefinition(), operationHistory.getResults());
editor.setReadOnly(true);
resultsSection.addMember(editor);
} else {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryPackageStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryPackageStep.java
index 8d0b6c9..ffd35be 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryPackageStep.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryPackageStep.java
@@ -39,7 +39,6 @@ public class ResourceFactoryPackageStep extends AbstractWizardStep {
private PackageVersionFileUploadForm uploadForm;
private ResourceFactoryCreateWizard wizard;
private boolean isUploadComplete = false;
- private int packageVersionId;
public ResourceFactoryPackageStep(ResourceFactoryCreateWizard wizard) {
this.wizard = wizard;
@@ -50,12 +49,12 @@ public class ResourceFactoryPackageStep extends AbstractWizardStep {
if (parent != null) {
uploadForm = new PackageVersionFileUploadForm(parent.extendLocatorId("ResFactPackageStep"), wizard
- .getNewResourcePackageType().getId(), wizard.getChildType().getName(), wizard
- .getNewResourceVersion(), wizard.getNewResourceArchitectureId(), null, true, true, null);
+ .getNewResourcePackageType().getId(), wizard.getChildType().getName(),
+ wizard.getNewResourceVersion(), wizard.getNewResourceArchitectureId(), null, true, true, null);
} else {
uploadForm = new PackageVersionFileUploadForm("ResFactPackageStep", wizard.getNewResourcePackageType()
- .getId(), wizard.getChildType().getName(), wizard.getNewResourceVersion(), wizard
- .getNewResourceArchitectureId(), null, true, true, null);
+ .getId(), wizard.getChildType().getName(), wizard.getNewResourceVersion(),
+ wizard.getNewResourceArchitectureId(), null, true, true, null);
}
uploadForm.setPadding(20);
uploadForm.addFormHandler(new DynamicFormHandler() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
index e28b586..84235af 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
@@ -55,11 +55,10 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
*/
public class OperationHistoryView extends TableSection<OperationHistoryDataSource> {
- public static final ViewName SUBSYSTEM_VIEW_ID = new ViewName("RecentOperations", MSG
- .common_title_recent_operations());
+ public static final ViewName SUBSYSTEM_VIEW_ID = new ViewName("RecentOperations",
+ MSG.common_title_recent_operations());
private static final Criteria INITIAL_CRITERIA = new Criteria();
- private static final String HEADER_ICON = "subsystems/control/Operation_24.png";
private static final SortSpecifier DEFAULT_SORT_SPECIFIER = new SortSpecifier(
OperationHistoryDataSource.Field.CREATED_TIME, SortDirection.DESCENDING);
@@ -117,17 +116,17 @@ public class OperationHistoryView extends TableSection<OperationHistoryDataSourc
statusValues.put(OperationRequestStatus.CANCELED.name(), MSG.common_status_canceled());
statusValues.put(OperationRequestStatus.FAILURE.name(), MSG.common_status_failed());
LinkedHashMap<String, String> statusIcons = new LinkedHashMap<String, String>(3);
- statusIcons.put(OperationRequestStatus.SUCCESS.name(), ImageManager
- .getOperationResultsIcon(OperationRequestStatus.SUCCESS));
- statusIcons.put(OperationRequestStatus.INPROGRESS.name(), ImageManager
- .getOperationResultsIcon(OperationRequestStatus.INPROGRESS));
- statusIcons.put(OperationRequestStatus.CANCELED.name(), ImageManager
- .getOperationResultsIcon(OperationRequestStatus.CANCELED));
- statusIcons.put(OperationRequestStatus.FAILURE.name(), ImageManager
- .getOperationResultsIcon(OperationRequestStatus.FAILURE));
-
- SelectItem statusFilter = new EnumSelectItem(OperationHistoryDataSource.Field.STATUS, MSG
- .common_title_operation_status(), OperationRequestStatus.class, statusValues, statusIcons);
+ statusIcons.put(OperationRequestStatus.SUCCESS.name(),
+ ImageManager.getOperationResultsIcon(OperationRequestStatus.SUCCESS));
+ statusIcons.put(OperationRequestStatus.INPROGRESS.name(),
+ ImageManager.getOperationResultsIcon(OperationRequestStatus.INPROGRESS));
+ statusIcons.put(OperationRequestStatus.CANCELED.name(),
+ ImageManager.getOperationResultsIcon(OperationRequestStatus.CANCELED));
+ statusIcons.put(OperationRequestStatus.FAILURE.name(),
+ ImageManager.getOperationResultsIcon(OperationRequestStatus.FAILURE));
+
+ SelectItem statusFilter = new EnumSelectItem(OperationHistoryDataSource.Field.STATUS,
+ MSG.common_title_operation_status(), OperationRequestStatus.class, statusValues, statusIcons);
statusFilter.setWidth(325);
if (isShowFilterForm()) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/GwtRelativeDurationConverter.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/GwtRelativeDurationConverter.java
index 0959d9b..911400c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/GwtRelativeDurationConverter.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/GwtRelativeDurationConverter.java
@@ -22,7 +22,6 @@ public class GwtRelativeDurationConverter {
private static final long MILLIS_IN_SECOND = 1000L;
private static final long MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND;
private static final long MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE;
- private static final long NEVER = -1;
private static final long MILLIS_IN_DAY = 24 * MILLIS_IN_HOUR;
private static final DateTimeFormat dayFormatter = DateTimeFormat.getFormat("d");
@@ -50,6 +49,7 @@ public class GwtRelativeDurationConverter {
return result;
}
+ @SuppressWarnings("unused")
private static TimeZone getTimeZone() {
if (tz == null) {
return TimeZone.createTimeZone(TimeZoneInfo.buildTimeZoneData(""));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/measurement/GwtMeasurementConverter.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/measurement/GwtMeasurementConverter.java
index 6833d07..fe21676 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/measurement/GwtMeasurementConverter.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/measurement/GwtMeasurementConverter.java
@@ -109,7 +109,6 @@ public class GwtMeasurementConverter {
targetUnits = fittedUnits;
}
- @SuppressWarnings("unused")
Set<String> existingStrings; // technically this *is* unused because
int precisionDigits = 1;
boolean scaleWithMorePrecision = true;
@@ -341,8 +340,8 @@ public class GwtMeasurementConverter {
}
if (wasNegative) {
- return new MeasurementNumericValueAndUnits(-currentValueAndUnits.getValue(), currentValueAndUnits
- .getUnits());
+ return new MeasurementNumericValueAndUnits(-currentValueAndUnits.getValue(),
+ currentValueAndUnits.getUnits());
}
return currentValueAndUnits;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
index 1b844aa..6f56f65 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
@@ -104,7 +104,6 @@ public class OperationGWTServiceImpl extends AbstractGWTServiceImpl implements O
public void invokeResourceOperation(int resourceId, String operationName, Configuration parameters,
String description, int timeout) throws RuntimeException {
try {
- @SuppressWarnings("unused")
ResourceOperationSchedule opSchedule = operationManager.scheduleResourceOperation(getSessionSubject(),
resourceId, operationName, 0, 0, 0, 0, parameters, description);
} catch (Throwable t) {
@@ -117,7 +116,6 @@ public class OperationGWTServiceImpl extends AbstractGWTServiceImpl implements O
try {
CronTrigger cronTrigger = new CronTrigger("resource " + resourceId + "_" + operationName, "group",
cronString);
- @SuppressWarnings("unused")
ResourceOperationSchedule opSchedule = operationManager.scheduleResourceOperation(getSessionSubject(),
resourceId, operationName, parameters, cronTrigger, description);
} catch (Throwable t) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
index d4624ef..5cbc8de 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
@@ -135,11 +135,11 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
File downloadsDir = getCliAlertScriptDownloadsDir();
List<File> files = getFiles(downloadsDir);
if (files == null) {
- return new HashMap<String, String>(0);
+ return new HashMap<String, String>(0);
} else {
HashMap<String, String> ret = new HashMap<String, String>(files.size());
-
- for(File file : files) {
+
+ for (File file : files) {
ret.put(file.getName(), "/downloads/cli-alert-scripts/" + file.getName());
}
return ret;
@@ -148,7 +148,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
throw getExceptionToThrowToClient(t);
}
}
-
+
@Override
public HashMap<String, String> getClientVersionProperties() throws RuntimeException {
File versionFile = new File(getClientDownloadDir(), "rhq-client-version.properties");
@@ -210,7 +210,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
}
return downloadDir;
}
-
+
private File getClientDownloadDir() {
File serverHomeDir = getServerHomeDir();
File downloadDir = new File(serverHomeDir, "deploy/rhq.ear/rhq-downloads/rhq-client");
@@ -249,6 +249,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
}
// GWT does not support java.util.Properties - we have to convert to/from Properties <-> HashMap
+ @SuppressWarnings("unused")
private Properties convertToProperties(HashMap<String, String> map) {
Properties props = new Properties();
if (map != null) {
commit 536525a315b8665a18fe743d9ed5006c73d13d04
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jan 13 16:56:26 2012 -0500
Change deprecated ListGrid.getSelection() to ListGrid.getSelectedRecords()
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 1b3133f..26dbae8 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
@@ -262,7 +262,7 @@ public class NotificationsAlertDefinitionForm extends LocatableVLayout implement
@Override
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
AlertNotification notif = (getDataSource()).copyValues(selectedRows[0]);
popupNotificationEditor(notif);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java
index a1f2c13..e6671ca 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java
@@ -147,7 +147,7 @@ public class BundleDeploymentListView extends Table<BundleDeploymentDataSource>
@Override
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String selectedId = selectedRows[0].getAttribute(BundleVersionDataSource.FIELD_BUNDLE_ID);
String selectedVersionId = selectedRows[0].getAttribute(BundleVersionDataSource.FIELD_ID);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java
index 6e3d4cd..42ef2b4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java
@@ -134,7 +134,7 @@ public class BundleDestinationListView extends Table<BundleDestinationDataSource
@Override
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String selectedId = selectedRows[0].getAttribute(BundleDestinationDataSource.FIELD_BUNDLE_ID);
String selectedDestId = selectedRows[0].getAttribute(BundleDestinationDataSource.FIELD_ID);
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 9db4577..d3666fe 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
@@ -121,7 +121,7 @@ public class BundlesListView extends Table<BundlesWithLatestVersionDataSource> {
@Override
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String selectedId = selectedRows[0].getAttribute(BundlesWithLatestVersionDataSource.FIELD_ID);
CoreGUI.goToView(LinkManager.getBundleLink(Integer.valueOf(selectedId)));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionListView.java
index 10e1e43..ad0f43e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionListView.java
@@ -90,7 +90,7 @@ public class BundleVersionListView extends Table<BundleVersionDataSource> {
@Override
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String selectedId = selectedRows[0].getAttribute(BundleVersionDataSource.FIELD_BUNDLE_ID);
String selectedVersionId = selectedRows[0].getAttribute(BundleVersionDataSource.FIELD_ID);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java
index 55e3cbc..42403da 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java
@@ -838,7 +838,7 @@ public abstract class Carousel extends LocatableHLayout implements RefreshableVi
//this.listGrid.setSelectionType(getDefaultSelectionStyle());
}
- //int selectionCount = this.listGrid.getSelection().length;
+ //int selectionCount = this.listGrid.getSelectedRecords().length;
for (CarouselActionInfo carouselAction : this.carouselActions) {
if (carouselAction.actionCanvas != null) { // if null, we haven't initialized our buttons yet, so skip this
boolean enabled = (!this.carouselActionDisableOverride && carouselAction.action.isEnabled());
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 63019a9..0d98e36 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
@@ -537,7 +537,7 @@ public abstract class AbstractSelector<T, C extends org.rhq.core.domain.criteria
private void notifyAssignedItemsChangedHandlers() {
for (AssignedItemsChangedHandler handler : this.assignedItemsChangedHandlers) {
- handler.onSelectionChanged(new AssignedItemsChangedEvent(this.assignedGrid.getSelection()));
+ handler.onSelectionChanged(new AssignedItemsChangedEvent(this.assignedGrid.getSelectedRecords()));
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/sorter/ReorderableList.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/sorter/ReorderableList.java
index 7e06b20..134f8f4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/sorter/ReorderableList.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/sorter/ReorderableList.java
@@ -169,7 +169,7 @@ public class ReorderableList extends LocatableVLayout {
private void notifyListOrderChangedHandlers() {
for (ListOrderChangedHandler handler : this.listOrderChangedHandlers) {
- handler.onListOrderChanged(new ListOrderChangedEvent(this.listGrid.getSelection()));
+ handler.onListOrderChanged(new ListOrderChangedEvent(this.listGrid.getSelectedRecords()));
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java
index b89934c..1092d74 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java
@@ -166,7 +166,7 @@ public abstract class AbstractTableSection<DS extends RPCDataSource, ID> extends
@Override
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
showDetails(selectedRows[0]);
}
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 3be68ac..ad9e43c 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
@@ -996,7 +996,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
this.listGrid.setSelectionType(getDefaultSelectionStyle());
}
- //int selectionCount = this.listGrid.getSelection().length;
+ //int selectionCount = this.listGrid.getSelectedRecords().length;
for (TableActionInfo tableAction : this.tableActions) {
if (tableAction.actionCanvas != null) { // if null, we haven't initialized our buttons yet, so skip this
boolean enabled = (!this.tableActionDisableOverride && tableAction.action.isEnabled(this.listGrid
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
index 1b23485..ba738a2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
@@ -357,7 +357,7 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
- int count = getListGrid().getSelection().length;
+ int count = getListGrid().getSelectedRecords().length;
getTableInfo().setContents(
MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
index 9c54052..c6d8e9d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
@@ -368,7 +368,7 @@ class GroupOperationsCriteriaHistoryListView extends GroupOperationHistoryListVi
public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
- int count = getListGrid().getSelection().length;
+ int count = getListGrid().getSelectedRecords().length;
getTableInfo().setContents(
MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
index 55e8305..9be65b5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
@@ -292,7 +292,7 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
- int count = getListGrid().getSelection().length;
+ int count = getListGrid().getSelectedRecords().length;
getTableInfo().setContents(
MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
index f26e9b4..fe02236 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
@@ -296,7 +296,7 @@ public abstract class AbstractRecentDriftsPortlet extends DriftHistoryView imple
public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
- int count = getListGrid().getSelection().length;
+ int count = getListGrid().getSelectedRecords().length;
getTableInfo().setContents(
MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
index 15f2428..66564c3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
@@ -262,7 +262,7 @@ public abstract class AbstractOperationHistoryPortlet extends OperationHistoryVi
public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
- int count = getListGrid().getSelection().length;
+ int count = getListGrid().getSelectedRecords().length;
getTableInfo().setContents(
MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
index d56d95c..90e2ce3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
@@ -151,7 +151,7 @@ public class ResourceConfigurationUpdatesPortlet extends GroupConfigurationUpdat
public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
- int count = getListGrid().getSelection().length;
+ int count = getListGrid().getSelectedRecords().length;
getTableInfo().setContents(
MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java
index 991ec84..7488d8e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java
@@ -98,7 +98,7 @@ public class DriftCarouselMemberView extends DriftHistoryView implements Carouse
@Override
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
ListGridRecord record = selectedRows[0];
Integer resourceId = record.getAttributeAsInt(AncestryUtil.RESOURCE_ID);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
index 9309c48..e4b2d7f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
@@ -271,7 +271,7 @@ public abstract class AbstractOperationHistoryListView<T extends AbstractOperati
@Override
protected void deleteSelectedRecords(DSRequest requestProperties) {
- final ListGridRecord[] recordsToBeDeleted = getListGrid().getSelection();
+ final ListGridRecord[] recordsToBeDeleted = getListGrid().getSelectedRecords();
final int numberOfRecordsToBeDeleted = recordsToBeDeleted.length;
Boolean forceValue = (requestProperties != null &&
requestProperties.getAttributeAsBoolean(AbstractOperationHistoryDataSource.RequestAttribute.FORCE));
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 65bcbae..a6740c0 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
@@ -233,7 +233,7 @@ public class ResourceGroupListView extends Table<ResourceGroupCompositeDataSourc
setListGridDoubleClickHandler(new DoubleClickHandler() {
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String selectedId = selectedRows[0].getAttribute("id");
CoreGUI.goToView(LinkManager.getResourceGroupLink(Integer.valueOf(selectedId)));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
index 73fa07f..e01d25a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
@@ -300,7 +300,7 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
@Override
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String groupUrl = LinkManager.getResourceGroupLink(selectedRows[0].getAttributeAsInt("id"));
CoreGUI.goToView(groupUrl);
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 c9210e9..231ff56 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
@@ -175,7 +175,7 @@ public class ResourceSearchView extends Table {
setListGridDoubleClickHandler(new DoubleClickHandler() {
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String selectedId = selectedRows[0].getAttribute("id");
CoreGUI.goToView(LinkManager.getResourceLink(Integer.valueOf(selectedId)));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java
index 94f0887..0d41906 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java
@@ -171,7 +171,7 @@ public class ChildHistoryView extends Table<ChildHistoryView.DataSource> {
setListGridDoubleClickHandler(new DoubleClickHandler() {
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String typeString = selectedRows[0].getAttribute(DataSource.Field.TYPE);
ChildHistoryDetails detailsView = null;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceErrorsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceErrorsView.java
index ae1ebfc..b698e65 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceErrorsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceErrorsView.java
@@ -121,7 +121,7 @@ public class ResourceErrorsView extends Table<ResourceErrorsDataSource> {
@Override
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length > 0) {
String details = selectedRows[0].getAttribute(Field.DETAIL);
popupDetails(details);
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 afbaeaf..af84edf 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
@@ -389,7 +389,7 @@ public class ResourceAutodiscoveryView extends LocatableVLayout implements Refre
private void updateButtonEnablement(IButton selectAllButton, IButton deselectAllButton, IButton importButton,
IButton ignoreButton, IButton unignoreButton) {
- if (treeGrid.getSelection().length == 0) {
+ if (treeGrid.getSelectedRecords().length == 0) {
selectAllButton.setDisabled(false);
deselectAllButton.setDisabled(true);
importButton.setDisabled(true);
@@ -399,7 +399,7 @@ public class ResourceAutodiscoveryView extends LocatableVLayout implements Refre
return;
}
- boolean allSelected = (treeGrid.getSelection().length == treeGrid.getRecords().length);
+ boolean allSelected = (treeGrid.getSelectedRecords().length == treeGrid.getRecords().length);
selectAllButton.setDisabled(allSelected);
deselectAllButton.setDisabled(false);
@@ -407,7 +407,7 @@ public class ResourceAutodiscoveryView extends LocatableVLayout implements Refre
boolean ignoreOk = false;
boolean unignoreOk = false;
- for (ListGridRecord listGridRecord : treeGrid.getSelection()) {
+ for (ListGridRecord listGridRecord : treeGrid.getSelectedRecords()) {
TreeNode node = treeGrid.getTree().findById(listGridRecord.getAttribute("id"));
String status = node.getAttributeAsString("status");
TreeNode parentNode = treeGrid.getTree().getParent(node);
@@ -438,7 +438,7 @@ public class ResourceAutodiscoveryView extends LocatableVLayout implements Refre
private int[] getSelectedIds() {
List<Integer> selected = new ArrayList<Integer>();
- for (ListGridRecord node : treeGrid.getSelection()) {
+ for (ListGridRecord node : treeGrid.getSelectedRecords()) {
if (!InventoryStatus.COMMITTED.name().equals(node.getAttributeAsString("status"))) {
selected.add(Integer.parseInt(node.getAttributeAsString("id")));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
index 5461aa0..e28b586 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
@@ -180,7 +180,7 @@ public class OperationHistoryView extends TableSection<OperationHistoryDataSourc
@Override
protected void deleteSelectedRecords(DSRequest requestProperties) {
- final ListGridRecord[] recordsToBeDeleted = getListGrid().getSelection();
+ final ListGridRecord[] recordsToBeDeleted = getListGrid().getSelectedRecords();
final int numberOfRecordsToBeDeleted = recordsToBeDeleted.length;
Boolean forceValue = (requestProperties != null && requestProperties.getAttributeAsBoolean("force"));
boolean force = ((forceValue != null) && forceValue);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReportResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReportResourceSearchView.java
index e076aae..faca27b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReportResourceSearchView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReportResourceSearchView.java
@@ -118,7 +118,7 @@ public class DriftComplianceReportResourceSearchView extends ResourceSearchView
setListGridDoubleClickHandler(new DoubleClickHandler() {
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String selectedId = selectedRows[0].getAttribute("id");
CoreGUI.goToView(LinkManager.getResourceTabLink(Integer.valueOf(selectedId),
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java
index 6722d5b..9bfd7c3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java
@@ -196,7 +196,7 @@ public class MessageCenterView extends Table implements MessageCenter.MessageLis
public void onDoubleClick(DoubleClickEvent event) {
try {
ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
+ ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length > 0) {
Message message = (Message) selectedRows[0].getAttributeAsObject(FIELD_OBJECT); // show the first selected
showDetails(message);
12 years, 5 months
[rhq] modules/integration-tests
by lkrejci
modules/integration-tests/jndi-access/jndi-access-test/pom.xml | 14 +++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
New commits:
commit 5b4ab4a5a34811b157ab8bcb889aa2f4a0274302
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Jan 16 13:41:23 2012 +0100
Fixing the JNDI integration test's pom.
diff --git a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
index 1991e0e..fad4127 100644
--- a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
+++ b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
@@ -80,6 +80,12 @@
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -94,6 +100,12 @@
<artifactId>rhq-server-client-api</artifactId>
<version>${project.version}</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -300,7 +312,7 @@
<jnp.port>${jnp.port}</jnp.port>
<jnp.rmiPort>${jnp.rmiPort}</jnp.rmiPort>
</systemPropertyVariables>
- <argLine>-Djava.security.manager -Djava.security.policy==target/test-classes/security.policy</argLine>
+ <argLine>-Djava.security.manager -Djava.security.policy==${basedir}/target/test-classes/security.policy</argLine>
<additionalClasspathElements>
<!-- The below is required for tests to run against
Oracle. -->
12 years, 5 months
[rhq] modules/pom.xml
by lkrejci
modules/pom.xml | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit eeeb3156b6b66fb4ead5cadec1f4eb3aa0af18c5
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Jan 16 12:24:39 2012 +0100
Adding missing module references to the integration tests profile.
diff --git a/modules/pom.xml b/modules/pom.xml
index f0eaeef..ba4d1b5 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -156,9 +156,19 @@
<module>core</module>
<module>common</module>
<module>plugins</module>
+
<!-- these two are needed by the rhq-agent plugin -->
<module>enterprise/agent</module>
<module>enterprise/comm</module>
+
+ <!-- These 6 are needed for the JNDI intergration tests -->
+ <module>enterprise/server/container-lib</module>
+ <module>enterprise/server/xml-schemas</module>
+ <module>enterprise/server/safe-invoker</module>
+ <module>enterprise/server/jar</module>
+ <module>enterprise/binding</module>
+ <module>enterprise/server/client-api</module>
+
<module>integration-tests</module>
</modules>
</profile>
12 years, 5 months
[rhq] 3 commits - modules/enterprise
by Heiko W. Rupp
modules/enterprise/gui/rest-war/src/main/webapp/raw_graph7.html | 11 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerBean.java | 23 ++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerBean.java | 65 +++++++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerLocal.java | 16 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/Baseline.java | 58 ++++++++
5 files changed, 153 insertions(+), 20 deletions(-)
New commits:
commit a5d162e2e77b65945eb56e0800b380de93ca1bba
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Sun Jan 15 14:32:14 2012 +0100
Fix a small issue with opacity, that prevented the dots to show.
diff --git a/modules/enterprise/gui/rest-war/src/main/webapp/raw_graph7.html b/modules/enterprise/gui/rest-war/src/main/webapp/raw_graph7.html
index 0f38577..4ff8174 100644
--- a/modules/enterprise/gui/rest-war/src/main/webapp/raw_graph7.html
+++ b/modules/enterprise/gui/rest-war/src/main/webapp/raw_graph7.html
@@ -160,12 +160,14 @@ $.getJSON('/rest/1/resource/platforms.json', function (json) {
var line = d3.svg.line()
.x(function(d,i) { return x(d.timeStamp-dayMinTs); })
- .y(function(d) { return y(d.value); })
- lines.append("svg:path").attr("d", line(daydat)).style("stroke",colors[day]);
+ .y(function(d) { return y(d.value); });
+ lines.append("svg:path")
+ .attr("d", line(daydat))
+ .style("stroke",colors[day]);
var dot = svg.append("svg:g").attr("class","dotschart")
- .selectAll("dot").data(jsondata)
+ .selectAll("dot").data(jsondata);
dot.enter().append("svg:circle")
.attr("cx", function (d) {
@@ -175,8 +177,7 @@ $.getJSON('/rest/1/resource/platforms.json', function (json) {
return y(d.value);
})
.style("stroke", colors[day])
- .attr("r", 1)
- .attr("opacity","0")
+ .attr("r", 1);
}
});
commit a6015157d51f146e824898b60108d5ea03ec030a
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Sun Jan 15 14:31:32 2012 +0100
Allow to get and set baselines.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerBean.java
index 71a6a45..53255a6 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerBean.java
@@ -36,6 +36,8 @@ import java.util.Set;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.interceptor.Interceptors;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
import javax.sql.DataSource;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
@@ -62,6 +64,7 @@ import org.jboss.cache.Fqn;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.MeasurementBaseline;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.MeasurementSchedule;
@@ -70,6 +73,7 @@ import org.rhq.core.util.jdbc.JDBCUtil;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.measurement.util.MeasurementDataManagerUtility;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
+import org.rhq.enterprise.server.rest.domain.Baseline;
import org.rhq.enterprise.server.rest.domain.Link;
import org.rhq.enterprise.server.rest.domain.MetricAggregate;
import org.rhq.enterprise.server.measurement.MeasurementAggregate;
@@ -93,6 +97,8 @@ public class MetricHandlerBean extends AbstractRestBean implements MetricHandle
MeasurementScheduleManagerLocal scheduleManager;
@EJB
ResourceManagerLocal resMgr;
+ @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
+ EntityManager em;
@javax.annotation.Resource(name = "RHQ_DS")
private DataSource rhqDs;
@@ -114,7 +120,7 @@ public class MetricHandlerBean extends AbstractRestBean implements MetricHandle
startTime = endTime - EIGHT_HOURS;
}
- MeasurementSchedule schedule = obtainSchedule(scheduleId);
+ MeasurementSchedule schedule = obtainSchedule(scheduleId, false);
MeasurementAggregate aggr = dataManager.getAggregate(caller, scheduleId, startTime, endTime);
MetricAggregate res = new MetricAggregate(scheduleId, aggr.getMin(),aggr.getAvg(),aggr.getMax());
@@ -149,13 +155,16 @@ public class MetricHandlerBean extends AbstractRestBean implements MetricHandle
/**
* Get the schedule for the passed schedule id
+ *
* @param scheduleId id to look up
+ * @param force
* @return schedule
* @throws StuffNotFoundException if there is no schedule with the passed id
*/
- private MeasurementSchedule obtainSchedule(int scheduleId) {
- MeasurementSchedule schedule;
- schedule = getFromCache(scheduleId,MeasurementSchedule.class);
+ private MeasurementSchedule obtainSchedule(int scheduleId, boolean force) {
+ MeasurementSchedule schedule=null;
+ if(!force)
+ schedule = getFromCache(scheduleId,MeasurementSchedule.class);
if (schedule==null) {
schedule = scheduleManager.getScheduleById(caller,scheduleId);
if (schedule==null) {
@@ -419,7 +428,7 @@ public class MetricHandlerBean extends AbstractRestBean implements MetricHandle
throw new IllegalArgumentException("Start time is older than 7 days");
// Check if the schedule exists
- obtainSchedule(scheduleId);
+ obtainSchedule(scheduleId, false);
RawNumericStreamingOutput so = new RawNumericStreamingOutput();
so.scheduleId = scheduleId;
@@ -441,7 +450,7 @@ public class MetricHandlerBean extends AbstractRestBean implements MetricHandle
NumericDataPoint point, @Context HttpHeaders headers, UriInfo uriInfo) {
MediaType mediaType = headers.getAcceptableMediaTypes().get(0);
- MeasurementSchedule schedule = obtainSchedule(scheduleId);
+ MeasurementSchedule schedule = obtainSchedule(scheduleId, false);
Set<MeasurementDataNumeric> data = new HashSet<MeasurementDataNumeric>(1);
data.add(new MeasurementDataNumeric(point.getTimeStamp(),scheduleId,point.getValue()));
@@ -476,6 +485,50 @@ public class MetricHandlerBean extends AbstractRestBean implements MetricHandle
}
+ @Override
+ @GET
+ @Path("data/{scheduleId}/baseline")
+ public Baseline getBaseline(@PathParam("scheduleId") int scheduleId, @Context HttpHeaders headers,
+ @Context UriInfo uriInfo) {
+ MeasurementSchedule schedule = obtainSchedule(scheduleId, true);
+ MeasurementBaseline mBase = schedule.getBaseline();
+
+ Baseline b;
+ if (mBase==null)
+ throw new StuffNotFoundException("Baseline for schedule [" + scheduleId +"]");
+ else
+ b = new Baseline(mBase.getMin(),mBase.getMax(),mBase.getMean(),mBase.getComputeTime().getTime());
+ return b;
+
+ }
+
+ @Override
+ @PUT
+ @Path("data/{scheduleId}/baseline")
+ public void setBaseline(@PathParam("scheduleId") int scheduleId,
+ Baseline baseline, HttpHeaders headers, @Context UriInfo uriInfo) {
+ MeasurementSchedule schedule = obtainSchedule(scheduleId, false);
+
+ // little bit of sanity checking
+ if (baseline.getMin()>baseline.getMean() || baseline.getMean()>baseline.getMax() || baseline.getMin()>baseline.getMax())
+ throw new IllegalArgumentException("Baseline not correct. it should be min<=mean<=max");
+
+ MeasurementBaseline mBase = schedule.getBaseline();
+ if (mBase == null) {
+ mBase = new MeasurementBaseline();
+ mBase.setSchedule(schedule);
+ schedule.setBaseline(mBase);
+ em.persist(mBase);
+ }
+ mBase.setMax(baseline.getMax());
+ mBase.setMin(baseline.getMin());
+ mBase.setMean(baseline.getMean());
+ mBase.setUserEntered(true);
+
+ scheduleManager.updateSchedule(caller,schedule);
+
+ }
+
/**
* Write the numeric data points to the output stream in JSON encoding
* without creating tons of objects in the middle to have them marshalled
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerLocal.java
index 6f76bce..6d9c174 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerLocal.java
@@ -39,6 +39,7 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
import javax.ws.rs.core.UriInfo;
+import org.rhq.enterprise.server.rest.domain.Baseline;
import org.rhq.enterprise.server.rest.domain.MetricAggregate;
import org.rhq.enterprise.server.rest.domain.MetricSchedule;
import org.rhq.enterprise.server.rest.domain.NumericDataPoint;
@@ -155,4 +156,19 @@ public interface MetricHandlerLocal {
@Path("data/raw")
@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
Response postMetricValues(Collection<NumericDataPoint> points, @Context HttpHeaders headers);
+
+ @GET
+ @Path("data/{scheduleId}/baseline")
+ @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
+ Baseline getBaseline(@PathParam("scheduleId") int scheduleId,
+ @Context HttpHeaders headers,
+ @Context UriInfo uriInfo);
+
+ @PUT
+ @Path("data/{scheduleId}/baseline")
+ @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
+ void setBaseline(@PathParam("scheduleId") int scheduleId,
+ Baseline baseline,
+ @Context HttpHeaders headers,
+ @Context UriInfo uriInfo);
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/Baseline.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/Baseline.java
new file mode 100644
index 0000000..d6a4073
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/Baseline.java
@@ -0,0 +1,58 @@
+package org.rhq.enterprise.server.rest.domain;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * A baseline
+ * @author Heiko W. Rupp
+ */
+@XmlRootElement
+public class Baseline {
+
+ double min;
+ double max;
+ double mean;
+ long computeTime;
+
+ public Baseline() {
+ }
+
+ public Baseline(double min, double max, double mean, long computeTime) {
+ this.min = min;
+ this.max = max;
+ this.mean = mean;
+ this.computeTime = computeTime;
+ }
+
+ public double getMin() {
+ return min;
+ }
+
+ public void setMin(double min) {
+ this.min = min;
+ }
+
+ public double getMax() {
+ return max;
+ }
+
+ public void setMax(double max) {
+ this.max = max;
+ }
+
+ public double getMean() {
+ return mean;
+ }
+
+ public void setMean(double mean) {
+ this.mean = mean;
+ }
+
+ public long getComputeTime() {
+ return computeTime;
+ }
+
+ public void setComputeTime(long computeTime) {
+ this.computeTime = computeTime;
+ }
+}
commit 10051994173b5b1467155bb957b7c4dbd579011c
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Sun Jan 15 13:55:51 2012 +0100
BZ 781801 - if frequency is 0 print a note and return.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerBean.java
index 286a75e..1d64102 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerBean.java
@@ -115,7 +115,12 @@ public class MeasurementBaselineManagerBean implements MeasurementBaselineManage
// Determine how much data we need to calculate baselines for by determining the oldest and youngest
// measurement data to include in the calculations.
long amountOfData = Long.parseLong(baselineDataSetString);
- long baselinesOlderThanTime = System.currentTimeMillis() - Long.parseLong(baselineFrequencyString);
+ long baselineFrequency = Long.parseLong(baselineFrequencyString);
+ if (baselineFrequency==0) {
+ log.info("Baseline frequency is set to 0 - not recomputing baselines. Go to Admin->System settings to change this.");
+ return;
+ }
+ long baselinesOlderThanTime = System.currentTimeMillis() - baselineFrequency;
measurementBaselineManager.calculateAutoBaselines(amountOfData, baselinesOlderThanTime);
@@ -147,20 +152,20 @@ public class MeasurementBaselineManagerBean implements MeasurementBaselineManage
now = System.currentTimeMillis();
int totalInserted = 0;
while (true) {
- /*
+ /*
* each call is done in a separate xtn of at most 100K inserted rows; this helps to keep the xtn
* shorter to avoid timeouts in scenarios where baseline calculations bunch together. the idea was that
- * by basing a batch of baseline calculations off of the import time of the resource into inventory,
+ * by basing a batch of baseline calculations off of the import time of the resource into inventory,
* that the total work would naturally be staggered throughout the day. in practice, this didn't always
* work as intended for one of several reasons:
- *
- * 1) all servers in the cloud were down for a few days (maybe a slow product upgrade, maybe a cold
+ *
+ * 1) all servers in the cloud were down for a few days (maybe a slow product upgrade, maybe a cold
* data center relocation)
* 2) issues with running the job itself, if quartz had locking issues under severe load and somehow
* this job wasn't get executed for a few hours / days
* 3) the user tended to import all new resources / platforms at the same time of day, thus bypassing
* the implicit optimization of trying to stagger the calculations by resource commit time
- *
+ *
* 2/18/2010 NOTE: Limits weren't / aren't actually achieving the affect we want. The baseline query
* follows the general form of "insert into...select from <big query> having <subquery> limit X".
* In this case, the limit was reducing the number of rows inserted, but it was still taking the full
@@ -169,20 +174,20 @@ public class MeasurementBaselineManagerBean implements MeasurementBaselineManage
* part - the "big query". What we actually want to do is come of with a strategy that lessens the
* amount of data we need to select, thereby reducing the amount of time it takes to calculate the
* insertion list.
- *
+ *
* One proposed strategy for this would be to chunk on the scheduleId. So if there were, say,
* 5M scheduleIds in the systems, we might take 500K of them at a time and then execute the
* baseline insertion job 10 times against a much smaller set of data each time. But the
* complication here is how to calculate precise groups of 500K schedules at a time, and then
* walk that chunked list.
- *
+ *
* Another strategy would be to divy things up by resource type. Since a measurementSchedule is
* linked to a measurementDefinition which is linked to a resourceType, we could very easily chunk
* the insertion based off the schedules that belong to each resourceType. This would create
* one insert statement for each type of resource in system. The complication here, however,
* is that you may have millions of resources of one type, but hardly any resources of another.
* So there's still a chance that some insertions proceed slowly (in the worst case).
- *
+ *
* In any event, an appropriate chunking solution needs to be found, and that partitioning strategy
* needs to replace the limits in the query today.
*/
12 years, 5 months
[rhq] Branch 'hotfix/jon300' - modules/enterprise
by Larry O'Leary
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java | 2 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 038735bfd0facb2632339532d073153545febe4d
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Jan 13 16:40:32 2012 -0500
[BZ 781621] fixing ldap ssl issue. Users unable to configure SSL support.
This was introduced with the other SystemSettings refactor changes. We thought we'd found all the places affected.
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 d1f2294..fc09b0f 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
@@ -165,7 +165,7 @@ public class CustomJaasDeploymentService implements CustomJaasDeploymentServiceM
configOptions.put(Context.INITIAL_CONTEXT_FACTORY, conf.getProperty(RHQConstants.LDAPFactory));
configOptions.put(Context.PROVIDER_URL, conf.getProperty(RHQConstants.LDAPUrl));
String value = conf.getProperty(SystemSetting.USE_SSL_FOR_LDAP.getInternalName());
- boolean ldapSsl = Boolean.TRUE.toString().equals(value);
+ boolean ldapSsl = "ssl".equalsIgnoreCase(value);
configOptions.put(Context.SECURITY_PROTOCOL, (ldapSsl) ? "ssl" : null);
configOptions.put("LoginProperty", conf.getProperty(RHQConstants.LDAPLoginProperty));
configOptions.put("Filter", conf.getProperty(RHQConstants.LDAPFilter));
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java
index 396b2c8..9dd2eb5 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java
@@ -443,7 +443,7 @@ public class LdapGroupManagerBean implements LdapGroupManagerLocal {
// Setup SSL if requested
String value = env.getProperty(SystemSetting.USE_SSL_FOR_LDAP.getInternalName());
- boolean ldapSsl = Boolean.TRUE.toString().equals(value);
+ boolean ldapSsl = "ssl".equalsIgnoreCase(value);
if (ldapSsl) {
String ldapSocketFactory = env.getProperty("java.naming.ldap.factory.socket");
if (ldapSocketFactory == null) {
12 years, 5 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java | 93 +++++++---
1 file changed, 71 insertions(+), 22 deletions(-)
New commits:
commit b68ebef3089a2358a64d1594c0357cd076ef4cf8
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jan 13 17:35:16 2012 -0500
[BZ 692948] config comparator GWT view now compares list-o-maps and maps
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java
index 15e0fb1..cbf4059 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java
@@ -37,10 +37,14 @@ import com.smartgwt.client.widgets.tree.TreeNode;
import org.rhq.core.domain.configuration.AbstractPropertyMap;
import org.rhq.core.domain.configuration.AbstractResourceConfigurationUpdate;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
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.domain.configuration.definition.PropertyGroupDefinition;
import org.rhq.core.domain.resource.ResourceType;
@@ -53,6 +57,8 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
* @author Greg Hinkle
*/
public class ConfigurationComparisonView extends VLayout {
+ private static final String ATTRIB_ALL_SAME = "consistent";
+
private static final Messages MSG = CoreGUI.getMessages();
private ConfigurationDefinition definition;
@@ -83,7 +89,7 @@ public class ConfigurationComparisonView extends VLayout {
nameField.setFrozen(true);
nameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
- if (listGridRecord == null || listGridRecord.getAttributeAsBoolean("consistent")) {
+ if (listGridRecord == null || listGridRecord.getAttributeAsBoolean(ATTRIB_ALL_SAME)) {
return String.valueOf(o);
} else {
return "<span style=\"color: red;\">" + String.valueOf(o) + "</span>";
@@ -103,7 +109,7 @@ public class ConfigurationComparisonView extends VLayout {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
if (!(listGridRecord instanceof ComparisonTreeNode)) {
return "";
- } else if (listGridRecord.getAttributeAsBoolean("consistent")) {
+ } else if (listGridRecord.getAttributeAsBoolean(ATTRIB_ALL_SAME)) {
return String.valueOf(o);
} else {
return "<span style=\"color: red;\">" + String.valueOf(o) + "</span>";
@@ -135,9 +141,7 @@ public class ConfigurationComparisonView extends VLayout {
}
for (PropertyGroupDefinition group : definition.getGroupDefinitions()) {
-
TreeNode groupNode = new TreeNode(group.getDisplayName());
-
buildNode(groupNode, definition.getPropertiesInGroup(group.getName()), configs);
children.add(groupNode);
}
@@ -152,23 +156,79 @@ public class ConfigurationComparisonView extends VLayout {
List<? extends AbstractPropertyMap> maps) {
ArrayList<TreeNode> children = new ArrayList<TreeNode>();
- parent.setAttribute("consistent", true);
+ parent.setAttribute(ATTRIB_ALL_SAME, true);
for (PropertyDefinition definition : definitions) {
if (definition instanceof PropertyDefinitionSimple) {
-
ArrayList<PropertySimple> properties = new ArrayList<PropertySimple>();
for (AbstractPropertyMap map : maps) {
properties.add(map.getSimple(definition.getName()));
}
ComparisonTreeNode node = new ComparisonTreeNode((PropertyDefinitionSimple) definition, properties,
titles);
- if (!node.getAttributeAsBoolean("consistent")) {
- parent.setAttribute("consistent", false);
+ if (!node.getAttributeAsBoolean(ATTRIB_ALL_SAME)) {
+ parent.setAttribute(ATTRIB_ALL_SAME, false);
}
children.add(node);
+ } else if (definition instanceof PropertyDefinitionMap) {
+ PropertyDefinitionMap defMap = (PropertyDefinitionMap) definition;
+ TreeNode mapNode = new TreeNode(defMap.getDisplayName());
+ ArrayList<PropertyMap> properties = new ArrayList<PropertyMap>();
+ for (AbstractPropertyMap map : maps) {
+ properties.add((PropertyMap) map);
+ }
+ buildNode(mapNode, defMap.getPropertyDefinitions().values(), properties);
+ if (!mapNode.getAttributeAsBoolean(ATTRIB_ALL_SAME)) {
+ parent.setAttribute(ATTRIB_ALL_SAME, false);
+ }
+ children.add(mapNode);
+ } else if (definition instanceof PropertyDefinitionList) {
+ PropertyDefinitionList defList = (PropertyDefinitionList) definition;
+ TreeNode listNode = new TreeNode(defList.getDisplayName());
+ listNode.setAttribute(ATTRIB_ALL_SAME, true);
+ if (defList.getMemberDefinition() instanceof PropertyDefinitionMap) { // support list-o-maps only
+ PropertyDefinition memberDef = defList.getMemberDefinition();
+ Collection<PropertyDefinition> memberDefColl = new ArrayList<PropertyDefinition>(1);
+ memberDefColl.add(memberDef);
+
+ int max = 0; // will be the largest size of any of our lists that are being compared
+ for (AbstractPropertyMap map : maps) {
+ try {
+ int size = map.getList(defList.getName()).getList().size();
+ if (size > max) {
+ max = size;
+ }
+ } catch (Throwable t) {
+ // paranoia - just skip so we don't kill entire compare window if our config doesn't have proper list-o-map
+ }
+ }
+ ArrayList<TreeNode> innerChildren = new ArrayList<TreeNode>();
+ for (int i = 0; i < max; i++) {
+ TreeNode listItemNode = new TreeNode(String.valueOf(i));
+ ArrayList<PropertyMap> properties = new ArrayList<PropertyMap>();
+ for (AbstractPropertyMap map : maps) {
+ try {
+ List<Property> list = map.getList(defList.getName()).getList();
+ if (list.size() < (i + 1)) {
+ properties.add(new PropertyMap()); // this list didn't have an i-th item, just use an empty map
+ } else {
+ properties.add((PropertyMap) list.get(i));
+ }
+ } catch (Throwable t) {
+ // paranoia - just skip so we don't kill entire compare window if our config doesn't have proper list-o-map
+ properties.add(new PropertyMap());
+ }
+ }
+ buildNode(listItemNode, memberDefColl, properties);
+ if (!listItemNode.getAttributeAsBoolean(ATTRIB_ALL_SAME)) {
+ parent.setAttribute(ATTRIB_ALL_SAME, false);
+ listNode.setAttribute(ATTRIB_ALL_SAME, false); // any diffs always causes this to indicate the diff
+ }
+ innerChildren.add(listItemNode);
+ }
+ listNode.setChildren(innerChildren.toArray(new TreeNode[innerChildren.size()]));
+ }
+ children.add(listNode);
}
-
- // TODO Add support for maps and lists of maps
}
parent.setChildren(children.toArray(new TreeNode[children.size()]));
}
@@ -232,25 +292,15 @@ public class ConfigurationComparisonView extends VLayout {
private static class ComparisonTreeNode extends TreeNode {
- PropertyDefinitionSimple definition;
- List<PropertySimple> properties;
-
private ComparisonTreeNode(PropertyDefinitionSimple definition, List<PropertySimple> properties,
List<String> titles) {
super(definition.getDisplayName());
-
- this.definition = definition;
- this.properties = properties;
-
setAttribute("type", definition.getType().name());
-
int i = 0;
boolean allTheSame = true;
String commonValue = null;
for (PropertySimple prop : properties) {
-
String value = prop != null ? prop.getStringValue() : null;
-
if (i == 0) {
commonValue = value;
} else if (allTheSame && commonValue == null && value != null
@@ -258,8 +308,7 @@ public class ConfigurationComparisonView extends VLayout {
allTheSame = false;
}
setAttribute(titles.get(i++), value);
-
- setAttribute("consistent", allTheSame);
+ setAttribute(ATTRIB_ALL_SAME, allTheSame);
}
}
}
12 years, 5 months
[rhq] modules/enterprise
by Simeon Pinder
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java | 2 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit ed0187d752ee3c47db6a7ac3b5b6566887ddc119
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Jan 13 16:40:32 2012 -0500
[BZ 781621] fixing ldap ssl issue. Users unable to configure SSL support.
This was introduced with the other SystemSettings refactor changes. We thought we'd found all the places affected.
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 d1f2294..fc09b0f 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
@@ -165,7 +165,7 @@ public class CustomJaasDeploymentService implements CustomJaasDeploymentServiceM
configOptions.put(Context.INITIAL_CONTEXT_FACTORY, conf.getProperty(RHQConstants.LDAPFactory));
configOptions.put(Context.PROVIDER_URL, conf.getProperty(RHQConstants.LDAPUrl));
String value = conf.getProperty(SystemSetting.USE_SSL_FOR_LDAP.getInternalName());
- boolean ldapSsl = Boolean.TRUE.toString().equals(value);
+ boolean ldapSsl = "ssl".equalsIgnoreCase(value);
configOptions.put(Context.SECURITY_PROTOCOL, (ldapSsl) ? "ssl" : null);
configOptions.put("LoginProperty", conf.getProperty(RHQConstants.LDAPLoginProperty));
configOptions.put("Filter", conf.getProperty(RHQConstants.LDAPFilter));
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java
index 396b2c8..9dd2eb5 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java
@@ -443,7 +443,7 @@ public class LdapGroupManagerBean implements LdapGroupManagerLocal {
// Setup SSL if requested
String value = env.getProperty(SystemSetting.USE_SSL_FOR_LDAP.getInternalName());
- boolean ldapSsl = Boolean.TRUE.toString().equals(value);
+ boolean ldapSsl = "ssl".equalsIgnoreCase(value);
if (ldapSsl) {
String ldapSocketFactory = env.getProperty("java.naming.ldap.factory.socket");
if (ldapSocketFactory == null) {
12 years, 5 months
[rhq] Branch 'feature/gwt-upgrade' - 3 commits - .classpath modules/enterprise
by Jay Shaughnessy
.classpath | 8
modules/enterprise/gui/coregui/pom.xml | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/TemplateSchedulesDataSource.java | 159 ------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/TemplateSchedulesView.java | 109 +++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 71 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleCompositeDataSource.java | 202 --------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java | 229 ----------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java | 151 ------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractSchedulesView.java | 158 ++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/SchedulesDataSource.java | 212 +++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/ResourceGroupSchedulesView.java | 139 ++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java | 164 -------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java | 56 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/ResourceSchedulesView.java | 143 ++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java | 159 ------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java | 56 --
19 files changed, 810 insertions(+), 1230 deletions(-)
New commits:
commit d075ae47ffd5036a728131bf05b8bdb360d1835f
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jan 13 16:28:07 2012 -0500
[Bug 773662 - Unable to view resource or group metric schedules]
Reorganize this dated impl with an approach more consistent with
more recent views/datasources. The old impl does not seem to
play with the smartgwt upgrade wrt the startegy employed for
datasource/listgrid fields.
- consolidate several datasource classes into new SchedulesDataSource
- uses a cleaner EntityContent approach, and favors ListGridFields
- move button-handling code into the view impl as opposed to the DS
- as overrides of the abstract base view class
- rename the view classes to be consistent with other views
- i.e. use Abstract/Resource/ResourceGroup/Template *SchedulesView prefixes
- Table changes:
- fixed Table constructor to set autofetch correctly
- moved contents.addMember(listGrid) up in onDraw(), closer to
onInit where is is initialized
- added a comment in onDraw about the potentially unnecessary
guard against multiple invocations, and the effect it could have
on calling addMember() in onInit()
- convert several deprecated ListGrid.getSelection() calls to
the new ListGrid.getSelectedRecords() call
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/TemplateSchedulesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/TemplateSchedulesDataSource.java
deleted file mode 100644
index 63e49cd..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/TemplateSchedulesDataSource.java
+++ /dev/null
@@ -1,159 +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.admin.templates;
-
-import java.util.List;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.data.DSRequest;
-import com.smartgwt.client.data.DataSourceField;
-import com.smartgwt.client.data.fields.DataSourceIntegerField;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
-
-import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
-import org.rhq.core.domain.measurement.composite.MeasurementScheduleComposite;
-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.AbstractMeasurementScheduleCompositeDataSource;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-
-/**
- * A DataSource for reading and updating the default metric schedules ("metric templates") for a particular ResourceType.
- *
- * @author Ian Springer
- */
-public class TemplateSchedulesDataSource extends AbstractMeasurementScheduleCompositeDataSource {
- private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService();
- private int resourceTypeId;
-
- public TemplateSchedulesDataSource(int resourceTypeId) {
- this.resourceTypeId = resourceTypeId;
- }
-
- @Override
- protected List<DataSourceField> addDataSourceFields() {
- List<DataSourceField> fields = super.addDataSourceFields();
-
- DataSourceField resourceGroupIdField = new DataSourceIntegerField(
- MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_TYPE_ID, "Resource Type Id");
- resourceGroupIdField.setHidden(true);
- fields.add(resourceGroupIdField);
-
- return fields;
- }
-
- @Override
- protected EntityContext getEntityContext(DSRequest request) {
- Criteria requestCriteria = request.getCriteria();
- Integer typeId = requestCriteria.getAttributeAsInt(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_TYPE_ID);
- return EntityContext.forTemplate(typeId);
- }
-
- @Override
- public ListGridRecord copyValues(MeasurementScheduleComposite from) {
- ListGridRecord record = super.copyValues(from);
- record.setAttribute(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_TYPE_ID, this.resourceTypeId);
- return record;
- }
-
- @Override
- protected void enableSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView,
- final int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) {
- TemplateSchedulesView templateSchedulesView = (TemplateSchedulesView) measurementScheduleListView;
- boolean updateExistingSchedules = templateSchedulesView.isUpdateExistingSchedules();
- final String s = (measurementDefinitionIds.length > 1) ? "s" : "";
- this.measurementService.enableSchedulesForResourceType(measurementDefinitionIds, updateExistingSchedules,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError(
- MSG.datasource_templateSchedules_enabled_failed(s,
- measurementDefinitionDisplayNames.toString(), String.valueOf(resourceTypeId)), throwable);
- }
-
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.datasource_templateSchedules_enabled(s), MSG
- .datasource_templateSchedules_enabled_detailed(s, measurementDefinitionDisplayNames
- .toString(), String.valueOf(resourceTypeId)), Message.Severity.Info));
- measurementScheduleListView.refresh();
- }
- });
- }
-
- @Override
- protected void disableSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView,
- int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) {
- TemplateSchedulesView templateSchedulesView = (TemplateSchedulesView) measurementScheduleListView;
- boolean updateExistingSchedules = templateSchedulesView.isUpdateExistingSchedules();
- final String s = (measurementDefinitionIds.length > 1) ? "s" : "";
- this.measurementService.disableSchedulesForResourceType(measurementDefinitionIds, updateExistingSchedules,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError(
- MSG.datasource_templateSchedules_disabled_failed(s, measurementDefinitionDisplayNames
- .toString(), String.valueOf(resourceTypeId)), throwable);
- }
-
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.datasource_templateSchedules_disabled(s), MSG
- .datasource_templateSchedules_disabled_detailed(s, measurementDefinitionDisplayNames
- .toString(), String.valueOf(resourceTypeId)), Message.Severity.Info));
- measurementScheduleListView.refresh();
- }
- });
- }
-
- @Override
- protected void updateSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView,
- int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames,
- final long collectionInterval) {
- TemplateSchedulesView templateSchedulesView = (TemplateSchedulesView) measurementScheduleListView;
- boolean updateExistingSchedules = templateSchedulesView.isUpdateExistingSchedules();
- final String s = (measurementDefinitionIds.length > 1) ? "s" : "";
- this.measurementService.updateSchedulesForResourceType(measurementDefinitionIds, collectionInterval,
- updateExistingSchedules, new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError(
- MSG.datasource_templateSchedules_updated_failed(String.valueOf(collectionInterval / 1000), s,
- measurementDefinitionDisplayNames.toString(), String.valueOf(resourceTypeId)), throwable);
- }
-
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter()
- .notify(
- new Message(MSG.datasource_templateSchedules_updated(s), MSG
- .datasource_templateSchedules_updated_detail(s, measurementDefinitionDisplayNames
- .toString(), String.valueOf(resourceTypeId), String
- .valueOf(collectionInterval / 1000)), Message.Severity.Info));
- measurementScheduleListView.refresh();
- }
- });
- }
-}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/TemplateSchedulesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/TemplateSchedulesView.java
index 90d6c11..b08a5a1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/TemplateSchedulesView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/TemplateSchedulesView.java
@@ -18,48 +18,40 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.templates;
+import java.util.List;
import java.util.Set;
-import com.smartgwt.client.data.Criteria;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import org.rhq.core.domain.authz.Permission;
-import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractSchedulesView;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* A view for viewing and updating the default metric schedules ("metric templates") for a particular ResourceType.
*
+ * @author Jay Shaughnessy
* @author Ian Springer
*/
-public class TemplateSchedulesView extends AbstractMeasurementScheduleListView {
-
- private static final String[] EXCLUDED_FIELD_NAMES = new String[] { MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_TYPE_ID };
+public class TemplateSchedulesView extends AbstractSchedulesView {
private boolean updateExistingSchedules = true;
- private Set<Permission> globalPermissions;
+ private String typeId;
public TemplateSchedulesView(String locatorId, ResourceType type, Set<Permission> globalPermissions) {
- super(locatorId, getTitle(type), new TemplateSchedulesDataSource(type.getId()), createCriteria(type.getId()),
- EXCLUDED_FIELD_NAMES);
+ super(locatorId, getTitle(type), EntityContext.forTemplate(type.getId()), globalPermissions
+ .contains(Permission.MANAGE_INVENTORY));
- this.globalPermissions = globalPermissions;
+ this.typeId = String.valueOf(type.getId());
}
public static String getTitle(ResourceType type) {
return MSG.view_adminConfig_metricTemplates() + " [" + type.getName() + "]";
}
- public boolean hasManageMeasurementsPermission() {
- return globalPermissions.contains(Permission.MANAGE_INVENTORY);
- }
-
- private static Criteria createCriteria(int resourceTypeId) {
- Criteria criteria = new Criteria();
- criteria.addCriteria(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_TYPE_ID, resourceTypeId);
- return criteria;
- }
-
@Override
protected void configureTable() {
super.configureTable();
@@ -75,4 +67,81 @@ public class TemplateSchedulesView extends AbstractMeasurementScheduleListView {
this.updateExistingSchedules = updateExistingSchedules;
}
+ @Override
+ protected void enableSchedules(final int[] measurementDefinitionIds,
+ final List<String> measurementDefinitionDisplayNames) {
+
+ boolean updateExistingSchedules = isUpdateExistingSchedules();
+ final String s = (measurementDefinitionIds.length > 1) ? "s" : "";
+ this.measurementService.enableSchedulesForResourceType(measurementDefinitionIds, updateExistingSchedules,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.datasource_templateSchedules_enabled_failed(s,
+ measurementDefinitionDisplayNames.toString(), typeId), throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.datasource_templateSchedules_enabled(s), MSG
+ .datasource_templateSchedules_enabled_detailed(s,
+ measurementDefinitionDisplayNames.toString(), typeId), Message.Severity.Info));
+ refresh();
+ }
+ });
+ }
+
+ @Override
+ protected void disableSchedules(int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) {
+
+ boolean updateExistingSchedules = isUpdateExistingSchedules();
+ final String s = (measurementDefinitionIds.length > 1) ? "s" : "";
+ this.measurementService.disableSchedulesForResourceType(measurementDefinitionIds, updateExistingSchedules,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.datasource_templateSchedules_disabled_failed(s,
+ measurementDefinitionDisplayNames.toString(), typeId), throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.datasource_templateSchedules_disabled(s), MSG
+ .datasource_templateSchedules_disabled_detailed(s,
+ measurementDefinitionDisplayNames.toString(), typeId), Message.Severity.Info));
+ refresh();
+ }
+ });
+ }
+
+ @Override
+ protected void updateSchedules(int[] measurementDefinitionIds,
+ final List<String> measurementDefinitionDisplayNames, final long collectionInterval) {
+
+ boolean updateExistingSchedules = isUpdateExistingSchedules();
+ final String s = (measurementDefinitionIds.length > 1) ? "s" : "";
+ this.measurementService.updateSchedulesForResourceType(measurementDefinitionIds, collectionInterval,
+ updateExistingSchedules, new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.datasource_templateSchedules_updated_failed(String.valueOf(collectionInterval / 1000), s,
+ measurementDefinitionDisplayNames.toString(), typeId), throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.datasource_templateSchedules_updated(s), MSG
+ .datasource_templateSchedules_updated_detail(s,
+ measurementDefinitionDisplayNames.toString(), typeId,
+ String.valueOf(collectionInterval / 1000)), Message.Severity.Info));
+ refresh();
+ }
+ });
+ }
}
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 302c55b..3be68ac 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
@@ -18,16 +18,35 @@
*/
package org.rhq.enterprise.gui.coregui.client.components.table;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.event.dom.client.KeyCodes;
-import com.smartgwt.client.data.*;
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.DSCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.data.ResultSet;
+import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.util.BooleanCallback;
import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.*;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.IButton;
+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.DoubleClickEvent;
@@ -52,6 +71,7 @@ import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.menu.IMenuButton;
import com.smartgwt.client.widgets.menu.MenuItem;
import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
+
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.InitializableView;
@@ -60,9 +80,15 @@ import org.rhq.enterprise.gui.coregui.client.components.form.SearchBarItem;
import org.rhq.enterprise.gui.coregui.client.util.CriteriaUtility;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.*;
-
-import java.util.*;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIMenuButton;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableMenu;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableToolStrip;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
* A tabular view of set of data records from an {@link RPCDataSource}.
@@ -76,7 +102,7 @@ import java.util.*;
* @author Greg Hinkle
* @author Ian Springer
*/
-@SuppressWarnings("unchecked")
+@SuppressWarnings("rawtypes")
public class Table<DS extends RPCDataSource> extends LocatableHLayout implements RefreshableView, InitializableView {
private static final int DATA_PAGE_SIZE = 50;
@@ -137,7 +163,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
}
public Table(String locatorId, String tableTitle, SortSpecifier[] sortSpecifiers) {
- this(locatorId, tableTitle, null, sortSpecifiers, null, false);
+ this(locatorId, tableTitle, null, sortSpecifiers, null, true);
}
protected Table(String locatorId, String tableTitle, SortSpecifier[] sortSpecifiers, Criteria criteria) {
@@ -304,10 +330,17 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
try {
super.onDraw();
+ // I'm not sure this is necessary as I'm not sure it's the case that draw()/onDraw() will get called
+ // multiple times. But if it did/does, this protects us by removing the current members before they
+ // get set below. Note that by having this here we *can non* add members in onInit, because they will
+ // immediately get removed. -jshaughn
for (Canvas child : contents.getMembers()) {
contents.removeChild(child);
}
+ // add the listGrid defined in onInit
+ contents.addMember(listGrid);
+
// Title
this.titleCanvas = new HTMLFlow();
updateTitleCanvas(this.titleString);
@@ -323,11 +356,9 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
contents.addMember(filterForm);
}
- contents.addMember(listGrid);
-
// Footer
- // A se cond toolstrip that optionally appears before the main footer - it will contain extra widgets.
+ // A second toolstrip that optionally appears before the main footer - it will contain extra widgets.
// This is hidden from view unless extra widgets are actually added to the table above the main footer.
this.footerExtraWidgets = new LocatableToolStrip(contents.extendLocatorId("FooterExtraWidgets"));
footerExtraWidgets.setPadding(5);
@@ -406,7 +437,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
String contents;
if (lengthIsKnown) {
int totalRows = this.listGrid.getTotalRows();
- int selectedRows = this.listGrid.getSelection().length;
+ int selectedRows = this.listGrid.getSelectedRecords().length;
contents = MSG.view_table_totalRows(String.valueOf(totalRows), String.valueOf(selectedRows));
} else {
contents = MSG.view_table_totalRowsUnknown();
@@ -464,20 +495,20 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
public void onClick(ClickEvent clickEvent) {
disableAllFooterControls();
if (tableAction.confirmMessage != null) {
- String message = tableAction.confirmMessage.replaceAll("\\#", String.valueOf(listGrid
- .getSelection().length));
+ String message = tableAction.confirmMessage.replaceAll("\\#",
+ String.valueOf(listGrid.getSelectedRecords().length));
SC.ask(message, new BooleanCallback() {
public void execute(Boolean confirmed) {
if (confirmed) {
- tableAction.action.executeAction(listGrid.getSelection(), null);
+ tableAction.action.executeAction(listGrid.getSelectedRecords(), null);
} else {
refreshTableInfo();
}
}
});
} else {
- tableAction.action.executeAction(listGrid.getSelection(), null);
+ tableAction.action.executeAction(listGrid.getSelectedRecords(), null);
}
}
});
@@ -494,7 +525,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
item.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {
public void onClick(MenuItemClickEvent event) {
disableAllFooterControls();
- tableAction.getAction().executeAction(listGrid.getSelection(), menuEntries.get(key));
+ tableAction.getAction().executeAction(listGrid.getSelectedRecords(), menuEntries.get(key));
}
});
menu.addItem(item);
@@ -969,7 +1000,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
for (TableActionInfo tableAction : this.tableActions) {
if (tableAction.actionCanvas != null) { // if null, we haven't initialized our buttons yet, so skip this
boolean enabled = (!this.tableActionDisableOverride && tableAction.action.isEnabled(this.listGrid
- .getSelection()));
+ .getSelectedRecords()));
tableAction.actionCanvas.setDisabled(!enabled);
}
}
@@ -998,7 +1029,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
protected void deleteSelectedRecords(DSRequest requestProperties) {
ListGrid listGrid = getListGrid();
- final int selectedRecordCount = listGrid.getSelection().length;
+ final int selectedRecordCount = listGrid.getSelectedRecords().length;
final List<String> deletedRecordNames = new ArrayList<String>(selectedRecordCount);
listGrid.removeSelectedData(new DSCallback() {
public void execute(DSResponse response, Object rawData, DSRequest request) {
@@ -1010,8 +1041,8 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
}
if (deletedRecordNames.size() == selectedRecordCount) {
// all selected schedules were successfully deleted.
- Message message = new Message(MSG.widget_recordEditor_info_recordsDeletedConcise(String
- .valueOf(deletedRecordNames.size()), getDataTypeNamePlural()), MSG
+ Message message = new Message(MSG.widget_recordEditor_info_recordsDeletedConcise(
+ String.valueOf(deletedRecordNames.size()), getDataTypeNamePlural()), MSG
.widget_recordEditor_info_recordsDeletedDetailed(String.valueOf(deletedRecordNames.size()),
getDataTypeNamePlural(), deletedRecordNames.toString()));
CoreGUI.getMessageCenter().notify(message);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleCompositeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleCompositeDataSource.java
deleted file mode 100644
index dfc951c..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleCompositeDataSource.java
+++ /dev/null
@@ -1,202 +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.common;
-
-import java.util.ArrayList;
-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.DataSourceField;
-import com.smartgwt.client.data.Record;
-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.common.EntityContext;
-import org.rhq.core.domain.criteria.Criteria;
-import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.composite.MeasurementScheduleComposite;
-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;
-
-/**
- * A server-side SmartGWT DataSource for reading and updating {@link MeasurementScheduleComposite}s.
- *
- * @author Ian Springer
- */
-public abstract class AbstractMeasurementScheduleCompositeDataSource extends
- RPCDataSource<MeasurementScheduleComposite, Criteria> {
- private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService();
-
- protected AbstractMeasurementScheduleCompositeDataSource() {
- super();
-
- setCanMultiSort(true);
-
- List<DataSourceField> fields = addDataSourceFields();
- addFields(fields);
- }
-
- @Override
- protected List<DataSourceField> addDataSourceFields() {
- List<DataSourceField> fields = super.addDataSourceFields();
-
- DataSourceIntegerField idField = new DataSourceIntegerField(
- MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID, MSG.common_title_id());
- idField.setPrimaryKey(true);
- idField.setHidden(true);
- fields.add(idField);
-
- DataSourceTextField nameField = new DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
- MSG.common_title_metric());
- fields.add(nameField);
-
- DataSourceTextField descriptionField = new DataSourceTextField(
- MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION, MSG.common_title_description());
- fields.add(descriptionField);
-
- DataSourceTextField typeField = new DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE, MSG
- .common_title_type());
- fields.add(typeField);
-
- DataSourceBooleanField enabledField = new DataSourceBooleanField(
- MeasurementScheduleCriteria.SORT_FIELD_ENABLED, MSG.common_title_enabled());
- fields.add(enabledField);
-
- DataSourceIntegerField intervalField = new DataSourceIntegerField(
- MeasurementScheduleCriteria.SORT_FIELD_INTERVAL, MSG.view_inventory_collectionInterval());
- fields.add(intervalField);
-
- return fields;
- }
-
- @Override
- protected Criteria getFetchCriteria(DSRequest request) {
- // we don't use criterias for this datasource, just return null
- return null;
- }
-
- @Override
- protected void executeFetch(final DSRequest request, final DSResponse response, final Criteria unused) {
- final EntityContext entityContext = getEntityContext(request);
-
- this.measurementService.getMeasurementScheduleCompositesByContext(entityContext,
- new AsyncCallback<PageList<MeasurementScheduleComposite>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(
- MSG.dataSource_schedules_loadFailedContext(entityContext.toString()), caught);
- response.setStatus(RPCResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(), response);
- }
-
- public void onSuccess(PageList<MeasurementScheduleComposite> result) {
- 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 abstract EntityContext getEntityContext(DSRequest request);
-
- @Override
- public MeasurementScheduleComposite copyValues(Record from) {
- return null;
- }
-
- @Override
- public ListGridRecord copyValues(MeasurementScheduleComposite from) {
- ListGridRecord record = new ListGridRecord();
-
- MeasurementDefinition measurementDefinition = from.getMeasurementDefinition();
- record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID, measurementDefinition.getId());
- record
- .setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, measurementDefinition.getDisplayName());
- record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION, measurementDefinition.getDescription());
- record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE, measurementDefinition.getDataType()
- .name().toLowerCase());
- record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_ENABLED, from.getCollectionEnabled());
- record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL, from.getCollectionInterval());
-
- return record;
- }
-
- public void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) {
- int[] ids = getMeasurementDefinitionIds(measurementScheduleListView);
- List<String> displayNames = getMeasurementDefinitionDisplayNames(measurementScheduleListView);
- enableSchedules(measurementScheduleListView, ids, displayNames);
- }
-
- protected abstract void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView,
- int[] measurementDefinitionIds, List<String> measurementDefinitionDisplayNames);
-
- public void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) {
- int[] ids = getMeasurementDefinitionIds(measurementScheduleListView);
- List<String> displayNames = getMeasurementDefinitionDisplayNames(measurementScheduleListView);
- disableSchedules(measurementScheduleListView, ids, displayNames);
- }
-
- protected abstract void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView,
- int[] measurementDefinitionIds, List<String> measurementDefinitionDisplayNames);
-
- public void updateSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, long interval) {
- int[] ids = getMeasurementDefinitionIds(measurementScheduleListView);
- List<String> displayNames = getMeasurementDefinitionDisplayNames(measurementScheduleListView);
- updateSchedules(measurementScheduleListView, ids, displayNames, interval);
- }
-
- private int[] getMeasurementDefinitionIds(AbstractMeasurementScheduleListView measurementScheduleListView) {
- ListGrid listGrid = measurementScheduleListView.getListGrid();
- ListGridRecord[] records = listGrid.getSelection();
-
- 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);
- measurementDefinitionIds[i] = measurementDefinitionId;
- }
- 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, List<String> measurementDefinitionDisplayNames, final long interval);
-}
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
deleted file mode 100644
index 657f2b0..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
+++ /dev/null
@@ -1,229 +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.common;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-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.Record;
-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;
-
-/**
- * A server-side SmartGWT DataSource for reading and updating {@link MeasurementSchedule}s.
- *
- * @deprecated this class has been replaced by {@link AbstractMeasurementScheduleCompositeDataSource}, but
- * I'm keeping it around in case we want to switch back to fetching schedules via criteria at
- * some point. (ips, 10/06/10)
- *
- * @author Ian Springer
- */
-@Deprecated
-public abstract class AbstractMeasurementScheduleDataSource extends
- RPCDataSource<MeasurementSchedule, MeasurementScheduleCriteria> {
- 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>();
-
- DataSourceIntegerField idField = new DataSourceIntegerField(
- MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID, MSG.common_title_id());
- idField.setPrimaryKey(true);
- idField.setHidden(true);
- fields.add(idField);
-
- DataSourceTextField nameField = new DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
- MSG.common_title_metric());
- fields.add(nameField);
-
- DataSourceTextField descriptionField = new DataSourceTextField(
- MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION, MSG.common_title_description());
- fields.add(descriptionField);
-
- DataSourceTextField typeField = new DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE, MSG
- .common_title_type());
- fields.add(typeField);
-
- DataSourceBooleanField enabledField = new DataSourceBooleanField(
- MeasurementScheduleCriteria.SORT_FIELD_ENABLED, MSG.common_title_enabled());
- fields.add(enabledField);
-
- DataSourceIntegerField intervalField = new DataSourceIntegerField(
- MeasurementScheduleCriteria.SORT_FIELD_INTERVAL, MSG.view_inventory_collectionInterval());
- fields.add(intervalField);
-
- return fields;
- }
-
- protected void executeFetch(final DSRequest request, final DSResponse response,
- final MeasurementScheduleCriteria criteria) {
- final long startTime = System.currentTimeMillis();
-
- this.measurementService.findMeasurementSchedulesByCriteria(criteria,
- new AsyncCallback<PageList<MeasurementSchedule>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(
- MSG.dataSource_schedules_loadFailedCriteria(criteria.toString()), caught);
- response.setStatus(RPCResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(), response);
- }
-
- public void onSuccess(PageList<MeasurementSchedule> result) {
- long fetchDuration = System.currentTimeMillis() - startTime;
- com.allen_sauer.gwt.log.client.Log.info(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);
- }
- });
- }
-
- @Override
- protected MeasurementScheduleCriteria getFetchCriteria(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(Record from) {
- return null;
- }
-
- @Override
- public ListGridRecord copyValues(MeasurementSchedule from) {
- ListGridRecord record = new ListGridRecord();
-
- 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()
- .toLowerCase());
- record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_ENABLED, from.isEnabled());
- record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL, from.getInterval());
-
- // TODO: resourceId and resourceGroupId (in subclasses)
-
- return record;
- }
-
- public void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) {
- int[] ids = getMeasurementDefinitionIds(measurementScheduleListView);
- List<String> displayNames = getMeasurementDefinitionDisplayNames(measurementScheduleListView);
- enableSchedules(measurementScheduleListView, ids, displayNames);
- measurementScheduleListView.refresh();
- }
-
- protected abstract void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView,
- int[] measurementDefinitionIds, List<String> measurementDefinitionDisplayNames);
-
- public void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) {
- int[] ids = getMeasurementDefinitionIds(measurementScheduleListView);
- List<String> displayNames = getMeasurementDefinitionDisplayNames(measurementScheduleListView);
- disableSchedules(measurementScheduleListView, ids, displayNames);
- measurementScheduleListView.refresh();
- }
-
- protected abstract void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView,
- int[] measurementDefinitionIds, List<String> measurementDefinitionDisplayNames);
-
- public void updateSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, long interval) {
- int[] ids = getMeasurementDefinitionIds(measurementScheduleListView);
- List<String> displayNames = getMeasurementDefinitionDisplayNames(measurementScheduleListView);
- updateSchedules(measurementScheduleListView, ids, displayNames, interval);
- measurementScheduleListView.refresh();
- }
-
- private int[] getMeasurementDefinitionIds(AbstractMeasurementScheduleListView measurementScheduleListView) {
- ListGrid listGrid = measurementScheduleListView.getListGrid();
- ListGridRecord[] records = listGrid.getSelection();
-
- 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);
- measurementDefinitionIds[i] = measurementDefinitionId;
- }
- 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, List<String> measurementDefinitionDisplayNames, 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
deleted file mode 100644
index 67d6556..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
+++ /dev/null
@@ -1,151 +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.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;
-
-/**
- * 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
- */
-public abstract class AbstractMeasurementScheduleListView extends Table {
-
- private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[] { new SortSpecifier(
- MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, SortDirection.ASCENDING) };
-
- public AbstractMeasurementScheduleListView(String locatorId, String title,
- AbstractMeasurementScheduleCompositeDataSource dataSource, Criteria criteria, String[] excludedFieldNames) {
- super(locatorId, title, criteria, SORT_SPECIFIERS, excludedFieldNames);
- setDataSource(dataSource);
- }
-
- public abstract boolean hasManageMeasurementsPermission();
-
- @Override
- public AbstractMeasurementScheduleCompositeDataSource getDataSource() {
- return (AbstractMeasurementScheduleCompositeDataSource) super.getDataSource();
- }
-
- protected void configureTable() {
- 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%");
- ListGridField enabledField = listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED);
- enabledField.setWidth("10%");
- enabledField.setCellFormatter(new CollectionEnabledCellFormatter());
- ListGridField intervalField = listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL);
- intervalField.setCellFormatter(new CollectionIntervalCellFormatter());
- intervalField.setWidth("25%");
-
- // Add action buttons and widgets.
- addTableAction(extendLocatorId("Enable"), MSG.common_button_enable(), null, new TableAction() {
- public boolean isEnabled(ListGridRecord[] selection) {
- return ((selection.length >= 1) && hasManageMeasurementsPermission());
- }
-
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- getDataSource().enableSchedules(AbstractMeasurementScheduleListView.this);
- }
- });
- addTableAction(extendLocatorId("Disable"), MSG.common_button_disable(), null, new TableAction() {
- public boolean isEnabled(ListGridRecord[] selection) {
- return ((selection.length >= 1) && hasManageMeasurementsPermission());
- }
-
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this);
- }
- });
- addExtraWidget(new UpdateCollectionIntervalWidget(this.getLocatorId(), this), true);
- }
-
- protected class CollectionEnabledCellFormatter extends BooleanCellFormatter {
- @Override
- public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
- String result = super.format(value, record, rowNum, colNum);
- return ("".equals(result)) ? MSG.view_inventory_mixed() : result;
- }
- }
-
- protected class CollectionIntervalCellFormatter implements CellFormatter {
-
- public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
- if (value == null) {
- return MSG.view_inventory_mixed();
- }
-
- long milliseconds = ((Number) value).longValue();
- if (milliseconds == 0) {
- return MSG.view_inventory_mixed();
- }
-
- 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(" ").append(MSG.common_unit_hours());
- }
- if (minutes != 0) {
- if (result.length() != 0) {
- result.append(", ");
- }
- result.append(minutes).append(" ").append(MSG.common_unit_minutes());
- }
- }
- if (seconds != 0) {
- if (result.length() != 0) {
- result.append(", ");
- }
- result.append(seconds).append(" ").append(MSG.common_unit_seconds());
- }
- }
- if (milliseconds != 0) {
- if (result.length() != 0) {
- result.append(", ");
- }
- result.append(milliseconds).append(" ").append(MSG.common_unit_milliseconds());
- }
- return result.toString();
- }
-
- }
-
-}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractSchedulesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractSchedulesView.java
new file mode 100644
index 0000000..f5e4dbb
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractSchedulesView.java
@@ -0,0 +1,158 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2012 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 java.util.ArrayList;
+import java.util.List;
+
+import com.smartgwt.client.data.SortSpecifier;
+import com.smartgwt.client.types.SortDirection;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.common.EntityContext;
+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;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync;
+
+/**
+ * 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 Jay Shaughnessy
+ * @author Ian Springer
+ */
+public abstract class AbstractSchedulesView extends Table<SchedulesDataSource> {
+
+ protected MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService();
+
+ private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[] { new SortSpecifier(
+ MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, SortDirection.ASCENDING) };
+
+ private EntityContext entityContext;
+ private boolean hasWriteAccess;
+
+ protected SchedulesDataSource dataSource;
+
+ public AbstractSchedulesView(String locatorId, String tableTitle, EntityContext entityContext,
+ boolean hasWriteAccess) {
+
+ super(locatorId, tableTitle, SORT_SPECIFIERS);
+ this.entityContext = entityContext;
+ this.hasWriteAccess = hasWriteAccess;
+
+ setDataSource(getDataSource());
+ }
+
+ @Override
+ public SchedulesDataSource getDataSource() {
+ if (null == this.dataSource) {
+ this.dataSource = new SchedulesDataSource(entityContext);
+ }
+ return this.dataSource;
+ }
+
+ @Override
+ protected void configureTable() {
+ ArrayList<ListGridField> listGridFields = getDataSource().getListGridFields();
+ getListGrid().setFields(listGridFields.toArray(new ListGridField[listGridFields.size()]));
+ setupTableInteractions(this.hasWriteAccess);
+
+ super.configureTable();
+ }
+
+ protected void setupTableInteractions(final boolean hasWriteAccess) {
+
+ addTableAction(extendLocatorId("Enable"), MSG.common_button_enable(), null, new TableAction() {
+ public boolean isEnabled(ListGridRecord[] selection) {
+ return ((selection.length >= 1) && hasWriteAccess);
+ }
+
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ enableSchedules();
+ }
+ });
+ addTableAction(extendLocatorId("Disable"), MSG.common_button_disable(), null, new TableAction() {
+ public boolean isEnabled(ListGridRecord[] selection) {
+ return ((selection.length >= 1) && hasWriteAccess);
+ }
+
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ disableSchedules();
+ }
+ });
+ addExtraWidget(new UpdateCollectionIntervalWidget(this.getLocatorId(), this), true);
+ }
+
+ protected abstract void enableSchedules(int[] measurementDefinitionIds,
+ List<String> measurementDefinitionDisplayNames);
+
+ protected abstract void disableSchedules(int[] measurementDefinitionIds,
+ List<String> measurementDefinitionDisplayNames);
+
+ protected abstract void updateSchedules(final int[] measurementDefinitionIds,
+ List<String> measurementDefinitionDisplayNames, final long interval);
+
+ public void disableSchedules() {
+ int[] ids = getMeasurementDefinitionIds();
+ List<String> displayNames = getMeasurementDefinitionDisplayNames();
+ disableSchedules(ids, displayNames);
+ }
+
+ public void enableSchedules() {
+ int[] ids = getMeasurementDefinitionIds();
+ List<String> displayNames = getMeasurementDefinitionDisplayNames();
+ enableSchedules(ids, displayNames);
+ }
+
+ public void updateSchedules(long interval) {
+ int[] ids = getMeasurementDefinitionIds();
+ List<String> displayNames = getMeasurementDefinitionDisplayNames();
+ updateSchedules(ids, displayNames, interval);
+ }
+
+ private int[] getMeasurementDefinitionIds() {
+ ListGridRecord[] records = getListGrid().getSelectedRecords();
+
+ 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);
+ measurementDefinitionIds[i] = measurementDefinitionId;
+ }
+ return measurementDefinitionIds;
+ }
+
+ private List<String> getMeasurementDefinitionDisplayNames() {
+ ListGridRecord[] records = getListGrid().getSelectedRecords();
+ 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;
+ }
+
+ public boolean hasWriteAccess() {
+ return hasWriteAccess;
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/SchedulesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/SchedulesDataSource.java
new file mode 100644
index 0000000..e73cb66
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/SchedulesDataSource.java
@@ -0,0 +1,212 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2012 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 java.util.ArrayList;
+
+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.rpc.RPCResponse;
+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.common.EntityContext;
+import org.rhq.core.domain.criteria.Criteria;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.composite.MeasurementScheduleComposite;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.table.BooleanCellFormatter;
+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;
+
+/**
+ * A server-side SmartGWT DataSource for reading and updating {@link MeasurementScheduleComposite}s.
+ *
+ * @author JayShaughnessy
+ * @author Ian Springer
+ */
+public class SchedulesDataSource extends RPCDataSource<MeasurementScheduleComposite, Criteria> {
+
+ public static final String ATTR_ID = "id";
+ public static final String ATTR_DATA_TYPE = MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE;
+ public static final String ATTR_DEFINITION_ID = MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID;
+ public static final String ATTR_DESCRIPTION = MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION;
+ public static final String ATTR_DISPLAY_NAME = MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME;
+ public static final String ATTR_ENABLED = MeasurementScheduleCriteria.SORT_FIELD_ENABLED;
+ public static final String ATTR_INTERVAL = MeasurementScheduleCriteria.SORT_FIELD_INTERVAL;
+
+ private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService();
+
+ protected EntityContext entityContext;
+
+ public SchedulesDataSource() {
+ this(EntityContext.forSubsystemView());
+ }
+
+ public SchedulesDataSource(EntityContext entityContext) {
+ this.entityContext = entityContext;
+ addDataSourceFields();
+ }
+
+ /**
+ * The view that contains the list grid which will display this datasource's data will call this
+ * method to get the field information which is used to control the display of the data.
+ *
+ * @return list grid fields used to display the datasource data
+ */
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>();
+
+ ListGridField displayNameField = new ListGridField(ATTR_DISPLAY_NAME, MSG.common_title_metric());
+ fields.add(displayNameField);
+
+ ListGridField descriptionField = new ListGridField(ATTR_DESCRIPTION, MSG.common_title_description());
+ fields.add(descriptionField);
+
+ ListGridField typeField = new ListGridField(ATTR_DATA_TYPE, MSG.common_title_type());
+ fields.add(typeField);
+
+ ListGridField enabledField = new ListGridField(ATTR_ENABLED, MSG.common_title_enabled());
+ enabledField.setCellFormatter(new CollectionEnabledCellFormatter());
+ fields.add(enabledField);
+
+ ListGridField intervalField = new ListGridField(ATTR_INTERVAL, MSG.view_inventory_collectionInterval());
+ intervalField.setCellFormatter(new CollectionIntervalCellFormatter());
+ fields.add(intervalField);
+
+ displayNameField.setWidth("20%");
+ descriptionField.setWidth("40%");
+ typeField.setWidth("10%");
+ enabledField.setWidth("10%");
+ intervalField.setWidth("*");
+
+ return fields;
+ }
+
+ @Override
+ protected Criteria getFetchCriteria(DSRequest request) {
+ // we don't use criterias for this datasource, just return null
+ return null;
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response, final Criteria unused) {
+
+ this.measurementService.getMeasurementScheduleCompositesByContext(entityContext,
+ new AsyncCallback<PageList<MeasurementScheduleComposite>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.dataSource_schedules_loadFailedContext(entityContext.toString()), caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(PageList<MeasurementScheduleComposite> result) {
+ 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);
+ }
+ });
+ }
+
+ @Override
+ public MeasurementScheduleComposite copyValues(Record from) {
+ return null;
+ }
+
+ @Override
+ public ListGridRecord copyValues(MeasurementScheduleComposite from) {
+
+ ListGridRecord record = new ListGridRecord();
+ MeasurementDefinition measurementDefinition = from.getMeasurementDefinition();
+
+ record.setAttribute(ATTR_DEFINITION_ID, measurementDefinition.getId());
+ record.setAttribute(ATTR_DISPLAY_NAME, measurementDefinition.getDisplayName());
+ record.setAttribute(ATTR_DESCRIPTION, measurementDefinition.getDescription());
+ record.setAttribute(ATTR_DATA_TYPE, measurementDefinition.getDataType().name().toLowerCase());
+ record.setAttribute(ATTR_ENABLED, from.getCollectionEnabled());
+ record.setAttribute(ATTR_INTERVAL, from.getCollectionInterval());
+
+ return record;
+ }
+
+ protected class CollectionEnabledCellFormatter extends BooleanCellFormatter {
+ @Override
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
+ String result = super.format(value, record, rowNum, colNum);
+ return ("".equals(result)) ? MSG.view_inventory_mixed() : result;
+ }
+ }
+
+ protected class CollectionIntervalCellFormatter implements CellFormatter {
+
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
+ if (value == null) {
+ return MSG.view_inventory_mixed();
+ }
+
+ long milliseconds = ((Number) value).longValue();
+ if (milliseconds == 0) {
+ return MSG.view_inventory_mixed();
+ }
+
+ 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(" ").append(MSG.common_unit_hours());
+ }
+ if (minutes != 0) {
+ if (result.length() != 0) {
+ result.append(", ");
+ }
+ result.append(minutes).append(" ").append(MSG.common_unit_minutes());
+ }
+ }
+ if (seconds != 0) {
+ if (result.length() != 0) {
+ result.append(", ");
+ }
+ result.append(seconds).append(" ").append(MSG.common_unit_seconds());
+ }
+ }
+ if (milliseconds != 0) {
+ if (result.length() != 0) {
+ result.append(", ");
+ }
+ result.append(milliseconds).append(" ").append(MSG.common_unit_milliseconds());
+ }
+ return result.toString();
+ }
+ }
+
+}
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 2a84944..93ee444 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
@@ -60,11 +60,11 @@ public class UpdateCollectionIntervalWidget extends LocatableHLayout implements
VALUE_MAP.put(UNITS_HOURS, MSG.common_unit_hours());
}
- private AbstractMeasurementScheduleListView schedulesView;
+ private AbstractSchedulesView schedulesView;
private DynamicForm form;
private LocatableButton setButton;
- public UpdateCollectionIntervalWidget(String locatorId, AbstractMeasurementScheduleListView schedulesView) {
+ public UpdateCollectionIntervalWidget(String locatorId, AbstractSchedulesView schedulesView) {
super(locatorId);
this.schedulesView = schedulesView;
}
@@ -110,7 +110,7 @@ public class UpdateCollectionIntervalWidget extends LocatableHLayout implements
}
});
- if (!schedulesView.hasManageMeasurementsPermission()) {
+ if (!schedulesView.hasWriteAccess()) {
intervalItem.setDisabled(true);
unitsItem.setDisabled(true);
}
@@ -124,8 +124,7 @@ public class UpdateCollectionIntervalWidget extends LocatableHLayout implements
public void onClick(ClickEvent clickEvent) {
if (form.validate()) {
UpdateCollectionIntervalWidget.this.schedulesView.disableAllFooterControls();
- UpdateCollectionIntervalWidget.this.schedulesView.getDataSource().updateSchedules(
- UpdateCollectionIntervalWidget.this.schedulesView, getInterval());
+ UpdateCollectionIntervalWidget.this.schedulesView.updateSchedules(getInterval());
}
}
});
@@ -138,7 +137,7 @@ public class UpdateCollectionIntervalWidget extends LocatableHLayout implements
public void refresh(ListGrid listGrid) {
if (isDrawn()) {
boolean isValid = this.form.validate();
- int count = listGrid.getSelection().length;
+ int count = listGrid.getSelectedRecords().length;
Long interval = getInterval();
this.setButton.setDisabled(!isValid || count == 0 || interval == null);
} else {
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 0085454..fbc12cd 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
@@ -61,7 +61,7 @@ import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.configurati
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.GroupPluginConfigurationEditView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.HistoryGroupPluginConfigurationView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.MembersView;
-import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules.SchedulesView;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules.ResourceGroupSchedulesView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.GroupMonitoringTablesView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.traits.TraitsView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.history.GroupOperationHistoryListView;
@@ -329,7 +329,7 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
- return new SchedulesView(monitorSched.extendLocatorId("View"), groupComposite);
+ return new ResourceGroupSchedulesView(monitorSched.extendLocatorId("View"), groupComposite);
}
};
updateSubTab(this.monitoringTab, this.monitorSched, visible, true, viewFactory);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/ResourceGroupSchedulesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/ResourceGroupSchedulesView.java
new file mode 100644
index 0000000..001cd91
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/ResourceGroupSchedulesView.java
@@ -0,0 +1,139 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2012 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 java.util.List;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractSchedulesView;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+/**
+ * The group Monitoring>Schedules subtab.
+ *
+ * @author Jay Shaughnessy
+ * @author Ian Springer
+ */
+public class ResourceGroupSchedulesView extends AbstractSchedulesView {
+
+ private static final String TITLE = MSG.view_group_meas_schedules_title();
+
+ private ResourceGroupComposite resourceGroupComposite;
+ private int groupId;
+
+ public ResourceGroupSchedulesView(String locatorId, ResourceGroupComposite resourceGroupComposite) {
+ super(locatorId, TITLE, EntityContext.forGroup(resourceGroupComposite.getResourceGroup().getId()),
+ resourceGroupComposite.getResourcePermission().isMeasure());
+
+ this.resourceGroupComposite = resourceGroupComposite;
+ this.groupId = resourceGroupComposite.getResourceGroup().getId();
+ }
+
+ @Override
+ protected void enableSchedules(final int[] measurementDefinitionIds,
+ final List<String> measurementDefinitionDisplayNames) {
+
+ this.measurementService.enableSchedulesForCompatibleGroup(this.groupId, measurementDefinitionIds,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.dataSource_schedules_enableFailure_group(String.valueOf(measurementDefinitionIds.length),
+ String.valueOf(groupId), measurementDefinitionDisplayNames.toString()), throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.dataSource_schedules_enableSuccessful_concise(String
+ .valueOf(measurementDefinitionIds.length)), MSG
+ .dataSource_schedules_enableSuccessful_full_group(
+ String.valueOf(measurementDefinitionIds.length), String.valueOf(groupId),
+ measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
+ refresh();
+ }
+ });
+ }
+
+ @Override
+ protected void disableSchedules(final int[] measurementDefinitionIds,
+ final List<String> measurementDefinitionDisplayNames) {
+
+ this.measurementService.disableSchedulesForCompatibleGroup(this.groupId, measurementDefinitionIds,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.dataSource_schedules_disableFailure_group(String.valueOf(measurementDefinitionIds.length),
+ String.valueOf(groupId), measurementDefinitionDisplayNames.toString()), throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.dataSource_schedules_disableSuccessful_concise(String
+ .valueOf(measurementDefinitionIds.length)), MSG
+ .dataSource_schedules_disableSuccessful_full_group(
+ String.valueOf(measurementDefinitionIds.length), String.valueOf(groupId),
+ measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
+ refresh();
+ }
+ });
+ }
+
+ @Override
+ protected void updateSchedules(final int[] measurementDefinitionIds,
+ final List<String> measurementDefinitionDisplayNames, final long collectionInterval) {
+
+ this.measurementService.updateSchedulesForCompatibleGroup(this.groupId, measurementDefinitionIds,
+ collectionInterval, new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.dataSource_schedules_updateFailure_group(String.valueOf(measurementDefinitionIds.length),
+ String.valueOf(groupId), measurementDefinitionDisplayNames.toString(),
+ String.valueOf(collectionInterval / 1000)), throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ String collIntervalStr = String.valueOf(collectionInterval / 1000);
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.dataSource_schedules_updateSuccessful_concise(collIntervalStr,
+ String.valueOf(measurementDefinitionIds.length)), MSG
+ .dataSource_schedules_updateSuccessful_full_group(collIntervalStr,
+ String.valueOf(measurementDefinitionIds.length), String.valueOf(groupId),
+ measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
+ refresh();
+ }
+ });
+ }
+
+ public ResourceGroupComposite getResourceGroupComposite() {
+ return resourceGroupComposite;
+ }
+
+ public int getGroupId() {
+ return 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
deleted file mode 100644
index c21484d..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2010-2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules;
-
-import java.util.List;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.data.DSRequest;
-import com.smartgwt.client.data.DataSourceField;
-import com.smartgwt.client.data.fields.DataSourceIntegerField;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
-
-import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
-import org.rhq.core.domain.measurement.composite.MeasurementScheduleComposite;
-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.AbstractMeasurementScheduleCompositeDataSource;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-
-/**
- * A DataSource for reading and updating the metric schedules for the current group.
- *
- * @author Ian Springer
- */
-public class SchedulesDataSource extends AbstractMeasurementScheduleCompositeDataSource {
-
- // Specify 60s timeout to compensate for schedule updates taking a long time for large groups.
- // TODO (ips, 08/31/11): Remove this once updating of group schedules has been optimized.
- private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService(60 * 1000);
- private int resourceGroupId;
-
- public SchedulesDataSource(int resourceGroupId) {
- this.resourceGroupId = resourceGroupId;
- }
-
- @Override
- protected List<DataSourceField> addDataSourceFields() {
- List<DataSourceField> fields = super.addDataSourceFields();
-
- DataSourceField resourceGroupIdField = new DataSourceIntegerField(
- MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID, MSG
- .dataSource_schedules_field_resourceGroupId());
- resourceGroupIdField.setHidden(true);
- fields.add(resourceGroupIdField);
-
- return fields;
- }
-
- @Override
- protected EntityContext getEntityContext(DSRequest request) {
- Criteria requestCriteria = request.getCriteria();
- Integer groupId = requestCriteria.getAttributeAsInt(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID);
- return EntityContext.forGroup(groupId);
- }
-
- @Override
- public ListGridRecord copyValues(MeasurementScheduleComposite from) {
- ListGridRecord record = super.copyValues(from);
- record.setAttribute(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID, this.resourceGroupId);
- return record;
- }
-
- @Override
- protected void enableSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView,
- final int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) {
-
- this.measurementService.enableSchedulesForCompatibleGroup(this.resourceGroupId, measurementDefinitionIds,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError(
- MSG.dataSource_schedules_enableFailure_group(String.valueOf(measurementDefinitionIds.length),
- String.valueOf(resourceGroupId), measurementDefinitionDisplayNames.toString()), throwable);
- }
-
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.dataSource_schedules_enableSuccessful_concise(String
- .valueOf(measurementDefinitionIds.length)), MSG
- .dataSource_schedules_enableSuccessful_full_group(String
- .valueOf(measurementDefinitionIds.length), String.valueOf(resourceGroupId),
- measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
- measurementScheduleListView.refresh();
- }
- });
- }
-
- @Override
- protected void disableSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView,
- final int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) {
-
- this.measurementService.disableSchedulesForCompatibleGroup(this.resourceGroupId, measurementDefinitionIds,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError(
- MSG.dataSource_schedules_disableFailure_group(String.valueOf(measurementDefinitionIds.length),
- String.valueOf(resourceGroupId), measurementDefinitionDisplayNames.toString()), throwable);
- }
-
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.dataSource_schedules_disableSuccessful_concise(String
- .valueOf(measurementDefinitionIds.length)), MSG
- .dataSource_schedules_disableSuccessful_full_group(String
- .valueOf(measurementDefinitionIds.length), String.valueOf(resourceGroupId),
- measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
- measurementScheduleListView.refresh();
- }
- });
- }
-
- @Override
- protected void updateSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView,
- final 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(
- MSG.dataSource_schedules_updateFailure_group(String.valueOf(measurementDefinitionIds.length),
- String.valueOf(resourceGroupId), measurementDefinitionDisplayNames.toString(), String
- .valueOf(collectionInterval / 1000)), throwable);
- }
-
- @Override
- public void onSuccess(Void aVoid) {
- String collIntervalStr = String.valueOf(collectionInterval / 1000);
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.dataSource_schedules_updateSuccessful_concise(collIntervalStr, String
- .valueOf(measurementDefinitionIds.length)), MSG
- .dataSource_schedules_updateSuccessful_full_group(collIntervalStr, String
- .valueOf(measurementDefinitionIds.length), String.valueOf(resourceGroupId),
- measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
- measurementScheduleListView.refresh();
- }
- });
- }
-
-}
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
deleted file mode 100644
index bd8d36d..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
+++ /dev/null
@@ -1,56 +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.monitoring.schedules;
-
-import com.smartgwt.client.data.Criteria;
-
-import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
-import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
-
-/**
- * The group Monitoring>Schedules subtab.
- *
- * @author Ian Springer
- */
-public class SchedulesView extends AbstractMeasurementScheduleListView {
-
- private static final String TITLE = MSG.view_group_meas_schedules_title();
- private static final String[] EXCLUDED_FIELD_NAMES = new String[] { MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID };
-
- private ResourceGroupComposite resourceGroupComposite;
-
- public SchedulesView(String locatorId, ResourceGroupComposite resourceGroupComposite) {
- super(locatorId, TITLE, new SchedulesDataSource(resourceGroupComposite.getResourceGroup().getId()),
- createCriteria(resourceGroupComposite.getResourceGroup().getId()), EXCLUDED_FIELD_NAMES);
-
- this.resourceGroupComposite = resourceGroupComposite;
- }
-
- public boolean hasManageMeasurementsPermission() {
- return this.resourceGroupComposite.getResourcePermission().isMeasure();
- }
-
- 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/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index e17575e..3205d28 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
@@ -64,7 +64,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.inventory.PluginConfigurationHistoryListView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.ResourceResourceAgentView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.SchedulesView;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.ResourceSchedulesView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.table.MeasurementTableView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.traits.TraitsView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryListView;
@@ -440,7 +440,7 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
new ViewFactory() {
@Override
public Canvas createView() {
- return new SchedulesView(monitoringTab.extendLocatorId("SchedulesView"), resourceComposite);
+ return new ResourceSchedulesView(monitoringTab.extendLocatorId("SchedulesView"), resourceComposite);
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/ResourceSchedulesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/ResourceSchedulesView.java
new file mode 100644
index 0000000..8690d23
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/ResourceSchedulesView.java
@@ -0,0 +1,143 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2012 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 java.util.List;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.resource.composite.ResourceComposite;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractSchedulesView;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+/**
+ * The Resource Monitoring>Schedules subtab.
+ *
+ * @author Jay Shaughnessy
+ * @author Ian Springer
+ */
+public class ResourceSchedulesView extends AbstractSchedulesView {
+
+ private static final String TITLE = MSG.view_resource_monitor_schedules_title();
+
+ private ResourceComposite resourceComposite;
+ private int resourceId;
+
+ public ResourceSchedulesView(String locatorId, ResourceComposite resourceComposite) {
+ super(locatorId, TITLE, EntityContext.forResource(resourceComposite.getResource().getId()), resourceComposite
+ .getResourcePermission().isMeasure());
+
+ this.resourceComposite = resourceComposite;
+ this.resourceId = resourceComposite.getResource().getId();
+ }
+
+ @Override
+ protected void enableSchedules(final int[] measurementDefinitionIds,
+ final List<String> measurementDefinitionDisplayNames) {
+
+ measurementService.enableSchedulesForResource(this.resourceId, measurementDefinitionIds,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.dataSource_schedules_enableFailure_resource(
+ String.valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
+ measurementDefinitionDisplayNames.toString()), throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.dataSource_schedules_enableSuccessful_concise(String
+ .valueOf(measurementDefinitionIds.length)), MSG
+ .dataSource_schedules_enableSuccessful_full_resource(
+ String.valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
+ measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
+ refresh();
+ }
+ });
+ }
+
+ @Override
+ protected void disableSchedules(final int[] measurementDefinitionIds,
+ final List<String> measurementDefinitionDisplayNames) {
+
+ measurementService.disableSchedulesForResource(this.resourceId, measurementDefinitionIds,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.dataSource_schedules_disableFailure_resource(
+ String.valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
+ measurementDefinitionDisplayNames.toString()), throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.dataSource_schedules_disableSuccessful_concise(String
+ .valueOf(measurementDefinitionIds.length)), MSG
+ .dataSource_schedules_disableSuccessful_full_resource(
+ String.valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
+ measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
+ refresh();
+ }
+ });
+ }
+
+ @Override
+ protected void updateSchedules(final int[] measurementDefinitionIds,
+ final List<String> measurementDefinitionDisplayNames, final long collectionInterval) {
+
+ measurementService.updateSchedulesForResource(this.resourceId, measurementDefinitionIds, collectionInterval,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.dataSource_schedules_updateFailure_resource(
+ String.valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
+ measurementDefinitionDisplayNames.toString(), String.valueOf(collectionInterval / 1000)),
+ throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ String collIntervalStr = String.valueOf(collectionInterval / 1000);
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.dataSource_schedules_updateSuccessful_concise(collIntervalStr,
+ String.valueOf(measurementDefinitionIds.length)), MSG
+ .dataSource_schedules_updateSuccessful_full_resource(collIntervalStr,
+ String.valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
+ measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
+ refresh();
+ }
+ });
+ }
+
+ public ResourceComposite getResourceComposite() {
+ return resourceComposite;
+ }
+
+ public int getResourceId() {
+ return resourceId;
+ }
+
+}
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
deleted file mode 100644
index c131931..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
+++ /dev/null
@@ -1,159 +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.resource.detail.monitoring.schedules;
-
-import java.util.List;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.data.DSRequest;
-import com.smartgwt.client.data.DataSourceField;
-import com.smartgwt.client.data.fields.DataSourceIntegerField;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
-
-import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
-import org.rhq.core.domain.measurement.composite.MeasurementScheduleComposite;
-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.AbstractMeasurementScheduleCompositeDataSource;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-
-/**
- * A DataSource for reading and updating the metric schedules for the current Resource.
- *
- * @author Ian Springer
- */
-public class SchedulesDataSource extends AbstractMeasurementScheduleCompositeDataSource {
- private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService();
- private int resourceId;
-
- public SchedulesDataSource(int resourceId) {
- this.resourceId = resourceId;
- }
-
- @Override
- protected List<DataSourceField> addDataSourceFields() {
- List<DataSourceField> fields = super.addDataSourceFields();
-
- DataSourceField resourceIdField = new DataSourceIntegerField(
- MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID, MSG.common_title_resource_id());
- resourceIdField.setHidden(true);
- fields.add(resourceIdField);
-
- return fields;
- }
-
- @Override
- protected EntityContext getEntityContext(DSRequest request) {
- Criteria requestCriteria = request.getCriteria();
- Integer resourceId = requestCriteria.getAttributeAsInt(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID);
- return EntityContext.forResource(resourceId);
- }
-
- @Override
- public ListGridRecord copyValues(MeasurementScheduleComposite from) {
- ListGridRecord record = super.copyValues(from);
- record.setAttribute(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID, this.resourceId);
- return record;
- }
-
- @Override
- protected void enableSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView,
- final int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) {
- this.measurementService.enableSchedulesForResource(this.resourceId, measurementDefinitionIds,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError(
- MSG.dataSource_schedules_enableFailure_resource(
- String.valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
- measurementDefinitionDisplayNames.toString()), throwable);
- }
-
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.dataSource_schedules_enableSuccessful_concise(String
- .valueOf(measurementDefinitionIds.length)), MSG
- .dataSource_schedules_enableSuccessful_full_resource(String
- .valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
- measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
- measurementScheduleListView.refresh();
- }
- });
- }
-
- @Override
- protected void disableSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView,
- final int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) {
- this.measurementService.disableSchedulesForResource(this.resourceId, measurementDefinitionIds,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError(
- MSG.dataSource_schedules_disableFailure_resource(String
- .valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
- measurementDefinitionDisplayNames.toString()), throwable);
- }
-
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.dataSource_schedules_disableSuccessful_concise(String
- .valueOf(measurementDefinitionIds.length)), MSG
- .dataSource_schedules_disableSuccessful_full_resource(String
- .valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
- measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
- measurementScheduleListView.refresh();
- }
- });
- }
-
- @Override
- protected void updateSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView,
- final 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(
- MSG.dataSource_schedules_updateFailure_resource(
- String.valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
- measurementDefinitionDisplayNames.toString(), String.valueOf(collectionInterval / 1000)),
- throwable);
- }
-
- @Override
- public void onSuccess(Void aVoid) {
- String collIntervalStr = String.valueOf(collectionInterval / 1000);
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.dataSource_schedules_updateSuccessful_concise(collIntervalStr, String
- .valueOf(measurementDefinitionIds.length)), MSG
- .dataSource_schedules_updateSuccessful_full_resource(collIntervalStr, String
- .valueOf(measurementDefinitionIds.length), String.valueOf(resourceId),
- measurementDefinitionDisplayNames.toString()), Message.Severity.Info));
- measurementScheduleListView.refresh();
- }
- });
- }
-}
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
deleted file mode 100644
index 46ef463..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
+++ /dev/null
@@ -1,56 +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.resource.detail.monitoring.schedules;
-
-import com.smartgwt.client.data.Criteria;
-
-import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
-import org.rhq.core.domain.resource.composite.ResourceComposite;
-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 TITLE = MSG.view_resource_monitor_schedules_title();
- private static final String[] EXCLUDED_FIELD_NAMES = new String[] { MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID };
-
- private ResourceComposite resourceComposite;
-
- public SchedulesView(String locatorId, ResourceComposite resourceComposite) {
- super(locatorId, TITLE, new SchedulesDataSource(resourceComposite.getResource().getId()),
- createCriteria(resourceComposite.getResource().getId()), EXCLUDED_FIELD_NAMES);
-
- this.resourceComposite = resourceComposite;
- }
-
- public boolean hasManageMeasurementsPermission() {
- return resourceComposite.getResourcePermission().isMeasure();
- }
-
- private static Criteria createCriteria(int resourceId) {
- Criteria criteria = new Criteria();
- criteria.addCriteria(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID, resourceId);
- return criteria;
- }
-
-}
commit fdbf54ac94317d69343132281c1bdd82632a8658
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jan 13 14:46:19 2012 -0500
update Eclipse .classpath with gwt/smartgw upgrades
diff --git a/.classpath b/.classpath
index 24fb54d..f8d0aa3 100644
--- a/.classpath
+++ b/.classpath
@@ -101,10 +101,10 @@
<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"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/fedorahosted/cobbler/cobbler4j/0.1/cobbler4j-0.1.jar"/>
- <classpathentry exported="true" kind="var" path="M2_REPO/com/google/gwt/gwt-user/2.0.4/gwt-user-2.0.4.jar"/>
- <classpathentry exported="true" kind="var" path="M2_REPO/com/google/gwt/gwt-dev/2.0.4/gwt-dev-2.0.4.jar"/>
- <classpathentry exported="true" kind="var" path="M2_REPO/com/smartgwt/smartgwt/2.4/smartgwt-2.4.jar"/>
- <classpathentry exported="true" kind="var" path="M2_REPO/com/google/code/gwt-log/gwt-log/3.0.4/gwt-log-3.0.4.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/com/google/gwt/gwt-user/2.4.0/gwt-user-2.4.0.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/com/google/gwt/gwt-dev/2.4.0/gwt-dev-2.4.0.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/com/smartgwt/smartgwt/3.0/smartgwt-3.0.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/com/google/code/gwt-log/gwt-log/3.1.0/gwt-log-3.1.0.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/ca/nanometrics/gflot/1.0.0/gflot-1.0.0.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/com/jcraft/jsch/0.1.29/jsch-0.1.29.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar"/>
commit c0477cba10be31a9236ca82855d2eba98c62bce8
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jan 13 14:44:49 2012 -0500
Add <soyc> element to help optimize gwt compiles. By default don't optimize.
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 4d0fced..bcd909f 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -59,6 +59,10 @@
up gwt compilation. -->
<gwt.draftCompile>false</gwt.draftCompile>
+ <!-- Change this to "false" via the mvn command line or your ~/.m2/settings.xml to speed
+ up gwt compilation and reduce memory consumption by avoiding report generation. -->
+ <gwt.soyc>true</gwt.soyc>
+
<!-- Comma-separated list of the locales that should be included during GWT compilation. The specified locales
should each have two corresponding message bundle properties files under
src/main/resources/org/rhq/enterprise/gui/coregui/client/. For example, the "ja" locale has
@@ -274,6 +278,7 @@
<extraJvmArgs>${gwt-plugin.extraJvmArgs}</extraJvmArgs>
<localWorkers>${gwt-plugin.localWorkers}</localWorkers>
<draftCompile>${gwt.draftCompile}</draftCompile>
+ <soyc>${gwt.soyc}</soyc>
<buildOutputDirectory>target/gwtclasses</buildOutputDirectory>
<hostedWebapp>target/hostedWar</hostedWebapp>
<debugSuspend>false</debugSuspend>
12 years, 5 months
[rhq] Changes to 'hotfix/jon300'
by Larry O'Leary
New branch 'hotfix/jon300' available with the following commits:
commit 27ad28e1ec30b0da7be156ee3474f32ea9ca8046
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu Jan 5 13:58:08 2012 +0100
[BZ 746113] - increasing the maximum wait time for the tomcat start/stop
scripts from 1s to 120s.
commit 7654b4d272e731a366272e8abe5dea96e3bad2ba
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jan 6 09:15:14 2012 -0500
[Bug 771201 - EPP 5.2 discovery fails with java.lang.StringIndexOutOfBoundsException]
EPP 5.2 has changed the format of its Implementation-Version string in the
manifest (5.1.1 was different). Add support for the new format. Also,
in general, fail more gracefully when encountering an unexpected version
string.
commit 7b96b7e92039844b49fc2cd3bfcc49ee4722c07c
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Fri Jan 6 16:18:07 2012 -0600
[BZ 765795] Removed the recursive call that was creating StackOverflowError and added the correct call to create a resource.
12 years, 5 months