return form;
}
private Canvas getActionLayout() {
EnhancedVLayout actionLayout = new EnhancedVLayout(10);
// we can only revert the live deployments, only show revert button when appropriate
// in addition, we provide a purge button if you are viewing the live deployment, so
// they can be shown an option to purge the platform content (since only the "live"
// deployment represents content on the remote machines, showing purge only for live
// deployments makes sense).
if (deployment.isLive()) {
IButton revertButton = new EnhancedIButton(MSG.view_bundle_revert(), ButtonColor.RED);
//revertButton.setIcon("subsystems/bundle/BundleAction_Revert_16.png");
revertButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
@Override
public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
new BundleRevertWizard(deployment.getDestination()).startWizard();
}
});
actionLayout.addMember(revertButton);
IButton purgeButton = new EnhancedIButton(MSG.view_bundle_purge(), ButtonColor.RED);
//purgeButton.setIcon("subsystems/bundle/BundleDestinationAction_Purge_16.png");
purgeButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
@Override
public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent) {
SC.ask(MSG.view_bundle_dest_purgeConfirm(), new BooleanCallback() {
@Override
public void execute(Boolean aBoolean) {
if (aBoolean) {
final int destinationId = deployment.getDestination().getId();
final String destinationName = deployment.getDestination().getName();
BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService(600000); // 10m should be enough right?
bundleService.purgeBundleDestination(destinationId, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
getErrorHandler().handleError(
MSG.view_bundle_dest_purgeFailure(destinationName), caught);
}
@Override
public void onSuccess(Void result) {
getMessageCenter().notify(
new Message(MSG.view_bundle_dest_purgeSuccessful(destinationName),
Message.Severity.Info));
// Bundle destination is purged, go back to bundle deployment view - it is not live anymore
goToView(
LinkManager.getBundleDeploymentLink(bundle.getId(), deployment.getId()),
true);
}
});
}
}
});
}
});
actionLayout.addMember(purgeButton);
if (!canDeploy) {
revertButton.setDisabled(true);
purgeButton.setDisabled(true);
}
}
IButton deleteButton = new EnhancedIButton(MSG.common_button_delete(), ButtonColor.RED);
//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() {
@Override
public void execute(Boolean confirmed) {
if (confirmed) {
doDeleteBundleDeployment();
}
}
});
}
});
actionLayout.addMember(deleteButton);
if (!canDelete) {
deleteButton.setDisabled(true);
}