http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java index d4917f3..98d8862 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java @@ -25,7 +25,7 @@ import java.util.EnumSet; import java.util.List; import org.apache.syncope.client.console.commons.Constants; import org.apache.syncope.client.console.panels.LoggerCategoryPanel; -import org.apache.syncope.client.console.panels.RoleSearchPanel; +import org.apache.syncope.client.console.panels.GroupSearchPanel; import org.apache.syncope.client.console.panels.UserSearchPanel; import org.apache.syncope.client.console.rest.LoggerRestClient; import org.apache.syncope.client.console.rest.NotificationRestClient; @@ -108,26 +108,26 @@ class NotificationModalPage extends BaseModalPage { form.add(aboutContainer); final AjaxCheckBoxPanel checkAbout = new AjaxCheckBoxPanel("checkAbout", "checkAbout", new Model<Boolean>( - notificationTO.getUserAbout() == null && notificationTO.getRoleAbout() == null)); + notificationTO.getUserAbout() == null && notificationTO.getGroupAbout() == null)); aboutContainer.add(checkAbout); final AjaxCheckBoxPanel checkUserAbout = new AjaxCheckBoxPanel("checkUserAbout", "checkUserAbout", new Model<Boolean>(notificationTO.getUserAbout() != null)); aboutContainer.add(checkUserAbout); - final AjaxCheckBoxPanel checkRoleAbout = new AjaxCheckBoxPanel("checkRoleAbout", "checkRoleAbout", - new Model<Boolean>(notificationTO.getRoleAbout() != null)); - aboutContainer.add(checkRoleAbout); + final AjaxCheckBoxPanel checkGroupAbout = new AjaxCheckBoxPanel("checkGroupAbout", "checkGroupAbout", + new Model<Boolean>(notificationTO.getGroupAbout() != null)); + aboutContainer.add(checkGroupAbout); final UserSearchPanel userAbout = new UserSearchPanel.Builder("userAbout").fiql(notificationTO.getUserAbout()).build(); aboutContainer.add(userAbout); userAbout.setEnabled(checkUserAbout.getModelObject()); - final RoleSearchPanel roleAbout = - new RoleSearchPanel.Builder("roleAbout").fiql(notificationTO.getRoleAbout()).build(); - aboutContainer.add(roleAbout); - roleAbout.setEnabled(checkRoleAbout.getModelObject()); + final GroupSearchPanel groupAbout = + new GroupSearchPanel.Builder("groupAbout").fiql(notificationTO.getGroupAbout()).build(); + aboutContainer.add(groupAbout); + groupAbout.setEnabled(checkGroupAbout.getModelObject()); checkAbout.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { @@ -137,9 +137,9 @@ class NotificationModalPage extends BaseModalPage { protected void onUpdate(final AjaxRequestTarget target) { if (checkAbout.getModelObject()) { checkUserAbout.setModelObject(Boolean.FALSE); - checkRoleAbout.setModelObject(Boolean.FALSE); + checkGroupAbout.setModelObject(Boolean.FALSE); userAbout.setEnabled(Boolean.FALSE); - roleAbout.setEnabled(Boolean.FALSE); + groupAbout.setEnabled(Boolean.FALSE); } else { checkAbout.setModelObject(Boolean.TRUE); } @@ -155,8 +155,8 @@ class NotificationModalPage extends BaseModalPage { protected void onUpdate(final AjaxRequestTarget target) { if (checkUserAbout.getModelObject()) { checkAbout.setModelObject(!checkUserAbout.getModelObject()); - checkRoleAbout.setModelObject(!checkUserAbout.getModelObject()); - roleAbout.setEnabled(Boolean.FALSE); + checkGroupAbout.setModelObject(!checkUserAbout.getModelObject()); + groupAbout.setEnabled(Boolean.FALSE); } else { checkUserAbout.setModelObject(Boolean.TRUE); } @@ -165,20 +165,20 @@ class NotificationModalPage extends BaseModalPage { } }); - checkRoleAbout.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { + checkGroupAbout.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { private static final long serialVersionUID = -1107858522700306810L; @Override protected void onUpdate(final AjaxRequestTarget target) { - if (checkRoleAbout.getModelObject()) { + if (checkGroupAbout.getModelObject()) { checkAbout.setModelObject(Boolean.FALSE); checkUserAbout.setModelObject(Boolean.FALSE); userAbout.setEnabled(Boolean.FALSE); } else { - checkRoleAbout.setModelObject(Boolean.TRUE); + checkGroupAbout.setModelObject(Boolean.TRUE); } - roleAbout.setEnabled(Boolean.TRUE); + groupAbout.setEnabled(Boolean.TRUE); target.add(aboutContainer); } }); @@ -353,9 +353,9 @@ class NotificationModalPage extends BaseModalPage { protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) { notificationTO.setUserAbout( !checkAbout.getModelObject() && checkUserAbout.getModelObject() ? userAbout.buildFIQL() : null); - notificationTO.setRoleAbout( + notificationTO.setGroupAbout( !checkAbout.getModelObject() - && checkRoleAbout.getModelObject() ? roleAbout.buildFIQL() : null); + && checkGroupAbout.getModelObject() ? groupAbout.buildFIQL() : null); notificationTO.setRecipients(checkRecipients.getModelObject() ? recipients.buildFIQL() : null); notificationTO.getStaticRecipients().removeAll(Collections.singleton(null));
http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java index efa61c1..8daecb7 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java @@ -36,7 +36,7 @@ import org.apache.syncope.common.lib.to.AbstractPolicyTO; import org.apache.syncope.common.lib.to.AccountPolicyTO; import org.apache.syncope.common.lib.to.PasswordPolicyTO; import org.apache.syncope.common.lib.to.ResourceTO; -import org.apache.syncope.common.lib.to.RoleTO; +import org.apache.syncope.common.lib.to.GroupTO; import org.apache.syncope.common.lib.to.SyncPolicyTO; import org.apache.syncope.common.lib.types.AccountPolicySpec; import org.apache.syncope.common.lib.types.PasswordPolicySpec; @@ -235,10 +235,10 @@ public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage { new AjaxFallbackDefaultDataTable<>("resources", resColumns, resDataProvider, 10); form.add(resources); - List<IColumn<RoleTO, String>> roleColumns = new ArrayList<>(); - roleColumns.add(new PropertyColumn<RoleTO, String>(new ResourceModel("key", "key"), "key", "key")); - roleColumns.add(new PropertyColumn<RoleTO, String>(new ResourceModel("name", "name"), "name", "name")); - roleColumns.add(new AbstractColumn<RoleTO, String>(new StringResourceModel("actions", this, null, "")) { + List<IColumn<GroupTO, String>> groupColumns = new ArrayList<>(); + groupColumns.add(new PropertyColumn<GroupTO, String>(new ResourceModel("key", "key"), "key", "key")); + groupColumns.add(new PropertyColumn<GroupTO, String>(new ResourceModel("name", "name"), "name", "name")); + groupColumns.add(new AbstractColumn<GroupTO, String>(new StringResourceModel("actions", this, null, "")) { private static final long serialVersionUID = 2054811145491901166L; @@ -248,10 +248,10 @@ public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage { } @Override - public void populateItem(final Item<ICellPopulator<RoleTO>> cellItem, final String componentId, - final IModel<RoleTO> model) { + public void populateItem(final Item<ICellPopulator<GroupTO>> cellItem, final String componentId, + final IModel<GroupTO> model) { - final RoleTO role = model.getObject(); + final GroupTO group = model.getObject(); final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference()); panel.add(new ActionLink() { @@ -266,52 +266,51 @@ public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage { @Override public Page createPage() { - return new RoleModalPage(PolicyModalPage.this.getPageReference(), mwindow, role); + return new GroupModalPage(PolicyModalPage.this.getPageReference(), mwindow, group); } }); mwindow.show(target); } - }, ActionLink.ActionType.EDIT, "Roles"); + }, ActionLink.ActionType.EDIT, "Groups"); cellItem.add(panel); } }); - ISortableDataProvider<RoleTO, String> roleDataProvider = new SortableDataProvider<RoleTO, String>() { + ISortableDataProvider<GroupTO, String> groupDataProvider = new SortableDataProvider<GroupTO, String>() { private static final long serialVersionUID = 8263758912838836438L; @Override - public Iterator<? extends RoleTO> iterator(final long first, final long count) { - List<RoleTO> roles = new ArrayList<>(); + public Iterator<? extends GroupTO> iterator(final long first, final long count) { + List<GroupTO> groups = new ArrayList<>(); if (policyTO.getKey() > 0) { - for (Long roleId : policyRestClient.getPolicy(policyTO.getKey()). - getUsedByRoles().subList((int) first, (int) first + (int) count)) { + for (Long groupId : policyRestClient.getPolicy(policyTO.getKey()).getUsedByGroups(). + subList((int) first, (int) first + (int) count)) { - roles.add(roleRestClient.read(roleId)); + groups.add(groupRestClient.read(groupId)); } } - return roles.iterator(); + return groups.iterator(); } @Override public long size() { return policyTO.getKey() == 0 ? 0 - : policyRestClient.getPolicy(policyTO.getKey()). - getUsedByRoles().size(); + : policyRestClient.getPolicy(policyTO.getKey()).getUsedByGroups().size(); } @Override - public IModel<RoleTO> model(final RoleTO object) { + public IModel<GroupTO> model(final GroupTO object) { return new Model<>(object); } }; - final AjaxFallbackDefaultDataTable<RoleTO, String> roles = - new AjaxFallbackDefaultDataTable<>("roles", roleColumns, roleDataProvider, 10); - form.add(roles); + final AjaxFallbackDefaultDataTable<GroupTO, String> groups = + new AjaxFallbackDefaultDataTable<>("groups", groupColumns, groupDataProvider, 10); + form.add(groups); mwindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { @@ -320,7 +319,7 @@ public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage { @Override public void onClose(final AjaxRequestTarget target) { target.add(resources); - target.add(roles); + target.add(groups); if (isModalResult()) { info(getString(Constants.OPERATION_SUCCEEDED)); feedbackPanel.refresh(target); http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java index dc3ee88..6418d61 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java @@ -35,7 +35,7 @@ import org.apache.syncope.common.lib.to.AbstractAttributableTO; import org.apache.syncope.common.lib.to.AbstractSubjectTO; import org.apache.syncope.common.lib.to.BulkActionResult; import org.apache.syncope.common.lib.to.ResourceTO; -import org.apache.syncope.common.lib.to.RoleTO; +import org.apache.syncope.common.lib.to.GroupTO; import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.types.ResourceDeassociationActionType; import org.apache.syncope.common.lib.wrap.AbstractWrappable; @@ -83,7 +83,7 @@ public class ProvisioningModalPage<T extends AbstractAttributableTO> extends Abs this.resourceTO = resourceTO; this.typeRef = typeRef; - statusUtils = new StatusUtils((UserTO.class.isAssignableFrom(typeRef) ? userRestClient : roleRestClient)); + statusUtils = new StatusUtils((UserTO.class.isAssignableFrom(typeRef) ? userRestClient : groupRestClient)); add(new Label("displayName", StringUtils.EMPTY)); @@ -199,7 +199,7 @@ public class ProvisioningModalPage<T extends AbstractAttributableTO> extends Abs if (UserTO.class.isAssignableFrom(typeRef)) { subjects.addAll((List<T>) userRestClient.search(fiql, 1, ROWS_PER_PAGE, new SortParam<>("key", true))); } else { - subjects.addAll((List<T>) roleRestClient.search(fiql, 1, ROWS_PER_PAGE, new SortParam<>("key", true))); + subjects.addAll((List<T>) groupRestClient.search(fiql, 1, ROWS_PER_PAGE, new SortParam<>("key", true))); } final List<ConnObjectWrapper> connObjects = statusUtils.getConnectorObjects( @@ -209,11 +209,10 @@ public class ProvisioningModalPage<T extends AbstractAttributableTO> extends Abs final LinkedHashMap<String, StatusBean> initialStatusBeanMap = new LinkedHashMap<>(connObjects.size()); for (ConnObjectWrapper entry : connObjects) { - final StatusBean statusBean = statusUtils.getStatusBean( - entry.getAttributable(), + final StatusBean statusBean = statusUtils.getStatusBean(entry.getAttributable(), entry.getResourceName(), entry.getConnObjectTO(), - RoleTO.class.isAssignableFrom(typeRef)); + GroupTO.class.isAssignableFrom(typeRef)); initialStatusBeanMap.put(entry.getResourceName(), statusBean); statusBeans.add(statusBean); http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/PushTaskModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/PushTaskModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/PushTaskModalPage.java index a799b15..51852be 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/PushTaskModalPage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/PushTaskModalPage.java @@ -20,7 +20,7 @@ package org.apache.syncope.client.console.pages; import java.util.List; import org.apache.syncope.client.console.commons.Constants; -import org.apache.syncope.client.console.panels.RoleSearchPanel; +import org.apache.syncope.client.console.panels.GroupSearchPanel; import org.apache.syncope.client.console.panels.UserSearchPanel; import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel; import org.apache.syncope.common.lib.to.PushTaskTO; @@ -44,11 +44,11 @@ public class PushTaskModalPage extends AbstractSyncTaskModalPage { private final UserSearchPanel userFilter; - private final RoleSearchPanel roleFilter; + private final GroupSearchPanel groupFilter; private final AjaxCheckBoxPanel checkUserFilter; - private final AjaxCheckBoxPanel checkRoleFilter; + private final AjaxCheckBoxPanel checkGroupFilter; @Override protected List<String> getSyncActions() { @@ -75,21 +75,21 @@ public class PushTaskModalPage extends AbstractSyncTaskModalPage { filterContainer.setOutputMarkupId(true); checkUserFilter = new AjaxCheckBoxPanel("checkUserFilter", "checkUserFilter", - new Model<Boolean>(taskTO.getUserFilter() != null)); + new Model<>(taskTO.getUserFilter() != null)); filterContainer.add(checkUserFilter); - checkRoleFilter = new AjaxCheckBoxPanel("checkRoleFilter", "checkRoleFilter", - new Model<Boolean>(taskTO.getRoleFilter() != null)); - filterContainer.add(checkRoleFilter); + checkGroupFilter = new AjaxCheckBoxPanel("checkGroupFilter", "checkGroupFilter", + new Model<>(taskTO.getGroupFilter() != null)); + filterContainer.add(checkGroupFilter); userFilter = new UserSearchPanel.Builder("userFilter").fiql(taskTO.getUserFilter()).build(); userFilter.setEnabled(checkUserFilter.getModelObject()); filterContainer.add(userFilter); - roleFilter = new RoleSearchPanel.Builder("roleFilter").fiql(taskTO.getRoleFilter()).build(); - roleFilter.setEnabled(checkRoleFilter.getModelObject()); - filterContainer.add(roleFilter); + groupFilter = new GroupSearchPanel.Builder("groupFilter").fiql(taskTO.getGroupFilter()).build(); + groupFilter.setEnabled(checkGroupFilter.getModelObject()); + filterContainer.add(groupFilter); checkUserFilter.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { @@ -102,13 +102,13 @@ public class PushTaskModalPage extends AbstractSyncTaskModalPage { } }); - checkRoleFilter.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { + checkGroupFilter.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { private static final long serialVersionUID = -1107858522700306810L; @Override protected void onUpdate(final AjaxRequestTarget target) { - roleFilter.setEnabled(checkRoleFilter.getModelObject()); + groupFilter.setEnabled(checkGroupFilter.getModelObject()); target.add(filterContainer); } }); @@ -129,7 +129,7 @@ public class PushTaskModalPage extends AbstractSyncTaskModalPage { private void setFilters(final PushTaskTO pushTaskTO) { // set user filter if enabled pushTaskTO.setUserFilter(checkUserFilter.getModelObject() ? userFilter.buildFIQL() : null); - // set role filter if enabled - pushTaskTO.setRoleFilter(checkRoleFilter.getModelObject() ? roleFilter.buildFIQL() : null); + // set group filter if enabled + pushTaskTO.setGroupFilter(checkGroupFilter.getModelObject() ? groupFilter.buildFIQL() : null); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java index e7155ca..36560b0 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java @@ -27,7 +27,7 @@ import java.util.Date; import java.util.List; import org.apache.commons.lang3.ArrayUtils; import org.apache.syncope.client.console.commons.Constants; -import org.apache.syncope.client.console.panels.RoleSearchPanel; +import org.apache.syncope.client.console.panels.GroupSearchPanel; import org.apache.syncope.client.console.panels.UserSearchPanel; import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton; import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel; @@ -278,8 +278,8 @@ public class ReportletConfModalPage extends BaseModalPage { fiql((String) wrapper.getPropertyValue(fieldName)).required(false).build(); // This is needed in order to manually update this.reportletConf with search panel selections panel.setDefaultModel(new Model<String>(fieldName)); - } else if (String.class.equals(field.getType()) && annotation != null && annotation.roleSearch()) { - panel = new RoleSearchPanel.Builder("value"). + } else if (String.class.equals(field.getType()) && annotation != null && annotation.groupSearch()) { + panel = new GroupSearchPanel.Builder("value"). fiql((String) wrapper.getPropertyValue(fieldName)).required(false).build(); // This is needed in order to manually update this.reportletConf with search panel selections panel.setDefaultModel(new Model<String>(fieldName)); @@ -305,16 +305,16 @@ public class ReportletConfModalPage extends BaseModalPage { choices = schemaRestClient.getVirSchemaNames(AttributableType.USER); break; - case RolePlainSchema: - choices = schemaRestClient.getPlainSchemaNames(AttributableType.ROLE); + case GroupPlainSchema: + choices = schemaRestClient.getPlainSchemaNames(AttributableType.GROUP); break; - case RoleDerivedSchema: - choices = schemaRestClient.getDerSchemaNames(AttributableType.ROLE); + case GroupDerivedSchema: + choices = schemaRestClient.getDerSchemaNames(AttributableType.GROUP); break; - case RoleVirtualSchema: - choices = schemaRestClient.getVirSchemaNames(AttributableType.ROLE); + case GroupVirtualSchema: + choices = schemaRestClient.getVirSchemaNames(AttributableType.GROUP); break; case MembershipPlainSchema: http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java index d6f69cf..0becc1a 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java @@ -76,7 +76,7 @@ public class ResourceModalPage extends BaseModalPage { // Resource mapping panels //-------------------------------- form.add(new ResourceMappingPanel("umapping", resourceTO, AttributableType.USER)); - form.add(new ResourceMappingPanel("rmapping", resourceTO, AttributableType.ROLE)); + form.add(new ResourceMappingPanel("gmapping", resourceTO, AttributableType.GROUP)); //-------------------------------- //-------------------------------- @@ -116,11 +116,11 @@ public class ResourceModalPage extends BaseModalPage { accountIdError = uAccountIdCount != 1; } - if (resourceTO.getRmapping() == null || resourceTO.getRmapping().getItems().isEmpty()) { - resourceTO.setRmapping(null); + if (resourceTO.getGmapping() == null || resourceTO.getGmapping().getItems().isEmpty()) { + resourceTO.setGmapping(null); } else { int rAccountIdCount = 0; - for (MappingItemTO item : resourceTO.getRmapping().getItems()) { + for (MappingItemTO item : resourceTO.getGmapping().getItems()) { if (item.isAccountid()) { rAccountIdCount++; } http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java index 0fabe59..542cc82 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java @@ -36,7 +36,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.LinkPanel; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.ConnInstanceTO; import org.apache.syncope.common.lib.to.ResourceTO; -import org.apache.syncope.common.lib.to.RoleTO; +import org.apache.syncope.common.lib.to.GroupTO; import org.apache.syncope.common.lib.to.UserTO; import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component; @@ -305,13 +305,13 @@ public class Resources extends BasePage { @Override public Page createPage() { return new ProvisioningModalPage<>( - getPageReference(), statusmodal, model.getObject(), RoleTO.class); + getPageReference(), statusmodal, model.getObject(), GroupTO.class); } }); statusmodal.show(target); } - }, ActionLink.ActionType.MANAGE_ROLES, "Resources"); + }, ActionLink.ActionType.MANAGE_GROUPS, "Resources"); panel.add(new ActionLink() { http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java index b6ecb9e..e5017e3 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java @@ -35,7 +35,7 @@ import org.apache.syncope.common.lib.to.AbstractSubjectTO; import org.apache.syncope.common.lib.to.AttrTO; import org.apache.syncope.common.lib.to.ConnObjectTO; import org.apache.syncope.common.lib.to.PropagationStatus; -import org.apache.syncope.common.lib.to.RoleTO; +import org.apache.syncope.common.lib.to.GroupTO; import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.types.PropagationTaskExecStatus; import org.apache.wicket.Component; @@ -56,7 +56,7 @@ import org.apache.wicket.model.ResourceModel; import org.apache.wicket.request.resource.ContextRelativeResource; /** - * Show user or role status after performing a successful operation. + * Show user or group status after performing a successful operation. */ public class ResultStatusModalPage extends BaseModalPage { @@ -133,8 +133,8 @@ public class ResultStatusModalPage extends BaseModalPage { fragment.add(new Label("info", ((subject instanceof UserTO) && ((UserTO) subject).getUsername() != null) ? ((UserTO) subject).getUsername() - : ((subject instanceof RoleTO) && ((RoleTO) subject).getName() != null) - ? ((RoleTO) subject).getName() + : ((subject instanceof GroupTO) && ((GroupTO) subject).getName() != null) + ? ((GroupTO) subject).getName() : String.valueOf(subject.getKey()))); final ListView<PropagationStatus> propRes = new ListView<PropagationStatus>("resources", @@ -376,8 +376,7 @@ public class ResultStatusModalPage extends BaseModalPage { private Fragment getStatusIcon(final String id, final String resourceName, final ConnObjectTO objectTO) { final Image image; final String alt, title; - switch (statusUtils.getStatusBean( - subject, resourceName, objectTO, this.subject instanceof RoleTO).getStatus()) { + switch (statusUtils.getStatusBean(subject, resourceName, objectTO, this.subject instanceof GroupTO).getStatus()) { case ACTIVE: image = new Image("status", http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleModalPage.java deleted file mode 100644 index 3cb9148..0000000 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleModalPage.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.client.console.pages; - -import java.util.ArrayList; -import java.util.List; -import org.apache.commons.lang3.SerializationUtils; -import org.apache.syncope.client.console.commons.Constants; -import org.apache.syncope.client.console.commons.Mode; -import org.apache.syncope.client.console.panels.RolePanel; -import org.apache.syncope.common.lib.AttributableOperations; -import org.apache.syncope.common.lib.mod.RoleMod; -import org.apache.syncope.common.lib.to.RoleTO; -import org.apache.wicket.PageReference; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.markup.html.form.AjaxButton; -import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy; -import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton; -import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.model.CompoundPropertyModel; -import org.apache.wicket.model.ResourceModel; - -/** - * Modal window with Role form. - */ -public class RoleModalPage extends BaseModalPage { - - private static final long serialVersionUID = -1732493223434085205L; - - protected final PageReference pageRef; - - protected final ModalWindow window; - - protected final Mode mode; - - protected final boolean createFlag; - - protected final RolePanel rolePanel; - - protected RoleTO originalRoleTO; - - public RoleModalPage(final PageReference pageRef, final ModalWindow window, final RoleTO roleTO) { - this(pageRef, window, roleTO, Mode.ADMIN); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - public RoleModalPage(final PageReference pageRef, final ModalWindow window, final RoleTO roleTO, final Mode mode) { - super(); - - this.pageRef = pageRef; - this.window = window; - this.mode = mode; - - this.createFlag = roleTO.getKey() == 0; - if (!createFlag) { - originalRoleTO = SerializationUtils.clone(roleTO); - } - - final Form<RoleTO> form = new Form<RoleTO>("roleForm"); - form.setMultiPart(true); - - add(new Label("displayName", roleTO.getKey() == 0 ? "" : roleTO.getDisplayName())); - - form.setModel(new CompoundPropertyModel<RoleTO>(roleTO)); - - this.rolePanel = new RolePanel.Builder("rolePanel").form(form).roleTO(roleTO). - roleModalPageMode(mode).pageRef(getPageReference()).build(); - form.add(rolePanel); - - final AjaxButton submit = new IndicatingAjaxButton(SUBMIT, new ResourceModel(SUBMIT)) { - - private static final long serialVersionUID = -958724007591692537L; - - @Override - protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) { - try { - submitAction(target, form); - - if (pageRef.getPage() instanceof BasePage) { - ((BasePage) pageRef.getPage()).setModalResult(true); - } - - closeAction(target, form); - } catch (Exception e) { - error(getString(Constants.ERROR) + ": " + e.getMessage()); - feedbackPanel.refresh(target); - } - } - - @Override - protected void onError(final AjaxRequestTarget target, final Form<?> form) { - feedbackPanel.refresh(target); - } - }; - form.add(submit); - form.setDefaultButton(submit); - - final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) { - - private static final long serialVersionUID = -958724007591692537L; - - @Override - protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) { - closeAction(target, form); - } - }; - cancel.setDefaultFormProcessing(false); - form.add(cancel); - - MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getEntitlement("Roles", - createFlag - ? "create" - : "update")); - - add(form); - } - - protected void submitAction(final AjaxRequestTarget target, final Form<?> form) { - final RoleTO roleTO = (RoleTO) form.getDefaultModelObject(); - final List<String> entitlementList = new ArrayList<String>(rolePanel.getSelectedEntitlements()); - roleTO.getEntitlements().clear(); - roleTO.getEntitlements().addAll(entitlementList); - - RoleTO result; - if (createFlag) { - result = roleRestClient.create(roleTO); - } else { - RoleMod roleMod = AttributableOperations.diff(roleTO, originalRoleTO); - - // update role just if it is changed - if (roleMod.isEmpty()) { - result = roleTO; - } else { - result = roleRestClient.update(originalRoleTO.getETagValue(), roleMod); - } - } - - setResponsePage(new ResultStatusModalPage.Builder(window, result).build()); - } - - protected void closeAction(final AjaxRequestTarget target, final Form<?> form) { - window.close(target); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleSelectModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleSelectModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleSelectModalPage.java deleted file mode 100644 index 26b1aea..0000000 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleSelectModalPage.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.client.console.pages; - -import java.lang.reflect.Constructor; -import javax.swing.tree.DefaultMutableTreeNode; -import org.apache.syncope.client.console.commons.RoleTreeBuilder; -import org.apache.syncope.client.console.wicket.markup.html.tree.DefaultMutableTreeNodeExpansion; -import org.apache.syncope.client.console.wicket.markup.html.tree.DefaultMutableTreeNodeExpansionModel; -import org.apache.syncope.client.console.wicket.markup.html.tree.TreeRoleProvider; -import org.apache.syncope.common.lib.to.RoleTO; -import org.apache.wicket.Component; -import org.apache.wicket.PageReference; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.event.Broadcast; -import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; -import org.apache.wicket.extensions.markup.html.repeater.tree.DefaultNestedTree; -import org.apache.wicket.extensions.markup.html.repeater.tree.ITreeProvider; -import org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree; -import org.apache.wicket.extensions.markup.html.repeater.tree.content.Folder; -import org.apache.wicket.extensions.markup.html.repeater.tree.theme.WindowsTheme; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; -import org.apache.wicket.spring.injection.annot.SpringBean; - -public class RoleSelectModalPage extends BaseModalPage { - - private static final long serialVersionUID = 2106489458494696439L; - - @SpringBean - private RoleTreeBuilder roleTreeBuilder; - - private final NestedTree<DefaultMutableTreeNode> tree; - - public RoleSelectModalPage(final PageReference pageRef, final ModalWindow window, final Class<?> payloadClass) { - super(); - - final ITreeProvider<DefaultMutableTreeNode> treeProvider = new TreeRoleProvider(roleTreeBuilder, true); - final DefaultMutableTreeNodeExpansionModel treeModel = new DefaultMutableTreeNodeExpansionModel(); - - tree = new DefaultNestedTree<DefaultMutableTreeNode>("treeTable", treeProvider, treeModel) { - - private static final long serialVersionUID = 7137658050662575546L; - - @Override - protected Component newContentComponent(final String id, final IModel<DefaultMutableTreeNode> node) { - final DefaultMutableTreeNode treeNode = node.getObject(); - final RoleTO roleTO = (RoleTO) treeNode.getUserObject(); - - return new Folder<DefaultMutableTreeNode>(id, RoleSelectModalPage.this.tree, node) { - - private static final long serialVersionUID = 9046323319920426493L; - - @Override - protected boolean isClickable() { - return true; - } - - @Override - protected IModel<?> newLabelModel(final IModel<DefaultMutableTreeNode> model) { - return new Model<>(roleTO.getDisplayName()); - } - - @Override - protected void onClick(final AjaxRequestTarget target) { - super.onClick(target); - - try { - Constructor<?> constructor = payloadClass.getConstructor(Long.class); - Object payload = constructor.newInstance(roleTO.getKey()); - - send(pageRef.getPage(), Broadcast.BREADTH, payload); - } catch (Exception e) { - LOG.error("Could not send role select event", e); - } - - window.close(target); - } - }; - } - }; - tree.add(new WindowsTheme()); - tree.setOutputMarkupId(true); - - DefaultMutableTreeNodeExpansion.get().expandAll(); - - this.add(tree); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleTemplateModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleTemplateModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleTemplateModalPage.java deleted file mode 100644 index 6639517..0000000 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleTemplateModalPage.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.client.console.pages; - -import org.apache.syncope.client.console.commons.Mode; -import org.apache.syncope.common.lib.to.RoleTO; -import org.apache.syncope.common.lib.to.SyncTaskTO; -import org.apache.wicket.PageReference; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; -import org.apache.wicket.markup.html.form.Form; - -public class RoleTemplateModalPage extends RoleModalPage { - - private static final long serialVersionUID = -3849135555203409845L; - - private final SyncTaskTO syncTaskTO; - - public RoleTemplateModalPage(final PageReference callerPageRef, final ModalWindow window, - final SyncTaskTO syncTaskTO) { - - super(callerPageRef, window, syncTaskTO.getRoleTemplate() == null - ? new RoleTO() - : syncTaskTO.getRoleTemplate(), Mode.TEMPLATE); - - this.syncTaskTO = syncTaskTO; - } - - @Override - protected void submitAction(final AjaxRequestTarget target, final Form form) { - syncTaskTO.setRoleTemplate((RoleTO) form.getModelObject()); - taskRestClient.updateSyncTask(syncTaskTO); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java deleted file mode 100644 index 8310792..0000000 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.client.console.pages; - -import org.apache.syncope.client.console.commons.Constants; -import org.apache.syncope.client.console.panels.AbstractSearchResultPanel; -import org.apache.syncope.client.console.panels.RoleSearchPanel; -import org.apache.syncope.client.console.panels.RoleSearchResultPanel; -import org.apache.syncope.client.console.panels.RoleSummaryPanel; -import org.apache.syncope.client.console.rest.RoleRestClient; -import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton; -import org.apache.syncope.client.console.wicket.markup.html.tree.TreeRolePanel; -import org.apache.wicket.Session; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.event.Broadcast; -import org.apache.wicket.event.IEvent; -import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.model.ResourceModel; -import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.apache.wicket.spring.injection.annot.SpringBean; - -/** - * Roles WebPage. - */ -public class Roles extends BasePage { - - private static final long serialVersionUID = -2147758241610831969L; - - private static final int WIN_HEIGHT = 500; - - private static final int WIN_WIDTH = 800; - - @SpringBean - private RoleRestClient restClient; - - private final ModalWindow editRoleWin; - - private final WebMarkupContainer roleTabsContainer; - - public Roles(final PageParameters parameters) { - super(parameters); - - roleTabsContainer = new WebMarkupContainer("roleTabsContainer"); - roleTabsContainer.setOutputMarkupId(true); - add(roleTabsContainer); - - editRoleWin = new ModalWindow("editRoleWin"); - editRoleWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY); - editRoleWin.setInitialHeight(WIN_HEIGHT); - editRoleWin.setInitialWidth(WIN_WIDTH); - editRoleWin.setCookieName("edit-role-modal"); - add(editRoleWin); - - final TreeRolePanel treePanel = new TreeRolePanel("treePanel"); - treePanel.setOutputMarkupId(true); - roleTabsContainer.add(treePanel); - - final RoleSummaryPanel summaryPanel = new RoleSummaryPanel.Builder("summaryPanel") - .window(editRoleWin).callerPageRef(Roles.this.getPageReference()).build(); - roleTabsContainer.add(summaryPanel); - - editRoleWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { - - private static final long serialVersionUID = 8804221891699487139L; - - @Override - public void onClose(final AjaxRequestTarget target) { - final RoleSummaryPanel summaryPanel = (RoleSummaryPanel) roleTabsContainer.get("summaryPanel"); - - final TreeNodeClickUpdate data = new TreeNodeClickUpdate(target, - summaryPanel == null || summaryPanel.getSelectedNode() == null - ? 0 - : summaryPanel.getSelectedNode().getKey()); - - send(getPage(), Broadcast.BREADTH, data); - - if (modalResult) { - getSession().info(getString(Constants.OPERATION_SUCCEEDED)); - feedbackPanel.refresh(target); - modalResult = false; - } - - } - }); - - final AbstractSearchResultPanel searchResult = - new RoleSearchResultPanel("searchResult", true, null, getPageReference(), restClient); - add(searchResult); - - final Form searchForm = new Form("searchForm"); - add(searchForm); - - final RoleSearchPanel searchPanel = new RoleSearchPanel.Builder("searchPanel").build(); - searchForm.add(searchPanel); - - searchForm.add(new ClearIndicatingAjaxButton("search", new ResourceModel("search"), getPageReference()) { - - private static final long serialVersionUID = -958724007591692537L; - - @Override - protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) { - final String fiql = searchPanel.buildFIQL(); - LOG.debug("Node condition {}", fiql); - - doSearch(target, fiql, searchResult); - - Session.get().getFeedbackMessages().clear(); - searchPanel.getSearchFeedback().refresh(target); - } - - @Override - protected void onError(final AjaxRequestTarget target, final Form<?> form) { - searchPanel.getSearchFeedback().refresh(target); - } - }); - } - - private void doSearch(final AjaxRequestTarget target, final String fiql, - final AbstractSearchResultPanel resultsetPanel) { - - if (fiql == null) { - error(getString(Constants.SEARCH_ERROR)); - return; - } - - resultsetPanel.search(fiql, target); - } - - @Override - public void onEvent(final IEvent<?> event) { - super.onEvent(event); - - if (event.getPayload() instanceof TreeNodeClickUpdate) { - final TreeNodeClickUpdate update = (TreeNodeClickUpdate) event.getPayload(); - - final RoleSummaryPanel summaryPanel = new RoleSummaryPanel.Builder("summaryPanel") - .window(editRoleWin).callerPageRef(Roles.this.getPageReference()) - .selectedNodeId(update.getSelectedNodeId()).build(); - - roleTabsContainer.addOrReplace(summaryPanel); - update.getTarget().add(roleTabsContainer); - } - } - - public static class TreeNodeClickUpdate { - - private final AjaxRequestTarget target; - - private Long selectedNodeId; - - public TreeNodeClickUpdate(final AjaxRequestTarget target, final Long selectedNodeId) { - this.target = target; - this.selectedNodeId = selectedNodeId; - } - - public AjaxRequestTarget getTarget() { - return target; - } - - public Long getSelectedNodeId() { - return selectedNodeId; - } - - public void setSelectedNodeId(final Long selectedNodeId) { - this.selectedNodeId = selectedNodeId; - } - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java index c47edcd..9bfba54 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java @@ -104,23 +104,23 @@ public class Schema extends BasePage { put(new SimpleEntry<>(AttributableType.CONFIGURATION, SchemaType.PLAIN), Constants.PREF_CONF_SCHEMA_PAGINATOR_ROWS); put(new SimpleEntry<>(AttributableType.USER, SchemaType.PLAIN), - Constants.PREF_USER_SCHEMA_PAGINATOR_ROWS); + Constants.PREF_USER_PLAIN_SCHEMA_PAGINATOR_ROWS); put(new SimpleEntry<>(AttributableType.USER, SchemaType.DERIVED), Constants.PREF_USER_DER_SCHEMA_PAGINATOR_ROWS); put(new SimpleEntry<>(AttributableType.USER, SchemaType.VIRTUAL), Constants.PREF_USER_VIR_SCHEMA_PAGINATOR_ROWS); put(new SimpleEntry<>(AttributableType.MEMBERSHIP, SchemaType.PLAIN), - Constants.PREF_MEMBERSHIP_SCHEMA_PAGINATOR_ROWS); + Constants.PREF_MEMBERSHIP_PLAIN_SCHEMA_PAGINATOR_ROWS); put(new SimpleEntry<>(AttributableType.MEMBERSHIP, SchemaType.DERIVED), Constants.PREF_MEMBERSHIP_DER_SCHEMA_PAGINATOR_ROWS); put(new SimpleEntry<>(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL), Constants.PREF_MEMBERSHIP_VIR_SCHEMA_PAGINATOR_ROWS); - put(new SimpleEntry<>(AttributableType.ROLE, SchemaType.PLAIN), - Constants.PREF_ROLE_SCHEMA_PAGINATOR_ROWS); - put(new SimpleEntry<>(AttributableType.ROLE, SchemaType.DERIVED), - Constants.PREF_ROLE_DER_SCHEMA_PAGINATOR_ROWS); - put(new SimpleEntry<>(AttributableType.ROLE, SchemaType.VIRTUAL), - Constants.PREF_ROLE_VIR_SCHEMA_PAGINATOR_ROWS); + put(new SimpleEntry<>(AttributableType.GROUP, SchemaType.PLAIN), + Constants.PREF_GROUP_PLAIN_SCHEMA_PAGINATOR_ROWS); + put(new SimpleEntry<>(AttributableType.GROUP, SchemaType.DERIVED), + Constants.PREF_GROUP_DER_SCHEMA_PAGINATOR_ROWS); + put(new SimpleEntry<>(AttributableType.GROUP, SchemaType.VIRTUAL), + Constants.PREF_GROUP_VIR_SCHEMA_PAGINATOR_ROWS); } }; http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java index 9d0ede2..cab0e04 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java @@ -36,7 +36,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPan import org.apache.syncope.common.lib.to.AbstractSubjectTO; import org.apache.syncope.common.lib.to.BulkActionResult; import org.apache.syncope.common.lib.to.ResourceTO; -import org.apache.syncope.common.lib.to.RoleTO; +import org.apache.syncope.common.lib.to.GroupTO; import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.types.ResourceAssociationActionType; import org.apache.wicket.PageReference; @@ -117,10 +117,10 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus this.statusOnly = statusOnly; this.subjectTO = subjectTO; - statusUtils = new StatusUtils(subjectTO instanceof UserTO ? userRestClient : roleRestClient); + statusUtils = new StatusUtils(subjectTO instanceof UserTO ? userRestClient : groupRestClient); add(new Label("displayName", subjectTO.getKey() + " " - + (subjectTO instanceof UserTO ? ((UserTO) subjectTO).getUsername() : ((RoleTO) subjectTO).getName()))); + + (subjectTO instanceof UserTO ? ((UserTO) subjectTO).getUsername() : ((GroupTO) subjectTO).getName()))); columns = new ArrayList<>(); columns.add(new AbstractColumn<StatusBean, String>( @@ -194,7 +194,7 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus }; table.setOutputMarkupId(true); - final String pageId = subjectTO instanceof RoleTO ? "Roles" : "Users"; + final String pageId = subjectTO instanceof GroupTO ? "Groups" : "Users"; final Fragment pwdMgtFragment = new Fragment("pwdMgtFields", "pwdMgtFragment", this); addOrReplace(pwdMgtFragment); @@ -316,7 +316,7 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus subjectTO.getKey(), new ArrayList<>(table.getModelObject())); } else { - roleRestClient.unlink( + groupRestClient.unlink( subjectTO.getETagValue(), subjectTO.getKey(), new ArrayList<>(table.getModelObject())); @@ -345,7 +345,7 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus subjectTO.getKey(), new ArrayList<>(table.getModelObject())); } else { - roleRestClient.link( + groupRestClient.link( subjectTO.getETagValue(), subjectTO.getKey(), new ArrayList<>(table.getModelObject())); @@ -375,7 +375,7 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus subjectTO.getKey(), new ArrayList<>(table.getModelObject())); } else { - bulkActionResult = roleRestClient.deprovision( + bulkActionResult = groupRestClient.deprovision( subjectTO.getETagValue(), subjectTO.getKey(), new ArrayList<>(table.getModelObject())); @@ -403,7 +403,7 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus target, ResourceAssociationActionType.PROVISION, table.getModelObject()); } else { try { - final BulkActionResult bulkActionResult = roleRestClient.provision( + final BulkActionResult bulkActionResult = groupRestClient.provision( subjectTO.getETagValue(), subjectTO.getKey(), new ArrayList<>(table.getModelObject())); @@ -433,7 +433,7 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus subjectTO.getKey(), new ArrayList<>(table.getModelObject())); } else { - bulkActionResult = roleRestClient.unassign( + bulkActionResult = groupRestClient.unassign( subjectTO.getETagValue(), subjectTO.getKey(), new ArrayList<>(table.getModelObject())); @@ -460,7 +460,7 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus target, ResourceAssociationActionType.ASSIGN, table.getModelObject()); } else { try { - final BulkActionResult bulkActionResult = roleRestClient.assign( + final BulkActionResult bulkActionResult = groupRestClient.assign( subjectTO.getETagValue(), subjectTO.getKey(), new ArrayList<>(table.getModelObject())); @@ -502,11 +502,10 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size() + 1); for (ConnObjectWrapper entry : connObjects) { - final StatusBean statusBean = statusUtils.getStatusBean( - subjectTO, + final StatusBean statusBean = statusUtils.getStatusBean(subjectTO, entry.getResourceName(), entry.getConnObjectTO(), - subjectTO instanceof RoleTO); + subjectTO instanceof GroupTO); statusBeans.add(statusBean); resources.remove(entry.getResourceName()); @@ -530,11 +529,10 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus statusBeans.add(syncope); } else { for (String resource : resources) { - final StatusBean statusBean = statusUtils.getStatusBean( - subjectTO, + final StatusBean statusBean = statusUtils.getStatusBean(subjectTO, resource, null, - subjectTO instanceof RoleTO); + subjectTO instanceof GroupTO); statusBean.setLinked(false); statusBeans.add(statusBean); @@ -625,11 +623,10 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size()); for (ConnObjectWrapper entry : connObjects) { - final StatusBean statusBean = statusUtils.getStatusBean( - subjectTO, + final StatusBean statusBean = statusUtils.getStatusBean(subjectTO, entry.getResourceName(), entry.getConnObjectTO(), - subjectTO instanceof RoleTO); + subjectTO instanceof GroupTO); statusBeans.add(statusBean); } http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java index 0215538..0835ca2 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java @@ -156,7 +156,7 @@ public abstract class UserModalPage extends BaseModalPage { //-------------------------------- //-------------------------------- - // Roles panel + // Groups panel //-------------------------------- form.add(new MembershipsPanel("memberships", userTO, mode, null, getPageReference())); //-------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java index d610739..ba4411e 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java @@ -31,10 +31,10 @@ import org.apache.cxf.jaxrs.ext.search.fiql.FiqlParser; import org.apache.syncope.client.console.rest.AuthRestClient; import org.apache.syncope.client.console.rest.ResourceRestClient; import org.apache.syncope.client.console.rest.SchemaRestClient; -import org.apache.syncope.common.lib.search.RoleFiqlSearchConditionBuilder; +import org.apache.syncope.common.lib.search.GroupFiqlSearchConditionBuilder; import org.apache.syncope.common.lib.search.SearchableFields; import org.apache.syncope.common.lib.search.SpecialAttr; -import org.apache.syncope.common.lib.search.SyncopeFiqlSearchConditionBuilder; +import org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder; import org.apache.syncope.common.lib.search.SyncopeProperty; import org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder; import org.apache.syncope.common.lib.to.ResourceTO; @@ -78,7 +78,7 @@ public abstract class AbstractSearchPanel extends Panel { protected IModel<List<SearchClause.Type>> types; - protected IModel<List<String>> roleNames; + protected IModel<List<String>> groupNames; protected NotificationPanel searchFeedback; @@ -136,7 +136,7 @@ public abstract class AbstractSearchPanel extends Panel { if (StringUtils.isNotBlank(fiql)) { try { FiqlParser<SearchBean> fiqlParser = new FiqlParser<>( - SearchBean.class, SyncopeFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); + SearchBean.class, AbstractFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES); List<SearchClause> parsed = getSearchClauses(fiqlParser.parse(fiql)); this.searchClauses.clear(); @@ -147,7 +147,7 @@ public abstract class AbstractSearchPanel extends Panel { } searchFormContainer.add(new SearchView("searchView", searchClauses, searchFormContainer, required, - types, anames, dnames, roleNames, resourceNames, entitlements)); + types, anames, dnames, groupNames, resourceNames, entitlements)); add(searchFormContainer); } @@ -159,7 +159,7 @@ public abstract class AbstractSearchPanel extends Panel { @Override protected List<String> load() { return SearchableFields.get( - attributableType == AttributableType.USER ? SubjectType.USER : SubjectType.ROLE); + attributableType == AttributableType.USER ? SubjectType.USER : SubjectType.GROUP); } }; @@ -216,9 +216,9 @@ public abstract class AbstractSearchPanel extends Panel { String value = sc.getCondition().get(property); searchClause.setValue(value); - if (SpecialAttr.ROLES.toString().equals(property)) { + if (SpecialAttr.GROUPS.toString().equals(property)) { searchClause.setType(SearchClause.Type.MEMBERSHIP); - for (String label : roleNames.getObject()) { + for (String label : groupNames.getObject()) { if (value.equals(label.substring(0, label.indexOf(' ')))) { searchClause.setProperty(label); } @@ -298,7 +298,7 @@ public abstract class AbstractSearchPanel extends Panel { return clauses; } - protected abstract SyncopeFiqlSearchConditionBuilder getSearchConditionBuilder(); + protected abstract AbstractFiqlSearchConditionBuilder getSearchConditionBuilder(); public String buildFIQL() { LOG.debug("Generating FIQL from List<SearchClause>: {}", searchClauses); @@ -307,7 +307,7 @@ public abstract class AbstractSearchPanel extends Panel { return StringUtils.EMPTY; } - SyncopeFiqlSearchConditionBuilder builder = getSearchConditionBuilder(); + AbstractFiqlSearchConditionBuilder builder = getSearchConditionBuilder(); CompleteCondition prevCondition; CompleteCondition condition = null; @@ -317,17 +317,17 @@ public abstract class AbstractSearchPanel extends Panel { switch (searchClauses.get(i).getType()) { case ENTITLEMENT: condition = searchClauses.get(i).getComparator() == SearchClause.Comparator.EQUALS - ? ((RoleFiqlSearchConditionBuilder) builder). + ? ((GroupFiqlSearchConditionBuilder) builder). hasEntitlements(searchClauses.get(i).getProperty()) - : ((RoleFiqlSearchConditionBuilder) builder). + : ((GroupFiqlSearchConditionBuilder) builder). hasNotEntitlements(searchClauses.get(i).getProperty()); break; case MEMBERSHIP: - Long roleId = NumberUtils.toLong(searchClauses.get(i).getProperty().split(" ")[0]); + Long groupId = NumberUtils.toLong(searchClauses.get(i).getProperty().split(" ")[0]); condition = searchClauses.get(i).getComparator() == SearchClause.Comparator.EQUALS - ? ((UserFiqlSearchConditionBuilder) builder).hasRoles(roleId) - : ((UserFiqlSearchConditionBuilder) builder).hasNotRoles(roleId); + ? ((UserFiqlSearchConditionBuilder) builder).inGroups(groupId) + : ((UserFiqlSearchConditionBuilder) builder).notInGroups(groupId); break; case RESOURCE: http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java index 1601ca7..98ada28 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java @@ -25,7 +25,7 @@ import org.apache.syncope.client.console.commons.Constants; import org.apache.syncope.client.console.commons.SelectChoiceRenderer; import org.apache.syncope.client.console.rest.SchemaRestClient; import org.apache.syncope.client.console.wicket.markup.html.form.NonI18nPalette; -import org.apache.syncope.common.lib.to.RoleTO; +import org.apache.syncope.common.lib.to.GroupTO; import org.apache.syncope.common.lib.types.AttributableType; import org.apache.syncope.common.lib.types.SchemaType; import org.apache.wicket.ajax.AjaxRequestTarget; @@ -41,9 +41,9 @@ public class AttrTemplatesPanel extends Panel { public enum Type { - rPlainAttrTemplates, - rDerAttrTemplates, - rVirAttrTemplates, + gPlainAttrTemplates, + gDerAttrTemplates, + gVirAttrTemplates, mPlainAttrTemplates, mDerAttrTemplates, mVirAttrTemplates; @@ -55,7 +55,7 @@ public class AttrTemplatesPanel extends Panel { @SpringBean private SchemaRestClient schemaRestClient; - private final RoleTO roleTO; + private final GroupTO groupTO; private final NonI18nPalette<String> rPlainAttrTemplates; @@ -63,18 +63,18 @@ public class AttrTemplatesPanel extends Panel { private final NonI18nPalette<String> rVirAttrTemplates; - public AttrTemplatesPanel(final String id, final RoleTO roleTO) { + public AttrTemplatesPanel(final String id, final GroupTO groupTO) { super(id); - this.roleTO = roleTO; + this.groupTO = groupTO; - rPlainAttrTemplates = buildPalette(Type.rPlainAttrTemplates, - schemaRestClient.getSchemaNames(AttributableType.ROLE, SchemaType.PLAIN)); + rPlainAttrTemplates = buildPalette(Type.gPlainAttrTemplates, + schemaRestClient.getSchemaNames(AttributableType.GROUP, SchemaType.PLAIN)); this.add(rPlainAttrTemplates); - rDerAttrTemplates = buildPalette(Type.rDerAttrTemplates, - schemaRestClient.getSchemaNames(AttributableType.ROLE, SchemaType.DERIVED)); + rDerAttrTemplates = buildPalette(Type.gDerAttrTemplates, + schemaRestClient.getSchemaNames(AttributableType.GROUP, SchemaType.DERIVED)); this.add(rDerAttrTemplates); - rVirAttrTemplates = buildPalette(Type.rVirAttrTemplates, - schemaRestClient.getSchemaNames(AttributableType.ROLE, SchemaType.VIRTUAL)); + rVirAttrTemplates = buildPalette(Type.gVirAttrTemplates, + schemaRestClient.getSchemaNames(AttributableType.GROUP, SchemaType.VIRTUAL)); this.add(rVirAttrTemplates); this.add(buildPalette(Type.mPlainAttrTemplates, @@ -91,7 +91,7 @@ public class AttrTemplatesPanel extends Panel { } ListModel<String> availableSchemas = new ListModel<>(allSchemas); - return new NonI18nPalette<String>(type.name(), new PropertyModel<List<String>>(roleTO, type.name()), + return new NonI18nPalette<String>(type.name(), new PropertyModel<List<String>>(groupTO, type.name()), availableSchemas, new SelectChoiceRenderer<String>(), 8, false, true) { private static final long serialVersionUID = 2295567122085510330L; @@ -101,16 +101,16 @@ public class AttrTemplatesPanel extends Panel { final Recorder<String> recorder = super.newRecorderComponent(); switch (type) { - case rPlainAttrTemplates: - case rDerAttrTemplates: - case rVirAttrTemplates: + case gPlainAttrTemplates: + case gDerAttrTemplates: + case gVirAttrTemplates: recorder.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { private static final long serialVersionUID = -1107858522700306810L; @Override protected void onUpdate(final AjaxRequestTarget target) { - send(getPage(), Broadcast.BREADTH, new RoleAttrTemplatesChange(type, target)); + send(getPage(), Broadcast.BREADTH, new GroupAttrTemplatesChange(type, target)); } }); break; @@ -126,15 +126,15 @@ public class AttrTemplatesPanel extends Panel { public Collection<String> getSelected(final Type type) { Collection<String> selected; switch (type) { - case rPlainAttrTemplates: + case gPlainAttrTemplates: selected = this.rPlainAttrTemplates.getModelCollection(); break; - case rDerAttrTemplates: + case gDerAttrTemplates: selected = this.rDerAttrTemplates.getModelCollection(); break; - case rVirAttrTemplates: + case gVirAttrTemplates: selected = this.rVirAttrTemplates.getModelCollection(); break; @@ -145,13 +145,13 @@ public class AttrTemplatesPanel extends Panel { return selected; } - public static class RoleAttrTemplatesChange { + public static class GroupAttrTemplatesChange { private final Type type; private final AjaxRequestTarget target; - public RoleAttrTemplatesChange(final Type type, final AjaxRequestTarget target) { + public GroupAttrTemplatesChange(final Type type, final AjaxRequestTarget target) { this.type = type; this.target = target; } http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/client/console/src/main/java/org/apache/syncope/client/console/panels/DerAttrsPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/DerAttrsPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/DerAttrsPanel.java index d68038f..c8872b5 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/DerAttrsPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/DerAttrsPanel.java @@ -21,14 +21,14 @@ package org.apache.syncope.client.console.panels; import java.util.ArrayList; import java.util.List; import org.apache.syncope.client.console.commons.Constants; -import org.apache.syncope.client.console.panels.AttrTemplatesPanel.RoleAttrTemplatesChange; -import org.apache.syncope.client.console.rest.RoleRestClient; +import org.apache.syncope.client.console.panels.AttrTemplatesPanel.GroupAttrTemplatesChange; +import org.apache.syncope.client.console.rest.GroupRestClient; import org.apache.syncope.client.console.rest.SchemaRestClient; import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDecoratedCheckbox; import org.apache.syncope.common.lib.to.AbstractAttributableTO; import org.apache.syncope.common.lib.to.AttrTO; import org.apache.syncope.common.lib.to.MembershipTO; -import org.apache.syncope.common.lib.to.RoleTO; +import org.apache.syncope.common.lib.to.GroupTO; import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.types.AttributableType; import org.apache.wicket.Component; @@ -62,7 +62,7 @@ public class DerAttrsPanel extends Panel { private SchemaRestClient schemaRestClient; @SpringBean - private RoleRestClient roleRestClient; + private GroupRestClient groupRestClient; private final AttrTemplatesPanel attrTemplates; @@ -85,22 +85,22 @@ public class DerAttrsPanel extends Panel { protected List<String> load() { List<String> derSchemaNames; - if (entityTO instanceof RoleTO) { - final RoleTO roleTO = (RoleTO) entityTO; + if (entityTO instanceof GroupTO) { + final GroupTO groupTO = (GroupTO) entityTO; if (attrTemplates == null) { - derSchemaNames = roleTO.getRDerAttrTemplates(); + derSchemaNames = groupTO.getGDerAttrTemplates(); } else { derSchemaNames = new ArrayList<>( - attrTemplates.getSelected(AttrTemplatesPanel.Type.rDerAttrTemplates)); - if (roleTO.isInheritTemplates() && roleTO.getParent() != 0) { - derSchemaNames.addAll(roleRestClient.read(roleTO.getParent()).getRDerAttrTemplates()); + attrTemplates.getSelected(AttrTemplatesPanel.Type.gDerAttrTemplates)); + if (groupTO.isInheritTemplates() && groupTO.getParent() != 0) { + derSchemaNames.addAll(groupRestClient.read(groupTO.getParent()).getGDerAttrTemplates()); } } } else if (entityTO instanceof UserTO) { derSchemaNames = schemaRestClient.getDerSchemaNames(AttributableType.USER); } else { - derSchemaNames = roleRestClient.read(((MembershipTO) entityTO).getRoleId()).getMDerAttrTemplates(); + derSchemaNames = groupRestClient.read(((MembershipTO) entityTO).getGroupId()).getMDerAttrTemplates(); } return derSchemaNames; @@ -196,9 +196,9 @@ public class DerAttrsPanel extends Panel { @Override public void onEvent(final IEvent<?> event) { - if ((event.getPayload() instanceof RoleAttrTemplatesChange)) { - final RoleAttrTemplatesChange update = (RoleAttrTemplatesChange) event.getPayload(); - if (attrTemplates != null && update.getType() == AttrTemplatesPanel.Type.rDerAttrTemplates) { + if ((event.getPayload() instanceof GroupAttrTemplatesChange)) { + final GroupAttrTemplatesChange update = (GroupAttrTemplatesChange) event.getPayload(); + if (attrTemplates != null && update.getType() == AttrTemplatesPanel.Type.gDerAttrTemplates) { update.getTarget().add(this); } }
