You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2012/03/06 18:29:31 UTC

svn commit: r1297585 [3/5] - in /incubator/syncope/trunk: client/src/main/java/org/syncope/client/report/ client/src/main/java/org/syncope/client/search/ client/src/main/java/org/syncope/client/to/ console/src/main/java/org/syncope/console/commons/ con...

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/PolicyBeanPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/PolicyBeanPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/PolicyBeanPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/PolicyBeanPanel.java Tue Mar  6 17:29:27 2012
@@ -42,17 +42,17 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.util.StringUtils;
 import org.syncope.annotation.SchemaList;
-import org.syncope.client.to.SchemaTO;
 import org.syncope.console.commons.XMLRolesReader;
 import org.syncope.console.rest.SchemaRestClient;
 import org.syncope.console.wicket.markup.html.form.AbstractFieldPanel;
-import org.syncope.console.wicket.markup.html.form.MultiValueSelectorPanel;
 import org.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel;
 import org.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
 import org.syncope.console.wicket.markup.html.form.AjaxPalettePanel;
 import org.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.syncope.console.wicket.markup.html.form.FieldPanel;
+import org.syncope.console.wicket.markup.html.form.MultiValueSelectorPanel;
 import org.syncope.types.AbstractPolicySpec;
+import org.syncope.types.AttributableType;
 import org.syncope.types.ConflictResolutionAction;
 
 public class PolicyBeanPanel extends Panel {
@@ -76,16 +76,7 @@ public class PolicyBeanPanel extends Pan
 
                 @Override
                 protected List<String> load() {
-                    final List<SchemaTO> schemaTOs;
-                    schemaTOs = schemaRestClient.getSchemas("user");
-
-                    final List<String> schemas = new ArrayList<String>();
-
-                    for (SchemaTO schemaTO : schemaTOs) {
-                        schemas.add(schemaTO.getName());
-                    }
-
-                    return schemas;
+                    return schemaRestClient.getSchemaNames(AttributableType.USER);
                 }
             };
 
@@ -96,18 +87,15 @@ public class PolicyBeanPanel extends Pan
             final String id, final AbstractPolicySpec policy) {
         super(id);
 
-        FieldWrapper fieldWrapper = null;
         final List<FieldWrapper> items = new ArrayList<FieldWrapper>();
 
-
         for (Field field : policy.getClass().getDeclaredFields()) {
             if (!"serialVersionUID".equals(field.getName())) {
-                fieldWrapper = new FieldWrapper();
+                FieldWrapper fieldWrapper = new FieldWrapper();
                 fieldWrapper.setName(field.getName());
                 fieldWrapper.setType(field.getType());
 
-                final SchemaList schemaList =
-                        field.getAnnotation(SchemaList.class);
+                final SchemaList schemaList = field.getAnnotation(SchemaList.class);
 
                 fieldWrapper.setSchemaList(schemaList);
 
@@ -137,11 +125,8 @@ public class PolicyBeanPanel extends Pan
                                 "get" + StringUtils.capitalize(field.getName()),
                                 new Class[]{});
 
-                        component = new AjaxDropDownChoicePanel(
-                                "field",
-                                field.getName(),
-                                new PropertyModel(policy, field.getName()),
-                                false);
+                        component = new AjaxDropDownChoicePanel("field", field.getName(),
+                                new PropertyModel(policy, field.getName()));
 
                         ((AjaxDropDownChoicePanel) component).setChoices(
                                 Arrays.asList(ConflictResolutionAction.values()));
@@ -156,20 +141,13 @@ public class PolicyBeanPanel extends Pan
                                 ConflictResolutionAction.IGNORE));
 
 
-                    } else if (field.getType().equals(boolean.class)
-                            || field.getType().equals(Boolean.class)) {
-
-                        item.add(new AjaxCheckBoxPanel(
-                                "check",
-                                field.getName(),
-                                new PropertyModel(policy, field.getName()),
-                                false));
+                    } else if (field.getType().equals(boolean.class) || field.getType().equals(Boolean.class)) {
+                        item.add(new AjaxCheckBoxPanel("check", field.getName(),
+                                new PropertyModel(policy, field.getName())));
 
                         item.add(new Label("field", new Model(null)));
 
-                    } else if (field.getType().equals(List.class)
-                            || field.getType().equals(Set.class)) {
-
+                    } else if (field.getType().equals(List.class) || field.getType().equals(Set.class)) {
                         classMethod = policy.getClass().getMethod(
                                 "get" + StringUtils.capitalize(field.getName()),
                                 new Class[]{});
@@ -197,18 +175,13 @@ public class PolicyBeanPanel extends Pan
                                     new ArrayList<String>(),
                                     new ArrayList<String>()));
                         } else {
-                            final FieldPanel panel = new AjaxTextFieldPanel(
-                                    "panel",
-                                    field.getName(),
-                                    new Model(null),
-                                    true);
+                            final FieldPanel panel = new AjaxTextFieldPanel("panel", field.getName(), new Model(null));
 
                             panel.setRequired(true);
 
                             component = new MultiValueSelectorPanel<String>(
                                     "field",
                                     new PropertyModel(policy, field.getName()),
-                                    String.class,
                                     panel);
 
                             item.add(component);
@@ -232,11 +205,8 @@ public class PolicyBeanPanel extends Pan
                                 "get" + StringUtils.capitalize(field.getName()),
                                 new Class[]{});
 
-                        component = new AjaxTextFieldPanel(
-                                "field",
-                                field.getName(),
-                                new PropertyModel(policy, field.getName()),
-                                false);
+                        component = new AjaxTextFieldPanel("field", field.getName(),
+                                new PropertyModel(policy, field.getName()));
 
                         item.add(component);
 
@@ -247,8 +217,7 @@ public class PolicyBeanPanel extends Pan
                                 0,
                                 0));
                     } else {
-                        item.add(new AjaxCheckBoxPanel(
-                                "check", field.getName(), new Model(), false));
+                        item.add(new AjaxCheckBoxPanel("check", field.getName(), new Model()));
                         item.add(new Label("field", new Model(null)));
                     }
                 } catch (Exception e) {
@@ -266,11 +235,7 @@ public class PolicyBeanPanel extends Pan
             final T defaultModelObject,
             final T reinitializedValue) {
 
-        final AjaxCheckBoxPanel check = new AjaxCheckBoxPanel(
-                "check",
-                "check",
-                new Model(checked),
-                false);
+        final AjaxCheckBoxPanel check = new AjaxCheckBoxPanel("check", "check", new Model(checked));
 
         panel.setEnabled(checked);
 
@@ -295,7 +260,7 @@ public class PolicyBeanPanel extends Pan
         return check;
     }
 
-    private class FieldWrapper implements Serializable {
+    private static class FieldWrapper implements Serializable {
 
         private static final long serialVersionUID = -6770429509752964215L;
 
@@ -303,7 +268,7 @@ public class PolicyBeanPanel extends Pan
 
         private String name;
 
-        private SchemaList schemaList;
+        private transient SchemaList schemaList;
 
         public String getName() {
             return name;

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceConnConfPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceConnConfPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceConnConfPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceConnConfPanel.java Tue Mar  6 17:29:27 2012
@@ -187,14 +187,8 @@ public class ResourceConnConfPanel exten
                         || GUARDED_BYTE_ARRAY.equalsIgnoreCase(
                         property.getSchema().getType())) {
 
-                    field = new AjaxPasswordFieldPanel(
-                            "panel",
-                            label.getDefaultModelObjectAsString(),
-                            new Model(),
-                            true);
-
-                    ((PasswordTextField) field.getField()).setResetPassword(
-                            false);
+                    field = new AjaxPasswordFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model());
+                    ((PasswordTextField) field.getField()).setResetPassword(false);
 
                     required = property.getSchema().isRequired();
 
@@ -211,29 +205,14 @@ public class ResourceConnConfPanel exten
                     }
 
                     if (NUMBER.contains(propertySchemaClass)) {
-                        field = new AjaxNumberFieldPanel(
-                                "panel",
-                                label.getDefaultModelObjectAsString(),
-                                new Model(),
-                                ClassUtils.resolvePrimitiveIfNecessary(
-                                propertySchemaClass),
-                                true);
+                        field = new AjaxNumberFieldPanel("panel", label.getDefaultModelObjectAsString(),
+                                new Model(), ClassUtils.resolvePrimitiveIfNecessary(propertySchemaClass));
 
                         required = property.getSchema().isRequired();
-                    } else if (Boolean.class.equals(propertySchemaClass)
-                            || boolean.class.equals(propertySchemaClass)) {
-                        field = new AjaxCheckBoxPanel(
-                                "panel",
-                                label.getDefaultModelObjectAsString(),
-                                new Model(),
-                                true);
+                    } else if (Boolean.class.equals(propertySchemaClass) || boolean.class.equals(propertySchemaClass)) {
+                        field = new AjaxCheckBoxPanel("panel", label.getDefaultModelObjectAsString(), new Model());
                     } else {
-
-                        field = new AjaxTextFieldPanel(
-                                "panel",
-                                label.getDefaultModelObjectAsString(),
-                                new Model(),
-                                true);
+                        field = new AjaxTextFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model());
 
                         required = property.getSchema().isRequired();
                     }
@@ -256,7 +235,6 @@ public class ResourceConnConfPanel exten
                             new MultiValueSelectorPanel<String>(
                             "panel",
                             new PropertyModel<List<String>>(property, "values"),
-                            String.class,
                             field,
                             true);
 
@@ -335,7 +313,7 @@ public class ResourceConnConfPanel exten
             // get configuration properties and send a new event
             send(getPage(), Broadcast.BREADTH,
                     new ConnConfModEvent(target, connConfProperties));
-            
+
         } else if (event.getPayload() instanceof MultiValueSelectorEvent) {
             // multi value connector property change: forward event
             final AjaxRequestTarget target =

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceDetailsPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceDetailsPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceDetailsPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceDetailsPanel.java Tue Mar  6 17:29:27 2012
@@ -82,97 +82,61 @@ public class ResourceDetailsPanel extend
         connInstanceTO =
                 getConectorInstanceTO(connectors.getObject(), resourceTO);
 
-        final AjaxTextFieldPanel resourceName = new AjaxTextFieldPanel(
-                "name",
-                new ResourceModel("name", "name").getObject(),
-                new PropertyModel<String>(resourceTO, "name"),
-                false);
+        final AjaxTextFieldPanel resourceName = new AjaxTextFieldPanel("name",
+                new ResourceModel("name", "name").getObject(), new PropertyModel<String>(resourceTO, "name"));
 
         resourceName.setEnabled(createFlag);
         resourceName.addRequiredLabel();
         add(resourceName);
 
-        final AjaxCheckBoxPanel forceMandatoryConstraint =
-                new AjaxCheckBoxPanel(
-                "forceMandatoryConstraint",
-                new ResourceModel(
-                "forceMandatoryConstraint", "forceMandatoryConstraint").
-                getObject(),
-                new PropertyModel<Boolean>(resourceTO,
-                "forceMandatoryConstraint"),
-                false);
+        final AjaxCheckBoxPanel forceMandatoryConstraint = new AjaxCheckBoxPanel("forceMandatoryConstraint",
+                new ResourceModel("forceMandatoryConstraint", "forceMandatoryConstraint").getObject(),
+                new PropertyModel<Boolean>(resourceTO, "forceMandatoryConstraint"));
         add(forceMandatoryConstraint);
 
-        final AjaxCheckBoxPanel propagationPrimary =
-                new AjaxCheckBoxPanel(
-                "propagationPrimary",
-                new ResourceModel(
-                "propagationPrimary", "propagationPrimary").getObject(),
-                new PropertyModel<Boolean>(resourceTO,
-                "propagationPrimary"),
-                false);
+        final AjaxCheckBoxPanel propagationPrimary = new AjaxCheckBoxPanel("propagationPrimary",
+                new ResourceModel("propagationPrimary", "propagationPrimary").getObject(),
+                new PropertyModel<Boolean>(resourceTO, "propagationPrimary"));
         add(propagationPrimary);
 
-        final AjaxNumberFieldPanel propagationPriority =
-                new AjaxNumberFieldPanel(
-                "propagationPriority",
-                new ResourceModel("propagationPriority", "propagationPriority").
-                getObject(),
-                new PropertyModel<Number>(resourceTO, "propagationPriority"),
-                Integer.class,
-                false);
+        final AjaxNumberFieldPanel propagationPriority = new AjaxNumberFieldPanel("propagationPriority",
+                new ResourceModel("propagationPriority", "propagationPriority").getObject(),
+                new PropertyModel<Number>(resourceTO, "propagationPriority"), Integer.class);
         add(propagationPriority);
 
-        final AjaxDropDownChoicePanel<PropagationMode> propagationMode =
-                new AjaxDropDownChoicePanel<PropagationMode>(
-                "propagationMode",
-                new ResourceModel("propagationMode", "propagationMode").
-                getObject(),
-                new PropertyModel(resourceTO, "propagationMode"),
-                false);
+        final AjaxDropDownChoicePanel<PropagationMode> propagationMode = new AjaxDropDownChoicePanel<PropagationMode>(
+                "propagationMode", new ResourceModel("propagationMode", "propagationMode").getObject(),
+                new PropertyModel(resourceTO, "propagationMode"));
         propagationMode.setChoices(
                 Arrays.asList(PropagationMode.values()));
         add(propagationMode);
 
-        final AjaxDropDownChoicePanel<TraceLevel> createTraceLevel =
-                new AjaxDropDownChoicePanel<TraceLevel>("createTraceLevel",
-                new ResourceModel("createTraceLevel", "createTraceLevel").
-                getObject(),
-                new PropertyModel(resourceTO, "createTraceLevel"),
-                false);
+        final AjaxDropDownChoicePanel<TraceLevel> createTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+                "createTraceLevel", new ResourceModel("createTraceLevel", "createTraceLevel").getObject(),
+                new PropertyModel(resourceTO, "createTraceLevel"));
         createTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
         add(createTraceLevel);
 
-        final AjaxDropDownChoicePanel<TraceLevel> updateTraceLevel =
-                new AjaxDropDownChoicePanel<TraceLevel>("updateTraceLevel",
-                new ResourceModel("updateTraceLevel", "updateTraceLevel").
-                getObject(),
-                new PropertyModel(resourceTO, "updateTraceLevel"),
-                false);
+        final AjaxDropDownChoicePanel<TraceLevel> updateTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+                "updateTraceLevel", new ResourceModel("updateTraceLevel", "updateTraceLevel").getObject(),
+                new PropertyModel(resourceTO, "updateTraceLevel"));
         updateTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
         add(updateTraceLevel);
 
-        final AjaxDropDownChoicePanel<TraceLevel> deleteTraceLevel =
-                new AjaxDropDownChoicePanel<TraceLevel>("deleteTraceLevel",
-                new ResourceModel("deleteTraceLevel", "deleteTraceLevel").
-                getObject(),
-                new PropertyModel(resourceTO, "deleteTraceLevel"),
-                false);
+        final AjaxDropDownChoicePanel<TraceLevel> deleteTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+                "deleteTraceLevel", new ResourceModel("deleteTraceLevel", "deleteTraceLevel").getObject(),
+                new PropertyModel(resourceTO, "deleteTraceLevel"));
         deleteTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
         add(deleteTraceLevel);
 
-        final AjaxDropDownChoicePanel<TraceLevel> syncTraceLevel =
-                new AjaxDropDownChoicePanel<TraceLevel>("syncTraceLevel",
-                new ResourceModel("syncTraceLevel", "syncTraceLevel").getObject(),
-                new PropertyModel(resourceTO, "syncTraceLevel"),
-                false);
+        final AjaxDropDownChoicePanel<TraceLevel> syncTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+                "syncTraceLevel", new ResourceModel("syncTraceLevel", "syncTraceLevel").getObject(),
+                new PropertyModel(resourceTO, "syncTraceLevel"));
         syncTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
         add(syncTraceLevel);
 
-        final AjaxCheckBoxPanel resetToken = new AjaxCheckBoxPanel(
-                "resetToken",
-                new ResourceModel("resetToken", "resetToken").getObject(),
-                new Model(null), false);
+        final AjaxCheckBoxPanel resetToken = new AjaxCheckBoxPanel("resetToken",
+                new ResourceModel("resetToken", "resetToken").getObject(), new Model(null));
 
         resetToken.getField().add(
                 new AjaxFormComponentUpdatingBehavior("onchange") {
@@ -189,12 +153,9 @@ public class ResourceDetailsPanel extend
                 });
         add(resetToken);
 
-        final AjaxDropDownChoicePanel<ConnInstanceTO> conn =
-                new AjaxDropDownChoicePanel<ConnInstanceTO>(
-                "connector",
-                new ResourceModel("connector", "connector").getObject(),
-                new PropertyModel(this, "connInstanceTO"),
-                false);
+        final AjaxDropDownChoicePanel<ConnInstanceTO> conn = new AjaxDropDownChoicePanel<ConnInstanceTO>(
+                "connector", new ResourceModel("connector", "connector").getObject(),
+                new PropertyModel(this, "connInstanceTO"));
         conn.setChoices(connectors.getObject());
         conn.setChoiceRenderer(new ChoiceRenderer("displayName", "id"));
 

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceMappingPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceMappingPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceMappingPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceMappingPanel.java Tue Mar  6 17:29:27 2012
@@ -54,8 +54,8 @@ import org.syncope.console.wicket.markup
 import org.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
 import org.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.syncope.console.wicket.markup.html.form.FieldPanel;
-import org.syncope.types.ConnConfProperty;
 import org.syncope.types.AttributableType;
+import org.syncope.types.ConnConfProperty;
 import org.syncope.types.IntMappingType;
 
 /**
@@ -164,10 +164,9 @@ public class ResourceMappingPanel extend
 
         initResourceSchemaNames();
 
-        final AjaxTextFieldPanel accountLink = new AjaxTextFieldPanel(
-                "accountLink",
+        final AjaxTextFieldPanel accountLink = new AjaxTextFieldPanel("accountLink",
                 new ResourceModel("accountLink", "accountLink").getObject(),
-                new PropertyModel<String>(resourceTO, "accountLink"), false);
+                new PropertyModel<String>(resourceTO, "accountLink"));
         add(accountLink);
 
         mappingContainer = new WebMarkupContainer("mappingContainer");
@@ -243,12 +242,8 @@ public class ResourceMappingPanel extend
                     }
                 });
 
-                final AjaxDropDownChoicePanel intAttrNames =
-                        new AjaxDropDownChoicePanel<String>(
-                        "intAttrNames",
-                        getString("intAttrNames"),
-                        new PropertyModel(mappingTO, "intAttrName"),
-                        true);
+                final AjaxDropDownChoicePanel intAttrNames = new AjaxDropDownChoicePanel<String>("intAttrNames",
+                        getString("intAttrNames"), new PropertyModel(mappingTO, "intAttrName"));
                 intAttrNames.setChoices(schemaNames);
                 intAttrNames.setRequired(true);
                 intAttrNames.setStyleShet(fieldStyle);
@@ -258,13 +253,9 @@ public class ResourceMappingPanel extend
                 item.add(intAttrNames);
 
 
-                final AjaxDropDownChoicePanel typesPanel =
-                        new AjaxDropDownChoicePanel(
-                        "intMappingTypes",
-                        new ResourceModel("intMappingTypes", "intMappingTypes").
-                        getObject(),
-                        new PropertyModel<IntMappingType>(
-                        mappingTO, "intMappingType"), false);
+                final AjaxDropDownChoicePanel typesPanel = new AjaxDropDownChoicePanel("intMappingTypes",
+                        new ResourceModel("intMappingTypes", "intMappingTypes").getObject(),
+                        new PropertyModel<IntMappingType>(mappingTO, "intMappingType"));
 
                 typesPanel.getField().add(
                         new AjaxFormComponentUpdatingBehavior(onchange) {
@@ -276,8 +267,7 @@ public class ResourceMappingPanel extend
                             protected void onUpdate(
                                     final AjaxRequestTarget target) {
                                 setAttrNames(
-                                        (IntMappingType) typesPanel.
-                                        getModelObject(), intAttrNames);
+                                        (IntMappingType) typesPanel.getModelObject(), intAttrNames);
                                 target.add(intAttrNames);
                             }
                         });
@@ -287,11 +277,8 @@ public class ResourceMappingPanel extend
                 typesPanel.setStyleShet(fieldStyle);
                 item.add(typesPanel);
 
-                final AjaxDropDownChoicePanel mappingTypesPanel =
-                        new AjaxDropDownChoicePanel(
-                        "mappingTypes",
-                        new ResourceModel("mappingTypes", "mappingTypes").
-                        getObject(), new Model(entity), false);
+                final AjaxDropDownChoicePanel mappingTypesPanel = new AjaxDropDownChoicePanel("mappingTypes",
+                        new ResourceModel("mappingTypes", "mappingTypes").getObject(), new Model(entity));
 
                 mappingTypesPanel.setChoices(Arrays.asList(AttributableType.values()));
                 mappingTypesPanel.setStyleShet(defFieldStyle);
@@ -309,8 +296,7 @@ public class ResourceMappingPanel extend
                                     final AjaxRequestTarget target) {
 
                                 attrTypes = getAttributeTypes(
-                                        (AttributableType) mappingTypesPanel.
-                                        getModelObject());
+                                        (AttributableType) mappingTypesPanel.getModelObject());
 
                                 typesPanel.setChoices(attrTypes);
                                 intAttrNames.setChoices(Collections.EMPTY_LIST);
@@ -324,24 +310,15 @@ public class ResourceMappingPanel extend
                 final FieldPanel extAttrName;
 
                 if (schemaNames.isEmpty()) {
-                    extAttrName = new AjaxTextFieldPanel(
-                            "extAttrName",
-                            new ResourceModel("extAttrNames", "extAttrNames").
-                            getObject(),
-                            new PropertyModel<String>(mappingTO, "extAttrName"),
-                            true);
+                    extAttrName = new AjaxTextFieldPanel("extAttrName",
+                            new ResourceModel("extAttrNames", "extAttrNames").getObject(),
+                            new PropertyModel<String>(mappingTO, "extAttrName"));
 
                 } else {
-                    extAttrName =
-                            new AjaxDropDownChoicePanel<String>(
-                            "extAttrName",
-                            new ResourceModel("extAttrNames", "extAttrNames").
-                            getObject(),
-                            new PropertyModel(mappingTO, "extAttrName"),
-                            true);
-                    ((AjaxDropDownChoicePanel) extAttrName).setChoices(
-                            schemaNames);
-
+                    extAttrName = new AjaxDropDownChoicePanel<String>("extAttrName",
+                            new ResourceModel("extAttrNames", "extAttrNames").getObject(),
+                            new PropertyModel(mappingTO, "extAttrName"));
+                    ((AjaxDropDownChoicePanel) extAttrName).setChoices(schemaNames);
                 }
 
                 boolean required = mappingTO != null
@@ -353,26 +330,19 @@ public class ResourceMappingPanel extend
                 extAttrName.setStyleShet(fieldStyle);
                 item.add(extAttrName);
 
-                final AjaxTextFieldPanel mandatory =
-                        new AjaxTextFieldPanel(
-                        "mandatoryCondition",
-                        new ResourceModel(
-                        "mandatoryCondition", "mandatoryCondition").getObject(),
-                        new PropertyModel(mappingTO, "mandatoryCondition"),
-                        true);
+                final AjaxTextFieldPanel mandatory = new AjaxTextFieldPanel("mandatoryCondition",
+                        new ResourceModel("mandatoryCondition", "mandatoryCondition").getObject(),
+                        new PropertyModel(mappingTO, "mandatoryCondition"));
 
-                mandatory.setChoices(
-                        Arrays.asList(new String[]{"true", "false"}));
+                mandatory.setChoices(Arrays.asList(new String[]{"true", "false"}));
 
                 mandatory.setStyleShet(shortFieldStyle);
 
                 item.add(mandatory);
 
-                final AjaxCheckBoxPanel accountId =
-                        new AjaxCheckBoxPanel(
-                        "accountId",
+                final AjaxCheckBoxPanel accountId = new AjaxCheckBoxPanel("accountId",
                         new ResourceModel("accountId", "accountId").getObject(),
-                        new PropertyModel(mappingTO, "accountid"), false);
+                        new PropertyModel(mappingTO, "accountid"));
 
                 accountId.getField().add(
                         new AjaxFormComponentUpdatingBehavior(onchange) {
@@ -395,11 +365,8 @@ public class ResourceMappingPanel extend
 
                 item.add(accountId);
 
-                final AjaxCheckBoxPanel password =
-                        new AjaxCheckBoxPanel(
-                        "password",
-                        new ResourceModel("password", "password").getObject(),
-                        new PropertyModel(mappingTO, "password"), true);
+                final AjaxCheckBoxPanel password = new AjaxCheckBoxPanel("password",
+                        new ResourceModel("password", "password").getObject(), new PropertyModel(mappingTO, "password"));
 
                 password.getField().add(
                         new AjaxFormComponentUpdatingBehavior(onchange) {
@@ -549,25 +516,19 @@ public class ResourceMappingPanel extend
                 case UserSchema:
                 case RoleSchema:
                 case MembershipSchema:
-                    toBeUpdated.setChoices(
-                            schemaRestClient.getSchemaNames(
-                            attrType.getAttributableType().toString().toLowerCase()));
+                    toBeUpdated.setChoices(schemaRestClient.getSchemaNames(attrType.getAttributableType()));
                     break;
 
                 case UserDerivedSchema:
                 case RoleDerivedSchema:
                 case MembershipDerivedSchema:
-                    toBeUpdated.setChoices(
-                            schemaRestClient.getDerivedSchemaNames(
-                            attrType.getAttributableType().toString().toLowerCase()));
+                    toBeUpdated.setChoices(schemaRestClient.getDerivedSchemaNames(attrType.getAttributableType()));
                     break;
 
                 case UserVirtualSchema:
                 case RoleVirtualSchema:
                 case MembershipVirtualSchema:
-                    toBeUpdated.setChoices(
-                            schemaRestClient.getVirtualSchemaNames(
-                            attrType.getAttributableType().toString().toLowerCase()));
+                    toBeUpdated.setChoices(schemaRestClient.getVirtualSchemaNames(attrType.getAttributableType()));
                     break;
 
                 case SyncopeUserId:

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceSecurityPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceSecurityPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceSecurityPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/ResourceSecurityPanel.java Tue Mar  6 17:29:27 2012
@@ -117,13 +117,9 @@ public class ResourceSecurityPanel exten
         // -------------------------------
         // Password policy specification
         // -------------------------------
-        final AjaxDropDownChoicePanel<Long> passwordPolicy =
-                new AjaxDropDownChoicePanel<Long>(
-                "passwordPolicy",
-                new ResourceModel("passwordPolicy", "passwordPolicy").
-                getObject(),
-                new PropertyModel(resourceTO, "passwordPolicy"),
-                false);
+        final AjaxDropDownChoicePanel<Long> passwordPolicy = new AjaxDropDownChoicePanel<Long>("passwordPolicy",
+                new ResourceModel("passwordPolicy", "passwordPolicy").getObject(),
+                new PropertyModel(resourceTO, "passwordPolicy"));
 
         passwordPolicy.setChoiceRenderer(
                 new PolicyRenderer(PolicyType.PASSWORD));
@@ -139,13 +135,9 @@ public class ResourceSecurityPanel exten
         // -------------------------------
         // Account policy specification
         // -------------------------------
-        final AjaxDropDownChoicePanel<Long> accountPolicy =
-                new AjaxDropDownChoicePanel<Long>(
-                "accountPolicy",
-                new ResourceModel("accountPolicy", "accountPolicy").
-                getObject(),
-                new PropertyModel(resourceTO, "accountPolicy"),
-                false);
+        final AjaxDropDownChoicePanel<Long> accountPolicy = new AjaxDropDownChoicePanel<Long>("accountPolicy",
+                new ResourceModel("accountPolicy", "accountPolicy").getObject(),
+                new PropertyModel(resourceTO, "accountPolicy"));
 
         accountPolicy.setChoiceRenderer(
                 new PolicyRenderer(PolicyType.ACCOUNT));
@@ -161,13 +153,8 @@ public class ResourceSecurityPanel exten
         // -------------------------------
         // Sync policy specification
         // -------------------------------
-        final AjaxDropDownChoicePanel<Long> syncPolicy =
-                new AjaxDropDownChoicePanel<Long>(
-                "syncPolicy",
-                new ResourceModel("syncPolicy", "syncPolicy").
-                getObject(),
-                new PropertyModel(resourceTO, "syncPolicy"),
-                false);
+        final AjaxDropDownChoicePanel<Long> syncPolicy = new AjaxDropDownChoicePanel<Long>("syncPolicy",
+                new ResourceModel("syncPolicy", "syncPolicy").getObject(), new PropertyModel(resourceTO, "syncPolicy"));
 
         syncPolicy.setChoiceRenderer(
                 new PolicyRenderer(PolicyType.SYNC));

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/RoleAttributesPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/RoleAttributesPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/RoleAttributesPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/RoleAttributesPanel.java Tue Mar  6 17:29:27 2012
@@ -47,19 +47,15 @@ public class RoleAttributesPanel extends
         //--------------------------------
         // Attributes panel
         //--------------------------------
-        final AjaxTextFieldPanel name = new AjaxTextFieldPanel(
-                "name", "name",
-                new PropertyModel<String>(roleTO, "name"), false);
+        final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", "name",
+                new PropertyModel<String>(roleTO, "name"));
         name.addRequiredLabel();
         this.add(name);
 
         this.add(new AttributesPanel("attributes", roleTO, form, false));
 
-        final AjaxCheckBoxPanel inhAttributes = new AjaxCheckBoxPanel(
-                "inheritAttributes",
-                "inheritAttributes",
-                new PropertyModel<Boolean>(roleTO, "inheritAttributes"),
-                false);
+        final AjaxCheckBoxPanel inhAttributes = new AjaxCheckBoxPanel("inheritAttributes", "inheritAttributes",
+                new PropertyModel<Boolean>(roleTO, "inheritAttributes"));
         this.add(inhAttributes);
         //--------------------------------
 
@@ -68,11 +64,8 @@ public class RoleAttributesPanel extends
         //--------------------------------
         this.add(new DerivedAttributesPanel("derivedAttributes", roleTO));
 
-        final AjaxCheckBoxPanel inhDerivedAttributes = new AjaxCheckBoxPanel(
-                "inheritDerivedAttributes",
-                "inheritDerivedAttributes",
-                new PropertyModel<Boolean>(roleTO, "inheritDerivedAttributes"),
-                false);
+        final AjaxCheckBoxPanel inhDerivedAttributes = new AjaxCheckBoxPanel("inheritDerivedAttributes",
+                "inheritDerivedAttributes", new PropertyModel<Boolean>(roleTO, "inheritDerivedAttributes"));
         inhDerivedAttributes.setOutputMarkupId(true);
         this.add(inhDerivedAttributes);
         //--------------------------------
@@ -83,11 +76,8 @@ public class RoleAttributesPanel extends
         this.add(new VirtualAttributesPanel("virtualAttributes", roleTO,
                 false));
 
-        final AjaxCheckBoxPanel inhVirtualAttributes = new AjaxCheckBoxPanel(
-                "inheritVirtualAttributes",
-                "inheritVirtualAttributes",
-                new PropertyModel<Boolean>(roleTO, "inheritVirtualAttributes"),
-                false);
+        final AjaxCheckBoxPanel inhVirtualAttributes = new AjaxCheckBoxPanel("inheritVirtualAttributes",
+                "inheritVirtualAttributes", new PropertyModel<Boolean>(roleTO, "inheritVirtualAttributes"));
         inhVirtualAttributes.setOutputMarkupId(true);
         this.add(inhVirtualAttributes);
         //--------------------------------
@@ -123,4 +113,4 @@ public class RoleAttributesPanel extends
     public Palette<String> getEntitlementsPalette() {
         return this.entitlementsPalette;
     }
-}
\ No newline at end of file
+}

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/RoleSecurityPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/RoleSecurityPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/RoleSecurityPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/RoleSecurityPanel.java Tue Mar  6 17:29:27 2012
@@ -47,14 +47,14 @@ public class RoleSecurityPanel extends P
      */
     protected static final Logger LOG =
             LoggerFactory.getLogger(RoleSecurityPanel.class);
-    
+
     private static final long serialVersionUID = -7982691107029848579L;
-    
+
     @SpringBean
     private PolicyRestClient policyRestClient;
-    
+
     IModel<Map<Long, String>> passwordPolicies = null;
-    
+
     IModel<Map<Long, String>> accountPolicies = null;
 
     public <T extends AbstractAttributableTO> RoleSecurityPanel(
@@ -103,11 +103,8 @@ public class RoleSecurityPanel extends P
         // -------------------------------
         // Password policy specification
         // -------------------------------
-        final AjaxDropDownChoicePanel<Long> passwordPolicy =
-                new AjaxDropDownChoicePanel<Long>(
-                "passwordPolicy", "passwordPolicy",
-                new PropertyModel(entityTO, "passwordPolicy"),
-                false);
+        final AjaxDropDownChoicePanel<Long> passwordPolicy = new AjaxDropDownChoicePanel<Long>("passwordPolicy",
+                "passwordPolicy", new PropertyModel(entityTO, "passwordPolicy"));
 
         passwordPolicy.setChoiceRenderer(
                 new PolicyRenderer(PolicyType.PASSWORD));
@@ -119,10 +116,8 @@ public class RoleSecurityPanel extends P
 
         securityContainer.add(passwordPolicy);
 
-        final AjaxCheckBoxPanel inhPasswordPolicy = new AjaxCheckBoxPanel(
-                "inheritPasswordPolicy", "inheritPasswordPolicy",
-                new PropertyModel<Boolean>(entityTO, "inheritPasswordPolicy"),
-                false);
+        final AjaxCheckBoxPanel inhPasswordPolicy = new AjaxCheckBoxPanel("inheritPasswordPolicy",
+                "inheritPasswordPolicy", new PropertyModel<Boolean>(entityTO, "inheritPasswordPolicy"));
 
         passwordPolicy.setReadOnly(inhPasswordPolicy.getModelObject());
 
@@ -147,29 +142,19 @@ public class RoleSecurityPanel extends P
         // -------------------------------
         // Account policy specification
         // -------------------------------
-        final AjaxDropDownChoicePanel<Long> accountPolicy =
-                new AjaxDropDownChoicePanel<Long>(
-                "accountPolicy",
-                "accountPolicy",
-                new PropertyModel(entityTO, "accountPolicy"),
-                false);
+        final AjaxDropDownChoicePanel<Long> accountPolicy = new AjaxDropDownChoicePanel<Long>("accountPolicy",
+                "accountPolicy", new PropertyModel(entityTO, "accountPolicy"));
 
-        accountPolicy.setChoiceRenderer(
-                new PolicyRenderer(PolicyType.ACCOUNT));
+        accountPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.ACCOUNT));
 
-        accountPolicy.setChoices(
-                new ArrayList<Long>(accountPolicies.getObject().keySet()));
+        accountPolicy.setChoices(new ArrayList<Long>(accountPolicies.getObject().keySet()));
 
         ((DropDownChoice) accountPolicy.getField()).setNullValid(true);
 
         securityContainer.add(accountPolicy);
 
-        final AjaxCheckBoxPanel inhAccountPolicy = new AjaxCheckBoxPanel(
-                "inheritAccountPolicy",
-                "inheritAccountPolicy",
-                new PropertyModel<Boolean>(entityTO, "inheritAccountPolicy"),
-                false);
-
+        final AjaxCheckBoxPanel inhAccountPolicy = new AjaxCheckBoxPanel("inheritAccountPolicy",
+                "inheritAccountPolicy", new PropertyModel<Boolean>(entityTO, "inheritAccountPolicy"));
         accountPolicy.setReadOnly(inhAccountPolicy.getModelObject());
 
         inhAccountPolicy.getField().add(
@@ -180,8 +165,7 @@ public class RoleSecurityPanel extends P
 
                     @Override
                     protected void onUpdate(final AjaxRequestTarget target) {
-                        accountPolicy.setReadOnly(
-                                inhAccountPolicy.getModelObject());
+                        accountPolicy.setReadOnly(inhAccountPolicy.getModelObject());
                         target.add(accountPolicy);
                     }
                 });

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/UserDetailsPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/UserDetailsPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/UserDetailsPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/UserDetailsPanel.java Tue Mar  6 17:29:27 2012
@@ -52,9 +52,8 @@ public class UserDetailsPanel extends Pa
         // ------------------------
         // Username
         // ------------------------
-        final FieldPanel username = new AjaxTextFieldPanel(
-                "username", "username",
-                new PropertyModel<String>(userTO, "username"), true);
+        final FieldPanel username = new AjaxTextFieldPanel("username", "username",
+                new PropertyModel<String>(userTO, "username"));
         if (!templateMode) {
             username.addRequiredLabel();
         }
@@ -69,30 +68,23 @@ public class UserDetailsPanel extends Pa
                 new ResourceModel("confirmPassword"));
         final FieldPanel confirmPassword;
         if (templateMode) {
-            password = new AjaxTextFieldPanel("password", "password",
-                    new PropertyModel<String>(userTO, "password"), true);
+            password = new AjaxTextFieldPanel("password", "password", new PropertyModel<String>(userTO, "password"));
 
             confirmPasswordLabel.setVisible(false);
-            confirmPassword = new AjaxTextFieldPanel("confirmPassword",
-                    "confirmPassword", new Model<String>(), false);
+            confirmPassword = new AjaxTextFieldPanel("confirmPassword", "confirmPassword", new Model<String>());
             confirmPassword.setEnabled(false);
             confirmPassword.setVisible(false);
         } else {
-            password = new AjaxPasswordFieldPanel("password", "password",
-                    new PropertyModel<String>(userTO, "password"), true);
+            password = new AjaxPasswordFieldPanel("password", "password", new PropertyModel<String>(userTO, "password"));
             password.setRequired(userTO.getId() == 0);
-            ((PasswordTextField) password.getField()).setResetPassword(
-                    resetPassword);
+            ((PasswordTextField) password.getField()).setResetPassword(resetPassword);
 
-            confirmPassword = new AjaxPasswordFieldPanel("confirmPassword",
-                    "confirmPassword", new Model<String>(), true);
+            confirmPassword = new AjaxPasswordFieldPanel("confirmPassword", "confirmPassword", new Model<String>());
             if (!resetPassword) {
-                confirmPassword.getField().setModelObject(
-                        userTO.getPassword());
+                confirmPassword.getField().setModelObject(userTO.getPassword());
             }
             confirmPassword.setRequired(userTO.getId() == 0);
-            ((PasswordTextField) confirmPassword.getField()).setResetPassword(
-                    resetPassword);
+            ((PasswordTextField) confirmPassword.getField()).setResetPassword(resetPassword);
 
             form.add(new EqualPasswordInputValidator(
                     password.getField(), confirmPassword.getField()));

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/UserSearchPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/UserSearchPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/UserSearchPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/UserSearchPanel.java Tue Mar  6 17:29:27 2012
@@ -34,6 +34,7 @@ import org.apache.wicket.markup.html.bas
 import org.apache.wicket.markup.html.form.CheckBox;
 import org.apache.wicket.markup.html.form.DropDownChoice;
 import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
 import org.apache.wicket.markup.html.form.TextField;
 import org.apache.wicket.markup.html.list.ListItem;
 import org.apache.wicket.markup.html.list.ListView;
@@ -60,6 +61,7 @@ import org.syncope.console.commons.Searc
 import org.syncope.console.rest.ResourceRestClient;
 import org.syncope.console.rest.RoleRestClient;
 import org.syncope.console.rest.SchemaRestClient;
+import org.syncope.types.AttributableType;
 
 public class UserSearchPanel extends Panel {
 
@@ -73,8 +75,7 @@ public class UserSearchPanel extends Pan
 
     private List<String> ATTRIBUTES_NOTINCLUDED = Arrays.asList(new String[]{
                 "attributes", "derivedAttributes", "virtualAttributes",
-                "serialVersionUID", "memberships", "resources", "password",
-                "propagationStatusMap"});
+                "serialVersionUID", "memberships", "resources", "password", "propagationStatusMap"});
 
     @SpringBean
     private SchemaRestClient schemaRestClient;
@@ -85,92 +86,82 @@ public class UserSearchPanel extends Pan
     @SpringBean
     private ResourceRestClient resourceRestClient;
 
-    final private IModel<List<String>> dnames =
-            new LoadableDetachableModel<List<String>>() {
+    private final boolean required;
 
-                @Override
-                protected List<String> load() {
+    final private IModel<List<String>> dnames = new LoadableDetachableModel<List<String>>() {
 
-                    final List<String> details = new ArrayList<String>();
+        private static final long serialVersionUID = 5275935387613157437L;
 
-                    Class<?> clazz = UserTO.class;
+        @Override
+        protected List<String> load() {
+            final List<String> details = new ArrayList<String>();
 
-                    // loop on class and all superclasses searching for field
-                    while (clazz != null && clazz != Object.class) {
-                        for (Field field : clazz.getDeclaredFields()) {
-                            if (!ATTRIBUTES_NOTINCLUDED.contains(
-                                    field.getName())) {
+            Class<?> clazz = UserTO.class;
 
-                                details.add(field.getName());
-                            }
-                        }
-                        clazz = clazz.getSuperclass();
+            // loop on class and all superclasses searching for field
+            while (clazz != null && clazz != Object.class) {
+                for (Field field : clazz.getDeclaredFields()) {
+                    if (!ATTRIBUTES_NOTINCLUDED.contains(field.getName())) {
+                        details.add(field.getName());
                     }
-
-                    Collections.reverse(details);
-                    return details;
                 }
-            };
+                clazz = clazz.getSuperclass();
+            }
 
-    final private IModel<List<String>> unames =
-            new LoadableDetachableModel<List<String>>() {
+            Collections.reverse(details);
+            return details;
+        }
+    };
 
-                private static final long serialVersionUID =
-                        5275935387613157437L;
+    final private IModel<List<String>> unames = new LoadableDetachableModel<List<String>>() {
 
-                @Override
-                protected List<String> load() {
-                    return schemaRestClient.getSchemaNames("user");
-                }
-            };
+        private static final long serialVersionUID = 5275935387613157437L;
 
-    final private IModel<List<String>> ronames =
-            new LoadableDetachableModel<List<String>>() {
+        @Override
+        protected List<String> load() {
+            return schemaRestClient.getSchemaNames(AttributableType.USER);
+        }
+    };
 
-                private static final long serialVersionUID =
-                        5275935387613157437L;
+    final private IModel<List<String>> roleNames = new LoadableDetachableModel<List<String>>() {
 
-                @Override
-                protected List<String> load() {
-                    List<RoleTO> roleTOs = roleRestClient.getAllRoles();
+        private static final long serialVersionUID = 5275935387613157437L;
 
-                    List<String> result = new ArrayList<String>(
-                            roleTOs.size());
-                    for (RoleTO role : roleTOs) {
-                        result.add(role.getDisplayName());
-                    }
+        @Override
+        protected List<String> load() {
+            List<RoleTO> roleTOs = roleRestClient.getAllRoles();
 
-                    return result;
-                }
-            };
+            List<String> result = new ArrayList<String>(roleTOs.size());
+            for (RoleTO role : roleTOs) {
+                result.add(role.getDisplayName());
+            }
 
-    final private IModel<List<String>> renames =
-            new LoadableDetachableModel<List<String>>() {
+            return result;
+        }
+    };
 
-                private static final long serialVersionUID =
-                        5275935387613157437L;
+    final private IModel<List<String>> resourceNames = new LoadableDetachableModel<List<String>>() {
 
-                @Override
-                protected List<String> load() {
-                    List<ResourceTO> resourceTOs =
-                            resourceRestClient.getAllResources();
+        private static final long serialVersionUID = 5275935387613157437L;
 
-                    List<String> result =
-                            new ArrayList<String>(resourceTOs.size());
+        @Override
+        protected List<String> load() {
+            List<ResourceTO> resourceTOs = resourceRestClient.getAllResources();
 
-                    for (ResourceTO resource : resourceTOs) {
-                        result.add(resource.getName());
-                    }
+            List<String> result = new ArrayList<String>(resourceTOs.size());
 
-                    return result;
-                }
-            };
+            for (ResourceTO resource : resourceTOs) {
+                result.add(resource.getName());
+            }
+
+            return result;
+        }
+    };
 
     final private IModel<List<AttributeCond.Type>> attributeTypes =
             new LoadableDetachableModel<List<AttributeCond.Type>>() {
 
-                private static final long serialVersionUID =
-                        5275935387613157437L;
+                private static final long serialVersionUID = 5275935387613157437L;
 
                 @Override
                 protected List<AttributeCond.Type> load() {
@@ -178,37 +169,38 @@ public class UserSearchPanel extends Pan
                 }
             };
 
-    final private IModel<List<FilterType>> filterTypes =
-            new LoadableDetachableModel<List<FilterType>>() {
+    final private IModel<List<FilterType>> filterTypes = new LoadableDetachableModel<List<FilterType>>() {
 
-                private static final long serialVersionUID =
-                        5275935387613157437L;
+        private static final long serialVersionUID = 5275935387613157437L;
 
-                @Override
-                protected List<FilterType> load() {
-                    return Arrays.asList(FilterType.values());
-                }
-            };
+        @Override
+        protected List<FilterType> load() {
+            return Arrays.asList(FilterType.values());
+        }
+    };
 
     final FeedbackPanel searchFeedback;
 
     final List<SearchCondWrapper> searchConditionList;
 
     public UserSearchPanel(final String id) {
-        this(id, null);
+        this(id, null, true);
     }
 
-    public UserSearchPanel(final String id, final NodeCond searchCondition) {
+    public UserSearchPanel(final String id, final NodeCond initCond) {
+        this(id, initCond, true);
+    }
+
+    public UserSearchPanel(final String id, final NodeCond initNodeCond, final boolean required) {
         super(id);
+        this.required = required;
 
         setOutputMarkupId(true);
 
-        final WebMarkupContainer searchFormContainer =
-                new WebMarkupContainer("searchFormContainer");
+        final WebMarkupContainer searchFormContainer = new WebMarkupContainer("searchFormContainer");
         searchFormContainer.setOutputMarkupId(true);
 
-        searchFeedback = new FeedbackPanel(
-                "searchFeedback", new IFeedbackMessageFilter() {
+        searchFeedback = new FeedbackPanel("searchFeedback", new IFeedbackMessageFilter() {
 
             private static final long serialVersionUID = 6895024863321391672L;
 
@@ -220,8 +212,7 @@ public class UserSearchPanel extends Pan
                 if (message.getReporter() != null) {
                     // only accept messages coming from the children
                     // of the search form container
-                    result = searchFormContainer.contains(
-                            message.getReporter(), true);
+                    result = searchFormContainer.contains(message.getReporter(), true);
                 } else {
                     result = false;
                 }
@@ -232,17 +223,15 @@ public class UserSearchPanel extends Pan
         searchFeedback.setOutputMarkupId(true);
         add(searchFeedback);
 
-        if (searchCondition == null) {
+        if (initNodeCond == null) {
             searchConditionList = new ArrayList<SearchCondWrapper>();
             searchConditionList.add(new SearchCondWrapper());
         } else {
-            searchConditionList = getSearchCondWrappers(searchCondition);
+            searchConditionList = getSearchCondWrappers(initNodeCond);
         }
-        searchFormContainer.add(new SearchView("searchView",
-                searchConditionList, searchFormContainer));
+        searchFormContainer.add(new SearchView("searchView", searchConditionList, searchFormContainer));
 
-        AjaxButton addAndButton = new IndicatingAjaxButton("addAndButton",
-                new ResourceModel("addAndButton")) {
+        AjaxButton addAndButton = new IndicatingAjaxButton("addAndButton", new ResourceModel("addAndButton")) {
 
             private static final long serialVersionUID = -4804368561204623354L;
 
@@ -250,43 +239,34 @@ public class UserSearchPanel extends Pan
             protected void onSubmit(final AjaxRequestTarget target,
                     final Form<?> form) {
 
-                SearchCondWrapper conditionWrapper =
-                        new SearchCondWrapper();
+                SearchCondWrapper conditionWrapper = new SearchCondWrapper();
                 conditionWrapper.setOperationType(OperationType.AND);
                 searchConditionList.add(conditionWrapper);
                 target.add(searchFormContainer);
             }
 
             @Override
-            protected void onError(final AjaxRequestTarget target,
-                    final Form<?> form) {
-
+            protected void onError(final AjaxRequestTarget target, final Form<?> form) {
                 target.add(searchFormContainer);
             }
         };
         addAndButton.setDefaultFormProcessing(false);
         searchFormContainer.add(addAndButton);
 
-        AjaxButton addOrButton = new IndicatingAjaxButton("addOrButton",
-                new ResourceModel("addOrButton")) {
+        AjaxButton addOrButton = new IndicatingAjaxButton("addOrButton", new ResourceModel("addOrButton")) {
 
             private static final long serialVersionUID = -4804368561204623354L;
 
             @Override
-            protected void onSubmit(final AjaxRequestTarget target,
-                    final Form<?> form) {
-
-                SearchCondWrapper conditionWrapper =
-                        new SearchCondWrapper();
+            protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+                SearchCondWrapper conditionWrapper = new SearchCondWrapper();
                 conditionWrapper.setOperationType(OperationType.OR);
                 searchConditionList.add(conditionWrapper);
                 target.add(searchFormContainer);
             }
 
             @Override
-            protected void onError(final AjaxRequestTarget target,
-                    final Form<?> form) {
-
+            protected void onError(final AjaxRequestTarget target, final Form<?> form) {
                 target.add(searchFormContainer);
             }
         };
@@ -300,13 +280,10 @@ public class UserSearchPanel extends Pan
         return searchFeedback;
     }
 
-    private List<SearchCondWrapper> getSearchCondWrappers(
-            final NodeCond searchCond) {
-
+    private List<SearchCondWrapper> getSearchCondWrappers(final NodeCond searchCond) {
         LOG.debug("Search condition: {}", searchCond);
 
-        List<SearchCondWrapper> wrappers =
-                new ArrayList<SearchCondWrapper>();
+        List<SearchCondWrapper> wrappers = new ArrayList<SearchCondWrapper>();
 
         switch (searchCond.getType()) {
             case LEAF:
@@ -316,12 +293,9 @@ public class UserSearchPanel extends Pan
 
             case AND:
             case OR:
-                wrappers.add(getSearchCondWrapper(
-                        searchCond.getLeftNodeCond()));
-                SearchCondWrapper wrapper = getSearchCondWrapper(
-                        searchCond.getRightNodeCond());
-                wrapper.setOperationType(
-                        searchCond.getType() == NodeCond.Type.AND
+                wrappers.add(getSearchCondWrapper(searchCond.getLeftNodeCond()));
+                SearchCondWrapper wrapper = getSearchCondWrapper(searchCond.getRightNodeCond());
+                wrapper.setOperationType(searchCond.getType() == NodeCond.Type.AND
                         ? OperationType.AND : OperationType.OR);
                 wrappers.add(wrapper);
                 break;
@@ -334,28 +308,20 @@ public class UserSearchPanel extends Pan
         return wrappers;
     }
 
-    private SearchCondWrapper getSearchCondWrapper(
-            final NodeCond searchCond) {
-
+    private SearchCondWrapper getSearchCondWrapper(final NodeCond searchCond) {
         SearchCondWrapper wrapper = new SearchCondWrapper();
 
         if (searchCond.getSyncopeUserCond() != null) {
             wrapper.setFilterType(FilterType.ATTRIBUTE);
-            wrapper.setFilterName(
-                    searchCond.getSyncopeUserCond().getSchema());
-            wrapper.setType(
-                    searchCond.getSyncopeUserCond().getType());
-            wrapper.setFilterValue(
-                    searchCond.getSyncopeUserCond().getExpression());
+            wrapper.setFilterName(searchCond.getSyncopeUserCond().getSchema());
+            wrapper.setType(searchCond.getSyncopeUserCond().getType());
+            wrapper.setFilterValue(searchCond.getSyncopeUserCond().getExpression());
         }
         if (searchCond.getAttributeCond() != null) {
             wrapper.setFilterType(FilterType.ATTRIBUTE);
-            wrapper.setFilterName(
-                    searchCond.getAttributeCond().getSchema());
-            wrapper.setType(
-                    searchCond.getAttributeCond().getType());
-            wrapper.setFilterValue(
-                    searchCond.getAttributeCond().getExpression());
+            wrapper.setFilterName(searchCond.getAttributeCond().getSchema());
+            wrapper.setType(searchCond.getAttributeCond().getType());
+            wrapper.setFilterValue(searchCond.getAttributeCond().getExpression());
         }
         if (searchCond.getMembershipCond() != null) {
             wrapper.setFilterType(FilterType.MEMBERSHIP);
@@ -366,12 +332,10 @@ public class UserSearchPanel extends Pan
         }
         if (searchCond.getResourceCond() != null) {
             wrapper.setFilterType(FilterType.RESOURCE);
-            wrapper.setFilterName(searchCond.getResourceCond().
-                    getResourceName());
+            wrapper.setFilterName(searchCond.getResourceCond().getResourceName());
         }
 
-        wrapper.setNotOperator(
-                searchCond.getType() == NodeCond.Type.NOT_LEAF);
+        wrapper.setNotOperator(searchCond.getType() == NodeCond.Type.NOT_LEAF);
 
         return wrapper;
     }
@@ -380,16 +344,15 @@ public class UserSearchPanel extends Pan
         return buildSearchCond(searchConditionList);
     }
 
-    private NodeCond buildSearchCond(
-            final List<SearchCondWrapper> conditions) {
-
+    private NodeCond buildSearchCond(final List<SearchCondWrapper> conditions) {
         // inverse processing: from right to left
         // (OperationType is specified on the right)
-        SearchCondWrapper searchConditionWrapper =
-                conditions.get(conditions.size() - 1);
+        SearchCondWrapper searchConditionWrapper = conditions.get(conditions.size() - 1);
+        if (searchConditionWrapper == null || searchConditionWrapper.getFilterType() == null) {
+            return null;
+        }
 
-        LOG.debug("Search conditions: "
-                + "fname {}; ftype {}; fvalue {}; OP {}; type {}; isnot {}",
+        LOG.debug("Search conditions: fname {}; ftype {}; fvalue {}; OP {}; type {}; isnot {}",
                 new Object[]{
                     searchConditionWrapper.getFilterName(),
                     searchConditionWrapper.getFilterType(),
@@ -409,10 +372,8 @@ public class UserSearchPanel extends Pan
                 if (dnames.getObject().contains(schema)) {
                     attributeCond = new SyncopeUserCond();
                     nodeCond = searchConditionWrapper.isNotOperator()
-                            ? NodeCond.getNotLeafCond(
-                            (SyncopeUserCond) attributeCond)
-                            : NodeCond.getLeafCond(
-                            (SyncopeUserCond) attributeCond);
+                            ? NodeCond.getNotLeafCond((SyncopeUserCond) attributeCond)
+                            : NodeCond.getLeafCond((SyncopeUserCond) attributeCond);
                 } else {
                     attributeCond = new AttributeCond();
                     nodeCond = searchConditionWrapper.isNotOperator()
@@ -422,14 +383,14 @@ public class UserSearchPanel extends Pan
 
                 attributeCond.setSchema(schema);
                 attributeCond.setType(searchConditionWrapper.getType());
-                attributeCond.setExpression(
-                        searchConditionWrapper.getFilterValue());
+                attributeCond.setExpression(searchConditionWrapper.getFilterValue());
 
                 break;
+
             case MEMBERSHIP:
                 final MembershipCond membershipCond = new MembershipCond();
-                membershipCond.setRoleId(RoleTO.fromDisplayName(
-                        searchConditionWrapper.getFilterName()));
+                membershipCond.setRoleId(RoleTO.fromDisplayName(searchConditionWrapper.getFilterName()));
+                membershipCond.setRoleName(searchConditionWrapper.getFilterName().split(" ")[1]);
 
                 if (searchConditionWrapper.isNotOperator()) {
                     nodeCond = NodeCond.getNotLeafCond(membershipCond);
@@ -438,10 +399,10 @@ public class UserSearchPanel extends Pan
                 }
 
                 break;
+
             case RESOURCE:
                 final ResourceCond resourceCond = new ResourceCond();
-                resourceCond.setResourceName(
-                        searchConditionWrapper.getFilterName());
+                resourceCond.setResourceName(searchConditionWrapper.getFilterName());
 
                 if (searchConditionWrapper.isNotOperator()) {
                     nodeCond = NodeCond.getNotLeafCond(resourceCond);
@@ -450,6 +411,7 @@ public class UserSearchPanel extends Pan
                 }
 
                 break;
+
             default:
             // nothing to do
         }
@@ -457,16 +419,12 @@ public class UserSearchPanel extends Pan
         LOG.debug("Processed condition {}", nodeCond);
 
         if (conditions.size() > 1) {
-            List<SearchCondWrapper> subList =
-                    conditions.subList(0, conditions.size() - 1);
+            List<SearchCondWrapper> subList = conditions.subList(0, conditions.size() - 1);
 
-            if (OperationType.OR.equals(
-                    searchConditionWrapper.getOperationType())) {
-                nodeCond = NodeCond.getOrCond(nodeCond,
-                        buildSearchCond(subList));
+            if (OperationType.OR.equals(searchConditionWrapper.getOperationType())) {
+                nodeCond = NodeCond.getOrCond(nodeCond, buildSearchCond(subList));
             } else {
-                nodeCond = NodeCond.getAndCond(nodeCond,
-                        buildSearchCond(subList));
+                nodeCond = NodeCond.getAndCond(nodeCond, buildSearchCond(subList));
             }
         }
 
@@ -479,8 +437,7 @@ public class UserSearchPanel extends Pan
 
         final private WebMarkupContainer searchFormContainer;
 
-        public SearchView(final String id,
-                final List<? extends SearchCondWrapper> list,
+        public SearchView(final String id, final List<? extends SearchCondWrapper> list,
                 final WebMarkupContainer searchFormContainer) {
 
             super(id, list);
@@ -488,150 +445,108 @@ public class UserSearchPanel extends Pan
         }
 
         @Override
-        protected void populateItem(
-                final ListItem<SearchCondWrapper> item) {
-
+        protected void populateItem(final ListItem<SearchCondWrapper> item) {
             final SearchCondWrapper searchCondition = item.getModelObject();
 
             if (item.getIndex() == 0) {
                 item.add(new Label("operationType", ""));
             } else {
-                item.add(new Label("operationType",
-                        searchCondition.getOperationType().toString()));
+                item.add(new Label("operationType", searchCondition.getOperationType().toString()));
             }
 
-            final CheckBox notOperator = new CheckBox(
-                    "notOperator",
-                    new PropertyModel(searchCondition, "notOperator"));
-
+            final CheckBox notOperator = new CheckBox("notOperator", new PropertyModel(searchCondition, "notOperator"));
             notOperator.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-                private static final long serialVersionUID =
-                        -1107858522700306810L;
+                private static final long serialVersionUID = -1107858522700306810L;
 
                 @Override
-                protected void onUpdate(final AjaxRequestTarget art) {
+                protected void onUpdate(final AjaxRequestTarget target) {
                 }
             });
-
             item.add(notOperator);
 
-            final DropDownChoice<String> filterNameChooser =
-                    new DropDownChoice<String>(
-                    "filterName", new PropertyModel<String>(
-                    searchCondition, "filterName"), (IModel) null);
-
-            filterNameChooser.setOutputMarkupId(true);
-            filterNameChooser.setRequired(true);
-            item.add(filterNameChooser);
-
-            filterNameChooser.add(
-                    new AjaxFormComponentUpdatingBehavior("onchange") {
-
-                        private static final long serialVersionUID =
-                                -1107858522700306810L;
+            final DropDownChoice<AttributeCond.Type> type = new DropDownChoice<AttributeCond.Type>(
+                    "type", new PropertyModel<AttributeCond.Type>(searchCondition, "type"), attributeTypes);
+            type.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-                        @Override
-                        protected void onUpdate(final AjaxRequestTarget art) {
-                        }
-                    });
+                private static final long serialVersionUID = -1107858522700306810L;
 
-            final DropDownChoice<AttributeCond.Type> type =
-                    new DropDownChoice<AttributeCond.Type>(
-                    "type", new PropertyModel<AttributeCond.Type>(
-                    searchCondition, "type"), attributeTypes);
+                @Override
+                protected void onUpdate(final AjaxRequestTarget target) {
+                }
+            });
+            item.add(type);
 
-            type.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+            final DropDownChoice<String> filterNameChooser = new DropDownChoice<String>(
+                    "filterName", new PropertyModel<String>(searchCondition, "filterName"), (IModel) null);
+            filterNameChooser.setOutputMarkupId(true);
+            filterNameChooser.setRequired(required);
+            filterNameChooser.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-                private static final long serialVersionUID =
-                        -1107858522700306810L;
+                private static final long serialVersionUID = -1107858522700306810L;
 
                 @Override
-                protected void onUpdate(final AjaxRequestTarget art) {
+                protected void onUpdate(final AjaxRequestTarget target) {
                 }
             });
+            item.add(filterNameChooser);
 
-            item.add(type);
-
-            final TextField<String> filterValue =
-                    new TextField<String>("filterValue",
+            final TextField<String> filterValue = new TextField<String>("filterValue",
                     new PropertyModel<String>(searchCondition, "filterValue"));
-            item.add(filterValue);
-
             filterValue.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-                private static final long serialVersionUID =
-                        -1107858522700306810L;
+                private static final long serialVersionUID = -1107858522700306810L;
 
                 @Override
-                protected void onUpdate(final AjaxRequestTarget art) {
+                protected void onUpdate(final AjaxRequestTarget target) {
                 }
             });
+            item.add(filterValue);
 
-            final DropDownChoice<FilterType> filterTypeChooser =
-                    new DropDownChoice<FilterType>("filterType",
-                    new PropertyModel<FilterType>(searchCondition,
-                    "filterType"), filterTypes);
+            final DropDownChoice<FilterType> filterTypeChooser = new DropDownChoice<FilterType>("filterType",
+                    new PropertyModel<FilterType>(searchCondition, "filterType"), filterTypes);
             filterTypeChooser.setOutputMarkupId(true);
+            filterTypeChooser.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-            filterTypeChooser.add(
-                    new AjaxFormComponentUpdatingBehavior(
-                    "onchange") {
-
-                        private static final long serialVersionUID =
-                                -1107858522700306810L;
-
-                        @Override
-                        protected void onUpdate(
-                                final AjaxRequestTarget target) {
-                            target.add(searchFormContainer);
-                        }
-                    });
-
-            filterTypeChooser.setRequired(true);
+                private static final long serialVersionUID = -1107858522700306810L;
 
+                @Override
+                protected void onUpdate(final AjaxRequestTarget target) {
+                    target.add(searchFormContainer);
+                }
+            });
+            filterTypeChooser.setRequired(required);
             item.add(filterTypeChooser);
 
-            AjaxButton dropButton = new IndicatingAjaxButton(
-                    "dropButton", new ResourceModel("dropButton")) {
+            AjaxButton dropButton = new IndicatingAjaxButton("dropButton", new ResourceModel("dropButton")) {
 
-                private static final long serialVersionUID =
-                        -4804368561204623354L;
+                private static final long serialVersionUID = -4804368561204623354L;
 
                 @Override
-                protected void onSubmit(final AjaxRequestTarget target,
-                        final Form<?> form) {
-
-                    getList().remove(
-                            Integer.valueOf(getParent().getId()).intValue());
+                protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+                    getList().remove(Integer.valueOf(getParent().getId()).intValue());
                     target.add(searchFormContainer);
                 }
 
                 @Override
-                protected void onError(final AjaxRequestTarget target,
-                        final Form<?> form) {
-
+                protected void onError(final AjaxRequestTarget target, final Form<?> form) {
                     target.add(searchFormContainer);
                 }
             };
-
             dropButton.setDefaultFormProcessing(false);
-
             if (item.getIndex() == 0) {
                 dropButton.setVisible(false);
             }
-
             item.add(dropButton);
 
-            try {
+            if (searchCondition == null || searchCondition.getFilterType() == null) {
+                filterNameChooser.setChoices(Collections.EMPTY_LIST);
+            } else {
                 switch (searchCondition.getFilterType()) {
                     case ATTRIBUTE:
-                        final List<String> names =
-                                new ArrayList<String>(dnames.getObject());
-
-                        if (unames.getObject() != null
-                                && !unames.getObject().isEmpty()) {
+                        final List<String> names = new ArrayList<String>(dnames.getObject());
 
+                        if (unames.getObject() != null && !unames.getObject().isEmpty()) {
                             names.addAll(unames.getObject());
                         }
                         Collections.sort(names);
@@ -646,8 +561,23 @@ public class UserSearchPanel extends Pan
                         }
 
                         break;
+
                     case MEMBERSHIP:
-                        filterNameChooser.setChoices(ronames);
+                        filterNameChooser.setChoices(roleNames);
+                        filterNameChooser.setChoiceRenderer(new IChoiceRenderer<String>() {
+
+                            private static final long serialVersionUID = -4288397951948436434L;
+
+                            @Override
+                            public Object getDisplayValue(String object) {
+                                return object;
+                            }
+
+                            @Override
+                            public String getIdValue(String object, int index) {
+                                return object;
+                            }
+                        });
                         type.setEnabled(false);
                         type.setRequired(false);
                         type.setModelObject(null);
@@ -656,8 +586,9 @@ public class UserSearchPanel extends Pan
                         filterValue.setModelObject("");
 
                         break;
+
                     case RESOURCE:
-                        filterNameChooser.setChoices(renames);
+                        filterNameChooser.setChoices(resourceNames);
                         type.setEnabled(false);
                         type.setRequired(false);
                         type.setModelObject(null);
@@ -666,12 +597,10 @@ public class UserSearchPanel extends Pan
                         filterValue.setModelObject("");
 
                         break;
+
                     default:
                         filterNameChooser.setChoices(Collections.EMPTY_LIST);
                 }
-            } catch (NullPointerException npe) {
-                // searchCondition null
-                filterNameChooser.setChoices(Collections.EMPTY_LIST);
             }
         }
     }

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/VirtualAttributesPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/VirtualAttributesPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/VirtualAttributesPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/panels/VirtualAttributesPanel.java Tue Mar  6 17:29:27 2012
@@ -46,6 +46,7 @@ import org.syncope.console.rest.SchemaRe
 import org.syncope.console.wicket.markup.html.form.AjaxDecoratedCheckbox;
 import org.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.syncope.console.wicket.markup.html.form.MultiValueSelectorPanel;
+import org.syncope.types.AttributableType;
 
 public class VirtualAttributesPanel extends Panel {
 
@@ -70,14 +71,11 @@ public class VirtualAttributesPanel exte
                     @Override
                     protected List<String> load() {
                         if (entityTO instanceof RoleTO) {
-                            return schemaRestClient.getVirtualSchemaNames(
-                                    "role");
+                            return schemaRestClient.getVirtualSchemaNames(AttributableType.ROLE);
                         } else if (entityTO instanceof UserTO) {
-                            return schemaRestClient.getVirtualSchemaNames(
-                                    "user");
+                            return schemaRestClient.getVirtualSchemaNames(AttributableType.USER);
                         } else {
-                            return schemaRestClient.getVirtualSchemaNames(
-                                    "membership");
+                            return schemaRestClient.getVirtualSchemaNames(AttributableType.MEMBERSHIP);
                         }
                     }
                 };
@@ -197,16 +195,11 @@ public class VirtualAttributesPanel exte
                 }
 
                 if (templateMode) {
-                    item.add(new AjaxTextFieldPanel(
-                            "values", "values", new Model(), true));
+                    item.add(new AjaxTextFieldPanel("values", "values", new Model()));
                 } else {
-                    item.add(new MultiValueSelectorPanel(
-                            "values",
-                            new PropertyModel<List<String>>(
-                            attributeTO, "values"),
-                            String.class,
-                            new AjaxTextFieldPanel(
-                            "panel", "values", new Model(null), true)));
+                    item.add(new MultiValueSelectorPanel("values",
+                            new PropertyModel<List<String>>(attributeTO, "values"),
+                            new AjaxTextFieldPanel("panel", "values", new Model(null))));
                 }
             }
         };

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ConnectorRestClient.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ConnectorRestClient.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ConnectorRestClient.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ConnectorRestClient.java Tue Mar  6 17:29:27 2012
@@ -98,9 +98,7 @@ public class ConnectorRestClient extends
 
         try {
             bundles = Arrays.asList(restTemplate.getForObject(
-                    baseURL + "connector/bundle/list?lang="
-                    + SyncopeSession.get().getLocale(),
-                    ConnBundleTO[].class));
+                    baseURL + "connector/bundle/list?lang=" + SyncopeSession.get().getLocale(), ConnBundleTO[].class));
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While getting connector bundles", e);
         }
@@ -114,14 +112,12 @@ public class ConnectorRestClient extends
      * @param connectorId the connector id
      * @return List of ConnConfProperty, or an empty list in case none found
      */
-    public List<ConnConfProperty> getConnectorProperties(
-            final Long connectorId) {
+    public List<ConnConfProperty> getConnectorProperties(final Long connectorId) {
         List<ConnConfProperty> properties = null;
 
         try {
             properties = Arrays.asList(restTemplate.getForObject(baseURL
-                    + "connector/{connectorId}/configurationProperty/list",
-                    ConnConfProperty[].class, connectorId));
+                    + "connector/{connectorId}/configurationProperty/list", ConnConfProperty[].class, connectorId));
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While getting connector configuration properties", e);
         }
@@ -129,9 +125,7 @@ public class ConnectorRestClient extends
         return properties;
     }
 
-    private Set<ConnConfProperty> filterProperties(
-            final Set<ConnConfProperty> properties) {
-
+    private Set<ConnConfProperty> filterProperties(final Set<ConnConfProperty> properties) {
         Set<ConnConfProperty> newProperties = new HashSet<ConnConfProperty>();
 
         for (ConnConfProperty property : properties) {
@@ -163,12 +157,10 @@ public class ConnectorRestClient extends
         ConnInstanceTO connector = new ConnInstanceTO();
         BeanUtils.copyProperties(connectorTO, connector);
 
-        connector.setConfiguration(
-                filterProperties(connector.getConfiguration()));
+        connector.setConfiguration(filterProperties(connector.getConfiguration()));
 
         try {
-            return restTemplate.postForObject(
-                    baseURL + "connector/check.json", connector, Boolean.class);
+            return restTemplate.postForObject(baseURL + "connector/check.json", connector, Boolean.class);
 
         } catch (Exception e) {
             LOG.error("Connector not found {}", connector, e);
@@ -181,12 +173,10 @@ public class ConnectorRestClient extends
 
         try {
             schemaNames = Arrays.asList(restTemplate.postForObject(
-                    baseURL + "connector/schema/list",
-                    connectorTO, String[].class));
+                    baseURL + "connector/schema/list", connectorTO, String[].class));
 
             // re-order schema names list
             Collections.sort(schemaNames);
-
         } catch (Exception e) {
             LOG.error("While getting resource schema names", e);
         }

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ReportRestClient.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ReportRestClient.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ReportRestClient.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ReportRestClient.java Tue Mar  6 17:29:27 2012
@@ -20,7 +20,6 @@ package org.syncope.console.rest;
 
 import java.util.Arrays;
 import java.util.List;
-import java.util.Set;
 import org.springframework.stereotype.Component;
 import org.syncope.client.to.ReportExecTO;
 import org.syncope.client.to.ReportTO;
@@ -30,12 +29,12 @@ import org.syncope.client.validation.Syn
 public class ReportRestClient extends AbstractBaseRestClient
         implements ExecutionRestClient {
 
-    public Set<String> getReportletClasses() {
-        Set<String> reportletClasses = null;
+    public List<String> getReportletConfClasses() {
+        List<String> reportletClasses = null;
 
         try {
-            reportletClasses = restTemplate.getForObject(
-                    baseURL + "report/reportletClasses.json", Set.class);
+            reportletClasses = Arrays.asList(restTemplate.getForObject(
+                    baseURL + "report/reportletConfClasses.json", String[].class));
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While getting available reportlet classes", e);
         }