syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1432990 - 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/ console/src/main/resources/org/ap...
Date Mon, 14 Jan 2013 17:02:51 GMT
Author: ilgrosso
Date: Mon Jan 14 17:02:50 2013
New Revision: 1432990

URL: http://svn.apache.org/viewvc?rev=1432990&view=rev
Log:
[SYNCOPE-172] Added ability to edit role mapping for resources in the admin console

Modified:
    syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/PreferenceManager.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Resources.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSecurityPanel.java
    syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.html
    syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties
    syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties
    syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources.properties
    syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources_it.properties
    syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceMappingPanel.html
    syncope/trunk/console/src/main/webapp/css/fieldstyle.css
    syncope/trunk/console/src/test/java/org/apache/syncope/console/ResourceTestITCase.java
    syncope/trunk/console/src/test/resources/configuration.properties
    syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/PreferenceManager.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/PreferenceManager.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/PreferenceManager.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/PreferenceManager.java Mon Jan 14 17:02:50 2013
@@ -148,7 +148,7 @@ public class PreferenceManager {
         try {
             cookieUtils.save(PREFMAN_KEY, new String(Base64.encodeBase64(setPrefs(current).getBytes())));
         } catch (IOException e) {
-            LOG.error("Could not save {} info: {}", new Object[]{getClass().getSimpleName(), current, e});
+            LOG.error("Could not save {} info: {}", getClass().getSimpleName(), current, e);
         }
     }
 
@@ -166,7 +166,7 @@ public class PreferenceManager {
         try {
             cookieUtils.save(PREFMAN_KEY, new String(Base64.encodeBase64(setPrefs(current).getBytes())));
         } catch (IOException e) {
-            LOG.error("Could not save {} info: {}", new Object[]{getClass().getSimpleName(), current, e});
+            LOG.error("Could not save {} info: {}", getClass().getSimpleName(), current, e);
         }
     }
 

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java Mon Jan 14 17:02:50 2013
@@ -113,6 +113,7 @@ public class ReportletConfModalPage exte
 
         final AjaxDropDownChoicePanel<String> reportletClass = new AjaxDropDownChoicePanel<String>("reportletClass",
                 "reportletClass", new IModel<String>() {
+
             private static final long serialVersionUID = -2316468110411802130L;
 
             @Override
@@ -142,6 +143,7 @@ public class ReportletConfModalPage exte
         ((DropDownChoice) reportletClass.getField()).setNullValid(true);
         reportletClass.addRequiredLabel();
         reportletClass.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {
+
             private static final long serialVersionUID = 5538299138211283825L;
 
             @Override
@@ -156,6 +158,7 @@ public class ReportletConfModalPage exte
         propertiesContainer.add(buildPropView());
 
         final AjaxButton submit = new AjaxButton("apply", new ResourceModel("apply")) {
+
             private static final long serialVersionUID = -958724007591692537L;
 
             @Override
@@ -189,6 +192,7 @@ public class ReportletConfModalPage exte
         form.add(submit);
 
         final IndicatingAjaxButton cancel = new IndicatingAjaxButton("cancel", new ResourceModel("cancel")) {
+
             private static final long serialVersionUID = -958724007591692537L;
 
             @Override
@@ -231,6 +235,7 @@ public class ReportletConfModalPage exte
 
     private ListView<String> buildPropView() {
         LoadableDetachableModel<List<String>> propViewModel = new LoadableDetachableModel<List<String>>() {
+
             private static final long serialVersionUID = 5275935387613157437L;
 
             @Override
@@ -249,6 +254,7 @@ public class ReportletConfModalPage exte
         };
 
         propView = new ListView<String>("propView", propViewModel) {
+
             private static final long serialVersionUID = 9101744072914090143L;
 
             @Override
@@ -262,8 +268,8 @@ public class ReportletConfModalPage exte
                 try {
                     field = ReportletConfModalPage.this.reportletConf.getClass().getDeclaredField(fieldName);
                 } catch (Exception e) {
-                    LOG.error("Could not find field {} in class {}", new Object[]{fieldName,
-                                ReportletConfModalPage.this.reportletConf.getClass(), e});
+                    LOG.error("Could not find field {} in class {}", fieldName,
+                            ReportletConfModalPage.this.reportletConf.getClass(), e);
                 }
                 if (field == null) {
                     return;
@@ -285,7 +291,8 @@ public class ReportletConfModalPage exte
 
                     Class<?> listItemType = String.class;
                     if (field.getGenericType() instanceof ParameterizedType) {
-                        listItemType = (Class<?>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
+                        listItemType =
+                                (Class<?>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
                     }
 
                     FormAttributeField annotation = field.getAnnotation(FormAttributeField.class);

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java Mon Jan 14 17:02:50 2013
@@ -26,6 +26,7 @@ import org.apache.syncope.console.pages.
 import org.apache.syncope.console.pages.panels.ResourceMappingPanel;
 import org.apache.syncope.console.pages.panels.ResourceSecurityPanel;
 import org.apache.syncope.console.rest.ResourceRestClient;
+import org.apache.syncope.types.AttributableType;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.form.AjaxButton;
@@ -63,9 +64,10 @@ public class ResourceModalPage extends B
         //--------------------------------
 
         //--------------------------------
-        // Resource mapping panel
+        // Resource mapping panels
         //--------------------------------
-        form.add(new ResourceMappingPanel("mapping", resourceTO));
+        form.add(new ResourceMappingPanel("umapping", resourceTO, AttributableType.USER));
+        form.add(new ResourceMappingPanel("rmapping", resourceTO, AttributableType.ROLE));
         //--------------------------------
 
         //--------------------------------
@@ -86,23 +88,39 @@ public class ResourceModalPage extends B
 
             @Override
             protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-
                 final ResourceTO resourceTO = (ResourceTO) form.getDefaultModelObject();
 
-                int accountIdCount = 0;
+                boolean accountIdError = false;
 
-                for (MappingItemTO item : resourceTO.getUmapping().getItems()) {
-                    if (item.isAccountid()) {
-                        accountIdCount++;
+                if (resourceTO.getUmapping().getItems().isEmpty()) {
+                    resourceTO.setUmapping(null);
+                } else {
+                    int uAccountIdCount = 0;
+                    for (MappingItemTO item : resourceTO.getUmapping().getItems()) {
+                        if (item.isAccountid()) {
+                            uAccountIdCount++;
+                        }
                     }
+                    accountIdError = uAccountIdCount != 1;
                 }
 
-                if (accountIdCount == 0 || accountIdCount > 1) {
+                if (resourceTO.getRmapping().getItems().isEmpty()) {
+                    resourceTO.setRmapping(null);
+                } else {
+                    int rAccountIdCount = 0;
+                    for (MappingItemTO item : resourceTO.getRmapping().getItems()) {
+                        if (item.isAccountid()) {
+                            rAccountIdCount++;
+                        }
+                    }
+                    accountIdError |= rAccountIdCount != 1;
+                }
+
+                if (accountIdError) {
                     error(new ResourceModel("accountIdValidation", "accountIdValidation").getObject());
                     target.add(feedbackPanel);
                 } else {
                     try {
-
                         if (createFlag) {
                             restClient.create(resourceTO);
                         } else {
@@ -111,9 +129,8 @@ public class ResourceModalPage extends B
 
                         ((Resources) pageref.getPage()).setModalResult(true);
                         window.close(target);
-
                     } catch (Exception e) {
-                        LOG.error("Failuer managing resource {}", resourceTO);
+                        LOG.error("Failure managing resource {}", resourceTO);
                         error(new ResourceModel("error", "error").getObject() + ":" + e.getMessage());
                         target.add(feedbackPanel);
                     }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Resources.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Resources.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Resources.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Resources.java Mon Jan 14 17:02:50 2013
@@ -56,6 +56,8 @@ import org.apache.syncope.console.rest.C
 import org.apache.syncope.console.rest.ResourceRestClient;
 import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
 import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.console.wicket.markup.html.form.LinkPanel;
+import org.apache.wicket.markup.html.basic.Label;
 
 /**
  * Resources WebPage.
@@ -114,6 +116,50 @@ public class Resources extends BasePage 
         List<IColumn> columns = new ArrayList<IColumn>();
 
         columns.add(new PropertyColumn(new ResourceModel("name"), "name", "name"));
+
+        columns.add(new AbstractColumn<ResourceTO, String>(new ResourceModel("connector", "connector")) {
+
+            private static final long serialVersionUID = 8263694778917279290L;
+
+            @Override
+            public void populateItem(final Item<ICellPopulator<ResourceTO>> cellItem, final String componentId,
+                    final IModel<ResourceTO> rowModel) {
+
+                final ConnInstanceTO connectorTO = connectorRestClient.read(rowModel.getObject().getConnectorId());
+
+                final IndicatingAjaxLink<String> editLink = new IndicatingAjaxLink<String>("link") {
+
+                    private static final long serialVersionUID = -7978723352517770644L;
+
+                    @Override
+                    public void onClick(final AjaxRequestTarget target) {
+
+                        editConnectorWin.setPageCreator(new ModalWindow.PageCreator() {
+
+                            private static final long serialVersionUID = -7834632442532690940L;
+
+                            @Override
+                            public Page createPage() {
+                                return new ConnectorModalPage(Resources.this.getPageReference(), editConnectorWin,
+                                        connectorTO);
+                            }
+                        });
+
+                        editConnectorWin.show(target);
+                    }
+                };
+                editLink.add(new Label("linkTitle", connectorTO.getDisplayName()));
+
+                LinkPanel editConnPanel = new LinkPanel(componentId);
+                editConnPanel.add(editLink);
+
+                cellItem.add(editConnPanel);
+
+                MetaDataRoleAuthorizationStrategy.authorize(editConnPanel, ENABLE, xmlRolesReader.getAllAllowedRoles(
+                        "Connectors", "read"));
+            }
+        });
+
         columns.add(new PropertyColumn(new ResourceModel("propagationPrimary"), "propagationPrimary",
                 "propagationPrimary"));
         columns.add(new PropertyColumn(new ResourceModel("propagationPriority"), "propagationPriority",
@@ -296,7 +342,6 @@ public class Resources extends BasePage 
 
                     @Override
                     public void onClick(final AjaxRequestTarget target) {
-
                         editConnectorWin.setPageCreator(new ModalWindow.PageCreator() {
 
                             private static final long serialVersionUID = -7834632442532690940L;
@@ -433,7 +478,7 @@ public class Resources extends BasePage 
 
             Collections.sort(list, comparator);
 
-            return list.subList((int)first, (int)first + (int)count).iterator();
+            return list.subList((int) first, (int) first + (int) count).iterator();
         }
 
         @Override
@@ -477,7 +522,7 @@ public class Resources extends BasePage 
 
             Collections.sort(list, comparator);
 
-            return list.subList((int)first, (int)first + (int)count).iterator();
+            return list.subList((int) first, (int) first + (int) count).iterator();
         }
 
         @Override

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java Mon Jan 14 17:02:50 2013
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
-
 import org.apache.wicket.Page;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -185,8 +184,8 @@ public class PoliciesPanel extends Panel
                         } catch (SyncopeClientCompositeErrorException e) {
                             error(getString("operation_error"));
 
-                            LOG.error("While deleting resource {}({})", new Object[] { accountPolicyTO.getId(),
-                                    accountPolicyTO.getDescription() }, e);
+                            LOG.error("While deleting resource {}({})", accountPolicyTO.getId(),
+                                    accountPolicyTO.getDescription(), e);
                         }
 
                         target.add(container);
@@ -293,7 +292,7 @@ public class PoliciesPanel extends Panel
 
             Collections.sort(policies, comparator);
 
-            return policies.subList((int)first, (int)first + (int)count).iterator();
+            return policies.subList((int) first, (int) first + (int) count).iterator();
         }
 
         @Override

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java Mon Jan 14 17:02:50 2013
@@ -291,7 +291,7 @@ public class ResourceConnConfPanel exten
          * Constructor.
          *
          * @param target request target.
-         * @param target connector configuration properties.
+         * @param conf connector configuration properties.
          */
         public ConnConfModEvent(final AjaxRequestTarget target, final List<ConnConfProperty> conf) {
             super(target);

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java Mon Jan 14 17:02:50 2013
@@ -39,12 +39,16 @@ import org.apache.syncope.console.wicket
 import org.apache.syncope.types.AttributableType;
 import org.apache.syncope.types.ConnConfProperty;
 import org.apache.syncope.types.IntMappingType;
+import org.apache.wicket.Component;
 import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
 import org.apache.wicket.ajax.markup.html.form.AjaxButton;
 import org.apache.wicket.event.IEvent;
 import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
 import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.list.ListItem;
 import org.apache.wicket.markup.html.list.ListView;
@@ -55,116 +59,129 @@ import org.apache.wicket.model.ResourceM
 import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.wicket.Component;
-import org.apache.wicket.ajax.attributes.AjaxCallListener;
-import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
 
 /**
  * Resource mapping panel.
  */
 public class ResourceMappingPanel extends Panel {
 
-    /**
-     * Serial verion UID.
-     */
     private static final long serialVersionUID = -7982691107029848579L;
 
     /**
      * Logger.
      */
-    protected static final Logger LOG = LoggerFactory.getLogger(ResourceMappingPanel.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ResourceMappingPanel.class);
 
     /**
-     * Schema rest client.
+     * OnChange event name.
      */
-    @SpringBean
-    private transient SchemaRestClient schemaRestClient;
+    private static final String ON_CHANGE = "onchange";
 
     /**
-     * ConnInstance rest client.
+     * Mapping field style sheet.
      */
-    @SpringBean
-    private transient ConnectorRestClient connRestClient;
+    private static final String FIELD_STYLE = "ui-widget-content ui-corner-all short_fixedsize";
 
     /**
-     * Resource schema name.
+     * Mapping field style sheet.
      */
-    private transient List<String> schemaNames;
+    private static final String DEF_FIELD_STYLE = "ui-widget-content ui-corner-all";
 
     /**
-     * Internal attribute types.
+     * Mapping field style sheet.
      */
-    private transient List<IntMappingType> attrTypes = new ArrayList<IntMappingType>();
+    private static final String SHORT_FIELD_STYLE = "ui-widget-content ui-corner-all veryshort_fixedsize";
 
     /**
-     * Add mapping button.
+     * Schema rest client.
      */
-    private final transient AjaxButton addMappingBtn;
+    @SpringBean
+    private SchemaRestClient schemaRestClient;
 
     /**
-     * All mappings.
+     * ConnInstance rest client.
      */
-    private final transient ListView mappings;
+    @SpringBean
+    private ConnectorRestClient connRestClient;
 
     /**
-     * External resource to be updated.
+     * Resource schema name.
      */
-    private final transient ResourceTO resourceTO;
+    private final List<String> schemaNames;
 
     /**
-     * Mapping container.
+     * Add mapping button.
      */
-    private final transient WebMarkupContainer mappingContainer;
+    private final AjaxButton addMappingBtn;
 
     /**
-     * AccountLink container.
+     * All mappings.
      */
-    private final transient WebMarkupContainer accountLinkContainer;
+    private final ListView mappings;
 
     /**
-     * OnChange event name.
+     * External resource to be updated.
      */
-    private static String onchange = "onchange";
+    private final ResourceTO resourceTO;
 
-    /**
-     * Mapping field style sheet.
-     */
-    private static String fieldStyle = "ui-widget-content ui-corner-all short_fixedsize";
+    private final AttributableType attrType;
 
     /**
-     * Mapping field style sheet.
+     * Mapping container.
      */
-    private static String defFieldStyle = "ui-widget-content ui-corner-all";
+    private final WebMarkupContainer mappingContainer;
 
     /**
-     * Mapping field style sheet.
+     * AccountLink container.
      */
-    private static String shortFieldStyle = "ui-widget-content ui-corner-all veryshort_fixedsize";
+    private final WebMarkupContainer accountLinkContainer;
+
+    private MappingTO getMapping() {
+        MappingTO result = null;
+
+        if (AttributableType.USER == attrType) {
+            if (this.resourceTO.getUmapping() == null) {
+                this.resourceTO.setUmapping(new MappingTO());
+            }
+            result = this.resourceTO.getUmapping();
+        }
+        if (AttributableType.ROLE == attrType) {
+            if (this.resourceTO.getRmapping() == null) {
+                this.resourceTO.setRmapping(new MappingTO());
+            }
+            result = this.resourceTO.getRmapping();
+        }
+
+        return result;
+    }
 
     /**
      * Attribute Mapping Panel.
      *
-     * @param panelid panel id.
-     * @param resourceTO external resource.
+     * @param panelid panel id
+     * @param resourceTO external resource
+     * @param attrType USER / ROLE
      */
-    public ResourceMappingPanel(final String panelid, final ResourceTO resourceTO) {
-
+    public ResourceMappingPanel(final String panelid, final ResourceTO resourceTO, final AttributableType attrType) {
         super(panelid);
         setOutputMarkupId(true);
 
         this.resourceTO = resourceTO;
-        if (resourceTO.getUmapping() == null) {
-            resourceTO.setUmapping(new MappingTO());
-        }
+        this.attrType = attrType;
 
-        initResourceSchemaNames();
+        if (this.resourceTO.getConnectorId() != null && this.resourceTO.getConnectorId() > 0) {
+            schemaNames =
+                    getResourceSchemaNames(this.resourceTO.getConnectorId(), this.resourceTO.getConnConfProperties());
+        } else {
+            schemaNames = Collections.<String>emptyList();
+        }
 
         accountLinkContainer = new WebMarkupContainer("accountLinkContainer");
         accountLinkContainer.setOutputMarkupId(true);
         add(accountLinkContainer);
 
         boolean accountLinkEnabled = false;
-        if (resourceTO.getUmapping().getAccountLink() != null) {
+        if (getMapping().getAccountLink() != null) {
             accountLinkEnabled = true;
         }
         final AjaxCheckBoxPanel accountLinkCheckbox = new AjaxCheckBoxPanel("accountLinkCheckbox",
@@ -174,13 +191,13 @@ public class ResourceMappingPanel extend
 
         accountLinkContainer.add(accountLinkCheckbox);
 
-        final AjaxTextFieldPanel accountLink = new AjaxTextFieldPanel("accountLink", new ResourceModel("accountLink",
-                "accountLink").getObject(), new PropertyModel<String>(resourceTO.getUmapping(), "accountLink"));
+        final AjaxTextFieldPanel accountLink = new AjaxTextFieldPanel("accountLink",
+                new ResourceModel("accountLink", "accountLink").getObject(),
+                new PropertyModel<String>(getMapping(), "accountLink"));
         accountLink.setEnabled(accountLinkEnabled);
-
         accountLinkContainer.add(accountLink);
 
-        accountLinkCheckbox.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {
+        accountLinkCheckbox.getField().add(new AjaxFormComponentUpdatingBehavior(ON_CHANGE) {
 
             private static final long serialVersionUID = -1107858522700306810L;
 
@@ -198,31 +215,30 @@ public class ResourceMappingPanel extend
             }
         });
 
-
         mappingContainer = new WebMarkupContainer("mappingContainer");
         mappingContainer.setOutputMarkupId(true);
         add(mappingContainer);
 
-        mappings = new ListView<MappingItemTO>("mappings", resourceTO.getUmapping().getItems()) {
+        final Label passwordLabel = new Label("passwordLabel", new ResourceModel("password"));
+        mappingContainer.add(passwordLabel);
+        if (AttributableType.USER != ResourceMappingPanel.this.attrType) {
+            passwordLabel.setVisible(false);
+        }
+
+        mappings = new ListView<MappingItemTO>("mappings", getMapping().getItems()) {
 
-            /**
-             * Serial version UID.
-             */
             private static final long serialVersionUID = 4949588177564901031L;
 
             @Override
             protected void populateItem(final ListItem<MappingItemTO> item) {
-
                 final MappingItemTO mapItem = item.getModelObject();
 
-                final AttributableType entity;
+                AttributableType entity = null;
                 if (mapItem.getIntMappingType() != null) {
                     entity = mapItem.getIntMappingType().getAttributableType();
-                } else {
-                    entity = null;
                 }
 
-                attrTypes = getAttributeTypes(entity);
+                final List<IntMappingType> attrTypes = new ArrayList<IntMappingType>(getAttributeTypes(entity));
 
                 item.add(new AjaxDecoratedCheckbox("toRemove", new Model<Boolean>(Boolean.FALSE)) {
 
@@ -231,25 +247,25 @@ public class ResourceMappingPanel extend
                     @Override
                     protected void onUpdate(final AjaxRequestTarget target) {
                         int index = -1;
-                        for (int i = 0; i < resourceTO.getUmapping().getItems().size() && index == -1; i++) {
-                            if (mapItem.equals(resourceTO.getUmapping().getItems().get(i))) {
+                        for (int i = 0; i < getMapping().getItems().size() && index == -1; i++) {
+                            if (mapItem.equals(getMapping().getItems().get(i))) {
                                 index = i;
                             }
                         }
 
                         if (index != -1) {
-                            resourceTO.getUmapping().getItems().remove(index);
+                            getMapping().getItems().remove(index);
                             item.getParent().removeAll();
-                            target.add(mappingContainer);
+                            target.add(ResourceMappingPanel.this);
                         }
                     }
 
                     @Override
-                    protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+                    protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
                         super.updateAjaxAttributes(attributes);
 
                         final AjaxCallListener ajaxCallListener = new AjaxCallListener() {
-                            
+
                             private static final long serialVersionUID = 7160235486520935153L;
 
                             @Override
@@ -265,86 +281,70 @@ public class ResourceMappingPanel extend
                         getString("intAttrNames"), new PropertyModel<String>(mapItem, "intAttrName"));
                 intAttrNames.setChoices(schemaNames);
                 intAttrNames.setRequired(true);
-                intAttrNames.setStyleSheet(fieldStyle);
+                intAttrNames.setStyleSheet(FIELD_STYLE);
                 item.add(intAttrNames);
 
                 final AjaxDropDownChoicePanel<IntMappingType> typesPanel =
                         new AjaxDropDownChoicePanel<IntMappingType>("intMappingTypes",
                         new ResourceModel("intMappingTypes", "intMappingTypes").getObject(),
                         new PropertyModel<IntMappingType>(mapItem, "intMappingType"));
-
-                // typesPanel onChange behavior provided below ...
-
                 typesPanel.setRequired(true);
                 typesPanel.setChoices(attrTypes);
-                typesPanel.setStyleSheet(fieldStyle);
+                typesPanel.setStyleSheet(FIELD_STYLE);
                 item.add(typesPanel);
 
-                final AjaxDropDownChoicePanel mappingTypesPanel = new AjaxDropDownChoicePanel("mappingTypes",
-                        new ResourceModel("mappingTypes", "mappingTypes").getObject(), new Model(entity));
-
-                mappingTypesPanel.setChoices(Arrays.asList(AttributableType.values()));
-                mappingTypesPanel.setStyleSheet(defFieldStyle);
-
-                item.add(mappingTypesPanel);
-
-                mappingTypesPanel.getField().add(new AjaxFormComponentUpdatingBehavior(onchange) {
+                final AjaxDropDownChoicePanel entitiesPanel = new AjaxDropDownChoicePanel("entities",
+                        new ResourceModel("entities", "entities").getObject(), new Model(entity));
+                entitiesPanel.setChoices(attrType == AttributableType.ROLE
+                        ? Collections.singletonList(AttributableType.ROLE)
+                        : Arrays.asList(AttributableType.values()));
+                entitiesPanel.setStyleSheet(DEF_FIELD_STYLE);
+                entitiesPanel.getField().add(new AjaxFormComponentUpdatingBehavior(ON_CHANGE) {
 
                     private static final long serialVersionUID = -1107858522700306810L;
 
                     @Override
                     protected void onUpdate(final AjaxRequestTarget target) {
-
-                        attrTypes = getAttributeTypes((AttributableType) mappingTypesPanel.getModelObject());
-
+                        attrTypes.clear();
+                        attrTypes.addAll(getAttributeTypes((AttributableType) entitiesPanel.getModelObject()));
                         typesPanel.setChoices(attrTypes);
-                        List<String> emptyList = Collections.emptyList();
-                        intAttrNames.setChoices(emptyList);
+
+                        intAttrNames.setChoices(Collections.<String>emptyList());
 
                         target.add(typesPanel.getField());
                         target.add(intAttrNames.getField());
-
                     }
                 });
+                item.add(entitiesPanel);
 
                 final FieldPanel extAttrName;
-
                 if (schemaNames.isEmpty()) {
                     extAttrName = new AjaxTextFieldPanel("extAttrName", new ResourceModel("extAttrNames",
                             "extAttrNames").getObject(), new PropertyModel<String>(mapItem, "extAttrName"));
-
                 } else {
                     extAttrName = new AjaxDropDownChoicePanel<String>("extAttrName", new ResourceModel("extAttrNames",
                             "extAttrNames").getObject(), new PropertyModel(mapItem, "extAttrName"));
                     ((AjaxDropDownChoicePanel) extAttrName).setChoices(schemaNames);
                 }
-
                 boolean required = false;
                 if (mapItem != null && !mapItem.isAccountid() && !mapItem.isPassword()) {
                     required = true;
                 }
-
-
                 extAttrName.setRequired(required);
                 extAttrName.setEnabled(required);
-
-                extAttrName.setStyleSheet(fieldStyle);
+                extAttrName.setStyleSheet(FIELD_STYLE);
                 item.add(extAttrName);
 
                 final AjaxTextFieldPanel mandatory = new AjaxTextFieldPanel("mandatoryCondition", new ResourceModel(
                         "mandatoryCondition", "mandatoryCondition").getObject(), new PropertyModel(mapItem,
                         "mandatoryCondition"));
-
                 mandatory.setChoices(Arrays.asList(new String[]{"true", "false"}));
-
-                mandatory.setStyleSheet(shortFieldStyle);
-
+                mandatory.setStyleSheet(SHORT_FIELD_STYLE);
                 item.add(mandatory);
 
                 final AjaxCheckBoxPanel accountId = new AjaxCheckBoxPanel("accountId", new ResourceModel("accountId",
                         "accountId").getObject(), new PropertyModel(mapItem, "accountid"));
-
-                accountId.getField().add(new AjaxFormComponentUpdatingBehavior(onchange) {
+                accountId.getField().add(new AjaxFormComponentUpdatingBehavior(ON_CHANGE) {
 
                     private static final long serialVersionUID = -1107858522700306810L;
 
@@ -356,13 +356,11 @@ public class ResourceMappingPanel extend
                         target.add(extAttrName);
                     }
                 });
-
                 item.add(accountId);
 
-                final AjaxCheckBoxPanel password = new AjaxCheckBoxPanel("password", new ResourceModel("password",
-                        "password").getObject(), new PropertyModel(mapItem, "password"));
-
-                password.getField().add(new AjaxFormComponentUpdatingBehavior(onchange) {
+                final AjaxCheckBoxPanel password = new AjaxCheckBoxPanel("password",
+                        new ResourceModel("password", "password").getObject(), new PropertyModel(mapItem, "password"));
+                password.getField().add(new AjaxFormComponentUpdatingBehavior(ON_CHANGE) {
 
                     private static final long serialVersionUID = -1107858522700306810L;
 
@@ -377,10 +375,12 @@ public class ResourceMappingPanel extend
                         target.add(accountId);
                     }
                 });
-
                 item.add(password);
+                if (AttributableType.USER != ResourceMappingPanel.this.attrType) {
+                    password.setVisible(false);
+                }
 
-                typesPanel.getField().add(new AjaxFormComponentUpdatingBehavior(onchange) {
+                typesPanel.getField().add(new AjaxFormComponentUpdatingBehavior(ON_CHANGE) {
 
                     private static final long serialVersionUID = -1107858522700306810L;
 
@@ -402,14 +402,14 @@ public class ResourceMappingPanel extend
         mappings.setReuseItems(true);
         mappingContainer.add(mappings);
 
-        addMappingBtn = new IndicatingAjaxButton("addUserSchemaMappingBtn", new ResourceModel("add")) {
+        addMappingBtn = new IndicatingAjaxButton("addMappingBtn", new ResourceModel("add")) {
 
             private static final long serialVersionUID = -4804368561204623354L;
 
             @Override
             protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-                resourceTO.getUmapping().getItems().add(new MappingItemTO());
-                target.add(mappingContainer);
+                getMapping().getItems().add(new MappingItemTO());
+                target.add(ResourceMappingPanel.this);
             }
 
             @Override
@@ -417,22 +417,9 @@ public class ResourceMappingPanel extend
                 // ignore errors
             }
         };
-
         addMappingBtn.setDefaultFormProcessing(false);
-        addMappingBtn.setEnabled(resourceTO.getConnectorId() != null && resourceTO.getConnectorId() > 0);
+        addMappingBtn.setEnabled(this.resourceTO.getConnectorId() != null && this.resourceTO.getConnectorId() > 0);
         mappingContainer.add(addMappingBtn);
-
-    }
-
-    /**
-     * Initialize resource schema names.
-     */
-    private void initResourceSchemaNames() {
-        if (resourceTO != null && resourceTO.getConnectorId() != null && resourceTO.getConnectorId() > 0) {
-            schemaNames = getResourceSchemaNames(resourceTO.getConnectorId(), resourceTO.getConnConfProperties());
-        } else {
-            schemaNames = Collections.emptyList();
-        }
     }
 
     /**
@@ -446,13 +433,11 @@ public class ResourceMappingPanel extend
         final List<String> names = new ArrayList<String>();
 
         try {
-
             final ConnInstanceTO connInstanceTO = new ConnInstanceTO();
             connInstanceTO.setId(connectorId);
             connInstanceTO.setConfiguration(conf);
 
             names.addAll(connRestClient.getSchemaNames(connInstanceTO));
-
         } catch (Exception e) {
             LOG.warn("Error retrieving resource schema names", e);
         }
@@ -462,9 +447,7 @@ public class ResourceMappingPanel extend
 
     @Override
     public void onEvent(final IEvent<?> event) {
-
         if (event.getPayload() instanceof ConnConfModEvent) {
-
             final AjaxRequestTarget target = ((ConnConfModEvent) event.getPayload()).getTarget();
 
             final List<ConnConfProperty> conf = ((ConnConfModEvent) event.getPayload()).getConfiguration();
@@ -473,9 +456,11 @@ public class ResourceMappingPanel extend
 
             addMappingBtn.setEnabled(resourceTO.getConnectorId() != null && resourceTO.getConnectorId() > 0);
 
-            schemaNames = getResourceSchemaNames(resourceTO.getConnectorId(), new HashSet<ConnConfProperty>(conf));
+            schemaNames.clear();
+            schemaNames.addAll(
+                    getResourceSchemaNames(resourceTO.getConnectorId(), new HashSet<ConnConfProperty>(conf)));
 
-            target.add(mappingContainer);
+            target.add(this);
         }
     }
 
@@ -517,6 +502,8 @@ public class ResourceMappingPanel extend
                 case UserId:
                 case Password:
                 case Username:
+                case RoleId:
+                case RoleName:
                 default:
                     toBeUpdated.setRequired(false);
                     toBeUpdated.setEnabled(false);

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java Mon Jan 14 17:02:50 2013
@@ -21,6 +21,11 @@ package org.apache.syncope.console.pages
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.syncope.client.to.PolicyTO;
+import org.apache.syncope.client.to.ResourceTO;
+import org.apache.syncope.console.rest.PolicyRestClient;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.types.PolicyType;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.form.ChoiceRenderer;
 import org.apache.wicket.markup.html.form.DropDownChoice;
@@ -32,29 +37,24 @@ import org.apache.wicket.model.ResourceM
 import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.syncope.client.to.PolicyTO;
-import org.apache.syncope.client.to.ResourceTO;
-import org.apache.syncope.console.rest.PolicyRestClient;
-import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.types.PolicyType;
 
 public class ResourceSecurityPanel extends Panel {
 
     /**
      * Logger.
      */
-    protected static final Logger LOG = LoggerFactory.getLogger(ResourceSecurityPanel.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ResourceSecurityPanel.class);
 
     private static final long serialVersionUID = -7982691107029848579L;
 
     @SpringBean
     private PolicyRestClient policyRestClient;
 
-    IModel<Map<Long, String>> passwordPolicies = null;
+    private IModel<Map<Long, String>> passwordPolicies = null;
 
-    IModel<Map<Long, String>> accountPolicies = null;
+    private IModel<Map<Long, String>> accountPolicies = null;
 
-    IModel<Map<Long, String>> syncPolicies = null;
+    private IModel<Map<Long, String>> syncPolicies = null;
 
     public ResourceSecurityPanel(final String id, final ResourceTO resourceTO) {
 
@@ -114,7 +114,7 @@ public class ResourceSecurityPanel exten
         // -------------------------------
         final AjaxDropDownChoicePanel<Long> passwordPolicy = new AjaxDropDownChoicePanel<Long>("passwordPolicy",
                 new ResourceModel("passwordPolicy", "passwordPolicy").getObject(), new PropertyModel<Long>(resourceTO,
-                        "passwordPolicy"));
+                "passwordPolicy"));
 
         passwordPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.PASSWORD));
 
@@ -130,7 +130,7 @@ public class ResourceSecurityPanel exten
         // -------------------------------
         final AjaxDropDownChoicePanel<Long> accountPolicy = new AjaxDropDownChoicePanel<Long>("accountPolicy",
                 new ResourceModel("accountPolicy", "accountPolicy").getObject(), new PropertyModel<Long>(resourceTO,
-                        "accountPolicy"));
+                "accountPolicy"));
 
         accountPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.ACCOUNT));
 
@@ -145,7 +145,8 @@ public class ResourceSecurityPanel exten
         // Sync policy specification
         // -------------------------------
         final AjaxDropDownChoicePanel<Long> syncPolicy = new AjaxDropDownChoicePanel<Long>("syncPolicy",
-                new ResourceModel("syncPolicy", "syncPolicy").getObject(), new PropertyModel<Long>(resourceTO, "syncPolicy"));
+                new ResourceModel("syncPolicy", "syncPolicy").getObject(), new PropertyModel<Long>(resourceTO,
+                "syncPolicy"));
 
         syncPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.SYNC));
 

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSecurityPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSecurityPanel.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSecurityPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSecurityPanel.java Mon Jan 14 17:02:50 2013
@@ -21,6 +21,12 @@ package org.apache.syncope.console.pages
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.syncope.client.to.AbstractAttributableTO;
+import org.apache.syncope.client.to.PolicyTO;
+import org.apache.syncope.console.rest.PolicyRestClient;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.types.PolicyType;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
 import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -33,12 +39,6 @@ import org.apache.wicket.model.PropertyM
 import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.syncope.client.to.AbstractAttributableTO;
-import org.apache.syncope.client.to.PolicyTO;
-import org.apache.syncope.console.rest.PolicyRestClient;
-import org.apache.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel;
-import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.types.PolicyType;
 
 public class RoleSecurityPanel extends Panel {
 
@@ -52,12 +52,11 @@ public class RoleSecurityPanel extends P
     @SpringBean
     private PolicyRestClient policyRestClient;
 
-    IModel<Map<Long, String>> passwordPolicies = null;
+    private IModel<Map<Long, String>> passwordPolicies = null;
 
-    IModel<Map<Long, String>> accountPolicies = null;
+    private IModel<Map<Long, String>> accountPolicies = null;
 
     public <T extends AbstractAttributableTO> RoleSecurityPanel(final String id, final T entityTO) {
-
         super(id);
 
         setOutputMarkupId(true);

Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.html?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.html Mon Jan 14 17:02:50 2013
@@ -49,21 +49,23 @@ under the License.
       <div id="tabs">
         <ul>
           <li  class="tabs-selected"><a href="#resource"><span><wicket:message key="resource"/></span></a></li>
-          <li><a href="#mappings"><span><wicket:message key="mappings"/></span></a></li>
+          <li><a href="#umapping"><span><wicket:message key="umapping"/></span></a></li>
+          <li><a href="#rmapping"><span><wicket:message key="rmapping"/></span></a></li>
           <li><a href="#connectorProperties"><span><wicket:message key="connectorProperties"/></span></a></li>
           <li><a href="#security"><span><wicket:message key="security"/></span></a></li>
         </ul>
         <div id="resource">
           <span wicket:id="details">[details]</span>
         </div>
-        <div id="mappings">
-          <span wicket:id="mapping">[mapping]</span>
+        <div id="umapping">
+          <span wicket:id="umapping">[umapping]</span>
+        </div>
+        <div id="rmapping">
+          <span wicket:id="rmapping">[rmapping]</span>
         </div>
-
         <div id="connectorProperties">
           <span wicket:id="connconf">[connconf]</span>
         </div>
-
         <div id="security">
           <span wicket:id="security">[security]</span>
         </div>

Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties Mon Jan 14 17:02:50 2013
@@ -14,8 +14,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-resource=Resource Details
-mappings=Schema Mappings
+resource=Resource details
+umapping=User mapping
 connectorProperties=Connector properties
 security=Security
 create_attribute=Create new resource
@@ -25,7 +25,7 @@ existing_resources=Existing resources
 action=Action
 edit_attribute=Edit resource
 title=Resource
-extAttrNames=External Attributes
+extAttrNames=External attributes
 intMappingTypes=Internal mapping types
 entity=Entity
 roleSchema=Role Schema
@@ -35,7 +35,7 @@ password=Password
 mappingUserSchema=Mapping User Schema
 mappingRoleSchema=Mapping Role Schema
 delete=Delete
-intAttrNames=Internal Attributes
+intAttrNames=Internal attributes
 enforceMandatoryCondition=Enforce mandatory condition
 fieldName=Field name
 
@@ -50,9 +50,10 @@ deleteTraceLevel=Delete trace level
 syncTraceLevel=Synchronization trace level
 propagationPriority=Propagation priority
 propagationPrimary=Propagation primary
-resetToken=Reset Token
+resetToken=Reset token
 
 success_connection=Successful connection
 error_connection=Connection failure
 check=Check connection
 actionsClass=Actions class
+rmapping=Role mapping

Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties Mon Jan 14 17:02:50 2013
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 resource=Dettagli Risorsa
-mappings=Schema Mapping
+umapping=Mapping utenti
 connectorProperties=Propriet\u00e0\u00a0 Connettore
 security=Sicurezza
 
@@ -51,9 +51,10 @@ deleteTraceLevel=Livello di tracciamento
 syncTraceLevel=Livello di tracciamento delle sincronizzazioni
 propagationPriority=Priorit\u00e0 in propagazione
 propagationPrimary=Primaria in propagazione
-resetToken=Reset Token
+resetToken=Reset token
 
 success_connection=Connessione avvenuta con successo
 error_connection=Connessione non riuscita
 check=Verifica connessione
 actionsClass=Classe azioni
+rmapping=Mapping ruoli

Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources.properties?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources.properties Mon Jan 14 17:02:50 2013
@@ -29,3 +29,4 @@ edit=Edit
 delete=Delete
 create-connector=Create new connector
 delete_error=Operation forbidden:the connector you're trying to delete is connected to a Resource
+connector=Connector

Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources_it.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources_it.properties?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources_it.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Resources_it.properties Mon Jan 14 17:02:50 2013
@@ -29,3 +29,4 @@ edit=Modifica
 delete=Elimina
 delete_error=Operazione vietata: il connettore che si desidera rimuovere \u00e8 correlato ad una risorsa
 displayName=Nome visualizzato
+connector=Connettore

Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceMappingPanel.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceMappingPanel.html?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceMappingPanel.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceMappingPanel.html Mon Jan 14 17:02:50 2013
@@ -16,101 +16,91 @@ KIND, either express or implied.  See th
 specific language governing permissions and limitations
 under the License.
 -->
-<html>
-    <wicket:panel>
-        <div id="formtable">
-            <div class="tablerow">
-                <div class="tablecolumn_field all_dynamicsize">
-                    <table id="mappingUserSchema"
-                           class="ui-widget ui-widget-content ui-corner-all"
-                           style="font-size: 1em;margin-top:2px;"
-                           width="100%" cellpadding="2px" cellspacing="1px"
-                           wicket:id="mappingContainer">
-                        <thead>
-                            <tr class="ui-widget-header">
-                                <th><wicket:message key="delete"/></th>
-                        <th><wicket:message key="entity"/></th>
-                        <th><wicket:message key="intMappingTypes"/></th>
-                        <th><wicket:message key="intAttrNames"/></th>
-                        <th><wicket:message key="extAttrNames"/></th>
-                        <th><wicket:message key="mandatoryCondition"/></th>
-                        <th><wicket:message key="accountId"/></th>
-                        <th><wicket:message key="password"/></th>
-                        </tr>
-                        </thead>
-                        <tfoot>
-                            <tr>
-                                <td colspan="7" style="padding: 5px">
-                                    <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
-                                           wicket:id="addUserSchemaMappingBtn" />
-                                </td>
-                            </tr>
-                        </tfoot>
-                        <tbody>
-                            <tr wicket:id="mappings">
-                                <td align="center" valign="middle">
-                                    <input type="checkbox" class="text ui-widget-content ui-corner-all"  wicket:id="toRemove"/>
-                                </td>
-                                <td align="center" valign="middle">
-                                    <span wicket:id="mappingTypes">[mappingTypes]</span>
-                                </td>
-                                <td align="center" valign="middle">
-                                    <span wicket:id="intMappingTypes">[intMappingTypes]</span>
-                                </td>
-                                <td align="center" valign="middle">
-                                    <span wicket:id="intAttrNames">[intAttrNames]</span>
-                                </td>
-                                <td align="center" valign="middle">
-                                    <span wicket:id="extAttrName">[extAttrName]</span>
-                                </td>
-                                <td align="center" valign="middle">
-                                    <span wicket:id="mandatoryCondition">[mandatoryCondition]</span>
-                                </td>
-                                <td align="center" valign="middle">
-                                    <span wicket:id="accountId">[accountId]</span>
-                                </td>
-                                <td align="center" valign="middle">
-                                    <span wicket:id="password">[password]</span>
-                                </td>
-                            </tr>
-                        </tbody>
-                    </table>
-                </div>
-            </div>
+<wicket:panel>
+  <div>
+    <table id="mappings"
+           class="ui-widget ui-widget-content ui-corner-all"
+           style="font-size: 1em;margin-top:2px;"
+           width="100%" cellpadding="2px" cellspacing="1px"
+           wicket:id="mappingContainer">
+      <thead>
+        <tr class="ui-widget-header">
+          <th><wicket:message key="delete"/></th>
+      <th><wicket:message key="entity"/></th>
+      <th><wicket:message key="intMappingTypes"/></th>
+      <th><wicket:message key="intAttrNames"/></th>
+      <th><wicket:message key="extAttrNames"/></th>
+      <th><wicket:message key="mandatoryCondition"/></th>
+      <th><wicket:message key="accountId"/></th>
+      <th><label wicket:id="passwordLabel"/></th>
+      </tr>
+      </thead>
+      <tfoot>
+        <tr>
+          <td colspan="7" style="padding: 5px">
+            <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+                   wicket:id="addMappingBtn" />
+          </td>
+        </tr>
+      </tfoot>
+      <tbody>
+        <tr wicket:id="mappings" class="tablerow">
+          <td align="center" valign="middle">
+            <input type="checkbox" class="text ui-widget-content ui-corner-all"  wicket:id="toRemove"/>
+          </td>
+          <td align="center" valign="middle">
+            <span wicket:id="entities">[entities]</span>
+          </td>
+          <td align="center" valign="middle">
+            <span wicket:id="intMappingTypes">[intMappingTypes]</span>
+          </td>
+          <td align="center" valign="middle">
+            <span wicket:id="intAttrNames">[intAttrNames]</span>
+          </td>
+          <td align="center" valign="middle">
+            <span wicket:id="extAttrName">[extAttrName]</span>
+          </td>
+          <td align="center" valign="middle">
+            <span wicket:id="mandatoryCondition">[mandatoryCondition]</span>
+          </td>
+          <td align="center" valign="middle">
+            <span wicket:id="accountId">[accountId]</span>
+          </td>
+          <td align="center" valign="middle">
+            <span wicket:id="password">[password]</span>
+          </td>
+        </tr>
+      </tbody>
+    </table>
 
-            <div class="tablerow">
-                <div class="tablecolumn_field all_dynamicsize">
-                    <table id="accountLinkTable"
-                           class="ui-widget ui-widget-content ui-corner-all"
-                           style="font-size: 1em;margin-top:2px;"
-                           border-width="1px;" border-color="#cccccc;" border-style="solid;"
-                           width="100%" cellpadding="2px" cellspacing="1px"
-                           wicket:id="accountLinkContainer">
-                        <thead>
-                            <tr class="ui-widget-header">
-                                <th width="10%" align="left"><wicket:message key="enable"/></th>
-                                <th align="left"><wicket:message key="accountLink"/></th>
-                            </tr>
-                        </thead>
-                        <tbody>
-                            <tr>
-                                <td width="10%" align="left" valign="middle">
-                                    <span wicket:id="accountLinkCheckbox">[accountLinkCheckbox]</span>
-                                </td>
-                                <td align="left" valign="middle">
-                                    <span wicket:id="accountLink">[accountLink]</span>
-                                </td>
-                            </tr>
-                        </tbody>
-                    </table>
-                </div>
-            </div>
-        </div>
+    <script type="text/javascript">
+      $(function() {
+        $('table#mappings tbody tr.tablerow:even').addClass("alt");
+      });
+    </script>
 
-        <script type="text/javascript">
-            $(function() {
-                $('div#mappings div#formtable div.tablerow:even').addClass("alt");
-            });
-        </script>
-    </wicket:panel>
-</html>
+    <table id="accountLinkTable"
+           class="ui-widget ui-widget-content ui-corner-all"
+           style="font-size: 1em;margin-top:2px;"
+           border-width="1px;" border-color="#cccccc;" border-style="solid;"
+           width="100%" cellpadding="2px" cellspacing="1px"
+           wicket:id="accountLinkContainer">
+      <thead>
+        <tr class="ui-widget-header">
+          <th width="10%" align="left"><wicket:message key="enable"/></th>
+      <th align="left"><wicket:message key="accountLink"/></th>
+      </tr>
+      </thead>
+      <tbody>
+        <tr>
+          <td width="10%" align="left" valign="middle">
+            <span wicket:id="accountLinkCheckbox">[accountLinkCheckbox]</span>
+          </td>
+          <td align="left" valign="middle">
+            <span wicket:id="accountLink">[accountLink]</span>
+          </td>
+        </tr>
+      </tbody>
+    </table>
+  </div>
+</wicket:panel>

Modified: syncope/trunk/console/src/main/webapp/css/fieldstyle.css
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/webapp/css/fieldstyle.css?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/main/webapp/css/fieldstyle.css (original)
+++ syncope/trunk/console/src/main/webapp/css/fieldstyle.css Mon Jan 14 17:02:50 2013
@@ -49,7 +49,7 @@ div.tablerow {
   width: 100%;
 }
 
-div.alt {
+.alt {
   background: #eff3ea;
 }
 
@@ -112,4 +112,4 @@ div.tablecolumn_check{
   zoom: 1; 
   overflow: visible; 
   padding: 7px 15px;
-}
\ No newline at end of file
+}

Modified: syncope/trunk/console/src/test/java/org/apache/syncope/console/ResourceTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/java/org/apache/syncope/console/ResourceTestITCase.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/test/java/org/apache/syncope/console/ResourceTestITCase.java (original)
+++ syncope/trunk/console/src/test/java/org/apache/syncope/console/ResourceTestITCase.java Mon Jan 14 17:02:50 2013
@@ -42,7 +42,7 @@ public class ResourceTestITCase extends 
 
         selenium.waitForCondition("selenium.isElementPresent(\"//div[@id='tabs']\");", "30000");
 
-        selenium.click("//td[4]/div/span[8]/a");
+        selenium.click("//td[5]/div/span[8]/a");
 
         selenium.waitForCondition("selenium.isElementPresent("
                 + "\"//form/div[2]/div/span/div/div/div/label[text()='Name']\");", "30000");
@@ -64,7 +64,7 @@ public class ResourceTestITCase extends 
 
         selenium.waitForCondition("selenium.isElementPresent(\"//div[@id='tabs']\");", "30000");
 
-        selenium.click("//tr[3]/td[4]/div/span[10]/a");
+        selenium.click("//tr[3]/td[5]/div/span[10]/a");
 
         assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
     }
@@ -75,7 +75,7 @@ public class ResourceTestITCase extends 
 
         selenium.waitForCondition("selenium.isElementPresent(\"//div[@id='tabs']\");", "30000");
 
-        selenium.click("//td[4]/div/span[8]/a");
+        selenium.click("//td[5]/div/span[8]/a");
 
         selenium.waitForCondition("selenium.isElementPresent("
                 + "\"//form/div[2]/div/span/div/div/div/label[text()='Name']\");", "30000");
@@ -97,7 +97,7 @@ public class ResourceTestITCase extends 
 
         selenium.waitForCondition("selenium.isElementPresent(\"//div[@id='tabs']\");", "30000");
 
-        selenium.click("//*[@id=\"users-contain\"]//*[div=\"ws-target-resource-delete\"]/../td[4]/div/span[8]/a");
+        selenium.click("//*[@id=\"users-contain\"]//*[div=\"ws-target-resource-delete\"]/../td[5]/div/span[8]/a");
 
         selenium.waitForCondition("selenium.isElementPresent("
                 + "\"//form/div[2]/div/span/div/div/div/label[text()='Name']\");", "30000");
@@ -106,7 +106,7 @@ public class ResourceTestITCase extends 
 
         selenium.waitForCondition("selenium.isElementPresent(" + "\"//span[text()='endpoint']\");", "30000");
 
-        selenium.click("//div[2]/form/div[2]/div[3]/span/span/div[2]/a/img");
+        selenium.click("//div[2]/form/div[2]/div[4]/span/span/div[2]/a");
 
         selenium.waitForCondition(
                 "selenium.isElementPresent(\"//div/ul/li/span[contains(text(), 'Successful connection')]\");", "30000");

Modified: syncope/trunk/console/src/test/resources/configuration.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/resources/configuration.properties?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/console/src/test/resources/configuration.properties (original)
+++ syncope/trunk/console/src/test/resources/configuration.properties Mon Jan 14 17:02:50 2013
@@ -17,4 +17,4 @@
 scheme=http
 host=localhost
 port=9080
-path=/syncope/rest/
+rootPath=/syncope/rest/

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java Mon Jan 14 17:02:50 2013
@@ -454,8 +454,8 @@ public class ConnectorFacadeProxy {
     /**
      * Return resource schema names.
      *
-     * @param showall return __NAME__ and __PASSWORD__ attribute if true.
-     * @return a list of schema names.
+     * @param showall return special attributes (like as __NAME__ or __PASSWORD__) if true
+     * @return a list of schema names
      */
     public Set<String> getSchema(final boolean showall) {
         final Set<String> resourceSchemaNames = new HashSet<String>();

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java?rev=1432990&r1=1432989&r2=1432990&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java Mon Jan 14 17:02:50 2013
@@ -322,22 +322,18 @@ public class ConnInstanceController exte
         }
 
         // consider the possibility to receive overridden properties only
-        final Set<ConnConfProperty> conf = mergeConnConfProperties(connectorTO.getConfiguration(), connInstance.
-                getConfiguration());
-
-        // We cannot use Spring bean because this method could be used during
-        // resource definition or modification: bean couldn't exist or bean
-        // couldn't be updated.
-        // This is the reason why we should take a "not mature" connector
-        // facade proxy to ask for schema names.
-
-        final List<String> result = new ArrayList<String>(connLoader.createConnectorBean(connInstance, conf).getSchema(
-                showall));
+        final Set<ConnConfProperty> conf = mergeConnConfProperties(connectorTO.getConfiguration(),
+                connInstance.getConfiguration());
 
+        // We cannot use Spring bean because this method could be used during resource definition or modification: 
+        // bean couldn't exist or couldn't be updated.
+        // This is the reason why we should take a "not mature" connector facade proxy to ask for schema names.
+        final List<String> result = new ArrayList<String>(connLoader.createConnectorBean(connInstance, conf).
+                getSchema(showall));
         Collections.sort(result);
 
         auditManager.audit(Category.connector, ConnectorSubCategory.getSchemaNames, Result.success,
-                "Successfully listed all schema names (" + result.size() + ") for connector "
+                "Successfully listed " + (showall ? "all " : "") + "schema names (" + result.size() + ") for connector "
                 + connInstance.getDisplayName());
 
         return result;



Mime
View raw message