syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1492225 - in /syncope/branches/1_1_X/console/src/main: java/org/apache/syncope/console/pages/ java/org/apache/syncope/console/pages/panels/ java/org/apache/syncope/console/rest/ java/org/apache/syncope/console/wicket/markup/html/tree/ java...
Date Wed, 12 Jun 2013 14:31:37 GMT
Author: massi
Date: Wed Jun 12 14:31:36 2013
New Revision: 1492225

URL: http://svn.apache.org/r1492225
Log:
Unused contructor parameter and new font to logged user

Modified:
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/WelcomePage.java
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSummaryPanel.java
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansion.java
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/TreeActionLinkPanel.java
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/markup/head/MetaHeaderItem.java
    syncope/branches/1_1_X/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
Wed Jun 12 14:31:36 2013
@@ -26,7 +26,6 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
-import org.apache.syncope.common.SyncopeConstants;
 import org.apache.syncope.common.to.ConfigurationTO;
 import org.apache.syncope.common.to.LoggerTO;
 import org.apache.syncope.common.to.NotificationTO;

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java
Wed Jun 12 14:31:36 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.console.pages;
 
+import static org.apache.wicket.Component.RENDER;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -417,17 +418,11 @@ public class Reports extends BasePage {
                 }
             });
             add(successGroup);
-            MetaDataRoleAuthorizationStrategy.authorize(successGroup, RENDER,
-                    xmlRolesReader.getAllAllowedRoles("Audit", "enable"));
-            MetaDataRoleAuthorizationStrategy.authorize(successGroup, RENDER,
-                    xmlRolesReader.getAllAllowedRoles("Audit", "disable"));
+            authorizeComponent(successGroup);
 
             final CheckGroupSelector successSelector = new CheckGroupSelector("successSelector",
successGroup);
             add(successSelector);
-            MetaDataRoleAuthorizationStrategy.authorize(successSelector, RENDER,
-                    xmlRolesReader.getAllAllowedRoles("Audit", "enable"));
-            MetaDataRoleAuthorizationStrategy.authorize(successSelector, RENDER,
-                    xmlRolesReader.getAllAllowedRoles("Audit", "disable"));
+            authorizeComponent(successSelector);
 
             final CheckGroup<AuditLoggerName> failureGroup = new CheckGroup<AuditLoggerName>("failureGroup",
                     new AuditsByCategoryModel(category, Result.failure));
@@ -441,17 +436,11 @@ public class Reports extends BasePage {
                 }
             });
             add(failureGroup);
-            MetaDataRoleAuthorizationStrategy.authorize(failureGroup, RENDER,
-                    xmlRolesReader.getAllAllowedRoles("Audit", "enable"));
-            MetaDataRoleAuthorizationStrategy.authorize(failureGroup, RENDER,
-                    xmlRolesReader.getAllAllowedRoles("Audit", "disable"));
+            authorizeComponent(failureGroup);
 
             final CheckGroupSelector failureSelector = new CheckGroupSelector("failureSelector",
failureGroup);
             add(failureSelector);
-            MetaDataRoleAuthorizationStrategy.authorize(failureSelector, RENDER,
-                    xmlRolesReader.getAllAllowedRoles("Audit", "enable"));
-            MetaDataRoleAuthorizationStrategy.authorize(failureSelector, RENDER,
-                    xmlRolesReader.getAllAllowedRoles("Audit", "disable"));
+            authorizeComponent(failureSelector);
 
             ListView<Enum<?>> categoryView =
                     new AltListView<Enum<?>>("categoryView", new ArrayList(category.getSubCategoryElements()))
{
@@ -502,4 +491,11 @@ public class Reports extends BasePage {
             failureGroup.add(failureView);
         }
     }
+
+    private void authorizeComponent(final Component component) {
+        MetaDataRoleAuthorizationStrategy.authorize(component, RENDER,
+                xmlRolesReader.getAllAllowedRoles("Audit", "enable"));
+        MetaDataRoleAuthorizationStrategy.authorize(component, RENDER,
+                xmlRolesReader.getAllAllowedRoles("Audit", "disable"));
+    }
 }

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/WelcomePage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/WelcomePage.java?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/WelcomePage.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/WelcomePage.java
Wed Jun 12 14:31:36 2013
@@ -36,7 +36,13 @@ public class WelcomePage extends WebPage
 
     public WelcomePage(final PageParameters parameters) {
         super(parameters);
+        setupNavigationPanel();
 
+
+    }
+
+    //To prevent warning: "leaking this in constructor java" 
+    private void setupNavigationPanel() {
         ((SyncopeApplication) getApplication()).setupNavigationPanel(this, xmlRolesReader,
false);
     }
 }

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSummaryPanel.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSummaryPanel.java?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSummaryPanel.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSummaryPanel.java
Wed Jun 12 14:31:36 2013
@@ -27,7 +27,6 @@ import org.apache.wicket.PageReference;
 import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
 import org.apache.wicket.markup.html.panel.Fragment;
 import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.Model;
 import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -108,7 +107,7 @@ public class RoleSummaryPanel extends Pa
 
         if (builder.selectedNodeId != null) {
             if (builder.selectedNodeId == 0) {
-                actionLink = new TreeActionLinkPanel("actionLink", builder.selectedNodeId,
new Model(),
+                actionLink = new TreeActionLinkPanel("actionLink", builder.selectedNodeId,
                         builder.window, builder.callerPageRef);
                 actionLink.setOutputMarkupId(true);
                 fragment.add(actionLink);

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java
Wed Jun 12 14:31:36 2013
@@ -50,8 +50,7 @@ public class RoleTabPanel extends Panel 
 
         final Form form = new Form("roleForm");
 
-        final TreeActionLinkPanel actionLink = new TreeActionLinkPanel("actionLink", roleTO.getId(),
-                new CompoundPropertyModel(roleTO), window, pageRef);
+        final TreeActionLinkPanel actionLink = new TreeActionLinkPanel("actionLink", roleTO.getId(),
window, pageRef);
 
         this.add(actionLink);
         this.add(new Label("displayName", roleTO.getDisplayName()));

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java
Wed Jun 12 14:31:36 2013
@@ -97,14 +97,16 @@ public class PolicyRestClient extends Ba
     }
 
     private PolicyType getPolicyType(final Class<? extends PolicyTO> clazz) {
+        PolicyType policyType;
         if (AccountPolicyTO.class.equals(clazz)) {
-            return PolicyType.ACCOUNT;
+            policyType = PolicyType.ACCOUNT;
         } else if (PasswordPolicyTO.class.equals(clazz)) {
-            return PolicyType.PASSWORD;
+            policyType = PolicyType.PASSWORD;
         } else if (SyncPolicyTO.class.equals(clazz)) {
-            return PolicyType.SYNC;
+            policyType = PolicyType.SYNC;
         } else {
             throw new IllegalArgumentException("Policy Type not supported");
         }
+        return policyType;
     }
 }

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansion.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansion.java?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansion.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansion.java
Wed Jun 12 14:31:36 2013
@@ -37,9 +37,9 @@ public class DefaultMutableTreeNodeExpan
     private static MetaDataKey<DefaultMutableTreeNodeExpansion> KEY =
             new MetaDataKey<DefaultMutableTreeNodeExpansion>() {
 
-                private static final long serialVersionUID = 3109256773218160485L;
+        private static final long serialVersionUID = 3109256773218160485L;
 
-            };
+    };
 
     private Set<Long> ids = new HashSet<Long>();
 
@@ -60,33 +60,39 @@ public class DefaultMutableTreeNodeExpan
     @Override
     public boolean add(final DefaultMutableTreeNode node) {
         RoleTO roleTO = (RoleTO) node.getUserObject();
+        boolean isAdded;
         if (inverse) {
-            return ids.remove(roleTO.getId());
+            isAdded = ids.remove(roleTO.getId());
         } else {
-            return ids.add(roleTO.getId());
+            isAdded = ids.add(roleTO.getId());
         }
+        return isAdded;
     }
 
     @Override
     public boolean remove(final Object object) {
         DefaultMutableTreeNode node = (DefaultMutableTreeNode) object;
         RoleTO roleTO = (RoleTO) node.getUserObject();
+        boolean isRemoved;
         if (inverse) {
-            return ids.add(roleTO.getId());
+            isRemoved = ids.add(roleTO.getId());
         } else {
-            return ids.remove(roleTO.getId());
+            isRemoved = ids.remove(roleTO.getId());
         }
+        return isRemoved;
     }
 
     @Override
     public boolean contains(final Object object) {
         DefaultMutableTreeNode node = (DefaultMutableTreeNode) object;
         RoleTO roleTO = (RoleTO) node.getUserObject();
+        boolean isContained;
         if (inverse) {
-            return !ids.contains(roleTO.getId());
+            isContained = !ids.contains(roleTO.getId());
         } else {
-            return ids.contains(roleTO.getId());
+            isContained = ids.contains(roleTO.getId());
         }
+        return isContained;
     }
 
     @Override

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/TreeActionLinkPanel.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/TreeActionLinkPanel.java?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/TreeActionLinkPanel.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/TreeActionLinkPanel.java
Wed Jun 12 14:31:36 2013
@@ -36,7 +36,6 @@ import org.apache.wicket.authroles.autho
 import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
 import org.apache.wicket.markup.html.panel.Fragment;
 import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.IModel;
 import org.apache.wicket.spring.injection.annot.SpringBean;
 
 /**
@@ -54,7 +53,7 @@ public class TreeActionLinkPanel extends
 
     private Fragment fragment;
 
-    public TreeActionLinkPanel(final String id, final long idRole, final IModel inputModel,
final ModalWindow window,
+    public TreeActionLinkPanel(final String id, final long idRole, final ModalWindow window,
             final PageReference pageRef) {
 
         super(id);

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/markup/head/MetaHeaderItem.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/markup/head/MetaHeaderItem.java?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/markup/head/MetaHeaderItem.java
(original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/markup/head/MetaHeaderItem.java
Wed Jun 12 14:31:36 2013
@@ -31,7 +31,7 @@ public class MetaHeaderItem extends Head
 
     private final String value;
 
-    public MetaHeaderItem(String key, String value) {
+    public MetaHeaderItem(final String key, final String value) {
         this.key = key;
         this.value = value;
     }

Modified: syncope/branches/1_1_X/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html?rev=1492225&r1=1492224&r2=1492225&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html
(original)
+++ syncope/branches/1_1_X/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html
Wed Jun 12 14:31:36 2013
@@ -46,16 +46,16 @@ under the License.
         $("#role").tabs();
         $("#membership").tabs();
       });
-                    
+
       /** Add rollover effect to tables supporting Ajax events (live)*/
-      $('table.ui-widget.ui-widget-content.table-hover tbody tr').live('mouseover mouseout',

-      function(event) {
-        if (event.type == 'mouseover') {
-          $(this).addClass('selectedRow');
-        } else if (event.type == 'mouseout') {
-          $(this).removeClass('selectedRow');
-        }
-      });
+      $('table.ui-widget.ui-widget-content.table-hover tbody tr').live('mouseover mouseout',
+              function(event) {
+                if (event.type == 'mouseover') {
+                  $(this).addClass('selectedRow');
+                } else if (event.type == 'mouseout') {
+                  $(this).removeClass('selectedRow');
+                }
+              });
     </script>
   </head>
   <body>
@@ -115,7 +115,9 @@ under the License.
           <a href="#" wicket:id="logout"><img src="img/menu/logout.png" alt="Logout"
width="80" height="80" /><br /></a>
           <div style="display: table-row;">
             <div id="username" style="padding-right: 5px;width: 100px;cursor: pointer;display:
table-cell;">
-              <a href="#" wicket:id="editProfileLink"><span wicket:id="username"/></a>
+              <a href="#" wicket:id="editProfileLink">
+                <span wicket:id="username" style="color: #B9CFB3;font-family: monospace;"/>
+              </a>
             </div>
             <div>
               <div wicket:id="infoModal"/>



Mime
View raw message