.classpath | 6 modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 3 modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java | 7 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 6 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java | 6 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java | 47 ++- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java | 16 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java | 23 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java | 6 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java | 21 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java | 6 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java | 129 +++++++--- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java | 21 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java | 3 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/table/Table.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java | 84 ++++++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 19 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java | 2 modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css | 25 - modules/enterprise/gui/coregui/src/main/webapp/images/header/breadcrumb_space.png |binary 23 files changed, 327 insertions(+), 115 deletions(-)
New commits: commit 7cf16927f6a488da0933c6d1941132df1d373eb1 Merge: 11e04e1... 666820e... Author: John Mazzitelli mazz@redhat.com Date: Fri May 28 13:09:28 2010 -0400
Merge branch 'bundle'
commit 666820e178fa96199cdc6d728b4cabd522fe12ce Merge: e7dd203... 845d357... Author: John Mazzitelli mazz@redhat.com Date: Fri May 28 12:58:01 2010 -0400
Merge branch 'bundle' of ssh://git.fedorahosted.org/git/rhq/rhq into bundle
commit e7dd20308d3829dc5ae11b17623455d19823d572 Author: John Mazzitelli mazz@redhat.com Date: Fri May 28 12:57:48 2010 -0400
make javadoc more clear
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java index 3ace2f9..32c1a26 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java @@ -65,7 +65,7 @@ public class DeploymentData { * that the regex must be applied to - in other words, the regex value is only applied * to relative file names as found in their associated zip file. * @param rawFilesToRealize identifies the raw files that need to be realized; note that each item in this set - * must match a <code>rawFiles</code> entry + * must match a key to a <code>rawFiles</code> entry * @param templateEngine if one or more filesToRealize are specified, this template engine is used to determine * the values that should replace all replacement variables found in those files * @param ignoreRegex the files/directories to ignore when updating an existing deployment
commit 845d3575948d0cef40fb5b133486626ddd6ae3ea Author: Greg Hinkle ghinkle@redhat.com Date: Fri May 28 11:18:31 2010 -0400
L&F tweaks, bundle table additions, new bundle action buttons
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java index 9e231bd..2ee987f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java @@ -56,15 +56,17 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment> DataSourceTextField name = new DataSourceTextField("name", "Deployment Name"); addField(name);
+ DataSourceTextField bundleVersion = new DataSourceTextField("bundleVersionVersion", "Bundle Version"); + addField(bundleVersion); + DataSourceTextField description = new DataSourceTextField("description", "Description"); addField(description);
- DataSourceDateTimeField created = new DataSourceDateTimeField("createdTime", "Deployment Time"); - addField(created); - - DataSourceTextField bundleVersion = new DataSourceTextField("bundleVersion", "Bundle Version"); - addField(bundleVersion); + DataSourceTextField status = new DataSourceTextField("status", "Status"); + addField(status);
+ DataSourceDateTimeField created = new DataSourceDateTimeField("deploymentTime", "Deployment Time"); + addField(created); }
@Override @@ -119,8 +121,10 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment> record.setAttribute("name", from.getName()); record.setAttribute("deployDir", from.getDestination().getDeployDir()); record.setAttribute("description", from.getDescription()); - record.setAttribute("createdTime", new Date(from.getCtime())); + record.setAttribute("deploymentTime", new Date(from.getCtime())); record.setAttribute("configuration", from.getConfiguration()); + record.setAttribute("status", from.getStatus().name()); + record.setAttribute("deployer", from.getSubjectName());
if (from.getBundleVersion() != null) { 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 907a2a0..3ab7627 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 @@ -94,5 +94,28 @@ public class BundleDeploymentListView extends Table { } });
+ + getListGrid().getField("bundleVersionVersion").setWidth("80"); + getListGrid().getField("bundleVersionVersion").setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + return "<a href="#Bundles/Bundle/" + listGridRecord.getAttribute("bundleId") + "/versions/" + + listGridRecord.getAttribute("bundleVersionId") + "">" + o + "</a>"; + } + }); + + getListGrid().getField("description").setWidth("25%"); + getListGrid().getField("deploymentTime").setWidth("20%"); + getListGrid().getField("status").setWidth("25%"); + ListGridField status = getListGrid().getField("status"); + HashMap<String, String> statusIcons = new HashMap<String, String>(); + statusIcons.put(BundleDeploymentStatus.IN_PROGRESS.name(), "subsystems/bundle/install-loader.gif"); + statusIcons.put(BundleDeploymentStatus.FAILURE.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.MIXED.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.WARN.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.SUCCESS.name(), "subsystems/bundle/Ok_11.png"); + status.setValueIcons(statusIcons); + status.setValueIconHeight(11); + status.setWidth(80); + } } 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 27f8b0b..6b84ece 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 @@ -30,6 +30,7 @@ import java.util.HashSet; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.AnimationEffect; import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.HTMLFlow; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.LinkItem; @@ -91,8 +92,7 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { addMember(new BackButton("Back to Destination: " + deployment.getDestination().getName(), "Bundles/" + version.getBundle().getId() + "/destinations/" + deployment.getDestination().getId()));
- addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") - + ""/> " + deployment.getName())); + addMember(new HeaderLabel(Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png"), deployment.getName()));
DynamicForm form = new DynamicForm(); form.setNumCols(4); @@ -158,6 +158,8 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { Table table = new Table("Deployment Machines");
+ table.setTitleComponent(new HTMLFlow("Select a row to show install detials")); + ListGridField resourceIcon = new ListGridField("resourceAvailabity", ""); HashMap<String, String> icons = new HashMap<String, String>(); icons.put("UP", "types/Platform_up_16.png"); 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 74b7b2b..1eda39e 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 @@ -28,6 +28,7 @@ import java.util.HashMap; import java.util.HashSet;
import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.Criteria; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.events.ClickEvent; @@ -53,8 +54,10 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.bundle.deploy.BundleDeployWizard; +import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleDeploymentListView; import org.rhq.enterprise.gui.coregui.client.bundle.revert.BundleRevertWizard; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; +import org.rhq.enterprise.gui.coregui.client.components.buttons.BackButton; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagsChangedCallback; @@ -85,12 +88,14 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { this.destination = bundleDestination; this.bundle = bundleDestination.getBundle();
- addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDestination_24.png") - + ""/> " + destination.getName())); + addMember(new BackButton("Back to Bundle: " + bundle.getName(),"Bundles/Bundle/" + bundle.getId())); + + addMember(new HeaderLabel(Canvas.getImgURL("subsystems/bundle/BundleDestination_24.png"), destination.getName()));
DynamicForm form = new DynamicForm(); form.setWidth100(); form.setNumCols(4); + form.setColWidths("20%","30%","25%","25%");
LinkItem bundleName = new LinkItem("bundle"); bundleName.setTitle("Bundle"); @@ -176,7 +181,14 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { }
private Table createDeploymentsTable() { - Table table = new Table("Deployment History"); + + Criteria criteria = new Criteria(); + criteria.addCriteria("bundleDestinationId", destination.getId()); + + return new BundleDeploymentListView(criteria); + + + /* Table table = new Table("Deployment History");
ListGridField name = new ListGridField("name", "Name"); name.setCellFormatter(new CellFormatter() { @@ -220,7 +232,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView {
table.getListGrid().setData(records.toArray(new ListGridRecord[records.size()]));
- return table; + return table;*/ }
public void renderView(final ViewPath viewPath) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java index e8985c7..6b08c63 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java @@ -46,14 +46,16 @@ public class BundleVersionDataSource extends RPCDataSource<BundleVersion> { idField.setPrimaryKey(true); addField(idField);
+ DataSourceTextField latestVersionField = new DataSourceTextField("version", "Version"); + addField(latestVersionField); + DataSourceTextField nameField = new DataSourceTextField("name", "Name"); addField(nameField);
DataSourceTextField descriptionField = new DataSourceTextField("description", "Description"); addField(descriptionField);
- DataSourceTextField latestVersionField = new DataSourceTextField("version", "Version"); - addField(latestVersionField); +
DataSourceIntegerField deploymentCountField = new DataSourceIntegerField("fileCount", "File Count"); addField(deploymentCountField); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index a75587f..41c6637 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -25,8 +25,14 @@ import com.smartgwt.client.data.Criteria; import com.smartgwt.client.types.Overflow; import com.smartgwt.client.types.SelectionAppearance; import com.smartgwt.client.types.SelectionStyle; +import com.smartgwt.client.util.BooleanCallback; +import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.IButton; +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.StaticTextItem; import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridRecord; @@ -36,6 +42,7 @@ import com.smartgwt.client.widgets.tab.Tab; import com.smartgwt.client.widgets.tab.TabSet;
import org.rhq.core.domain.bundle.Bundle; +import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; import org.rhq.core.domain.criteria.BundleCriteria; import org.rhq.core.domain.tagging.Tag; import org.rhq.core.domain.util.PageList; @@ -44,6 +51,7 @@ import org.rhq.enterprise.gui.coregui.client.Breadcrumb; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.bundle.deploy.BundleDeployWizard; import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleDeploymentView; import org.rhq.enterprise.gui.coregui.client.bundle.destination.BundleDestinationListView; import org.rhq.enterprise.gui.coregui.client.bundle.destination.BundleDestinationView; @@ -52,8 +60,10 @@ import org.rhq.enterprise.gui.coregui.client.bundle.version.BundleVersionView; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.components.buttons.BackButton; import org.rhq.enterprise.gui.coregui.client.components.table.Table; +import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagsChangedCallback; +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;
@@ -64,6 +74,8 @@ public class BundleView extends VLayout implements BookmarkableView { DynamicForm form; private Table bundleVersionsTable;
+ private BundleGWTServiceAsync bundleManager = GWTServiceLookup.getBundleService(); + private Bundle bundle;
public BundleView() { @@ -90,10 +102,11 @@ public class BundleView extends VLayout implements BookmarkableView {
headerLabel = new HeaderLabel("subsystems/bundle/Bundle_24.png", bundle.getName());
+ addMember(headerLabel); + + addMember(createSummaryForm());
TabSet tabs = new TabSet(); - Tab summaryTab = createSummaryTab(); - tabs.addTab(summaryTab);
Tab versionsTab = createVersionsTab(); tabs.addTab(versionsTab); @@ -101,7 +114,6 @@ public class BundleView extends VLayout implements BookmarkableView { Tab deploymentsTab = createDestinationsTab(); tabs.addTab(deploymentsTab);
- addMember(headerLabel); addMember(tabs);
if (nextViewId != null) { @@ -139,38 +151,31 @@ public class BundleView extends VLayout implements BookmarkableView { return versionsTab; }
- private Tab createSummaryTab() { - Tab summaryTab = new Tab("Summary"); + private DynamicForm createSummaryForm() {
form = new DynamicForm(); - form.setWidth("50%"); + form.setWidth100(); + form.setColWidths("20%","30%","25%","25%"); + form.setNumCols(4); form.setWrapItemTitles(false); form.setPadding(10);
StaticTextItem descriptionItem = new StaticTextItem("description", "Description"); descriptionItem.setWrap(false); + descriptionItem.setValue(bundle.getDescription());
StaticTextItem versionCountItem = new StaticTextItem("versionCount", "Version Count"); + versionCountItem.setValue(bundle.getBundleVersions() != null ? bundle.getBundleVersions().size() : 0);
+ StaticTextItem destinationsCountItem = new StaticTextItem("destinationsCount", "Destinations Count"); + destinationsCountItem.setValue(bundle.getDestinations() != null ? bundle.getDestinations().size() : 0);
- StaticTextItem latestVersionItem = new StaticTextItem("latestVersion", "Latest Version"); - latestVersionItem.setWrap(false); - - - StaticTextItem liveDeployments = new StaticTextItem("liveDeployments", "Live Deployments"); - - - form.setFields(descriptionItem, versionCountItem, latestVersionItem, liveDeployments); + form.setFields(descriptionItem, getTagItem(), getActionItem(), versionCountItem, destinationsCountItem);
+ return form; + }
- form.setValue("description", bundle.getDescription()); - form.setValue("versionCount", bundle.getBundleVersions() != null ? bundle.getBundleVersions().size() : 0); - - - HLayout layout = new HLayout(); - layout.setWidth100(); - - layout.addMember(form); + private CanvasItem getTagItem() {
TagEditorView tagEditor = new TagEditorView(bundle.getTags(), false, new TagsChangedCallback() { public void tagsChanged(HashSet<Tag> tags) { @@ -185,17 +190,84 @@ public class BundleView extends VLayout implements BookmarkableView { }); } }); -// tagEditor.setAlwaysEdit(true); tagEditor.setVertical(true); - layout.addMember(tagEditor);
+ CanvasItem tagItem = new CanvasItem("tags"); + tagItem.setShowTitle(false); + tagItem.setRowSpan(3); + tagItem.setCanvas(tagEditor);
- summaryTab.setPane(layout); + return tagItem; + }
+ private CanvasItem getActionItem() { + VLayout layout = new VLayout(10); + + IButton deleteButton = new IButton("Delete"); + deleteButton.setIcon("subsystems/bundle/BundleAction_Delete_16.png"); + deleteButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + SC.ask("Are you sure you want to delete this bundle?", new BooleanCallback() { + public void execute(Boolean aBoolean) { + if (aBoolean) { + bundleManager.deleteBundle(bundleBeingViewed, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError( + "Failed to delete bundle [" + bundle.getName() + "]", caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify( + new Message("Deleted bundle [" + bundle.getName() + "]", Message.Severity.Info)); + } + }); + } + } + }); + } + });
- return summaryTab; - }
+ IButton deployButton = new IButton("Deploy"); + deployButton.setIcon("subsystems/bundle/BundleAction_Deploy_16.png"); + deployButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + + // can change this back to SINGLE selection when we feel like it. currently allowing the wizard to + // select the bundle. + + BundleCriteria bc = new BundleCriteria(); + bc.addFilterId(bundle.getId()); + BundleGWTServiceAsync bundleManager = GWTServiceLookup.getBundleService(); + bundleManager.findBundlesByCriteria(bc, new AsyncCallback<PageList<Bundle>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError( + "Failed to load bundle to deploy [" + bundle.getName() + "]", caught); + } + + public void onSuccess(PageList<Bundle> result) { + if (result == null || result.size() != 1) { + CoreGUI.getMessageCenter().notify( + new Message("Failed to get single bundle to deploy [" + bundle.getName() + "]", + Message.Severity.Error)); + return; + } + new BundleDeployWizard(result.get(0).getId()).startBundleWizard(); + } + }); + } + }); + + layout.addMember(deleteButton); + layout.addMember(deployButton); + + + CanvasItem actionItem = new CanvasItem("actions"); + actionItem.setRowSpan(3); + actionItem.setShowTitle(false); + actionItem.setCanvas(layout); + return actionItem; + }
public void renderView(final ViewPath viewPath) { @@ -212,6 +284,7 @@ public class BundleView extends VLayout implements BookmarkableView { BundleCriteria criteria = new BundleCriteria(); criteria.addFilterId(bundleId); criteria.fetchBundleVersions(true); + criteria.fetchDestinations(true); criteria.fetchTags(true);
GWTServiceLookup.getBundleService().findBundlesByCriteria(criteria, @@ -222,7 +295,7 @@ public class BundleView extends VLayout implements BookmarkableView {
public void onSuccess(PageList<Bundle> result) { Bundle bundle = result.get(0); - viewId.getBreadcrumbs().set(0,new Breadcrumb(String.valueOf(bundle.getId()), bundle.getName())); + viewId.getBreadcrumbs().set(0, new Breadcrumb(String.valueOf(bundle.getId()), bundle.getName())); viewBundle(bundle, viewPath.getCurrent()); // viewId.getBreadcrumbs().add(new Breadcrumb(String.valueOf(bundle.getId()), bundle.getName())); CoreGUI.refreshBreadCrumbTrail(); 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 c668e84..86e42a8 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 @@ -83,7 +83,8 @@ public class BundleVersionView extends VLayout implements BookmarkableView {
addMember(new BackButton("Back to Bundle: " + version.getBundle().getName(),"Bundles/Bundle/" + version.getBundle().getId()));
- addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleVersion_24.png") + ""/> " + version.getName() + ": " + version.getVersion())); + addMember(new HeaderLabel(Canvas.getImgURL("subsystems/bundle/BundleVersion_24.png"), version.getName() + ": " + version.getVersion())); + addMember(tabs);
if (nextViewId != null) { 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 f6dbee7..2052702 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 @@ -28,7 +28,7 @@ import com.smartgwt.client.widgets.Label; public class HeaderLabel extends HTMLFlow {
public HeaderLabel(String icon, String contents) { - this("<img src="" + getImgURL(icon) + ""/> " + contents); + this("<img src="" + getImgURL(icon) + "" style="vertical-align: middle;"/> " + contents); }
public HeaderLabel(String contents) { 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 592bceb..329bbab 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 @@ -192,7 +192,9 @@ public class Table extends VLayout { titleLayout.setAlign(VerticalAlignment.BOTTOM);
if (headerIcon != null) { - titleLayout.addMember(new Img(headerIcon,24, 24)); + Img img = new Img(headerIcon,24, 24); + img.setPadding(4); + titleLayout.addMember(img); }
titleLayout.addMember(title);
commit 2723617708cbe5d8e6d347de97bd856b056412db Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 27 18:02:19 2010 -0400
Bundle : more work on static deployment naming. wizard is acting a bit strange at end but seems to work. May need F5 to clear it.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java index 513685e..36c7cde 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java @@ -54,7 +54,6 @@ public class GetDeploymentInfoStep implements WizardStep {
final StaticTextItem nameTextItem = new StaticTextItem("name", "Deployment Name"); nameTextItem.setWidth(300); - nameTextItem.setRequired(true); wizard.setNewDeploymentName(getDeploymentName()); wizard.setSubtitle(wizard.getNewDeploymentName()); nameTextItem.setValue(wizard.getNewDeploymentName()); @@ -100,8 +99,8 @@ public class GetDeploymentInfoStep implements WizardStep { String liveVersion = wizard.getLiveDeployment().getBundleVersion().getVersion(); if (liveVersion.equals(version)) { // redeploy - int iStart = liveName.indexOf("["), iEnd = liveName.indexOf("]"); - deploy = Integer.valueOf(liveName.substring(iStart, iEnd) + 1); + int iStart = liveName.indexOf("[") + 1, iEnd = liveName.indexOf("]"); + deploy = Integer.valueOf(liveName.substring(iStart, iEnd)) + 1; deploymentName = "Deployment [" + deploy + "] of Version [" + version + "] to [" + dest + "]"; } else { // upgrade @@ -114,6 +113,6 @@ public class GetDeploymentInfoStep implements WizardStep { }
public boolean nextPage() { - return form.validate(); + return true; } }
commit ad0d278d3a5ee8838f96e11e23536f09126486fc Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 27 18:00:59 2010 -0400
update gwt jar versions
diff --git a/.classpath b/.classpath index 9804072..b6ae47b 100644 --- a/.classpath +++ b/.classpath @@ -247,9 +247,9 @@ <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.0/gwt-user-2.0.0.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/com/google/gwt/gwt-dev/2.0.0/gwt-dev-2.0.0.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/com/smartgwt/smartgwt/2.1/smartgwt-2.1.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/com/google/gwt/gwt-user/2.0.3/gwt-user-2.0.3.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/com/google/gwt/gwt-dev/2.0.3/gwt-dev-2.0.3.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/com/smartgwt/smartgwt/2.2/smartgwt-2.2.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 kind="output" path="eclipse-classes"/>
commit 439319b9e83bb2e83a2106ac86f32f4258c3adb7 Merge: a93cf0d... c579592... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 27 15:22:18 2010 -0400
Merge branch 'bundle' of ssh://git.fedorahosted.org/git/rhq/rhq into bundle
commit c579592cf1c89e6b146560de773bb5495439e380 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 27 15:15:47 2010 -0400
Fix font overriding by gwt themes (we're back to tahoma) Improve breadcrumb layout resource icons displayed
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java index 8916c0a..76e104c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java @@ -40,7 +40,8 @@ public class BreadcrumbTrailPane extends HTMLPane { setBackgroundColor("#E6E3E3"); setBackgroundImage("[skin]images/SectionHeader/header_opened_stretch.png"); //ToolStrip/background.png"); setBackgroundRepeat(BkgndRepeat.REPEAT_X); - setPadding(5); +// setPadding(5); + setOverflow(Overflow.CLIP_V); }
@@ -58,7 +59,7 @@ public class BreadcrumbTrailPane extends HTMLPane { if (!viewId.getBreadcrumbs().isEmpty()) { if (!first) { path.append("/"); - content.append(" > "); + content.append("<img src="images/header/breadcrumb_space.png" style="vertical-align: middle;" width="28" height="28"/>"); } else { first = false; } @@ -81,7 +82,7 @@ public class BreadcrumbTrailPane extends HTMLPane { content.append("<a href="#"); // NOTE: We have to call toString() below, because GWT chokes if you try to append a StringBuilder. content.append(path.toString() + breadcrumb.getName()); - content.append("">"); + content.append("" style="padding: 0 10px;">"); content.append(breadcrumb.getDisplayName()); content.append("</a>"); } 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 ab30742..4dbb543 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 @@ -76,7 +76,11 @@ public class LinkManager { }
public static String getDashboardLink() { - return "/Dashboard.do"; + if (GWT) { + return "#Dashboard"; + } else { + return "/Dashboard.do"; + } }
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 4c5ad03..74b7b2b 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 @@ -154,6 +154,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView {
private Canvas getActionLayout() { VLayout actionLayout = new VLayout(); + actionLayout.setMembersMargin(10); IButton deployButton = new IButton("Deploy"); deployButton.setIcon("subsystems/bundle/BundleAction_Deploy_16.png"); deployButton.addClickHandler(new ClickHandler() { 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 e6cfcd6..bdc854c 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 @@ -53,13 +53,15 @@ public class BundlesListView extends Table {
public BundlesListView(Criteria criteria) { super("Bundles", criteria); - setHeaderIcon("subsystems/bundle/Bundle_24.png"); }
@Override protected void onInit() { super.onInit();
+ setHeaderIcon("subsystems/bundle/Bundle_24.png"); + + setDataSource(new BundlesWithLatestVersionDataSource());
getListGrid().getField("id").setWidth("60"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java index b2a7f14..8852dfc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java @@ -33,14 +33,22 @@ import com.smartgwt.client.widgets.tree.TreeGrid; import com.smartgwt.client.widgets.tree.TreeNode;
import org.rhq.core.domain.resource.Resource; +import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.ViewId; +import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.admin.agent.install.RemoteAgentInstallView; +import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesView; +import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView; +import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListView; import org.rhq.enterprise.gui.coregui.client.inventory.groups.definitions.GroupDefinitionListView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView;
/** * @author Greg Hinkle */ -public class InventoryView extends HLayout { +public class InventoryView extends HLayout implements BookmarkableView {
public static final String VIEW_PATH = "Inventory";
@@ -179,4 +187,78 @@ public class InventoryView extends HLayout { contentCanvas.addChild(newContent); contentCanvas.markForRedraw(); } + + + + private void renderContentView(ViewPath viewPath) { + + ViewId currentSectionViewId = viewPath.getCurrent(); + ViewId currentPageViewId = viewPath.getNext(); + + String section = currentSectionViewId.getPath(); + String page = currentPageViewId.getPath(); + + + Canvas content = null; + if ("Reports".equals(section)) { + + if ("Inventory Summary".equals(page)) { + content = new FullHTMLPane("/rhq/admin/report/resourceInstallReport-body.xhtml"); + } + + + } else if ("Security".equals(section)) { + + if ("Manage Users".equals(page)) { + content = new UsersView(); + } else if ("Manage Roles".equals(page)) { + content = new RolesView(); + } else if ("Auto Discovery Queue".equals(page)) { + content = new ResourceAutodiscoveryView(); + } else if ("Remote Agent Install".equals(page)) { + content = new RemoteAgentInstallView(); + } + } + + + /* for (String name : treeGrids.keySet()) { + + TreeGrid treeGrid = treeGrids.get(name); + if (name.equals(section)) { + treeGrid.setSelectedPaths(page); + } else { + treeGrid.deselectAllRecords(); + } + }*/ + + + + setContent(content); + + + if (content instanceof BookmarkableView) { + ((BookmarkableView) content).renderView(viewPath.next().next()); + } + + + } + + + public void renderView(ViewPath viewPath) { + +/* + if (!viewPath.isCurrent(currentSectionViewId) || !viewPath.isNext(currentPageViewId)) { + + if (viewPath.isEnd()) { + // Display default view + setContent(defaultView()); + } else { + renderContentView(viewPath); + } + } +*/ + + + + } } 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 91627d2..c08c42f 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 @@ -80,15 +80,15 @@ public class ResourceSearchView extends Table { setWidth100(); setHeight100();
- DynamicForm searchPanel = new DynamicForm(); - final TextItem searchBox = new TextItem("query", "Search Resources"); - searchBox.setValue(""); - searchPanel.setWrapItemTitles(false); - searchPanel.setFields(searchBox); +// DynamicForm searchPanel = new DynamicForm(); +// final TextItem searchBox = new TextItem("query", "Search Resources"); +// searchBox.setValue(""); +// searchPanel.setWrapItemTitles(false); +// searchPanel.setFields(searchBox);
final ResourceDatasource datasource = new ResourceDatasource(); - setTitleComponent(searchPanel); +// setTitleComponent(searchPanel); setDataSource(datasource);
getListGrid().setSelectionType(SelectionStyle.SIMPLE); @@ -97,6 +97,7 @@ public class ResourceSearchView extends Table {
ListGridField idField = new ListGridField("id", "Id", 55); idField.setType(ListGridFieldType.INTEGER); + ListGridField iconField = new ListGridField("icon","", 40); ListGridField nameField = new ListGridField("name", "Name", 250); nameField.setCellFormatter(new CellFormatter() { public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { @@ -111,7 +112,7 @@ public class ResourceSearchView extends Table {
ListGridField availabilityField = new ListGridField("currentAvailability", "Availability", 55); availabilityField.setAlign(Alignment.CENTER); - getListGrid().setFields(idField, nameField, descriptionField, typeNameField, pluginNameField, + getListGrid().setFields(idField, iconField, nameField, descriptionField, typeNameField, pluginNameField, categoryField, availabilityField);
addTableAction("Uninventory", Table.SelectionEnablement.ANY, @@ -122,7 +123,7 @@ public class ResourceSearchView extends Table { });
- searchBox.addKeyPressHandler(new KeyPressHandler() { + /*searchBox.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { if ((event.getCharacterValue() != null) && (event.getCharacterValue() == KeyCodes.KEY_ENTER)) { datasource.setQuery((String) searchBox.getValue()); @@ -139,7 +140,7 @@ public class ResourceSearchView extends Table { System.out.println("Loaded in: " + (System.currentTimeMillis() - start)); } } - }); + });*/ }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java index b69eb0e..3c4e3a6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java @@ -89,7 +89,7 @@ public class TaggedView extends VLayout implements BookmarkableView {
tileLayout = new TileLayout(); tileLayout.setWidth100(); - tileLayout.setTileHeight(250); + tileLayout.setTileHeight(220); tileLayout.setTileWidth(getWidth() / 2 - 20); addMember(tileLayout);
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css index 05997e8..40274c1 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css +++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css @@ -8,8 +8,8 @@
body, p, td, th, option, input, textarea, select { color: #000000; - font-family: tahoma, verdana, sans-serif; - font-size: 11px; + font-family: tahoma, verdana, sans-serif !important; + font-size: 11px !important; }
img { @@ -27,22 +27,15 @@ hr { width: 100%; }
-a:link { - color: #4A5D75; - font-weight: bold; - text-decoration: none; -} +a, a:link, a:visited, a:hover { + color: #4A5D75 !important; + font-weight: bold !important; + text-decoration: none !important;
-a:visited { - color: #4A5D75; - font-weight: bold; - text-decoration: none; }
a:hover { - color: #4A5D75; - font-weight: bold; - text-decoration: underline; + text-decoration: underline !important; }
@@ -214,7 +207,7 @@ a:hover { .SubTabButtonSelectedFocusedOver, .SubTabButtonDisabled, .SubTabButtonSelectedDisabled { - font-family: Arial, Verdana, Bitstream Vera Sans, sans-serif; + font-family: tahoma, verdona, sans-serif; font-size: 11px; padding: 2px; } @@ -297,7 +290,7 @@ a:hover { .SimpleButtonSelectedOver, .SimpleButtonSelectedFocusedOver, .SimpleButtonSelectedDisabled{ - font-family: Arial, Verdana, Bitstream Vera Sans, sans-serif; + font-family: tahoma, verdana, sans-serif; font-size: 11px; padding: 2px; font-weight: bold; diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/header/breadcrumb_space.png b/modules/enterprise/gui/coregui/src/main/webapp/images/header/breadcrumb_space.png new file mode 100644 index 0000000..e25b082 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/header/breadcrumb_space.png differ
commit a93cf0db1237d95b681fd383d8e73edf61855275 Merge: 8a80b6d... a06d973... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 27 14:07:43 2010 -0400
Merge branch 'bundle' of ssh://git.fedorahosted.org/git/rhq/rhq into bundle
commit 8a80b6de7a7701d0155f87807bd36d3afaa69f28 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 27 14:06:56 2010 -0400
Set deployment names to uneditable generated strings. This helps the user set an intelligent value for a tricky field and will provide a more consistent listing view of deployments
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java index c471ec6..3d315c1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java @@ -42,9 +42,9 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { List<WizardStep> steps = init(); steps.add(new SelectBundleStep(this)); steps.add(new GetDestinationStep(this)); - steps.add(new GetDeploymentInfoStep(this)); steps.add(new SelectBundleVersionStep(this)); steps.add(new GetDeploymentConfigStep(this)); + steps.add(new GetDeploymentInfoStep(this)); steps.add(new DeployStep(this)); }
@@ -55,9 +55,9 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard {
List<WizardStep> steps = init(); steps.add(new GetDestinationStep(this)); - steps.add(new GetDeploymentInfoStep(this)); steps.add(new SelectBundleVersionStep(this)); steps.add(new GetDeploymentConfigStep(this)); + steps.add(new GetDeploymentInfoStep(this)); steps.add(new DeployStep(this)); }
@@ -72,9 +72,9 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { this.setDestination(destination);
List<WizardStep> steps = init(); - steps.add(new GetDeploymentInfoStep(this)); steps.add(new SelectBundleVersionStep(this)); steps.add(new GetDeploymentConfigStep(this)); + steps.add(new GetDeploymentInfoStep(this)); steps.add(new DeployStep(this)); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java index 5fbe7a1..513685e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java @@ -21,8 +21,8 @@ package org.rhq.enterprise.gui.coregui.client.bundle.deploy; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.CheckboxItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; import com.smartgwt.client.widgets.form.fields.TextAreaItem; -import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
@@ -52,19 +52,12 @@ public class GetDeploymentInfoStep implements WizardStep { form.setNumCols(2); form.setColWidths("50%", "*");
- final TextItem nameTextItem = new TextItem("name", "Deployment Name"); + final StaticTextItem nameTextItem = new StaticTextItem("name", "Deployment Name"); nameTextItem.setWidth(300); nameTextItem.setRequired(true); - nameTextItem.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - Object value = event.getValue(); - if (value == null) { - value = ""; - } - wizard.setSubtitle(value.toString()); - wizard.setNewDeploymentName(value.toString()); - } - }); + wizard.setNewDeploymentName(getDeploymentName()); + wizard.setSubtitle(wizard.getNewDeploymentName()); + nameTextItem.setValue(wizard.getNewDeploymentName());
final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description", "Deployment Description"); descriptionTextAreaItem.setWidth(300); @@ -93,6 +86,33 @@ public class GetDeploymentInfoStep implements WizardStep { return form; }
+ private String getDeploymentName() { + String deploymentName = "none"; + + int deploy = 1; + String version = wizard.getBundleVersion().getVersion(); + String dest = wizard.getDestination().getName(); + + if (wizard.isInitialDeployment()) { + deploymentName = "Deployment [" + deploy + "] of Version [" + version + "] to [" + dest + "]"; + } else { + String liveName = wizard.getLiveDeployment().getName(); + String liveVersion = wizard.getLiveDeployment().getBundleVersion().getVersion(); + if (liveVersion.equals(version)) { + // redeploy + int iStart = liveName.indexOf("["), iEnd = liveName.indexOf("]"); + deploy = Integer.valueOf(liveName.substring(iStart, iEnd) + 1); + deploymentName = "Deployment [" + deploy + "] of Version [" + version + "] to [" + dest + "]"; + } else { + // upgrade + deploymentName = "Deployment [" + deploy + "] of Version [" + version + "] to [" + dest + + "]. Upgrade from Version [" + liveVersion + "]"; + } + } + + return deploymentName; + } + public boolean nextPage() { return form.validate(); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java index f4ecf09..827c3e3 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java @@ -21,8 +21,8 @@ package org.rhq.enterprise.gui.coregui.client.bundle.revert; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.CheckboxItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; import com.smartgwt.client.widgets.form.fields.TextAreaItem; -import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
@@ -52,30 +52,21 @@ public class GetRevertInfoStep implements WizardStep { form.setNumCols(2); form.setColWidths("50%", "*");
- final TextItem nameTextItem = new TextItem("name", "Revert Deployment Name"); + final StaticTextItem nameTextItem = new StaticTextItem("name", "Revert Deployment Name"); nameTextItem.setRequired(true); nameTextItem.setWidth(300); - wizard.setDeploymentName("[Reverted] " + this.wizard.getPreviousDeployment().getName()); + wizard.setDeploymentName("[REVERT To] " + this.wizard.getPreviousDeployment().getName()); + wizard.setSubtitle(wizard.getDeploymentName()); nameTextItem.setValue(wizard.getDeploymentName()); - nameTextItem.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - Object value = event.getValue(); - if (value == null) { - value = ""; - } - wizard.setSubtitle(value.toString()); - wizard.setDeploymentName(value.toString()); - } - });
final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description", - "revert Deployment Description"); + "Revert Deployment Description"); descriptionTextAreaItem.setWidth(300); String liveDesc = this.wizard.getLiveDeployment().getDescription(); liveDesc = (null == liveDesc) ? this.wizard.getLiveDeployment().getName() : liveDesc; String prevDesc = this.wizard.getPreviousDeployment().getDescription(); prevDesc = (null == prevDesc) ? this.wizard.getPreviousDeployment().getName() : prevDesc; - wizard.setDeploymentDescription("[Reverted From]\n" + liveDesc + "\n\n[Reverted To]\n" + prevDesc); + wizard.setDeploymentDescription("[REVERT From]\n" + liveDesc + "\n\n[REVERT To]\n" + prevDesc); descriptionTextAreaItem.setValue(wizard.getDeploymentDescription()); descriptionTextAreaItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) {
commit e309498563db198a660db70588abafd4a33daf6d Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 27 14:05:34 2010 -0400
Change RHQ_BUNDLE_RES_DEP_HIST.CATEGORY to nullable. The upgrade did not mirror dbsetup.
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index a00c8a5..b84efb4 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2628,8 +2628,7 @@ <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="ACTION" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="INFO" columnType="VARCHAR2" precision="512" /> <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="INFO" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="CATEGORY" columnType="VARCHAR2" precision="32" /> - <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="CATEGORY" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="CATEGORY" columnType="VARCHAR2" precision="32" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="STATUS" columnType="VARCHAR2" precision="16" /> <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="STATUS" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="MESSAGE" columnType="LONGVARCHAR" />
rhq-commits@lists.fedorahosted.org