syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1484014 - in /syncope/trunk: ./ console/src/main/java/org/apache/syncope/console/commons/ console/src/main/java/org/apache/syncope/console/pages/ console/src/main/java/org/apache/syncope/console/pages/panels/
Date Fri, 17 May 2013 22:09:56 GMT
Author: massi
Date: Fri May 17 22:09:56 2013
New Revision: 1484014

URL: http://svn.apache.org/r1484014
Log:
Merge from 1_1_X branch

Modified:
    syncope/trunk/   (props changed)
    syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/ConnidAttribute.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/EditUserModalPage.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/UserModalPage.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourcesPanel.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java

Propchange: syncope/trunk/
------------------------------------------------------------------------------
  Merged /syncope/branches/1_1_X:r1482714-1484008

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/ConnidAttribute.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/ConnidAttribute.java?rev=1484014&r1=1484013&r2=1484014&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/ConnidAttribute.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/ConnidAttribute.java
Fri May 17 22:09:56 2013
@@ -15,10 +15,6 @@
  */
 package org.apache.syncope.console.commons;
 
-/**
- *
- * @author massi
- */
 public final class ConnidAttribute {
     
     public static final String ENABLE = "__ENABLE__";

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/EditUserModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/EditUserModalPage.java?rev=1484014&r1=1484013&r2=1484014&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/EditUserModalPage.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/EditUserModalPage.java
Fri May 17 22:09:56 2013
@@ -73,7 +73,7 @@ public class EditUserModalPage extends U
 
             form.addOrReplace(new AccountInformationPanel("accountinformation", userTO));
 
-            form.addOrReplace(new ResourcesPanel.ResourcesPanelBuilder("resources").attributableTO(userTO).statusPanel(
+            form.addOrReplace(new ResourcesPanel.Builder("resources").attributableTO(userTO).statusPanel(
                     statusPanel).build());
 
             form.addOrReplace(new MembershipsPanel("memberships", userTO, false, statusPanel,
getPageReference()));

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java?rev=1484014&r1=1484013&r2=1484014&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java
Fri May 17 22:09:56 2013
@@ -92,7 +92,8 @@ public class RoleModalPage extends BaseM
 
         form.setModel(new CompoundPropertyModel(roleTO));
 
-        this.rolePanel = new RolePanel("rolePanel", form, roleTO, mode, getPageReference());
+        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"))
{

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/UserModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/UserModalPage.java?rev=1484014&r1=1484013&r2=1484014&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/UserModalPage.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/UserModalPage.java
Fri May 17 22:09:56 2013
@@ -134,7 +134,7 @@ public abstract class UserModalPage exte
         //--------------------------------
         // Resources panel
         //--------------------------------
-        form.add(new ResourcesPanel.ResourcesPanelBuilder("resources")
+        form.add(new ResourcesPanel.Builder("resources")
                 .attributableTO(userTO).statusPanel(null).build());
         //--------------------------------
 

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourcesPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourcesPanel.java?rev=1484014&r1=1484013&r2=1484014&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourcesPanel.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourcesPanel.java
Fri May 17 22:09:56 2013
@@ -62,7 +62,7 @@ public class ResourcesPanel extends Pane
 
     private final List<String> allResources;
 
-    public static class ResourcesPanelBuilder {
+    public static class Builder {
 
         private String id;
 
@@ -70,16 +70,16 @@ public class ResourcesPanel extends Pane
 
         private StatusPanel statusPanel;
 
-        public ResourcesPanelBuilder(String id) {
+        public Builder(final String id) {
             this.id = id;
         }
 
-        public ResourcesPanelBuilder attributableTO(Object to) {
+        public Builder attributableTO(final Object to) {
             this.to = to;
             return this;
         }
 
-        public ResourcesPanelBuilder statusPanel(StatusPanel statusPanel) {
+        public Builder statusPanel(final StatusPanel statusPanel) {
             this.statusPanel = statusPanel;
             return this;
         }
@@ -89,7 +89,7 @@ public class ResourcesPanel extends Pane
         }
     }
 
-    private ResourcesPanel(final ResourcesPanelBuilder builder) {
+    private ResourcesPanel(final Builder builder) {
         super(builder.id);
         attributableTO = (AbstractAttributableTO) builder.to;
         previousResources = new HashSet<String>(attributableTO.getResources());

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java?rev=1484014&r1=1484013&r2=1484014&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java
Fri May 17 22:09:56 2013
@@ -53,21 +53,58 @@ public class RolePanel extends Panel {
 
     private final AjaxPalettePanel<String> entitlementsPalette;
 
-    public RolePanel(final String id, final Form form, final RoleTO roleTO, final RoleModalPage.Mode
mode) {
-        this(id, form, roleTO, mode, null);
-    }
+    public static class Builder {
+
+        private String id;
+
+        private Form form;
+
+        private RoleTO roleTO;
+
+        private RoleModalPage.Mode mode;
+
+        private PageReference pageReference;
+
+        public Builder(String id) {
+            this.id = id;
+        }
+
+        public RolePanel.Builder form(final Form form) {
+            this.form = form;
+            return this;
+        }
+
+        public RolePanel.Builder roleTO(final RoleTO roleTO) {
+            this.roleTO = roleTO;
+            return this;
+        }
+
+        public RolePanel.Builder roleModalPageMode(final RoleModalPage.Mode mode) {
+            this.mode = mode;
+            return this;
+        }
 
-    public RolePanel(final String id, final Form form, final RoleTO roleTO, final RoleModalPage.Mode
mode,
-            final PageReference pageref) {
+        public RolePanel.Builder pageRef(final PageReference pageReference) {
+            this.pageReference = pageReference;
+            return this;
+        }
+
+        public RolePanel build() {
+            return new RolePanel(this);
+        }
+    }
 
-        super(id);
+    private RolePanel(final Builder builder) {
+        super(builder.id);
 
-        this.add(new RoleDetailsPanel("details", roleTO, form, mode == RoleModalPage.Mode.TEMPLATE));
+        this.add(new RoleDetailsPanel(
+                "details", builder.roleTO, builder.form, builder.mode == RoleModalPage.Mode.TEMPLATE));
 
-        if (pageref == null || roleTO.getId() == 0) {
+        if (builder.pageReference == null || builder.roleTO.getId() == 0) {
             this.add(new Label("statuspanel", ""));
         } else {
-            StatusPanel statusPanel = new StatusPanel("statuspanel", roleTO, new ArrayList<StatusBean>(),
pageref);
+            StatusPanel statusPanel = new StatusPanel(
+                    "statuspanel", builder.roleTO, new ArrayList<StatusBean>(), builder.pageReference);
             statusPanel.setOutputMarkupId(true);
             MetaDataRoleAuthorizationStrategy.authorize(
                     statusPanel, RENDER, xmlRolesReader.getAllAllowedRoles("Resources", "getConnectorObject"));
@@ -76,10 +113,11 @@ public class RolePanel extends Panel {
 
         //--------------------------------
         // Attributes panel
-        this.add(new AttributesPanel("attributes", roleTO, form, mode == RoleModalPage.Mode.TEMPLATE));
+        this.add(new AttributesPanel(
+                "attributes", builder.roleTO, builder.form, builder.mode == RoleModalPage.Mode.TEMPLATE));
 
         final AjaxCheckBoxPanel inhAttributes = new AjaxCheckBoxPanel("inheritAttributes",
"inheritAttributes",
-                new PropertyModel<Boolean>(roleTO, "inheritAttributes"));
+                new PropertyModel<Boolean>(builder.roleTO, "inheritAttributes"));
         inhAttributes.setOutputMarkupId(true);
         this.add(inhAttributes);
         //--------------------------------
@@ -87,10 +125,10 @@ public class RolePanel extends Panel {
         //--------------------------------
         // Derived attributes container
         //--------------------------------
-        this.add(new DerivedAttributesPanel("derivedAttributes", roleTO));
+        this.add(new DerivedAttributesPanel("derivedAttributes", builder.roleTO));
 
         final AjaxCheckBoxPanel inhDerivedAttributes = new AjaxCheckBoxPanel("inheritDerivedAttributes",
-                "inheritDerivedAttributes", new PropertyModel<Boolean>(roleTO, "inheritDerivedAttributes"));
+                "inheritDerivedAttributes", new PropertyModel<Boolean>(builder.roleTO,
"inheritDerivedAttributes"));
         inhDerivedAttributes.setOutputMarkupId(true);
         inhDerivedAttributes.setOutputMarkupId(true);
         this.add(inhDerivedAttributes);
@@ -99,10 +137,11 @@ public class RolePanel extends Panel {
         //--------------------------------
         // Virtual attributes container
         //--------------------------------
-        this.add(new VirtualAttributesPanel("virtualAttributes", roleTO, mode == RoleModalPage.Mode.TEMPLATE));
+        this.add(new VirtualAttributesPanel(
+                "virtualAttributes", builder.roleTO, builder.mode == RoleModalPage.Mode.TEMPLATE));
 
         final AjaxCheckBoxPanel inhVirtualAttributes = new AjaxCheckBoxPanel("inheritVirtualAttributes",
-                "inheritVirtualAttributes", new PropertyModel<Boolean>(roleTO, "inheritVirtualAttributes"));
+                "inheritVirtualAttributes", new PropertyModel<Boolean>(builder.roleTO,
"inheritVirtualAttributes"));
         inhVirtualAttributes.setOutputMarkupId(true);
         inhVirtualAttributes.setOutputMarkupId(true);
         this.add(inhVirtualAttributes);
@@ -112,18 +151,18 @@ public class RolePanel extends Panel {
         // Security container
         //--------------------------------
 
-        this.add(new RoleSecurityPanel("security", roleTO).setOutputMarkupId(true));
+        this.add(new RoleSecurityPanel("security", builder.roleTO).setOutputMarkupId(true));
         //--------------------------------
 
         //--------------------------------
         // Resources container
         //--------------------------------
 
-        this.add(new ResourcesPanel.ResourcesPanelBuilder("resources").attributableTO(roleTO).build()
+        this.add(new ResourcesPanel.Builder("resources").attributableTO(builder.roleTO).build()
                 .setOutputMarkupId(true));
         //--------------------------------
 
-        ListModel<String> selectedEntitlements = new ListModel<String>(roleTO.getEntitlements());
+        ListModel<String> selectedEntitlements = new ListModel<String>(builder.roleTO.getEntitlements());
 
         List<String> allEntitlements = entitlementRestClient.getAllEntitlements();
         if (allEntitlements != null && !allEntitlements.isEmpty()) {

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java?rev=1484014&r1=1484013&r2=1484014&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java
(original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java
Fri May 17 22:09:56 2013
@@ -59,7 +59,8 @@ public class RoleTabPanel extends Panel 
         form.setModel(new CompoundPropertyModel(roleTO));
         form.setOutputMarkupId(true);
 
-        final RolePanel rolePanel = new RolePanel("rolePanel", form, roleTO, RoleModalPage.Mode.ADMIN);
+        final RolePanel rolePanel = new RolePanel.Builder("rolePanel").form(form).roleTO(roleTO)
+                .roleModalPageMode(RoleModalPage.Mode.ADMIN).build();
         rolePanel.setEnabled(false);
         form.add(rolePanel);
 



Mime
View raw message