modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
| 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
| 58 +++++++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java
| 32 +++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java
| 2
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
| 6 +
5 files changed, 95 insertions(+), 8 deletions(-)
New commits:
commit fa3e4ecacf731ef96e116c6905c8ee1522ca4c6b
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Dec 20 17:24:09 2010 -0500
we can now delete bundle destinations and deployments.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index c7cc475..46b4e41 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -325,11 +325,12 @@ public class LinkManager {
}
public static String getBundleVersionLink(int bundleId, int bundleVersionId) {
- return "#Bundles/Bundle/" + bundleId + "/versions/" +
bundleVersionId;
+ return "#Bundles/Bundle/" + bundleId + "/versions" +
(bundleVersionId == 0 ? "" : ("/" + bundleVersionId));
}
public static String getBundleDestinationLink(int bundleId, int bundleDestinationId)
{
- return "#Bundles/Bundle/" + bundleId + "/destinations/" +
bundleDestinationId;
+ return "#Bundles/Bundle/" + bundleId + "/destinations"
+ + (bundleDestinationId == 0 ? "" : ("/" +
bundleDestinationId));
}
public static String getBundleDeploymentLink(int bundleId, int bundleDeploymentId) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
index 393e4a6..94b216a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
@@ -32,9 +32,12 @@ import com.smartgwt.client.types.AnimationEffect;
import com.smartgwt.client.types.AutoFitWidthApproach;
import com.smartgwt.client.types.DateDisplayFormat;
import com.smartgwt.client.types.ListGridFieldType;
-import com.smartgwt.client.types.VerticalAlignment;
+import com.smartgwt.client.util.BooleanCallback;
+import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.IButton;
+import com.smartgwt.client.widgets.form.fields.CanvasItem;
import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
@@ -76,6 +79,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
@@ -134,7 +138,7 @@ public class BundleDeploymentView extends LocatableVLayout implements
Bookmarkab
LocatableDynamicForm form = new
LocatableDynamicForm(extendLocatorId("Summary"));
form.setWidth100();
form.setAutoHeight();
- form.setNumCols(4);
+ form.setNumCols(5);
form.setWrapItemTitles(false);
form.setExtraSpace(10);
form.setIsGroup(true);
@@ -147,6 +151,12 @@ public class BundleDeploymentView extends LocatableVLayout implements
Bookmarkab
bundleName.setLinkTitle(bundle.getName());
bundleName.setTarget("_self");
+ CanvasItem actionItem = new CanvasItem("actions");
+ actionItem.setColSpan(1);
+ actionItem.setRowSpan(4);
+ actionItem.setShowTitle(false);
+
actionItem.setCanvas(getActionLayout(form.extendLocatorId("actions")));
+
LinkItem bundleVersionName = new LinkItem("bundleVersion");
bundleVersionName.setTitle(MSG.view_bundle_bundleVersion());
bundleVersionName.setValue(LinkManager.getBundleVersionLink(bundle.getId(),
deployment.getBundleVersion()
@@ -172,7 +182,6 @@ public class BundleDeploymentView extends LocatableVLayout implements
Bookmarkab
StaticTextItem description = new StaticTextItem("description",
MSG.common_title_description());
description.setValue(deployment.getDescription());
- description.setTitleVAlign(VerticalAlignment.TOP);
StaticTextItem status = new StaticTextItem("status",
MSG.common_title_status());
status.setValue(deployment.getStatus().name());
@@ -192,12 +201,51 @@ public class BundleDeploymentView extends LocatableVLayout
implements Bookmarkab
});
}
- form.setFields(bundleName, deployed, bundleVersionName, deployedBy, //
- destinationGroup, path, description, status);
+ form.setFields(bundleName, deployed, actionItem, bundleVersionName, deployedBy,
destinationGroup, path,
+ description, status);
return form;
}
+ private Canvas getActionLayout(String locatorId) {
+ LocatableVLayout actionLayout = new LocatableVLayout(locatorId, 10);
+ IButton deleteButton = new
LocatableIButton(actionLayout.extendLocatorId("Delete"),
MSG.common_button_delete());
+
deleteButton.setIcon("subsystems/bundle/BundleDeploymentAction_Delete_16.png");
+ deleteButton.addClickHandler(new
com.smartgwt.client.widgets.events.ClickHandler() {
+ @Override
+ public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
+ SC.ask(MSG.view_bundle_deploy_deleteConfirm(), new BooleanCallback() {
+ public void execute(Boolean aBoolean) {
+ if (aBoolean) {
+ bundleService.deleteBundleDeployment(deployment.getId(), new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(
+
MSG.view_bundle_deploy_deleteFailure(deployment.getName()), caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(
+ new
Message(MSG.view_bundle_deploy_deleteSuccessful(deployment.getName()),
+ Message.Severity.Info));
+ // Bundle deployment is deleted, go back to main
bundle destinations view
+
CoreGUI.goToView(LinkManager.getBundleDestinationLink(bundle.getId(), deployment
+ .getDestination().getId()));
+ }
+ });
+ }
+ }
+ });
+ }
+ });
+ actionLayout.addMember(deleteButton);
+
+ if (!canManageBundles) {
+ deleteButton.setDisabled(true);
+ }
+
+ return actionLayout;
+ }
+
private TagEditorView createTagEditor() {
boolean readOnly = !this.canManageBundles;
TagEditorView tagEditor = new
TagEditorView(extendLocatorId("tagEditor"), version.getTags(), readOnly,
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java
index ec1ca5e..91eaa34 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java
@@ -27,6 +27,8 @@ import java.util.HashSet;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.util.BooleanCallback;
+import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.events.ClickEvent;
@@ -192,9 +194,39 @@ public class BundleDestinationView extends LocatableVLayout
implements Bookmarka
});
actionLayout.addMember(revertButton);
+ IButton deleteButton = new
LocatableIButton(actionLayout.extendLocatorId("Delete"),
MSG.common_button_delete());
+
deleteButton.setIcon("subsystems/bundle/BundleDestinationAction_Delete_16.png");
+ deleteButton.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ SC.ask(MSG.view_bundle_dest_deleteConfirm(), new BooleanCallback() {
+ public void execute(Boolean aBoolean) {
+ if (aBoolean) {
+ bundleService.deleteBundleDestination(destination.getId(),
new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(
+
MSG.view_bundle_dest_deleteFailure(destination.getName()), caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(
+ new
Message(MSG.view_bundle_dest_deleteSuccessful(destination.getName()),
+ Message.Severity.Info));
+ // Bundle destination is deleted, go back to main
bundle view
+
CoreGUI.goToView(LinkManager.getBundleDestinationLink(bundle.getId(), 0));
+ }
+ });
+ }
+ }
+ });
+ }
+ });
+ actionLayout.addMember(deleteButton);
+
if (!canManageBundles) {
deployButton.setDisabled(true);
revertButton.setDisabled(true);
+ deleteButton.setDisabled(true);
}
return actionLayout;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java
index cf4ab17..44f950c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java
@@ -174,7 +174,7 @@ public class BundleVersionView extends LocatableVLayout implements
BookmarkableV
new
Message(MSG.view_bundle_version_deleteSuccessful(version.getVersion()),
Message.Severity.Info));
// Bundle version is deleted, go back to main bundle
view
-
CoreGUI.goToView(LinkManager.getBundleLink(version.getBundle().getId()));
+
CoreGUI.goToView(LinkManager.getBundleVersionLink(version.getBundle().getId(), 0));
}
});
}
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index 4e12244..a34c71c 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -961,6 +961,9 @@ view_bundle_dest_loadFailureVersionInfo = Failed to load bundle
destination depl
view_bundle_dest_backToBundle = Back to Bundle
view_bundle_dest_tagUpdateFailure = Failed to update bundle destination tags
view_bundle_dest_tagUpdateSuccessful = You have successfully updated the bundle
destination tags
+view_bundle_dest_deleteConfirm = Are you sure you want to delete this bundle
destination?
+view_bundle_dest_deleteFailure = Failed to delete the bundle destination [{0}]
+view_bundle_dest_deleteSuccessful = You successfully deleted the bundle destination
[{0}]
view_bundle_resDeployDS_loadFailure = Failed to load bundle resource deployments
view_bundle_deploy_name = Deployment Name
view_bundle_deploy_time = Deployment Time
@@ -977,6 +980,9 @@ view_bundle_deploy_loadFailure = Failed to load bundle deployment
view_bundle_deploy_loadBundleFailure = Failed to find bundle
view_bundle_deploy_deployedBy = Deployed By
view_bundle_deploy_clickForError = Click the icon for the error message
+view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle
deployment?
+view_bundle_deploy_deleteFailure = Failed to delete the bundle deployment [{0}]
+view_bundle_deploy_deleteSuccessful = You successfully deleted the bundle deployment
[{0}]
view_bundle_createWizard_title = Create Bundle
view_bundle_createWizard_windowTitle = Bundle Creation Wizard
view_bundle_createWizard_cancelSuccessful = Canceled the creation of bundle [{0}],
version = [{1}]