modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/AbstractRecordEditor.java
| 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDataSource.java
| 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
| 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/ExecutionSchedule.java
| 311 -------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationCreateWizard.java
| 157 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationParametersStep.java
| 78 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationSchedulingStep.java
| 430 ----------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
| 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
| 6
9 files changed, 40 insertions(+), 998 deletions(-)
New commits:
commit 899277fc716afccc33bf413acaf0c513e20f6ad6
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Feb 25 13:51:46 2011 -0500
switch operations context menu on resource tree to link to operations>schedule
subtab, rather than opening a wizard; delete the schedule-operation wizard classes, which
are no longer used
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/AbstractRecordEditor.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/AbstractRecordEditor.java
index b2a45b7..e4f061b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/AbstractRecordEditor.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/AbstractRecordEditor.java
@@ -105,12 +105,7 @@ public abstract class AbstractRecordEditor<DS extends
RPCDataSource> extends Loc
viewPath.next();
String parentViewPath = viewPath.getParentViewPath();
- if (!viewPath.isEnd()) {
-
CoreGUI.getErrorHandler().handleError(MSG.widget_recordEditor_error_invalidViewPath(viewPath.toString()));
- CoreGUI.goToView(parentViewPath);
- } else {
- this.listViewPath = parentViewPath; // e.g. Administration/Security/Roles
- }
+ this.listViewPath = parentViewPath; // e.g. Administration/Security/Roles
}
/**
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDataSource.java
index e808b76..2e18af7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDataSource.java
@@ -99,18 +99,17 @@ public abstract class AbstractOperationScheduleDataSource<T extends
OperationSch
DataSourceTextField operationNameField = createTextField(Field.OPERATION_NAME,
"Operation", null, 100,
true);
- fields.add(operationNameField);
-
- DataSourceTextField operationDisplayNameField =
createTextField(Field.OPERATION_DISPLAY_NAME, "Operation", null,
- 100, true);
- fields.add(operationDisplayNameField);
-
Set<OperationDefinition> operationDefinitions =
this.resourceType.getOperationDefinitions();
LinkedHashMap<String, String> valueMap = new LinkedHashMap<String,
String>();
for (OperationDefinition operationDefinition : operationDefinitions) {
valueMap.put(operationDefinition.getName(),
operationDefinition.getDisplayName());
}
- operationNameField.setValueMap(valueMap);
+ operationNameField.setValueMap(valueMap);
+ fields.add(operationNameField);
+
+ DataSourceTextField operationDisplayNameField =
createTextField(Field.OPERATION_DISPLAY_NAME, "Operation", null,
+ 100, true);
+ fields.add(operationDisplayNameField);
DataSourceField subjectField = new DataSourceField(Field.SUBJECT, FieldType.ANY,
"Owner");
subjectField.setCanEdit(false);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
index 807d6a9..0600e5a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
@@ -74,6 +74,7 @@ public abstract class AbstractOperationScheduleDetailsView extends
AbstractRecor
protected static final int FIRST_COLUMN_WIDTH = 140;
+ private Map<Integer, String> operationIdToNameMap = new HashMap<Integer,
String>();
private Map<String, String> operationNameToDescriptionMap = new
HashMap<String, String>();
private Map<String, ConfigurationDefinition>
operationNameToParametersDefinitionMap =
new HashMap<String, ConfigurationDefinition>();
@@ -83,6 +84,7 @@ public abstract class AbstractOperationScheduleDetailsView extends
AbstractRecor
private JobTriggerEditor triggerEditor;
private Configuration parameters;
private EnhancedDynamicForm notesForm;
+ private Integer operationDefinitionId;
public AbstractOperationScheduleDetailsView(String locatorId,
AbstractOperationScheduleDataSource dataSource,
ResourceType resourceType, int
scheduleId) {
@@ -90,6 +92,7 @@ public abstract class AbstractOperationScheduleDetailsView extends
AbstractRecor
Set<OperationDefinition> operationDefinitions =
resourceType.getOperationDefinitions();
for (OperationDefinition operationDefinition : operationDefinitions) {
+ this.operationIdToNameMap.put(operationDefinition.getId(),
operationDefinition.getName());
this.operationNameToDescriptionMap.put(operationDefinition.getName(),
operationDefinition.getDescription());
this.operationNameToParametersDefinitionMap.put(operationDefinition.getName(),
operationDefinition.getParametersConfigurationDefinition());
@@ -102,6 +105,11 @@ public abstract class AbstractOperationScheduleDetailsView extends
AbstractRecor
public void renderView(ViewPath viewPath) {
super.renderView(viewPath);
+ if (!viewPath.isEnd()) {
+ this.operationDefinitionId = viewPath.getCurrentAsInt();
+ viewPath.next();
+ }
+
// Existing schedules are not editable. This may change in the future.
boolean isReadOnly = (!hasControlPermission() || (getRecordId() != 0));
init(isReadOnly);
@@ -205,10 +213,17 @@ public abstract class AbstractOperationScheduleDetailsView extends
AbstractRecor
@Override
protected Record createNewRecord() {
Record record = super.createNewRecord();
+
+ if (this.operationDefinitionId != null) {
+ String operationName =
this.operationIdToNameMap.get(this.operationDefinitionId);
+ record.setAttribute(AbstractOperationScheduleDataSource.Field.OPERATION_NAME,
operationName);
+ }
+
Subject sessionSubject = UserSessionManager.getSessionSubject();
AbstractOperationScheduleDataSource.SubjectRecord subjectRecord =
new AbstractOperationScheduleDataSource.SubjectRecord(sessionSubject);
record.setAttribute(ResourceOperationScheduleDataSource.Field.SUBJECT,
subjectRecord);
+
return record;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/ExecutionSchedule.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/ExecutionSchedule.java
deleted file mode 100644
index 26d53a8..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/ExecutionSchedule.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.schedule;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.HashSet;
-
-import com.google.gwt.i18n.client.DateTimeFormat;
-
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.Messages;
-
-/**
- * @author Greg Hinkle
- */
-public class ExecutionSchedule implements Serializable {
-
- private static final Messages MSG = CoreGUI.getMessages();
-
- public enum Start {
- Immediately, Future
- };
-
- public enum End {
- Never, EndOn
- };
-
- public enum Recurr {
- Once, EveryNMinutes, Hourly, Daily, Weekly, Monthly
- };
-
- public enum DayOfWeek {
- Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
- };
-
- private Start start = Start.Immediately;
-
- // start.Future
- private Recurr recurr = Recurr.Once;
-
- // Once
- private Date onceDateTime;
-
-
- // EveryNMinutes
- private Integer minuteInterval;
-
-
- // Hourly
- private Integer minuteInHour;
-
-
- // Daily
- private Date timeOfDay;
-
-
- // Weekly
- // Time of Day above
- private HashSet<DayOfWeek> daysOfWeek; // Can't use EnumSet because it
doesn't have default instantiator
-
-
- // Monthly
- // Time of Day above
- private Integer dayOfMonth;
-
-
- // Used for all start.Future except for once
- private Date startDate;
-
- private Date endDate;
-
-
- public Start getStart() {
- return start;
- }
-
- public void setStart(Start start) {
- this.start = start;
- }
-
- public Recurr getRecurr() {
- return recurr;
- }
-
- public void setRecurr(Recurr recurr) {
- this.recurr = recurr;
- }
-
- public Date getOnceDateTime() {
- return onceDateTime;
- }
-
- public void setOnceDateTime(Date onceDateTime) {
- this.onceDateTime = onceDateTime;
- }
-
- public Integer getMinuteInterval() {
- return minuteInterval;
- }
-
- public void setMinuteInterval(Integer minuteInterval) {
- this.minuteInterval = minuteInterval;
- }
-
- public Integer getMinuteInHour() {
- return minuteInHour;
- }
-
- public void setMinuteInHour(Integer minuteInHour) {
- this.minuteInHour = minuteInHour;
- }
-
- public HashSet<DayOfWeek> getDaysOfWeek() {
- return daysOfWeek;
- }
-
- public void setDaysOfWeek(HashSet<DayOfWeek> daysOfWeek) {
- this.daysOfWeek = daysOfWeek;
- }
-
- public Integer getDayOfMonth() {
- return dayOfMonth;
- }
-
- public void setDayOfMonth(Integer dayOfMonth) {
- this.dayOfMonth = dayOfMonth;
- }
-
- public Date getStartDate() {
- return startDate;
- }
-
- public void setStartDate(Date startDate) {
- this.startDate = startDate;
- }
-
- public Date getEndDate() {
- return endDate;
- }
-
- public void setEndDate(Date endDate) {
- this.endDate = endDate;
- }
-
- public Date getTimeOfDay() {
- return timeOfDay;
- }
-
- public void setTimeOfDay(Date timeOfDay) {
- this.timeOfDay = timeOfDay;
- }
-
- public String getMessage() {
- DateTimeFormat dateFormat = DateTimeFormat.getMediumDateFormat();
- DateTimeFormat timeFormat = DateTimeFormat.getMediumTimeFormat();
-
- String message;
- switch (start) {
-
- case Immediately:
- message =
MSG.view_operationCreateWizard_executionSchedule_willExecuteOnce(
- MSG.view_operationCreateWizard_executionSchedule_immediately());
- break;
-
- case Future:
- if (recurr == Recurr.Once) {
- message =
MSG.view_operationCreateWizard_executionSchedule_willExecuteOnce(
-
MSG.view_operationCreateWizard_executionSchedule_onceAtGivenTime(onceDateTime.toString()));
- } else {
- String recurrenceMessage;
- switch (recurr) {
- case EveryNMinutes:
- recurrenceMessage =
MSG.view_operationCreateWizard_executionSchedule_everyNMinutes(minuteInterval.toString());
- break;
- case Hourly:
- recurrenceMessage =
MSG.view_operationCreateWizard_executionSchedule_everyHourOnNthMinute(suffix(minuteInHour));
- break;
- case Daily:
- recurrenceMessage =
MSG.view_operationCreateWizard_executionSchedule_everyDayAtGivenTime(timeFormat.format(timeOfDay));
- break;
- case Weekly:
- recurrenceMessage =
MSG.view_operationCreateWizard_executionSchedule_everyWeekOnGivenDayAtGivenTime(daysOfWeek.toString(),
timeFormat.format(timeOfDay));
- break;
- case Monthly:
- recurrenceMessage =
MSG.view_operationCreateWizard_executionSchedule_everyMonthOnNthDayAtGivenTime(suffix(dayOfMonth),
timeFormat.format(timeOfDay));
- break;
- default:
- recurrenceMessage = "";
- }
-
- if (endDate != null) {
- message =
MSG.view_operationCreateWizard_executionSchedule_willExecuteRecurringWithEnd(
- recurrenceMessage, dateFormat.format(startDate),
dateFormat.format(endDate));
- } else {
- message =
MSG.view_operationCreateWizard_executionSchedule_willExecuteRecurring(
- recurrenceMessage, dateFormat.format(startDate));
- }
- }
- break;
-
- default:
- message = "";
-
- }
-
- return message;
- }
-
-
- public String getCronString() {
-
- /* Cron fields
- 1. Seconds
- 2. Minutes
- 3. Hours
- 4. Day-of-Month
- 5. Month
- 6. Day-of-Week
- 7. Year (optional field)
- */
-
- String cseconds, cminutes = null, chours = null, cdayOfMonth = null, cmonth =
null, cdayOfWeek = null;
-
- cseconds = "0";
-
- switch (start) {
-
- case Immediately:
- return null; // No cron string for immediate execution
-
- case Future:
-
- if (recurr == Recurr.Once) {
- return null; // No cron string for non recurring
- } else {
- switch (recurr) {
- case EveryNMinutes:
- cminutes = "0/" + minuteInterval;
- chours = cdayOfMonth = cmonth = "*";
- cdayOfWeek = "?";
- break;
- case Hourly:
- cminutes = "" + minuteInHour;
- chours = "*";
- cdayOfMonth = cmonth = cdayOfWeek = "*";
- break;
- case Daily:
- cminutes = "" + timeOfDay.getMinutes();
- chours = "" + timeOfDay.getHours();
- cdayOfMonth = cmonth = cdayOfWeek = "*";
- break;
- case Weekly:
- cminutes = "" + timeOfDay.getMinutes();
- chours = "" + timeOfDay.getHours();
- cdayOfMonth = "?";
- cmonth = "*";
- cdayOfWeek = daysOfWeek.toString();
- break;
- case Monthly:
- cminutes = "" + timeOfDay.getMinutes();
- chours = "" + timeOfDay.getHours();
- cdayOfMonth = "" + dayOfMonth;
- cmonth = "*";
- cdayOfWeek = "?";
- break;
- }
- }
- break;
- }
- return cseconds + " " + cminutes + " " + chours + "
" + cdayOfMonth + " " + cmonth + " " + cdayOfWeek;
-
- }
-
- public static String suffix(int number) {
- String result;
- String numberAsString = String.valueOf(number);
- int last = number % 10;
- switch (last) {
- case 1:
- result = MSG.common_val_n1st(numberAsString);
- break;
- case 2:
- result = MSG.common_val_n2nd(numberAsString);
- break;
- case 3:
- result = MSG.common_val_n3rd(numberAsString);
- break;
- default:
- result = MSG.common_val_nth(numberAsString);
- }
- return result;
- }
-
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationCreateWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationCreateWizard.java
deleted file mode 100644
index fc3c6f2..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationCreateWizard.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.schedule;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.widgets.IButton;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.operation.OperationDefinition;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-
-/**
- * @author Greg Hinkle
- */
-public class OperationCreateWizard extends AbstractWizard {
-
- private Resource resource;
- private OperationDefinition operationDefinition;
-
- private OperationParametersStep parametersStep;
- private OperationSchedulingStep schedulingStep;
-
- private WizardView view;
-
- private IButton executeNowButton;
- private IButton executeButton;
-
- public OperationCreateWizard(Resource resource, OperationDefinition
operationDefinition) {
- this.resource = resource;
- this.operationDefinition = operationDefinition;
- }
-
- public void startOperationWizard() {
-
- parametersStep = new OperationParametersStep(operationDefinition);
- schedulingStep = new OperationSchedulingStep();
-
- ArrayList<WizardStep> steps = new ArrayList<WizardStep>();
- steps.add(parametersStep);
- steps.add(schedulingStep);
- setSteps(steps);
-
- executeNowButton = new
IButton(MSG.view_operationCreateWizard_button_executeImmediately());
- executeNowButton.setAutoFit(true);
- executeNowButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- execute();
- }
- });
-
- executeButton = new IButton(MSG.view_operationCreateWizard_button_execute());
- executeButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- execute();
- }
- });
-
- view = new WizardView(this);
- view.displayDialog();
- }
-
- public String getWindowTitle() {
- return MSG.view_operationCreateWizard_title();
- }
-
- public String getTitle() {
- return
MSG.view_operationCreateWizard_header(operationDefinition.getDisplayName(),
resource.getName());
- }
-
- public String getSubtitle() {
- return operationDefinition.getDescription();
- }
-
- public List<IButton> getCustomButtons(int step) {
- switch (step) {
- case 0:
- return Arrays.asList(executeNowButton);
- case 1:
- return Arrays.asList(executeButton);
- default:
- return Collections.emptyList();
- }
- }
-
- private void execute() {
- Configuration parameters = parametersStep.getParameterConfiguration();
- final ExecutionSchedule schedule = schedulingStep.getExecutionSchedule();
-
- // TODO: get the description and timeout from user input
- String description = "";
- int timeout = 0;
-
- AsyncCallback<Void> operationCallback = new AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_operationCreateWizard_error_scheduleOperationFailure(),
- caught);
- }
-
- public void onSuccess(Void result) {
- String opName = operationDefinition.getDisplayName();
- String cron = schedule.getCronString();
- if (cron == null) {
- cron = MSG.common_val_na();
- }
- String concise =
MSG.view_operationCreateWizard_message_scheduleOperationSuccess_short(opName);
- String message =
MSG.view_operationCreateWizard_message_scheduleOperationSuccess(opName, String
- .valueOf(resource.getId()), cron);
-
- CoreGUI.getMessageCenter().notify(new Message(concise, message,
Message.Severity.Info));
- }
- };
-
- if (schedule.getStart() == ExecutionSchedule.Start.Immediately) {
-
GWTServiceLookup.getOperationService().invokeResourceOperation(resource.getId(),
- operationDefinition.getName(), parameters, description, timeout,
operationCallback);
- } else {
-
GWTServiceLookup.getOperationService().scheduleResourceOperation(resource.getId(),
- operationDefinition.getName(), parameters, description, timeout,
schedule.getCronString(),
- operationCallback);
- }
-
- view.closeDialog();
- }
-
- public void cancel() {
- // TODO: revert back to original state
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationParametersStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationParametersStep.java
deleted file mode 100644
index 8ce2ada..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationParametersStep.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.schedule;
-
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
-import org.rhq.core.domain.operation.OperationDefinition;
-import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.Locatable;
-
-/**
- * @author Greg Hinkle
- */
-public class OperationParametersStep extends AbstractWizardStep {
-
- private OperationDefinition definition;
-
- private ConfigurationEditor configurationEditor;
-
- public OperationParametersStep(OperationDefinition operationDefinition) {
- super();
- this.definition = operationDefinition;
- }
-
- public Canvas getCanvas(Locatable parent) {
- if (definition.getParametersConfigurationDefinition() != null) {
- if (configurationEditor == null) {
- ConfigurationDefinition configurationDefinition =
definition.getParametersConfigurationDefinition();
- Configuration defaultConfiguration =
configurationDefinition.getDefaultTemplate() != null ? configurationDefinition
- .getDefaultTemplate().createConfiguration()
- : new Configuration();
- if (parent != null) {
- configurationEditor = new
ConfigurationEditor(parent.extendLocatorId("OperationParams"),
- configurationDefinition, defaultConfiguration);
- } else {
- configurationEditor = new
ConfigurationEditor("OperationParams", configurationDefinition,
- defaultConfiguration);
- }
- }
- return configurationEditor;
- } else {
- return new
HTMLFlow(MSG.view_operationCreateWizard_parametersStep_noParameters());
- }
- }
-
- public boolean nextPage() {
- return true; // TODO: Implement this method.
- }
-
- public String getName() {
- return MSG.view_operationCreateWizard_parametersStep_name();
- }
-
- public Configuration getParameterConfiguration() {
- return configurationEditor != null ? configurationEditor.getConfiguration() :
null;
- }
-
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationSchedulingStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationSchedulingStep.java
deleted file mode 100644
index 1db4791..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/OperationSchedulingStep.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.schedule;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import com.smartgwt.client.types.FormErrorOrientation;
-import com.smartgwt.client.types.TimeFormatter;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.FormItemIfFunction;
-import com.smartgwt.client.widgets.form.ValuesManager;
-import com.smartgwt.client.widgets.form.events.ItemChangedEvent;
-import com.smartgwt.client.widgets.form.events.ItemChangedHandler;
-import com.smartgwt.client.widgets.form.fields.CanvasItem;
-import com.smartgwt.client.widgets.form.fields.CheckboxItem;
-import com.smartgwt.client.widgets.form.fields.DateItem;
-import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.HeaderItem;
-import com.smartgwt.client.widgets.form.fields.IntegerItem;
-import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
-import com.smartgwt.client.widgets.form.fields.SpacerItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.form.fields.TimeItem;
-import com.smartgwt.client.widgets.form.validator.CustomValidator;
-
-import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.Locatable;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
-
-/**
- * @author Greg Hinkle
- */
-public class OperationSchedulingStep extends AbstractWizardStep implements
ItemChangedHandler {
-
- private DynamicForm form;
- private ValuesManager valuesManager;
-
- private ExecutionSchedule executionSchedule = new ExecutionSchedule();
-
- public Canvas getCanvas(Locatable parent) {
-
- if (form == null) {
- valuesManager = new ValuesManager();
- if (parent != null) {
- form = new
LocatableDynamicForm(parent.extendLocatorId("OperationScheduling"));
- } else {
- form = new LocatableDynamicForm("OperationScheduling");
- }
- form.setValuesManager(valuesManager);
- form.setWrapItemTitles(false);
- form.setErrorOrientation(FormErrorOrientation.RIGHT);
- form.setWidth100();
- form.setPadding(10);
- form.setNumCols(3);
- // form.setColWidths("15%", "35%",
"15%", "*");
- form.setValidateOnChange(true);
-
- final RadioGroupItem start = new RadioGroupItem("start", MSG
- .view_operationCreateWizard_schedulingStep_name());
- start.setColSpan(3);
- start.setValueMap(enumValueMap(ExecutionSchedule.Start.class)); //
"Immediately", "Future"
- start.setRedrawOnChange(true);
- start.setValue("Immediately");
-
- HeaderItem scheduleHeader = new HeaderItem("scheduleHeader");
-
scheduleHeader.setValue(MSG.view_operationCreateWizard_schedulingStep_label_schedule());
- scheduleHeader.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!"Immediately".equals(form.getValueAsString("start"));
- }
- });
-
- RadioGroupItem recurr = new RadioGroupItem("recurr", MSG
- .view_operationCreateWizard_schedulingStep_label_recurrence());
- recurr.setValueMap(enumValueMap(ExecutionSchedule.Recurr.class)); //
"Once", "EveryNMinutes", "Hourly", "Daily",
"Weekly", "Monthly");
- recurr.setRedrawOnChange(true);
- recurr.setValue(ExecutionSchedule.Recurr.Once.name());
- recurr.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"));
- }
- });
-
- CanvasItem onceForm = new CanvasItem("once",
MSG.view_operationCreateWizard_schedulingStep_label_onceAt());
- onceForm.setShowTitle(false);
- onceForm.setCanvas(getOnceForm());
- onceForm.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"))
- &&
ExecutionSchedule.Recurr.Once.name().equals(form.getValueAsString("recurr"));
- }
- });
-
- CanvasItem everyNMinuteForm = new CanvasItem("everyNMinutesForm",
MSG
- .view_operationCreateWizard_schedulingStep_label_everyNMinutes());
- everyNMinuteForm.setShowTitle(false);
- everyNMinuteForm.setCanvas(getEveryNMinutesForm());
- everyNMinuteForm.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"))
- &&
ExecutionSchedule.Recurr.EveryNMinutes.name().equals(form.getValueAsString("recurr"));
- }
- });
-
- CanvasItem hourlyForm = new CanvasItem("hourlyForm", MSG
- .view_operationCreateWizard_schedulingStep_label_hourly());
- hourlyForm.setShowTitle(false);
- hourlyForm.setCanvas(getHourlyForm());
- hourlyForm.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!"Immediately".equals(form.getValueAsString("start"))
- &&
ExecutionSchedule.Recurr.Hourly.name().equals(form.getValueAsString("recurr"));
- }
- });
-
- CanvasItem dailyForm = new CanvasItem("daily",
MSG.view_operationCreateWizard_schedulingStep_label_daily());
- dailyForm.setShowTitle(false);
- dailyForm.setCanvas(getDailyForm());
- dailyForm.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"))
- &&
ExecutionSchedule.Recurr.Daily.name().equals(form.getValueAsString("recurr"));
- }
- });
-
- CanvasItem weeklyForm = new CanvasItem("weekly", MSG
- .view_operationCreateWizard_schedulingStep_label_weekly());
- weeklyForm.setShowTitle(false);
- weeklyForm.setCanvas(getWeeklyForm());
- weeklyForm.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"))
- &&
ExecutionSchedule.Recurr.Weekly.name().equals(form.getValueAsString("recurr"));
- }
- });
-
- CanvasItem monthlyForm = new CanvasItem("monthly", MSG
- .view_operationCreateWizard_schedulingStep_label_monthly());
- monthlyForm.setShowTitle(false);
- monthlyForm.setCanvas(getMonthlyForm());
- monthlyForm.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"))
- &&
ExecutionSchedule.Recurr.Monthly.name().equals(form.getValueAsString("recurr"));
- }
- });
-
- HeaderItem rangeHeader = new HeaderItem("timePeriod");
-
rangeHeader.setValue(MSG.view_operationCreateWizard_schedulingStep_label_timePeriod());
- rangeHeader.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"))
- &&
!ExecutionSchedule.Recurr.Once.name().equals(form.getValueAsString("recurr"));
- }
- });
-
- DateItem startDate = new DateItem("startDate", MSG
- .view_operationCreateWizard_schedulingStep_label_startDate());
- startDate.setStartRow(true);
- startDate.setStartDate(new Date());
- startDate.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"))
- &&
!"Once".equals(form.getValueAsString("recurr"));
- }
- });
-
- final RadioGroupItem end = new RadioGroupItem("endType", MSG
- .view_operationCreateWizard_schedulingStep_label_endDate());
- end.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"))
- &&
!"Once".equals(form.getValueAsString("recurr"));
- }
- });
- end.setStartRow(true);
- // TODO: i18n
- end.setValueMap("Never", "End On");
- end.setRedrawOnChange(true);
- end.setValue("Never");
-
- DateItem endDate = new DateItem("endDate",
MSG.view_operationCreateWizard_schedulingStep_label_endDate());
- endDate.setStartRow(true);
- endDate.setStartDate(new Date());
- endDate.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- return
!ExecutionSchedule.Start.Immediately.name().equals(form.getValueAsString("start"))
- &&
!"Once".equals(form.getValueAsString("recurr"))
- &&
!"Never".equals(form.getValueAsString("endType"));
- }
- });
- endDate.setValidators(new CustomValidator() {
- @Override
- protected boolean condition(Object o) {
- return (((Date) form.getValue("startDate")).before((Date)
o));
- }
- });
-
- StaticTextItem messageItem = new StaticTextItem("message");
-
messageItem.setValue(MSG.view_operationCreateWizard_schedulingStep_label_willExecuteImmediately());
- messageItem.setStartRow(true);
- messageItem.setColSpan(3);
- messageItem.setShowTitle(false);
- messageItem.setCellStyle("HeaderLabel");
-
- form.setItems(start, scheduleHeader, recurr, onceForm, everyNMinuteForm,
hourlyForm, dailyForm, weeklyForm,
- monthlyForm, rangeHeader, startDate, end, endDate, new SpacerItem(),
messageItem);
-
- form.addItemChangedHandler(this);
- }
-
- return form;
- }
-
- private DynamicForm getOnceForm() {
- DynamicForm form = new DynamicForm();
- form.setValuesManager(valuesManager);
- form.setPadding(10);
- form.setIsGroup(true);
-
form.setGroupTitle(MSG.view_operationCreateWizard_schedulingStep_label_onceAt());
- form.addItemChangedHandler(this);
-
- form.setWrapItemTitles(false);
- form.setNumCols(2);
-
- DateItem startDate = new DateItem("onceStartDate", MSG
- .view_operationCreateWizard_schedulingStep_label_startDate());
- startDate.setValue(new Date());
-
- TimeItem startTime = new TimeItem("onceStartDate", MSG
- .view_operationCreateWizard_schedulingStep_label_startDate());
- startTime.setValue(new Date());
- startTime.setDisplayFormat(TimeFormatter.TOSHORTPADDEDTIME);
- startTime.setUseMask(true);
- form.setItems(startDate, startTime);
- return form;
- }
-
- private DynamicForm getEveryNMinutesForm() {
- DynamicForm form = new DynamicForm();
- form.setValuesManager(valuesManager);
- form.setPadding(10);
- form.setIsGroup(true);
-
form.setGroupTitle(MSG.view_operationCreateWizard_schedulingStep_label_everyNMinutes());
- form.addItemChangedHandler(this);
-
- form.setWrapItemTitles(false);
- form.setNumCols(2);
-
- IntegerItem everyNMinutes = new IntegerItem();
- everyNMinutes.setName("minuteInterval");
-
everyNMinutes.setTitle(MSG.view_operationCreateWizard_schedulingStep_label_minuteInterval());
- everyNMinutes.setValue(60);
-
- form.setItems(everyNMinutes);
- return form;
- }
-
- private DynamicForm getHourlyForm() {
- DynamicForm form = new DynamicForm();
- form.setValuesManager(valuesManager);
- form.setPadding(10);
- form.setIsGroup(true);
-
form.setGroupTitle(MSG.view_operationCreateWizard_schedulingStep_label_hourly());
- form.addItemChangedHandler(this);
-
- form.setWrapItemTitles(false);
- form.setNumCols(2);
-
- IntegerItem minuteOfHour = new IntegerItem();
- minuteOfHour.setName("minuteOfHour");
-
minuteOfHour.setTitle(MSG.view_operationCreateWizard_schedulingStep_label_minuteOfHour());
- minuteOfHour.setValue(5);
-
- form.setItems(minuteOfHour);
- return form;
- }
-
- private DynamicForm getDailyForm() {
- DynamicForm form = new DynamicForm();
- form.setValuesManager(valuesManager);
- form.setPadding(10);
- form.setWrapItemTitles(false);
- form.setIsGroup(true);
- form.setGroupTitle(MSG.view_operationCreateWizard_schedulingStep_label_daily());
- form.addItemChangedHandler(this);
-
- TimeItem timeOfDay = new TimeItem("timeOfDay",
MSG.view_operationCreateWizard_schedulingStep_label_timeOfDay());
- timeOfDay.setValue(new Date());
- timeOfDay.setDisplayFormat(TimeFormatter.TOSHORTPADDEDTIME);
- timeOfDay.setUseMask(true);
-
- form.setItems(timeOfDay);
- return form;
- }
-
- private DynamicForm getWeeklyForm() {
- DynamicForm form = new DynamicForm();
- form.setValuesManager(valuesManager);
- form.setPadding(10);
- form.setIsGroup(true);
-
form.setGroupTitle(MSG.view_operationCreateWizard_schedulingStep_label_weekly());
- form.addItemChangedHandler(this);
-
- form.setWrapItemTitles(false);
-
- TimeItem timeOfDay = new TimeItem("dayOfWeek",
MSG.view_operationCreateWizard_schedulingStep_label_dayOfWeek());
- timeOfDay.setValue(new Date());
- timeOfDay.setDisplayFormat(TimeFormatter.TOSHORTPADDEDTIME);
- timeOfDay.setUseMask(true);
-
- ExecutionSchedule.DayOfWeek[] daysOfWeek = ExecutionSchedule.DayOfWeek.values();
- List<String> dayList = new ArrayList<String>();
- for (ExecutionSchedule.DayOfWeek dayOfWeek : daysOfWeek) {
- dayList.add(dayOfWeek.name());
- }
- FormItem[] items = new FormItem[8];
- items[0] = timeOfDay;
- int i = 1;
- for (String day : dayList) {
- CheckboxItem dayItem = new CheckboxItem(day);
- dayItem.setShowTitle(false);
- items[i++] = dayItem;
- }
- form.setItems(items);
- return form;
- }
-
- private DynamicForm getMonthlyForm() {
- DynamicForm form = new DynamicForm();
- form.setValuesManager(valuesManager);
- form.setPadding(10);
- form.setWrapItemTitles(false);
- form.setIsGroup(true);
-
form.setGroupTitle(MSG.view_operationCreateWizard_schedulingStep_label_monthly());
- form.addItemChangedHandler(this);
-
- IntegerItem dayItem = new IntegerItem();
- dayItem.setName("dayOfMonth");
-
dayItem.setTitle(MSG.view_operationCreateWizard_schedulingStep_label_dayOfMonth());
- dayItem.setValue(1);
-
- TimeItem timeOfDay = new TimeItem("timeOfDay",
MSG.view_operationCreateWizard_schedulingStep_label_timeOfDay());
- timeOfDay.setValue(new Date());
- timeOfDay.setDisplayFormat(TimeFormatter.TOSHORTPADDEDTIME);
- timeOfDay.setUseMask(true);
-
- form.setItems(dayItem, timeOfDay);
- return form;
- }
-
- public boolean nextPage() {
- return true; // TODO: Implement this method.
- }
-
- public String getName() {
- return MSG.view_operationCreateWizard_schedulingStep_name();
- }
-
- public void onItemChanged(ItemChangedEvent itemChangeEvent) {
-
-
executionSchedule.setStart(ExecutionSchedule.Start.valueOf(valuesManager.getValueAsString("start")));
-
executionSchedule.setRecurr(ExecutionSchedule.Recurr.valueOf(valuesManager.getValueAsString("recurr")));
-
- Date onceDate = (Date) valuesManager.getValues().get("onceStartDate");
- executionSchedule.setOnceDateTime(onceDate);
-
-
executionSchedule.setMinuteInterval(Integer.parseInt(valuesManager.getValueAsString("minuteInterval")));
-
-
executionSchedule.setMinuteInHour(Integer.parseInt(valuesManager.getValueAsString("minuteOfHour")));
-
- executionSchedule.setTimeOfDay((Date)
valuesManager.getValues().get("timeOfDay"));
-
- HashSet<ExecutionSchedule.DayOfWeek> selectedDays = new
HashSet<ExecutionSchedule.DayOfWeek>();
//.noneOf(ExecutionSchedule.DayOfWeek.class);
- for (ExecutionSchedule.DayOfWeek d :
EnumSet.allOf(ExecutionSchedule.DayOfWeek.class)) {
- if (valuesManager.getValues().containsKey(d.name())) {
- selectedDays.add(d);
- }
- }
- executionSchedule.setDaysOfWeek(selectedDays);
-
-
executionSchedule.setDayOfMonth(Integer.parseInt(valuesManager.getValueAsString("dayOfMonth")));
-
- executionSchedule.setStartDate((Date)
valuesManager.getValues().get("startDate"));
-
- if ("Never".equals(valuesManager.getValues().get("endType")))
{
- executionSchedule.setEndDate(null);
- } else {
- executionSchedule.setEndDate((Date)
valuesManager.getValues().get("endDate"));
- }
-
- form.setValue("message", executionSchedule.getMessage());
- }
-
- private LinkedHashMap<String, String> enumValueMap(Class<? extends Enum>
e) {
- LinkedHashMap<String, String> map = new LinkedHashMap<String,
String>();
- for (Object o : EnumSet.allOf(e)) {
- Enum v = (Enum) o;
- map.put(v.name(), v.name()); // localize
- }
- return map;
- }
-
- public ExecutionSchedule getExecutionSchedule() {
- return executionSchedule;
- }
-
-}
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 89a87fb..4af193b 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
@@ -80,6 +80,16 @@ public class ResourceDetailView extends
AbstractTwoLevelTabSetView<ResourceCompo
private static final String BASE_VIEW_PATH = "Resource";
+ public static class Tab {
+ public static final String OPERATIONS = "Operations";
+ // TODO: other tabs
+ }
+
+ public static class OperationsSubTab {
+ public static final String SCHEDULES = "Schedules";
+ public static final String HISTORY = "History";
+ }
+
private Integer resourceId;
private ResourceComposite resourceComposite;
@@ -189,13 +199,12 @@ public class ResourceDetailView extends
AbstractTwoLevelTabSetView<ResourceCompo
.view_tabs_common_history()), null);
eventsTab.registerSubTabs(eventHistory);
tabs.add(eventsTab);
-
- operationsTab = new
TwoLevelTab(getTabSet().extendLocatorId("Operations"), new
ViewName("Operations", MSG
+ operationsTab = new TwoLevelTab(getTabSet().extendLocatorId(Tab.OPERATIONS), new
ViewName(Tab.OPERATIONS, MSG
.view_tabs_common_operations()),
"/images/icons/Operation_grey_16.png");
- this.operationsSchedules = new
SubTab(operationsTab.extendLocatorId("Schedules"), new
ViewName("Schedules", MSG
- .view_tabs_common_schedules()), null);
- this.operationsHistory = new
SubTab(operationsTab.extendLocatorId("History"), new
ViewName("History", MSG
- .view_tabs_common_history()), null);
+ this.operationsSchedules = new
SubTab(operationsTab.extendLocatorId(OperationsSubTab.SCHEDULES),
+ new ViewName(OperationsSubTab.SCHEDULES,
MSG.view_tabs_common_schedules()), null);
+ this.operationsHistory = new
SubTab(operationsTab.extendLocatorId(OperationsSubTab.HISTORY),
+ new ViewName(OperationsSubTab.HISTORY, MSG.view_tabs_common_history()),
null);
operationsTab.registerSubTabs(this.operationsSchedules, this.operationsHistory);
tabs.add(operationsTab);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
index 98e5755..cf34caf 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
@@ -77,7 +77,6 @@ import
org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.inventory.InventoryView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.schedule.OperationCreateWizard;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupContextMenu;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupDetailView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeDatasource.AutoGroupTreeNode;
@@ -413,7 +412,7 @@ public class ResourceTreeView extends LocatableVLayout {
// Operations Menu
MenuItem operations = new
MenuItem(MSG.view_tree_common_contextMenu_operations());
- enabled = (resourcePermission.isControl() && null ==
resourceType.getOperationDefinitions() && !resourceType
+ enabled = (resourcePermission.isControl() &&
(resourceType.getOperationDefinitions() != null) && !resourceType
.getOperationDefinitions().isEmpty());
operations.setEnabled(enabled);
if (enabled) {
@@ -422,7 +421,8 @@ public class ResourceTreeView extends LocatableVLayout {
MenuItem operationItem = new
MenuItem(operationDefinition.getDisplayName());
operationItem.addClickHandler(new ClickHandler() {
public void onClick(MenuItemClickEvent event) {
- new OperationCreateWizard(resource,
operationDefinition).startOperationWizard();
+ CoreGUI.goToView(LinkManager.getResourceTabLink(resource.getId(),
ResourceDetailView.Tab.OPERATIONS,
+ ResourceDetailView.OperationsSubTab.SCHEDULES) +
"/0/" + operationDefinition.getId());
}
});
opSubMenu.addItem(operationItem);