syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1558319 [2/2] - in /syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console: commons/ pages/ pages/panels/
Date Wed, 15 Jan 2014 08:33:01 GMT
Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/MembershipsPanel.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/MembershipsPanel.java?rev=1558319&r1=1558318&r2=1558319&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/MembershipsPanel.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/MembershipsPanel.java
Wed Jan 15 08:33:00 2014
@@ -23,6 +23,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import javax.swing.tree.DefaultMutableTreeNode;
+import org.apache.syncope.console.commons.PageUtils;
 import org.apache.syncope.common.to.MembershipTO;
 import org.apache.syncope.common.to.RoleTO;
 import org.apache.syncope.common.to.UserTO;
@@ -122,7 +123,7 @@ public class MembershipsPanel extends Pa
 
                             @Override
                             public Page createPage() {
-                                PageReference pageRef = getPage().getPageReference();
+                                PageReference pageRef = PageUtils.getPageReference(getPage());
 
                                 for (MembershipTO membTO : membView.getList()) {
                                     if (membTO.getRoleId() == roleTO.getId()) {
@@ -151,67 +152,68 @@ public class MembershipsPanel extends Pa
         membView = new ListView<MembershipTO>("memberships",
                 new PropertyModel<List<? extends MembershipTO>>(userTO, "memberships"))
{
 
-            private static final long serialVersionUID = 9101744072914090143L;
+                    private static final long serialVersionUID = 9101744072914090143L;
 
-            @Override
-            protected void populateItem(final ListItem<MembershipTO> item) {
-                final MembershipTO membershipTO = (MembershipTO) item.getDefaultModelObject();
+                    @Override
+                    protected void populateItem(final ListItem<MembershipTO> item)
{
+                        final MembershipTO membershipTO = (MembershipTO) item.getDefaultModelObject();
 
-                item.add(new Label("roleId", new Model<Long>(membershipTO.getRoleId())));
-                item.add(new Label("roleName", new Model<String>(membershipTO.getRoleName())));
+                        item.add(new Label("roleId", new Model<Long>(membershipTO.getRoleId())));
+                        item.add(new Label("roleName", new Model<String>(membershipTO.getRoleName())));
 
-                AjaxLink editLink = new ClearIndicatingAjaxLink("editLink", pageRef) {
+                        AjaxLink editLink = new ClearIndicatingAjaxLink("editLink", pageRef)
{
 
-                    private static final long serialVersionUID = -7978723352517770644L;
+                            private static final long serialVersionUID = -7978723352517770644L;
 
-                    @Override
-                    protected void onClickInternal(final AjaxRequestTarget target) {
-                        membWin.setPageCreator(new ModalWindow.PageCreator() {
+                            @Override
+                            protected void onClickInternal(final AjaxRequestTarget target)
{
+                                membWin.setPageCreator(new ModalWindow.PageCreator() {
 
-                            private static final long serialVersionUID = -7834632442532690940L;
+                                    private static final long serialVersionUID = -7834632442532690940L;
 
-                            @Override
-                            public Page createPage() {
-                                return new MembershipModalPage(getPage().getPageReference(),
membWin,
-                                        membershipTO, templateMode);
+                                    @Override
+                                    public Page createPage() {
+                                        return new MembershipModalPage(PageUtils.getPageReference(getPage()),
membWin,
+                                                membershipTO, templateMode);
 
+                                    }
+                                });
+                                membWin.show(target);
                             }
-                        });
-                        membWin.show(target);
-                    }
-                };
-                item.add(editLink);
+                        };
+                        item.add(editLink);
 
-                AjaxLink deleteLink = new IndicatingDeleteOnConfirmAjaxLink("deleteLink",
pageRef) {
+                        AjaxLink deleteLink = new IndicatingDeleteOnConfirmAjaxLink("deleteLink",
pageRef) {
 
-                    private static final long serialVersionUID = -7978723352517770644L;
+                            private static final long serialVersionUID = -7978723352517770644L;
 
-                    @Override
-                    protected void onClickInternal(final AjaxRequestTarget target) {
-                        userTO.removeMembership(membershipTO);
-                        target.add(membershipsContainer);
+                            @Override
+                            protected void onClickInternal(final AjaxRequestTarget target)
{
+                                userTO.removeMembership(membershipTO);
+                                target.add(membershipsContainer);
 
-                        RoleTO roleTO = RoleUtils.findRole(roleTreeBuilder, membershipTO.getRoleId());
-                        Set<String> resourcesToRemove = roleTO == null
+                                RoleTO roleTO = RoleUtils.findRole(roleTreeBuilder, membershipTO.getRoleId());
+                                Set<String> resourcesToRemove = roleTO == null
                                 ? Collections.<String>emptySet() : roleTO.getResources();
-                        if (!resourcesToRemove.isEmpty()) {
-                            Set<String> resourcesAssignedViaMembership = new HashSet<String>();
-                            for (MembershipTO membTO : userTO.getMemberships()) {
-                                roleTO = RoleUtils.findRole(roleTreeBuilder, membTO.getRoleId());
-                                if (roleTO != null) {
-                                    resourcesAssignedViaMembership.addAll(roleTO.getResources());
+                                if (!resourcesToRemove.isEmpty()) {
+                                    Set<String> resourcesAssignedViaMembership = new
HashSet<String>();
+                                    for (MembershipTO membTO : userTO.getMemberships()) {
+                                        roleTO = RoleUtils.findRole(roleTreeBuilder, membTO.getRoleId());
+                                        if (roleTO != null) {
+                                            resourcesAssignedViaMembership.addAll(roleTO.getResources());
+                                        }
+                                    }
+                                    resourcesToRemove.removeAll(resourcesAssignedViaMembership);
+                                    resourcesToRemove.removeAll(userTO.getResources());
                                 }
-                            }
-                            resourcesToRemove.removeAll(resourcesAssignedViaMembership);
-                            resourcesToRemove.removeAll(userTO.getResources());
-                        }
 
-                        StatusUtils.update(statusPanel, target, Collections.<String>emptySet(),
resourcesToRemove);
+                                StatusUtils.update(statusPanel, target, Collections.<String>emptySet(),
+                                        resourcesToRemove);
+                            }
+                        };
+                        item.add(deleteLink);
                     }
                 };
-                item.add(deleteLink);
-            }
-        };
 
         membershipsContainer.add(membView);
 

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleDetailsPanel.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleDetailsPanel.java?rev=1558319&r1=1558318&r2=1558319&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleDetailsPanel.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleDetailsPanel.java
Wed Jan 15 08:33:00 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.console.pages.panels;
 
+import org.apache.syncope.console.commons.PageUtils;
 import org.apache.syncope.common.to.RoleTO;
 import org.apache.syncope.common.to.UserTO;
 import org.apache.syncope.common.types.AttributableType;
@@ -101,7 +102,7 @@ public class RoleDetailsPanel extends Pa
 
                         @Override
                         public Page createPage() {
-                            return new RoleSelectModalPage(getPage().getPageReference(),
parentSelectWin,
+                            return new RoleSelectModalPage(PageUtils.getPageReference(getPage()),
parentSelectWin,
                                     ParentSelectPayload.class);
                         }
                     });
@@ -158,7 +159,7 @@ public class RoleDetailsPanel extends Pa
 
                     @Override
                     public Page createPage() {
-                        return new UserOwnerSelectModalPage(getPage().getPageReference(),
userOwnerSelectWin);
+                        return new UserOwnerSelectModalPage(PageUtils.getPageReference(getPage()),
userOwnerSelectWin);
                     }
                 });
                 userOwnerSelectWin.show(target);
@@ -194,7 +195,7 @@ public class RoleDetailsPanel extends Pa
 
                     @Override
                     public Page createPage() {
-                        return new RoleSelectModalPage(getPage().getPageReference(), parentSelectWin,
+                        return new RoleSelectModalPage(PageUtils.getPageReference(getPage()),
parentSelectWin,
                                 RoleOwnerSelectPayload.class);
                     }
                 });

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSearchResultPanel.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSearchResultPanel.java?rev=1558319&r1=1558318&r2=1558319&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSearchResultPanel.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSearchResultPanel.java
Wed Jan 15 08:33:00 2014
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import org.apache.syncope.console.commons.PageUtils;
 import org.apache.syncope.common.search.NodeCond;
 import org.apache.syncope.common.to.AbstractAttributableTO;
 import org.apache.syncope.common.to.RoleTO;
@@ -65,7 +66,7 @@ public class RoleSearchResultPanel exten
         final List<IColumn<AbstractAttributableTO, String>> columns =
                 new ArrayList<IColumn<AbstractAttributableTO, String>>();
 
-        final String[] colnames = {"id", "name", "entitlements"};
+        final String[] colnames = { "id", "name", "entitlements" };
         for (String name : colnames) {
             columns.add(
                     new PropertyColumn<AbstractAttributableTO, String>(new ResourceModel(name,
name), name, name));
@@ -84,7 +85,8 @@ public class RoleSearchResultPanel exten
             public void populateItem(final Item<ICellPopulator<AbstractAttributableTO>>
cellItem,
                     final String componentId, final IModel<AbstractAttributableTO>
model) {
 
-                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, page.getPageReference());
+                final ActionLinksPanel panel =
+                        new ActionLinksPanel(componentId, model, PageUtils.getPageReference(page));
 
                 panel.add(new ActionLink() {
 
@@ -98,7 +100,8 @@ public class RoleSearchResultPanel exten
 
                             @Override
                             public Page createPage() {
-                                return new StatusModalPage(page.getPageReference(), statusmodal,
model.getObject());
+                                return new StatusModalPage(PageUtils.getPageReference(page),
+                                        statusmodal, model.getObject());
                             }
                         });
 
@@ -119,7 +122,7 @@ public class RoleSearchResultPanel exten
                             @Override
                             public Page createPage() {
                                 return new RoleModalPage(
-                                        page.getPageReference(), editmodal, (RoleTO) model.getObject());
+                                        PageUtils.getPageReference(page), editmodal, (RoleTO)
model.getObject());
                             }
                         });
 

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchResultPanel.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchResultPanel.java?rev=1558319&r1=1558318&r2=1558319&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchResultPanel.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchResultPanel.java
Wed Jan 15 08:33:00 2014
@@ -24,6 +24,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
+import org.apache.syncope.console.commons.PageUtils;
 import org.apache.syncope.common.search.NodeCond;
 import org.apache.syncope.common.to.AbstractAttributableTO;
 import org.apache.syncope.common.to.UserTO;
@@ -139,7 +140,8 @@ public class UserSearchResultPanel exten
             @Override
             public ActionLinksPanel getActions(final String componentId, final IModel<AbstractAttributableTO>
model) {
 
-                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, page.getPageReference());
+                final ActionLinksPanel panel =
+                        new ActionLinksPanel(componentId, model, PageUtils.getPageReference(page));
 
                 panel.add(new ActionLink() {
 
@@ -153,7 +155,8 @@ public class UserSearchResultPanel exten
 
                             @Override
                             public Page createPage() {
-                                return new StatusModalPage(page.getPageReference(), statusmodal,
model.getObject());
+                                return new StatusModalPage(PageUtils.getPageReference(page),
+                                        statusmodal, model.getObject());
                             }
                         });
 
@@ -175,7 +178,7 @@ public class UserSearchResultPanel exten
                             public Page createPage() {
                                 // SYNCOPE-294: re-read userTO before edit
                                 UserTO userTO = ((UserRestClient) restClient).read(model.getObject().getId());
-                                return new EditUserModalPage(page.getPageReference(), editmodal,
userTO);
+                                return new EditUserModalPage(PageUtils.getPageReference(page),
editmodal, userTO);
                             }
                         });
 
@@ -217,7 +220,8 @@ public class UserSearchResultPanel exten
 
             @Override
             public ActionLinksPanel getHeader(final String componentId) {
-                final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(),
page.getPageReference());
+                final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(),
+                        PageUtils.getPageReference(page));
 
                 panel.add(new ActionLink() {
 
@@ -231,7 +235,7 @@ public class UserSearchResultPanel exten
 
                             @Override
                             public Page createPage() {
-                                return new DisplayAttributesModalPage(page.getPageReference(),
displaymodal,
+                                return new DisplayAttributesModalPage(PageUtils.getPageReference(page),
displaymodal,
                                         schemaNames, dSchemaNames, vSchemaNames);
                             }
                         });



Mime
View raw message