summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java4
-rw-r--r--modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java8
-rw-r--r--modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java20
-rw-r--r--modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java4
-rw-r--r--modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties1
-rw-r--r--modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties1
-rw-r--r--modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties1
-rw-r--r--modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties1
-rw-r--r--modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties1
-rw-r--r--modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties1
-rw-r--r--modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties1
11 files changed, 37 insertions, 6 deletions
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 15f8331..6f99d10 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
@@ -334,11 +334,11 @@ public class LinkManager {
}
public static String getHubCompatibleGroupsLink() {
- return "/rhq/inventory/browseGroups.xhtml?subtab=compatible";
+ return "#Inventory/Groups/CompatibleGroups";
}
public static String getHubMixedGroupsLink() {
- return "/rhq/inventory/browseGroups.xhtml?subtab=mixed";
+ return "#Inventory/Groups/MixedGroups";
}
public static String getHubGroupDefinitionsLink() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
index 2947bce..fd617c2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
@@ -211,7 +211,13 @@ public class ResourceGroupListView extends Table<ResourceGroupCompositeDataSourc
addTableAction(extendLocatorId("New"), MSG.common_button_new(), new AuthorizedTableAction(this,
Permission.MANAGE_INVENTORY) {
public void executeAction(ListGridRecord[] selection, Object actionValue) {
- new GroupCreateWizard(ResourceGroupListView.this).startWizard();
+ GroupCategory category = null;
+ String categoryString = getInitialCriteria().getAttribute(ResourceGroupDataSourceField.CATEGORY.propertyName());
+ if (categoryString != null) {
+ category = GroupCategory.COMPATIBLE.name().equals(categoryString) ? GroupCategory.COMPATIBLE : GroupCategory.MIXED;
+ }
+
+ new GroupCreateWizard(ResourceGroupListView.this, category).startWizard();
// we can refresh the table buttons immediately since the wizard is a dialog, the
// user can't access enabled buttons anyway.
ResourceGroupListView.this.refreshTableInfo();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
index 462b636..85d8c99 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
@@ -22,7 +22,12 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard;
+import com.smartgwt.client.util.SC;
+
+import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListView;
/**
@@ -33,13 +38,24 @@ import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListV
*/
public class GroupCreateWizard extends AbstractGroupCreateWizard {
private ResourceGroupListView resourceGroupListView;
+ private GroupCategory category;
- public GroupCreateWizard(ResourceGroupListView resourceGroupListView) {
- super();
+ public GroupCreateWizard(ResourceGroupListView resourceGroupListView, GroupCategory category) {
this.resourceGroupListView = resourceGroupListView;
+ this.category = category;
}
public void groupCreateCallback(ResourceGroup group) {
resourceGroupListView.refresh();
+ if (category != null && category != group.getGroupCategory()) {
+ if (category == GroupCategory.COMPATIBLE && group.getExplicitResources().isEmpty()) {
+ SC.say(MSG.view_group_common_emptyGroup());
+ }
+ // if null, it was invoked from all groups list
+ // the other type of group has been created
+ // navigate user to the right category
+ CoreGUI.goToView(GroupCategory.COMPATIBLE == group.getGroupCategory() ? LinkManager
+ .getHubCompatibleGroupsLink() : LinkManager.getHubMixedGroupsLink());
+ }
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
index 8c5c54d..f426ed1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
@@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.server.gwt;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria;
+import org.rhq.core.domain.resource.group.DuplicateExpressionTypeException;
import org.rhq.core.domain.resource.group.GroupDefinition;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
@@ -29,7 +30,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTService;
import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerLocal;
-import org.rhq.core.domain.resource.group.DuplicateExpressionTypeException;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -107,6 +107,8 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl implemen
Subject user = getSessionSubject();
group = groupManager.createResourceGroup(user, group);
groupManager.setAssignedResources(user, group.getId(), resourceIds, true);
+ // we need the group.groupCategory to be set
+ group = groupManager.getResourceGroup(user, group.getId());
return SerialUtility.prepare(group, "ResourceGroupService.createResourceGroup");
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
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 9681ea1..ab0eed7 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
@@ -1425,6 +1425,7 @@ view_groupCreateWizard_title = Create Group
view_groupCreateWizard_windowTitle = Create Group
view_groupInventoryMembers_button_updateMembership = Update Membership...
view_groupInventoryMembers_title_updateMembership = Update Membership
+view_group_common_emptyGroup = An empty group is always considered as mixed.
view_group_detail_failLoad = Failed to load group for group with ID [{0}]
view_group_detail_failLoadComp = Group with id [{0}] does not exist or is not accessible
view_group_detail_failRecursiveChange = Failed to update the recursive setting for group [{0}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
index b2a842d..dfd116e 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
@@ -1442,6 +1442,7 @@ view_groupCreateWizard_createSuccessful_full = Vytvořili jste novou [{0}] skupi
view_groupCreateWizard_membersStepName = Vybrat členy
view_groupCreateWizard_title = Vytvořit skupinu
view_groupCreateWizard_windowTitle = Vytvořit skupinu
+view_group_common_emptyGroup = Prázndá skupina je vždy považována jako smíšená.
view_groupInventoryMembers_button_updateMembership = Upravit členství...
view_groupInventoryMembers_title_updateMembership = Upravit členství
view_group_detail_failLoad = Nepodařilo se načíst skupinu s ID [{0}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 4fe89d0..473bc14 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -1260,6 +1260,7 @@ view_groupCreateWizard_title = Gruppe anlegen
view_groupCreateWizard_windowTitle = Gruppe anlegen
view_groupInventoryMembers_button_updateMembership = Mitgliedschaft aktualisieren...
view_groupInventoryMembers_title_updateMembership = Mitgliedschaft aktualisieren
+##view_group_common_emptyGroup = An empty group is always considered as mixed.
view_group_detail_failLoad = Konnte die Gruppe mit der ID [{0}] nicht laden
view_group_detail_failLoadComp = Group with id [{0}] does not exist or is not accessible
view_group_detail_failRecursiveChange = Konnte die Einstellung ''Rekursiv'' für die Gruppe [{0}] nicht aktualisieren
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index e2e25e8..35f696e 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -1412,6 +1412,7 @@ view_groupCreateWizard_createSuccessful_full = [{2}] メンバーリソースを
view_groupCreateWizard_membersStepName = メンバーの選択
view_groupCreateWizard_title = グループ作成
view_groupCreateWizard_windowTitle = グループ作成
+##view_group_common_emptyGroup = An empty group is always considered as mixed.
view_groupInventoryMembers_button_updateMembership = メンバーシップの更新...
view_groupInventoryMembers_title_updateMembership = メンバーシップの更新
view_group_detail_failLoad = ID [{0}] の付いたグループのロードに失敗しました
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index e3f044f..38b0f01 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -1437,6 +1437,7 @@ view_groupCreateWizard_title = Criar Grupo
view_groupCreateWizard_windowTitle = Criar Novo Grupo
view_groupInventoryMembers_button_updateMembership = Atualizar Membros do Grupo...
view_groupInventoryMembers_title_updateMembership = Atualizar Membros
+##view_group_common_emptyGroup = An empty group is always considered as mixed.
view_group_detail_failLoad = Falha ao carregar o grupo com ID [{0}]
view_group_detail_failLoadComp = Falha ao carregar a composi��o do grupo com ID [{0}]
view_group_detail_failRecursiveChange = Falha ao alterar a recursividade do grupo [{0}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
index e27ce16..64479c7 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
@@ -2468,6 +2468,7 @@ view_admin_downloads_cli_version = Версия CLI
##view_bundle_revertWizard_getInfoStep_revertDeployDescFull = [REVERT From] {0} [REVERT To] {1}
##view_configEdit_property = Property
##view_configEdit_unset = Unset?
+##view_group_common_emptyGroup = An empty group is always considered as mixed.
##view_inventory_resources_disableSuccessful = You have successfully disabled the selected resources and their children, [{0}] resources.
##view_messageCenter_messageRootCause = Root Cause
##view_operationHistoryList_cancelConfirm = Are you sure you want to cancel the selected operations? NOTE: Only those selected operations that are currently "in progress" will be attempted to be canceled.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 2de43cc..c1f347f 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -1415,6 +1415,7 @@ view_groupCreateWizard_title = \u521b\u5efa\u7ec4
view_groupCreateWizard_windowTitle = \u521b\u5efa\u7ec4
view_groupInventoryMembers_button_updateMembership = \u66f4\u65b0\u6210\u5458\u5173\u7cfb\u4e2d...
view_groupInventoryMembers_title_updateMembership = \u66f4\u65b0\u6210\u5458\u5173\u7cfb
+##view_group_common_emptyGroup = An empty group is always considered as mixed.
view_group_detail_failLoad = \u52a0\u8f7d\u7ec4ID\u4e3a[{0}]\u7684\u7ec4\u4fe1\u606f\u5931\u8d25
view_group_detail_failLoadComp = Group with id [{0}] does not exist or is not accessible
view_group_detail_failRecursiveChange = \u4fee\u6539\u7ec4[{0}]\u7684\u9012\u5f52\u8bbe\u7f6e\u5931\u8d25