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 [4/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/rest/SchemaRestClient.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/SchemaRestClient.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/SchemaRestClient.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/SchemaRestClient.java Tue Mar  6 17:29:27 2012
@@ -26,6 +26,7 @@ import org.syncope.client.to.DerivedSche
 import org.syncope.client.to.SchemaTO;
 import org.syncope.client.to.VirtualSchemaTO;
 import org.syncope.client.validation.SyncopeClientCompositeErrorException;
+import org.syncope.types.AttributableType;
 
 /**
  * Console client for invoking rest schema services.
@@ -35,34 +36,33 @@ public class SchemaRestClient extends Ab
 
     /**
      * Get schemas.
+     *
      * @return List of schemas.
      */
-    public List<SchemaTO> getSchemas(final String kind) {
-        List<SchemaTO> userSchemas = null;
+    public List<SchemaTO> getSchemas(final AttributableType type) {
+        List<SchemaTO> schemas = null;
 
         try {
-            userSchemas = Arrays.asList(
-                    restTemplate.getForObject(
-                    baseURL + "schema/" + kind + "/list.json",
-                    SchemaTO[].class));
+            schemas = Arrays.asList(restTemplate.getForObject(
+                    baseURL + "schema/" + type.name().toLowerCase() + "/list.json", SchemaTO[].class));
         } catch (SyncopeClientCompositeErrorException e) {
-            LOG.error("While getting all user schemas", e);
+            LOG.error("While getting all schemas", e);
         }
 
-        return userSchemas;
+        return schemas;
     }
 
     /**
      * Get schema names.
+     *
      * @return List of schema names.
      */
-    public List<String> getSchemaNames(final String kind) {
+    public List<String> getSchemaNames(final AttributableType type) {
         final List<String> schemaNames = new ArrayList<String>();
 
         try {
-            final List<SchemaTO> userSchemas = Arrays.asList(
-                    restTemplate.getForObject(baseURL
-                    + "schema/" + kind + "/list.json", SchemaTO[].class));
+            final List<SchemaTO> userSchemas = Arrays.asList(restTemplate.getForObject(
+                    baseURL + "schema/" + type.name().toLowerCase() + "/list.json", SchemaTO[].class));
 
             for (SchemaTO schemaTO : userSchemas) {
                 schemaNames.add(schemaTO.getName());
@@ -76,17 +76,16 @@ public class SchemaRestClient extends Ab
 
     /**
      * Get derived schemas.
+     *
      * @return List of derived schemas.
      */
-    public List<DerivedSchemaTO> getDerivedSchemas(final String kind) {
+    public List<DerivedSchemaTO> getDerivedSchemas(final AttributableType type) {
 
         List<DerivedSchemaTO> userDerivedSchemas = null;
 
         try {
-            userDerivedSchemas = Arrays.asList(
-                    restTemplate.getForObject(
-                    baseURL + "derivedSchema/" + kind + "/list.json",
-                    DerivedSchemaTO[].class));
+            userDerivedSchemas = Arrays.asList(restTemplate.getForObject(
+                    baseURL + "derivedSchema/" + type.name().toLowerCase() + "/list.json", DerivedSchemaTO[].class));
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While getting all user derived schemas", e);
         }
@@ -95,68 +94,62 @@ public class SchemaRestClient extends Ab
     }
 
     /**
-     * Get derived schemas.
-     * @return List of derived schemas.
+     * Get derived schema names.
+     *
+     * @return List of derived schema names.
      */
-    public List<VirtualSchemaTO> getVirtualSchemas(final String kind) {
+    public List<String> getDerivedSchemaNames(final AttributableType type) {
 
-        List<VirtualSchemaTO> userVirtualSchemas = null;
+        final List<String> userDerivedSchemasNames = new ArrayList<String>();
 
         try {
-            userVirtualSchemas = Arrays.asList(
-                    restTemplate.getForObject(
-                    baseURL + "virtualSchema/" + kind + "/list.json",
-                    VirtualSchemaTO[].class));
+            final List<DerivedSchemaTO> userDerivedSchemas = Arrays.asList(restTemplate.getForObject(
+                    baseURL + "derivedSchema/" + type.name().toLowerCase() + "/list.json", DerivedSchemaTO[].class));
+
+            for (DerivedSchemaTO schemaTO : userDerivedSchemas) {
+                userDerivedSchemasNames.add(schemaTO.getName());
+            }
         } catch (SyncopeClientCompositeErrorException e) {
-            LOG.error("While getting all user derived schemas", e);
+            LOG.error("While getting all user derived schema names", e);
         }
 
-        return userVirtualSchemas;
+        return userDerivedSchemasNames;
     }
 
     /**
-     * Get derived schema names.
-     * @return List of derived schema names.
+     * Get derived schemas.
+     *
+     * @return List of derived schemas.
      */
-    public List<String> getDerivedSchemaNames(final String kind) {
+    public List<VirtualSchemaTO> getVirtualSchemas(final AttributableType type) {
 
-        final List<String> userDerivedSchemasNames = new ArrayList<String>();
+        List<VirtualSchemaTO> userVirtualSchemas = null;
 
         try {
-            final List<DerivedSchemaTO> userDerivedSchemas =
-                    Arrays.asList(restTemplate.getForObject(baseURL
-                    + "derivedSchema/" + kind + "/list.json",
-                    DerivedSchemaTO[].class));
-
-            for (DerivedSchemaTO schemaTO : userDerivedSchemas) {
-                userDerivedSchemasNames.add(schemaTO.getName());
-            }
-
+            userVirtualSchemas = Arrays.asList(restTemplate.getForObject(
+                    baseURL + "virtualSchema/" + type.name().toLowerCase() + "/list.json", VirtualSchemaTO[].class));
         } catch (SyncopeClientCompositeErrorException e) {
-            LOG.error("While getting all user derived schema names", e);
+            LOG.error("While getting all user derived schemas", e);
         }
 
-        return userDerivedSchemasNames;
+        return userVirtualSchemas;
     }
 
     /**
      * Get virtual schema names.
+     *
      * @return List of virtual schema names.
      */
-    public List<String> getVirtualSchemaNames(final String kind) {
-
+    public List<String> getVirtualSchemaNames(final AttributableType type) {
         final List<String> userVirtualSchemasNames = new ArrayList<String>();
 
         try {
-            final List<VirtualSchemaTO> userVirtualSchemas =
-                    Arrays.asList(restTemplate.getForObject(baseURL
-                    + "virtualSchema/" + kind + "/list.json",
-                    VirtualSchemaTO[].class));
+            final List<VirtualSchemaTO> userVirtualSchemas = Arrays.asList(restTemplate.getForObject(
+                    baseURL + "virtualSchema/" + type.name().toLowerCase() + "/list.json", VirtualSchemaTO[].class));
 
             for (VirtualSchemaTO schemaTO : userVirtualSchemas) {
                 userVirtualSchemasNames.add(schemaTO.getName());
             }
-
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While getting all user derived schema names", e);
         }
@@ -166,26 +159,26 @@ public class SchemaRestClient extends Ab
 
     /**
      * Create new user schema.
+     *
      * @param schemaTO
      */
-    public void createSchema(final String kind, final SchemaTO schemaTO) {
-        restTemplate.postForObject(baseURL
-                + "schema/" + kind + "/create", schemaTO, SchemaTO.class);
+    public void createSchema(final AttributableType type, final SchemaTO schemaTO) {
+        restTemplate.postForObject(
+                baseURL + "schema/" + type.name().toLowerCase() + "/create", schemaTO, SchemaTO.class);
     }
 
     /**
      * Load an already existent user schema by its name.
+     *
      * @param name (e.g.:surname)
      * @return schemaTO
      */
-    public SchemaTO readSchema(final String kind, final String name) {
+    public SchemaTO readSchema(final AttributableType type, final String name) {
         SchemaTO schema = null;
 
         try {
             schema = restTemplate.getForObject(
-                    baseURL
-                    + "schema/" + kind + "/read/" + name + ".json",
-                    SchemaTO.class);
+                    baseURL + "schema/" + type.name().toLowerCase() + "/read/" + name + ".json", SchemaTO.class);
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While reading a user schema", e);
         }
@@ -194,60 +187,55 @@ public class SchemaRestClient extends Ab
 
     /**
      * Update an already existent user schema.
+     *
      * @param schemaTO updated
      */
-    public void updateSchema(String kind, SchemaTO schemaTO) {
-        restTemplate.postForObject(baseURL
-                + "schema/" + kind + "/update", schemaTO, SchemaTO.class);
+    public void updateSchema(final AttributableType type, SchemaTO schemaTO) {
+        restTemplate.postForObject(
+                baseURL + "schema/" + type.name().toLowerCase() + "/update", schemaTO, SchemaTO.class);
     }
 
     /**
      * Delete an already existent user schema by its name.
+     *
      * @param name (e.g.:surname)
      * @return schemaTO
      */
-    public void deleteSchema(String kind, String name) {
-        restTemplate.delete(baseURL
-                + "schema/" + kind + "/delete/" + name + ".json");
+    public void deleteSchema(final AttributableType type, String name) {
+        restTemplate.delete(baseURL + "schema/" + type.name().toLowerCase() + "/delete/" + name + ".json");
     }
 
     /**
      * Create new derived user schema.
+     *
      * @param schemaTO
      */
-    public void createDerivedSchema(final String kind,
-            final DerivedSchemaTO schemaTO) {
-
-        restTemplate.postForObject(baseURL
-                + "derivedSchema/" + kind + "/create", schemaTO,
-                DerivedSchemaTO.class);
+    public void createDerivedSchema(final AttributableType type, final DerivedSchemaTO schemaTO) {
+        restTemplate.postForObject(
+                baseURL + "derivedSchema/" + type.name().toLowerCase() + "/create", schemaTO, DerivedSchemaTO.class);
     }
 
     /**
      * Create new derived user schema.
+     *
      * @param schemaTO
      */
-    public void createVirtualSchema(final String kind,
-            final VirtualSchemaTO schemaTO) {
-
-        restTemplate.postForObject(baseURL
-                + "virtualSchema/" + kind + "/create", schemaTO,
-                VirtualSchemaTO.class);
+    public void createVirtualSchema(final AttributableType type, final VirtualSchemaTO schemaTO) {
+        restTemplate.postForObject(
+                baseURL + "virtualSchema/" + type.name().toLowerCase() + "/create", schemaTO, VirtualSchemaTO.class);
     }
 
     /**
      * Load an already existent user derived schema by its name.
+     *
      * @param name (e.g.:surname)
      * @return DerivedSchemaTO
      */
-    public DerivedSchemaTO readDerivedSchema(final String kind,
-            final String name) {
-
+    public DerivedSchemaTO readDerivedSchema(final AttributableType type, final String name) {
         DerivedSchemaTO derivedSchemaTO = null;
         try {
             derivedSchemaTO = restTemplate.getForObject(
-                    baseURL
-                    + "derivedSchema/" + kind + "/read/" + name + ".json",
+                    baseURL + "derivedSchema/" + type.name().toLowerCase() + "/read/" + name + ".json",
                     DerivedSchemaTO.class);
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While reading a derived user schema", e);
@@ -257,50 +245,40 @@ public class SchemaRestClient extends Ab
 
     /**
      * Update an already existent user derived schema.
+     *
      * @param schemaTO updated
      */
-    public void updateDerivedSchema(final String kind,
-            final DerivedSchemaTO schemaTO) {
-
-        restTemplate.postForObject(baseURL
-                + "derivedSchema/" + kind + "/update", schemaTO,
-                DerivedSchemaTO.class);
+    public void updateDerivedSchema(final AttributableType type, final DerivedSchemaTO schemaTO) {
+        restTemplate.postForObject(
+                baseURL + "derivedSchema/" + type.name().toLowerCase() + "/update", schemaTO, DerivedSchemaTO.class);
     }
 
     /**
      * Update an already existent user derived schema.
+     *
      * @param schemaTO updated
      */
-    public void updateVirtualSchema(final String kind,
-            final VirtualSchemaTO schemaTO) {
-
+    public void updateVirtualSchema(final AttributableType type, final VirtualSchemaTO schemaTO) {
         restTemplate.postForObject(baseURL
-                + "virtualSchema/" + kind + "/update", schemaTO,
-                VirtualSchemaTO.class);
+                + "virtualSchema/" + type.name().toLowerCase() + "/update", schemaTO, VirtualSchemaTO.class);
     }
 
     /**
      * Delete an already existent user derived schema by its name.
+     *
      * @param name (e.g.:surname)
      */
-    public void deleteDerivedSchema(String kind, String name) {
-        try {
-            restTemplate.delete(baseURL
-                    + "derivedSchema/" + kind + "/delete/" + name + ".json");
-        } catch (SyncopeClientCompositeErrorException e) {
-            LOG.error("While deleting a derived user schema", e);
-        }
+    public void deleteDerivedSchema(final AttributableType type, String name) {
+        restTemplate.delete(baseURL + "derivedSchema/" + type.name().toLowerCase() + "/delete/" + name + ".json");
     }
 
     /**
-     * Delete an already existent user derived schema by its name.
+     * Delete an already existent user virtual schema by its name.
+     *
      * @param name (e.g.:surname)
      */
-    public void deleteVirtualSchema(final String kind,
-            final String name) {
-
-        restTemplate.delete(baseURL
-                + "virtualSchema/" + kind + "/delete/" + name + ".json");
+    public void deleteVirtualSchema(final AttributableType type, final String name) {
+        restTemplate.delete(baseURL + "virtualSchema/" + type.name().toLowerCase() + "/delete/" + name + ".json");
     }
 
     /**
@@ -311,8 +289,7 @@ public class SchemaRestClient extends Ab
 
         try {
             validators = Arrays.asList(restTemplate.getForObject(
-                    baseURL + "configuration/validators.json",
-                    String[].class));
+                    baseURL + "configuration/validators.json", String[].class));
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While getting all validators", e);
         }

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/TaskRestClient.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/TaskRestClient.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/TaskRestClient.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/TaskRestClient.java Tue Mar  6 17:29:27 2012
@@ -43,24 +43,22 @@ public class TaskRestClient extends Abst
      *
      * @return list of classes.
      */
-    public Set<String> getJobClasses() {
-        Set<String> jobClasses = null;
+    public List<String> getJobClasses() {
+        List<String> jobClasses = null;
 
         try {
-            jobClasses = restTemplate.getForObject(
-                    baseURL + "task/jobClasses.json", Set.class);
+            jobClasses = Arrays.asList(restTemplate.getForObject(baseURL + "task/jobClasses.json", String[].class));
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While getting all job classes", e);
         }
         return jobClasses;
     }
 
-    public Set<String> getJobActionsClasses() {
-        Set<String> actions = null;
+    public List<String> getJobActionsClasses() {
+        List<String> actions = null;
 
         try {
-            actions = restTemplate.getForObject(
-                    baseURL + "task/jobActionsClasses.json", Set.class);
+            actions = Arrays.asList(restTemplate.getForObject(baseURL + "task/jobActionsClasses.json", String[].class));
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While getting all job actions classes", e);
         }
@@ -74,8 +72,7 @@ public class TaskRestClient extends Abst
      * @return number of stored tasks.
      */
     public Integer count(final String kind) {
-        return restTemplate.getForObject(baseURL + "task/{kind}/count.json",
-                Integer.class, kind);
+        return restTemplate.getForObject(baseURL + "task/{kind}/count.json", Integer.class, kind);
     }
 
     /**
@@ -85,9 +82,7 @@ public class TaskRestClient extends Abst
      * @param size per page.
      * @return paginated list.
      */
-    public <T extends TaskTO> List<T> listTasks(
-            final Class<T> reference, final int page, final int size) {
-
+    public <T extends TaskTO> List<T> listTasks(final Class<T> reference, final int page, final int size) {
         List<T> result = Collections.EMPTY_LIST;
 
         if (PropagationTaskTO.class == reference) {
@@ -112,28 +107,18 @@ public class TaskRestClient extends Abst
     }
 
     public PropagationTaskTO readPropagationTask(final Long taskId) {
-        return restTemplate.getForObject(
-                baseURL + "task/read/{taskId}",
-                PropagationTaskTO.class, taskId);
+        return restTemplate.getForObject(baseURL + "task/read/{taskId}", PropagationTaskTO.class, taskId);
     }
 
     public NotificationTaskTO readNotificationTask(final Long taskId) {
-        return restTemplate.getForObject(
-                baseURL + "task/read/{taskId}",
-                NotificationTaskTO.class, taskId);
+        return restTemplate.getForObject(baseURL + "task/read/{taskId}", NotificationTaskTO.class, taskId);
     }
 
-    public <T extends SchedTaskTO> T readSchedTask(
-            final Class<T> reference, final Long taskId) {
-
+    public <T extends SchedTaskTO> T readSchedTask(final Class<T> reference, final Long taskId) {
         if (SyncTaskTO.class.getName().equals(reference.getName())) {
-            return (T) restTemplate.getForObject(
-                    baseURL + "task/read/{taskId}",
-                    SyncTaskTO.class, taskId);
+            return (T) restTemplate.getForObject(baseURL + "task/read/{taskId}", SyncTaskTO.class, taskId);
         } else {
-            return (T) restTemplate.getForObject(
-                    baseURL + "task/read/{taskId}",
-                    SchedTaskTO.class, taskId);
+            return (T) restTemplate.getForObject(baseURL + "task/read/{taskId}", SchedTaskTO.class, taskId);
         }
     }
 
@@ -144,10 +129,7 @@ public class TaskRestClient extends Abst
      */
     @Override
     public List<TaskExecTO> listExecutions() {
-        return Arrays.asList(
-                restTemplate.getForObject(
-                baseURL + "task/execution/list",
-                TaskExecTO[].class));
+        return Arrays.asList(restTemplate.getForObject(baseURL + "task/execution/list", TaskExecTO[].class));
     }
 
     /**
@@ -156,8 +138,7 @@ public class TaskRestClient extends Abst
      * @param taskId task to delete
      */
     public void delete(final Long taskId) {
-        restTemplate.delete(
-                baseURL + "task/delete/{taskId}", taskId);
+        restTemplate.delete(baseURL + "task/delete/{taskId}", taskId);
     }
 
     @Override
@@ -172,8 +153,7 @@ public class TaskRestClient extends Abst
      */
     public void startExecution(final Long taskId, boolean dryRun) {
         restTemplate.postForObject(
-                baseURL + "task/execute/{taskId}?dryRun={dryRun}",
-                null, TaskExecTO.class, taskId, dryRun);
+                baseURL + "task/execute/{taskId}?dryRun={dryRun}", null, TaskExecTO.class, taskId, dryRun);
     }
 
     /**
@@ -183,27 +163,22 @@ public class TaskRestClient extends Abst
      */
     @Override
     public void deleteExecution(final Long taskExecId) {
-        restTemplate.delete(baseURL
-                + "task/execution/delete/{execId}", taskExecId);
+        restTemplate.delete(baseURL + "task/execution/delete/{execId}", taskExecId);
     }
 
     public SyncTaskTO createSyncTask(final SyncTaskTO taskTO) {
-        return restTemplate.postForObject(baseURL
-                + "task/create/sync", taskTO, SyncTaskTO.class);
+        return restTemplate.postForObject(baseURL + "task/create/sync", taskTO, SyncTaskTO.class);
     }
 
     public SchedTaskTO createSchedTask(final SchedTaskTO taskTO) {
-        return restTemplate.postForObject(baseURL
-                + "task/create/sched", taskTO, SchedTaskTO.class);
+        return restTemplate.postForObject(baseURL + "task/create/sched", taskTO, SchedTaskTO.class);
     }
 
     public SchedTaskTO updateSchedTask(final SchedTaskTO taskTO) {
-        return restTemplate.postForObject(baseURL
-                + "task/update/sched", taskTO, SchedTaskTO.class);
+        return restTemplate.postForObject(baseURL + "task/update/sched", taskTO, SchedTaskTO.class);
     }
 
     public SyncTaskTO updateSyncTask(final SyncTaskTO taskTO) {
-        return restTemplate.postForObject(baseURL
-                + "task/update/sync", taskTO, SyncTaskTO.class);
+        return restTemplate.postForObject(baseURL + "task/update/sync", taskTO, SyncTaskTO.class);
     }
 }

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/ajax/markup/html/IndicatingDeleteOnConfirmAjaxLink.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/ajax/markup/html/IndicatingDeleteOnConfirmAjaxLink.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/ajax/markup/html/IndicatingDeleteOnConfirmAjaxLink.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/ajax/markup/html/IndicatingDeleteOnConfirmAjaxLink.java Tue Mar  6 17:29:27 2012
@@ -23,12 +23,11 @@ import org.apache.wicket.ajax.calldecora
 import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
 import org.apache.wicket.model.IModel;
 
-public abstract class IndicatingDeleteOnConfirmAjaxLink<T>
-        extends IndicatingAjaxLink<T> {
+public abstract class IndicatingDeleteOnConfirmAjaxLink<T> extends IndicatingAjaxLink<T> {
 
-    public IndicatingDeleteOnConfirmAjaxLink(final String id,
-            final IModel<T> model) {
+    private static final long serialVersionUID = 2228670850922265663L;
 
+    public IndicatingDeleteOnConfirmAjaxLink(final String id, final IModel<T> model) {
         super(id, model);
     }
 
@@ -38,13 +37,12 @@ public abstract class IndicatingDeleteOn
 
     @Override
     protected IAjaxCallDecorator getAjaxCallDecorator() {
-        return new AjaxPreprocessingCallDecorator(
-                super.getAjaxCallDecorator()) {
+        return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator()) {
 
-            @Override
-            public CharSequence preDecorateScript(
-                    final CharSequence script) {
+            private static final long serialVersionUID = -7927968187160354605L;
 
+            @Override
+            public CharSequence preDecorateScript(final CharSequence script) {
                 return "if (confirm('"
                         + getString("confirmDelete") + "'))"
                         + "{" + script + "}";

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxCheckBoxPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxCheckBoxPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxCheckBoxPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxCheckBoxPanel.java Tue Mar  6 17:29:27 2012
@@ -34,15 +34,14 @@ public class AjaxCheckBoxPanel extends F
     public AjaxCheckBoxPanel(
             final String id,
             final String name,
-            final IModel<Boolean> model,
-            final boolean active) {
+            final IModel<Boolean> model) {
 
-        super(id, name, model, active);
+        super(id, name, model);
 
         field = new CheckBox("checkboxField", model);
         add(field.setLabel(new Model(name)).setOutputMarkupId(true));
 
-        if (active) {
+        if (!isReadOnly()) {
             field.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
                 private static final long serialVersionUID =

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxDecoratedCheckbox.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxDecoratedCheckbox.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxDecoratedCheckbox.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxDecoratedCheckbox.java Tue Mar  6 17:29:27 2012
@@ -41,6 +41,8 @@ public abstract class AjaxDecoratedCheck
 
         add(new AjaxEventBehavior("onclick") {
 
+            private static final long serialVersionUID = -295188647830294610L;
+
             @Override
             protected void onEvent(final AjaxRequestTarget target) {
                 onUpdate(target);
@@ -59,6 +61,7 @@ public abstract class AjaxDecoratedCheck
      *
      * @return ajax call decorator
      */
+    @Override
     protected IAjaxCallDecorator getAjaxCallDecorator() {
         return null;
     }

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java Tue Mar  6 17:29:27 2012
@@ -28,39 +28,24 @@ import org.apache.wicket.markup.html.for
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 
-public class AjaxDropDownChoicePanel<T>
-        extends FieldPanel implements Cloneable {
+public class AjaxDropDownChoicePanel<T> extends FieldPanel implements Cloneable {
 
     private static final long serialVersionUID = -4716376580659196095L;
 
     public AjaxDropDownChoicePanel(
             final String id,
             final String name,
-            final IModel<T> model,
-            final boolean active) {
+            final IModel<T> model) {
 
-        this(id, name, model, active, true);
-    }
+        super(id, name, model);
 
-    public AjaxDropDownChoicePanel(
-            final String id,
-            final String name,
-            final IModel<T> model,
-            final boolean active,
-            final boolean nullValid) {
-
-        super(id, name, model, active);
-
-        field = new DropDownChoice("dropDownChoiceField", model,
-                Collections.EMPTY_LIST, new ChoiceRenderer());
-        ((DropDownChoice) field).setNullValid(nullValid);
+        field = new DropDownChoice("dropDownChoiceField", model, Collections.EMPTY_LIST, new ChoiceRenderer());
         add(field.setLabel(new Model(name)).setOutputMarkupId(true));
 
-        if (active) {
+        if (!isReadOnly()) {
             field.add(new AjaxFormComponentUpdatingBehavior("onblur") {
 
-                private static final long serialVersionUID =
-                        -1107858522700306810L;
+                private static final long serialVersionUID = -1107858522700306810L;
 
                 @Override
                 protected void onUpdate(final AjaxRequestTarget target) {
@@ -70,9 +55,7 @@ public class AjaxDropDownChoicePanel<T>
         }
     }
 
-    public AjaxDropDownChoicePanel<T> setChoiceRenderer(
-            final IChoiceRenderer renderer) {
-
+    public AjaxDropDownChoicePanel<T> setChoiceRenderer(final IChoiceRenderer renderer) {
         ((DropDownChoice) field).setChoiceRenderer(renderer);
         return this;
     }
@@ -82,17 +65,14 @@ public class AjaxDropDownChoicePanel<T>
         return this;
     }
 
-    public AjaxDropDownChoicePanel<T> setChoices(
-            final IModel<? extends List<? extends T>> choices) {
-
+    public AjaxDropDownChoicePanel<T> setChoices(final IModel<? extends List<? extends T>> choices) {
         ((DropDownChoice) field).setChoices(choices);
         return this;
     }
 
     @Override
     public FieldPanel clone() {
-        AjaxDropDownChoicePanel<T> panel =
-                (AjaxDropDownChoicePanel<T>) super.clone();
+        AjaxDropDownChoicePanel<T> panel = (AjaxDropDownChoicePanel<T>) super.clone();
 
         setChoiceRenderer(((DropDownChoice) field).getChoiceRenderer());
         setChoices(((DropDownChoice) field).getChoices());

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxNumberFieldPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxNumberFieldPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxNumberFieldPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxNumberFieldPanel.java Tue Mar  6 17:29:27 2012
@@ -32,16 +32,15 @@ public class AjaxNumberFieldPanel extend
             final String id,
             final String name,
             final IModel<Number> model,
-            final Class reference,
-            final boolean active) {
+            final Class reference) {
 
-        super(id, name, model, active);
+        super(id, name, model);
 
         field = new TextField<Number>("numberField", model, reference);
 
         add(field.setLabel(new Model(name)).setOutputMarkupId(true));
 
-        if (active) {
+        if (!isReadOnly()) {
             field.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
                 private static final long serialVersionUID =

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxPalettePanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxPalettePanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxPalettePanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxPalettePanel.java Tue Mar  6 17:29:27 2012
@@ -21,7 +21,6 @@ package org.syncope.console.wicket.marku
 import java.io.Serializable;
 import java.util.List;
 import org.apache.wicket.extensions.markup.html.form.palette.Palette;
-import org.apache.wicket.markup.html.form.ChoiceRenderer;
 import org.apache.wicket.markup.html.form.IChoiceRenderer;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.util.ListModel;
@@ -38,42 +37,45 @@ public class AjaxPalettePanel<T> extends
             final IModel<List<T>> model,
             final ListModel<T> choices) {
 
-        super(id, model);
+        this(id, model, choices, false);
+    }
 
-        this.palette = createPalette(
-                id, model, choices, new SelectChoiceRenderer());
-        add(palette.setOutputMarkupId(true));
-        setOutputMarkupId(true);
+    public AjaxPalettePanel(
+            final String id,
+            final IModel<List<T>> model,
+            final ListModel<T> choices,
+            final boolean allowOrder) {
+
+        this(id, model, choices, new SelectChoiceRenderer(), allowOrder);
     }
 
     public AjaxPalettePanel(
             final String id,
             final IModel<List<T>> model,
             final ListModel<T> choices,
-            final ChoiceRenderer<T> renderer) {
+            final IChoiceRenderer<T> renderer,
+            final boolean allowOrder) {
 
         super(id, model);
 
-        this.palette = createPalette(id, model, choices, renderer);
+        this.palette = createPalette(model, choices, renderer, allowOrder);
         add(palette.setOutputMarkupId(true));
         setOutputMarkupId(true);
     }
 
     private Palette<T> createPalette(
-            final String id,
             final IModel<List<T>> model,
             final ListModel<T> choices,
-            final IChoiceRenderer renderer) {
+            final IChoiceRenderer<T> renderer,
+            final boolean allowOrder) {
 
-        final Palette<T> palette = new Palette(
+        return new Palette(
                 "paletteField",
                 model,
                 choices,
                 renderer,
                 8,
-                false);
-
-        return palette;
+                allowOrder);
     }
 
     @Override

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java Tue Mar  6 17:29:27 2012
@@ -31,10 +31,9 @@ public class AjaxPasswordFieldPanel exte
     public AjaxPasswordFieldPanel(
             final String id,
             final String name,
-            final IModel<String> model,
-            final boolean active) {
+            final IModel<String> model) {
 
-        super(id, name, model, active);
+        super(id, name, model);
 
         field = new PasswordTextField("passwordField", model);
 
@@ -42,7 +41,7 @@ public class AjaxPasswordFieldPanel exte
 
         add(field.setLabel(new Model(name)).setOutputMarkupId(true));
 
-        if (active) {
+        if (!isReadOnly()) {
             field.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
                 private static final long serialVersionUID =

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxTextFieldPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxTextFieldPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxTextFieldPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/AjaxTextFieldPanel.java Tue Mar  6 17:29:27 2012
@@ -39,10 +39,9 @@ public class AjaxTextFieldPanel extends 
     public AjaxTextFieldPanel(
             final String id,
             final String name,
-            final IModel<String> model,
-            final boolean active) {
+            final IModel<String> model) {
 
-        super(id, name, model, active);
+        super(id, name, model);
 
         field = new AutoCompleteTextField<String>("textField", model) {
 
@@ -68,11 +67,10 @@ public class AjaxTextFieldPanel extends 
 
         add(field.setLabel(new Model(name)).setOutputMarkupId(true));
 
-        if (active) {
+        if (!isReadOnly()) {
             field.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-                private static final long serialVersionUID =
-                        -1107858522700306810L;
+                private static final long serialVersionUID = -1107858522700306810L;
 
                 @Override
                 protected void onUpdate(AjaxRequestTarget art) {

Added: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java?rev=1297585&view=auto
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java (added)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java Tue Mar  6 17:29:27 2012
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.syncope.console.wicket.markup.html.form;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import org.apache.wicket.markup.html.form.CheckBoxMultipleChoice;
+import org.apache.wicket.model.IModel;
+
+public class CheckBoxMultipleChoiceFieldPanel extends AbstractFieldPanel {
+
+    private static final long serialVersionUID = 4124935025837737298L;
+
+    private final CheckBoxMultipleChoice field;
+
+    public CheckBoxMultipleChoiceFieldPanel(final String id, final IModel<Collection> model,
+            final IModel<List> choices) {
+
+        super(id, model);
+
+        field = new CheckBoxMultipleChoice("checkBoxMultipleChoice", model, choices);
+        add(field);
+    }
+
+    @Override
+    public AbstractFieldPanel setModelObject(final Serializable object) {
+        field.setModelObject(object);
+        return this;
+    }
+}

Propchange: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/DateTextFieldPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/DateTextFieldPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/DateTextFieldPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/DateTextFieldPanel.java Tue Mar  6 17:29:27 2012
@@ -26,14 +26,14 @@ import java.util.Date;
 import java.util.List;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
-import org.apache.wicket.model.IModel;
 import org.apache.wicket.datetime.markup.html.form.DateTextField;
 import org.apache.wicket.extensions.yui.calendar.DatePicker;
 import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.springframework.util.StringUtils;
 
-public class DateTextFieldPanel extends FieldPanel<Date> {
+public class DateTextFieldPanel extends FieldPanel<Date> implements Cloneable {
 
     private static final long serialVersionUID = 1919852712185883648L;
 
@@ -43,16 +43,15 @@ public class DateTextFieldPanel extends 
             final String id,
             final String name,
             final IModel<Date> model,
-            final boolean active,
             final String datePattern) {
 
-        super(id, name, model, active);
+        super(id, name, model);
 
         this.datePattern = datePattern;
 
         field = DateTextField.forDatePattern("field", model, datePattern);
 
-        if (active) {
+        if (!isReadOnly()) {
             field.add(
                     new AjaxFormComponentUpdatingBehavior("onchange") {
 
@@ -91,7 +90,7 @@ public class DateTextFieldPanel extends 
     }
 
     @Override
-    public FieldPanel setNewModel(final ListItem item, final Class reference) {
+    public FieldPanel setNewModel(final ListItem item) {
         final DateFormat formatter = new SimpleDateFormat(datePattern);
 
         IModel<Date> model = new Model() {
@@ -104,7 +103,7 @@ public class DateTextFieldPanel extends 
                 Date date = null;
 
                 if (StringUtils.hasText((String) item.getModelObject())) {
-                    if (reference.equals(String.class)) {
+                    if (item.getModelObject() instanceof String) {
                         // Parse string using datePattern
                         try {
                             date = formatter.parse(
@@ -112,7 +111,7 @@ public class DateTextFieldPanel extends 
                         } catch (ParseException e) {
                             LOG.error("While parsing date", e);
                         }
-                    } else if (reference.equals(Date.class)) {
+                    } else if (item.getModelObject() instanceof Date) {
                         // Don't parse anything
                         date = (Date) item.getModelObject();
                     } else {
@@ -127,11 +126,11 @@ public class DateTextFieldPanel extends 
             @Override
             public void setObject(final Serializable object) {
                 if (object != null) {
-                    if (reference.equals(String.class)) {
+                    if (item.getModelObject() instanceof String) {
                         // Parse string using datePattern
                         item.setModelObject(
                                 (String) formatter.format((Date) object));
-                    } else if (reference.equals(Date.class)) {
+                    } else if (item.getModelObject() instanceof Date) {
                         // Don't parse anything
                         item.setModelObject((Date) object);
                     } else {
@@ -188,9 +187,7 @@ public class DateTextFieldPanel extends 
 
     @Override
     public FieldPanel clone() {
-        final FieldPanel panel = new DateTextFieldPanel(
-                id, name, new Model(null), active, datePattern);
-
+        final FieldPanel panel = new DateTextFieldPanel(id, name, new Model(null), datePattern);
         panel.setRequired(isRequired());
         panel.setReadOnly(isReadOnly());
         panel.setTitle(title);

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/DateTimeFieldPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/DateTimeFieldPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/DateTimeFieldPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/DateTimeFieldPanel.java Tue Mar  6 17:29:27 2012
@@ -27,19 +27,19 @@ import java.util.List;
 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.extensions.yui.calendar.DateTimeField;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.form.FormComponent;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.extensions.yui.calendar.DateTimeField;
 import org.apache.wicket.markup.html.form.validation.AbstractFormValidator;
-import org.apache.wicket.validation.IValidationError;
-import org.apache.wicket.validation.ValidationError;
 import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
+import org.apache.wicket.validation.IValidationError;
+import org.apache.wicket.validation.ValidationError;
 import org.springframework.util.StringUtils;
 import org.syncope.client.SyncopeConstants;
 
-public class DateTimeFieldPanel extends FieldPanel<Date> {
+public class DateTimeFieldPanel extends FieldPanel<Date> implements Cloneable {
 
     private static final long serialVersionUID = -428975732068281726L;
 
@@ -61,10 +61,9 @@ public class DateTimeFieldPanel extends 
             final String id,
             final String name,
             final IModel<Date> model,
-            final boolean active,
             final String datePattern) {
 
-        super(id, name, model, active);
+        super(id, name, model);
 
         this.datePattern = datePattern;
 
@@ -72,30 +71,24 @@ public class DateTimeFieldPanel extends 
 
         final Calendar cal = Calendar.getInstance();
 
-        field.get("hours").
-                add(new AjaxFormComponentUpdatingBehavior("onchange") {
+        field.get("hours").add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-            private static final long serialVersionUID =
-                    -1107858522700306810L;
+            private static final long serialVersionUID = -1107858522700306810L;
 
             @Override
             protected void onUpdate(AjaxRequestTarget art) {
                 if (((DateTimeField) field).getHours() > 12) {
-                    cal.set(Calendar.HOUR_OF_DAY,
-                            ((DateTimeField) field).getHours());
+                    cal.set(Calendar.HOUR_OF_DAY, ((DateTimeField) field).getHours());
                 } else {
-                    cal.set(Calendar.HOUR,
-                            ((DateTimeField) field).getHours());
+                    cal.set(Calendar.HOUR, ((DateTimeField) field).getHours());
                 }
                 field.setModelObject(cal.getTime());
             }
         });
 
-        field.get("minutes").
-                add(new AjaxFormComponentUpdatingBehavior("onchange") {
+        field.get("minutes").add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-            private static final long serialVersionUID =
-                    -1107858522700306810L;
+            private static final long serialVersionUID = -1107858522700306810L;
 
             @Override
             protected void onUpdate(final AjaxRequestTarget target) {
@@ -104,11 +97,9 @@ public class DateTimeFieldPanel extends 
             }
         });
 
-        field.get("date").
-                add(new AjaxFormComponentUpdatingBehavior("onchange") {
+        field.get("date").add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-            private static final long serialVersionUID =
-                    -1107858522700306810L;
+            private static final long serialVersionUID = -1107858522700306810L;
 
             @Override
             protected void onUpdate(final AjaxRequestTarget target) {
@@ -124,11 +115,9 @@ public class DateTimeFieldPanel extends 
             }
         });
 
-        field.get("amOrPmChoice").
-                add(new AjaxFormComponentUpdatingBehavior("onchange") {
+        field.get("amOrPmChoice").add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-            private static final long serialVersionUID =
-                    -1107858522700306810L;
+            private static final long serialVersionUID = -1107858522700306810L;
 
             @Override
             protected void onUpdate(final AjaxRequestTarget target) {
@@ -146,8 +135,7 @@ public class DateTimeFieldPanel extends 
     }
 
     /**
-     * Custom form validator for registering and handling DateTimeField
-     * components that are in it.
+     * Custom form validator for registering and handling DateTimeField components that are in it.
      */
     private class DateTimeFormValidator extends AbstractFormValidator {
 
@@ -157,8 +145,7 @@ public class DateTimeFieldPanel extends 
 
         public DateTimeFormValidator(final DateTimeField dateTimeComponent) {
             if (dateTimeComponent == null) {
-                throw new IllegalArgumentException(
-                        "argument dateTimeComponent cannot be null");
+                throw new IllegalArgumentException("argument dateTimeComponent cannot be null");
             }
 
             dateTimeComponents = new FormComponent[]{dateTimeComponent};
@@ -171,12 +158,12 @@ public class DateTimeFieldPanel extends 
 
         /**
          * Validation rule : all 3 fields (date,hours,minutes) must be not-null.
+         *
          * @param form
          */
         @Override
         public void validate(final Form form) {
-            final DateTimeField dateTimeField =
-                    (DateTimeField) dateTimeComponents[0];
+            final DateTimeField dateTimeField = (DateTimeField) dateTimeComponents[0];
 
             if (!(dateTimeField.getDate() != null
                     && dateTimeField.getHours() != null
@@ -203,7 +190,7 @@ public class DateTimeFieldPanel extends 
     }
 
     @Override
-    public FieldPanel setNewModel(final ListItem item, final Class reference) {
+    public FieldPanel setNewModel(final ListItem item) {
         final SimpleDateFormat formatter = DATE_FORMAT.get();
 
         if (datePattern != null) {
@@ -212,23 +199,21 @@ public class DateTimeFieldPanel extends 
 
         IModel<Date> model = new Model() {
 
-            private static final long serialVersionUID =
-                    6799404673615637845L;
+            private static final long serialVersionUID = 6799404673615637845L;
 
             @Override
             public Serializable getObject() {
                 Date date = null;
 
                 if (StringUtils.hasText((String) item.getModelObject())) {
-                    if (reference.equals(String.class)) {
+                    if (item.getModelObject() instanceof String) {
                         // Parse string using datePattern
                         try {
-                            date = formatter.parse(
-                                    (String) item.getModelObject());
+                            date = formatter.parse((String) item.getModelObject());
                         } catch (ParseException e) {
                             LOG.error("While parsing date", e);
                         }
-                    } else if (reference.equals(Date.class)) {
+                    } else if (item.getModelObject() instanceof Date) {
                         // Don't parse anything
                         date = (Date) item.getModelObject();
                     } else {
@@ -243,11 +228,10 @@ public class DateTimeFieldPanel extends 
             @Override
             public void setObject(final Serializable object) {
                 if (object != null) {
-                    if (reference.equals(String.class)) {
+                    if (item.getModelObject() instanceof String) {
                         // Parse string using datePattern
-                        item.setModelObject(
-                                (String) formatter.format((Date) object));
-                    } else if (reference.equals(Date.class)) {
+                        item.setModelObject((String) formatter.format((Date) object));
+                    } else if (item.getModelObject() instanceof Date) {
                         // Don't parse anything
                         item.setModelObject((Date) object);
                     } else {
@@ -280,8 +264,7 @@ public class DateTimeFieldPanel extends 
             public Serializable getObject() {
                 Date date = null;
 
-                if (list != null && !list.isEmpty()
-                        && StringUtils.hasText(list.get(0).toString())) {
+                if (list != null && !list.isEmpty() && StringUtils.hasText(list.get(0).toString())) {
                     try {
                         // Parse string using datePattern
                         date = formatter.parse(list.get(0).toString());
@@ -307,25 +290,20 @@ public class DateTimeFieldPanel extends 
 
     @Override
     public FieldPanel setStyleShet(String classes) {
-        field.get("date").add(AttributeModifier.replace(
-                "class", (classes != null ? classes : "") + " date_size"));
+        field.get("date").add(AttributeModifier.replace("class", (classes != null ? classes : "") + " date_size"));
 
-        field.get("hours").add(AttributeModifier.replace(
-                "class", classes != null ? classes : ""));
+        field.get("hours").add(AttributeModifier.replace("class", classes != null ? classes : ""));
 
-        field.get("minutes").add(AttributeModifier.replace(
-                "class", classes != null ? classes : ""));
+        field.get("minutes").add(AttributeModifier.replace("class", classes != null ? classes : ""));
 
-        field.get("amOrPmChoice").add(AttributeModifier.replace(
-                "class", classes != null ? classes : ""));
+        field.get("amOrPmChoice").add(AttributeModifier.replace("class", classes != null ? classes : ""));
 
         return this;
     }
 
     @Override
     public FieldPanel clone() {
-        final FieldPanel panel = new DateTimeFieldPanel(
-                id, name, new Model(null), active, datePattern);
+        final FieldPanel panel = new DateTimeFieldPanel(id, name, new Model(null), datePattern);
 
         panel.setRequired(isRequired());
         panel.setReadOnly(isReadOnly());

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/FieldPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/FieldPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/FieldPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/FieldPanel.java Tue Mar  6 17:29:27 2012
@@ -28,15 +28,12 @@ import org.apache.wicket.markup.html.pan
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 
-public abstract class FieldPanel<T extends Serializable>
-        extends AbstractFieldPanel<T> {
+public abstract class FieldPanel<T extends Serializable> extends AbstractFieldPanel<T> {
 
     private static final long serialVersionUID = -198988924922541273L;
 
     protected FormComponent field = null;
 
-    final protected boolean active;
-
     final protected String id;
 
     final protected String name;
@@ -45,21 +42,13 @@ public abstract class FieldPanel<T exten
 
     protected boolean isRequiredLabelAdded = false;
 
-    public FieldPanel(
-            final String id,
-            final String name,
-            final IModel<T> model,
-            final boolean active) {
-
+    public FieldPanel(final String id, final String name, final IModel<T> model) {
         super(id, model);
 
         this.id = id;
         this.name = name;
-        this.active = active;
-
-        final Fragment fragment =
-                new Fragment("required", "notRequiredFragment", this);
 
+        final Fragment fragment = new Fragment("required", "notRequiredFragment", this);
         add(fragment);
 
         setOutputMarkupId(true);
@@ -70,15 +59,13 @@ public abstract class FieldPanel<T exten
     }
 
     public FieldPanel setTitle(String title) {
-        field.add(AttributeModifier.replace(
-                "title", title != null ? title : ""));
+        field.add(AttributeModifier.replace("title", title != null ? title : ""));
 
         return this;
     }
 
     public FieldPanel setStyleShet(final String classes) {
-        field.add(AttributeModifier.replace(
-                "class", classes != null ? classes : ""));
+        field.add(AttributeModifier.replace("class", classes != null ? classes : ""));
 
         return this;
     }
@@ -119,13 +106,12 @@ public abstract class FieldPanel<T exten
     }
 
     /**
-     * Userd by MultiValueSelectorPanel to attach items.
+     * Used by MultiValueSelectorPanel to attach items.
+     *
      * @param item item to attach.
      * @return updated FieldPanel object.
      */
-    public FieldPanel setNewModel(
-            final ListItem<T> item, final Class reference) {
-
+    public FieldPanel setNewModel(final ListItem<T> item) {
         setNewModel(new Model() {
 
             private static final long serialVersionUID = 6799404673615637845L;
@@ -172,12 +158,8 @@ public abstract class FieldPanel<T exten
     public FieldPanel clone() {
         final FieldPanel panel;
         try {
-            panel = this.getClass().getConstructor(new Class[]{
-                        String.class,
-                        String.class,
-                        IModel.class,
-                        boolean.class}).newInstance(
-                    id, name, new Model(null), active);
+            panel = this.getClass().getConstructor(new Class[]{String.class, String.class, IModel.class}).
+                    newInstance(id, name, new Model(null));
         } catch (Exception e) {
             LOG.error("Error cloning field panel", e);
             return null;

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java Tue Mar  6 17:29:27 2012
@@ -35,36 +35,25 @@ public class MultiValueSelectorPanel<E> 
 
     private static final long serialVersionUID = -6322397761456513324L;
 
-    ListView<E> view;
+    private ListView<E> view;
 
-    WebMarkupContainer container;
+    private WebMarkupContainer container;
 
     public MultiValueSelectorPanel(
             final String id,
             final IModel<List<E>> model,
-            final Class reference,
             final FieldPanel panelTemplate) {
-        super(id, model);
-        init(id, model, reference, panelTemplate, false);
 
+        this(id, model, panelTemplate, false);
     }
 
     public MultiValueSelectorPanel(
             final String id,
             final IModel<List<E>> model,
-            final Class reference,
             final FieldPanel panelTemplate,
             final boolean eventTemplate) {
-        super(id, model);
-        init(id, model, reference, panelTemplate, eventTemplate);
-    }
 
-    private void init(
-            final String id,
-            final IModel<List<E>> model,
-            final Class reference,
-            final FieldPanel panelTemplate,
-            final boolean sendEvent) {
+        super(id, model);
 
         // -----------------------
         // Object container definition
@@ -80,33 +69,28 @@ public class MultiValueSelectorPanel<E> 
 
             @Override
             protected void populateItem(final ListItem<E> item) {
-
                 final FieldPanel fieldPanel = panelTemplate.clone();
 
-                if (sendEvent) {
-                    fieldPanel.getField().add(
-                            new AjaxFormComponentUpdatingBehavior("onchange") {
-
-                                private static final long serialVersionUID =
-                                        -1107858522700306810L;
-
-                                @Override
-                                protected void onUpdate(
-                                        final AjaxRequestTarget target) {
-
-                                    send(getPage(), Broadcast.BREADTH,
-                                            new MultiValueSelectorEvent(target));
-                                }
-                            });
+                if (eventTemplate) {
+                    fieldPanel.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {
+
+                        private static final long serialVersionUID = -1107858522700306810L;
+
+                        @Override
+                        protected void onUpdate(
+                                final AjaxRequestTarget target) {
+
+                            send(getPage(), Broadcast.BREADTH, new MultiValueSelectorEvent(target));
+                        }
+                    });
                 }
 
-                fieldPanel.setNewModel(item, reference);
+                fieldPanel.setNewModel(item);
                 item.add(fieldPanel);
 
                 AjaxLink minus = new IndicatingAjaxLink("drop") {
 
-                    private static final long serialVersionUID =
-                            -7978723352517770644L;
+                    private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
                     public void onClick(final AjaxRequestTarget target) {
@@ -115,9 +99,8 @@ public class MultiValueSelectorPanel<E> 
                         fieldPanel.getField().clearInput();
                         target.add(container);
 
-                        if (sendEvent) {
-                            send(getPage(), Broadcast.BREADTH,
-                                    new MultiValueSelectorEvent(target));
+                        if (eventTemplate) {
+                            send(getPage(), Broadcast.BREADTH, new MultiValueSelectorEvent(target));
                         }
                     }
                 };
@@ -132,11 +115,11 @@ public class MultiValueSelectorPanel<E> 
                     minus.setEnabled(true);
                 }
 
+                final Fragment fragment;
                 if (item.getIndex() == model.getObject().size() - 1) {
                     final AjaxLink plus = new IndicatingAjaxLink("add") {
 
-                        private static final long serialVersionUID =
-                                -7978723352517770644L;
+                        private static final long serialVersionUID = -7978723352517770644L;
 
                         @Override
                         public void onClick(final AjaxRequestTarget target) {
@@ -146,16 +129,13 @@ public class MultiValueSelectorPanel<E> 
                         }
                     };
 
-                    final Fragment fragment = new Fragment(
-                            "panelPlus", "fragmentPlus", container);
+                    fragment = new Fragment("panelPlus", "fragmentPlus", container);
 
                     fragment.add(plus);
-                    item.add(fragment);
                 } else {
-                    final Fragment fragment = new Fragment(
-                            "panelPlus", "emptyFragment", container);
-                    item.add(fragment);
+                    fragment = new Fragment("panelPlus", "emptyFragment", container);
                 }
+                item.add(fragment);
             }
         };
 

Added: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SelectableRecorder.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SelectableRecorder.java?rev=1297585&view=auto
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SelectableRecorder.java (added)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SelectableRecorder.java Tue Mar  6 17:29:27 2012
@@ -0,0 +1,203 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.syncope.console.wicket.markup.html.form;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.wicket.WicketRuntimeException;
+import org.apache.wicket.extensions.markup.html.form.palette.Palette;
+import org.apache.wicket.extensions.markup.html.form.palette.component.Recorder;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.string.Strings;
+
+/**
+ * A variant of Recorder, supporting single element selection (for editing purpose, for example). <b>Note</b>: this
+ * class extends Recorder<T> but in fact it is a bare copy of most source code; this was done because the original class
+ * is keeping everything private.
+ *
+ * @param <T> Type of the palette
+ */
+public class SelectableRecorder<T> extends Recorder<T> {
+
+    private static final long serialVersionUID = -3009044376132921879L;
+
+    private boolean attached = false;
+
+    private static final String[] EMPTY_IDS = new String[0];
+
+    /**
+     * conveniently maintained array of selected ids
+     */
+    private String[] ids;
+
+    private String selectedId;
+
+    public SelectableRecorder(final String id, final Palette<T> palette) {
+        super(id, palette);
+    }
+
+    @Override
+    protected void onBeforeRender() {
+        super.onBeforeRender();
+
+        if (!getForm().hasError()) {
+            initIds();
+        } else if (ids == null) {
+            ids = EMPTY_IDS;
+        }
+        attached = true;
+    }
+
+    /**
+     * Synchronize ids collection from the palette's model
+     */
+    private void initIds() {
+        // construct the model string based on selection collection
+        IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
+        StringBuilder modelStringBuffer = new StringBuilder();
+        Collection<T> modelCollection = getPalette().getModelCollection();
+        if (modelCollection == null) {
+            throw new WicketRuntimeException(
+                    "Expected getPalette().getModelCollection() to return a non-null value."
+                    + " Please make sure you have model object assigned to the palette");
+        }
+        Iterator<T> selection = modelCollection.iterator();
+
+        int i = 0;
+        while (selection.hasNext()) {
+            modelStringBuffer.append(renderer.getIdValue(selection.next(), i++));
+            if (selection.hasNext()) {
+                modelStringBuffer.append(",");
+            }
+        }
+
+        // set model and update ids array
+        String modelString = modelStringBuffer.toString();
+        setDefaultModel(new Model<String>(modelString));
+        updateIds(modelString);
+    }
+
+    public T getSelectedItem() {
+        if (selectedId == null) {
+            return null;
+        }
+
+        IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
+
+        T selected = null;
+        for (T choice : getPalette().getChoices()) {
+            if (renderer.getIdValue(choice, 0).equals(selectedId)) {
+                selected = choice;
+                break;
+            }
+        }
+
+        return selected;
+    }
+
+    /**
+     * @return iterator over selected choices
+     */
+    @Override
+    public Iterator<T> getSelectedChoices() {
+        IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
+        if (ids.length == 0) {
+            return Collections.EMPTY_LIST.iterator();
+        }
+
+        List<T> selected = new ArrayList<T>(ids.length);
+        for (String id : ids) {
+            for (T choice : getPalette().getChoices()) {
+                if (renderer.getIdValue(choice, 0).equals(id)) {
+                    selected.add(choice);
+                    break;
+                }
+            }
+        }
+        return selected.iterator();
+    }
+
+    /**
+     * @return iterator over unselected choices
+     */
+    @Override
+    public Iterator<T> getUnselectedChoices() {
+        IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
+        Collection<? extends T> choices = getPalette().getChoices();
+
+        if (choices.size() - ids.length == 0) {
+            return Collections.<T>emptyList().iterator();
+        }
+
+        List<T> unselected = new ArrayList<T>(Math.max(1, choices.size() - ids.length));
+        for (T choice : choices) {
+            final String choiceId = renderer.getIdValue(choice, 0);
+            boolean selected = false;
+            for (String id : ids) {
+                if (id.equals(choiceId)) {
+                    selected = true;
+                    break;
+                }
+            }
+            if (!selected) {
+                unselected.add(choice);
+            }
+        }
+        return unselected.iterator();
+    }
+
+    @Override
+    protected void onValid() {
+        super.onValid();
+        if (attached) {
+            updateIds();
+        }
+    }
+
+    @Override
+    protected void onInvalid() {
+        super.onInvalid();
+        if (attached) {
+            updateIds();
+        }
+    }
+
+    private void updateIds() {
+        updateIds(getValue());
+    }
+
+    private void updateIds(final String value) {
+        if (Strings.isEmpty(value)) {
+            ids = EMPTY_IDS;
+        } else {
+            if (value.indexOf('|') == -1) {
+                ids = value.split(",");
+                selectedId = null;
+            } else {
+                String[] splitted = value.split("\\|");
+                selectedId = splitted[0];
+                ids = splitted[1].split(",");
+            }
+        }
+    }
+}

Propchange: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SelectableRecorder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SelectableRecorder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SelectableRecorder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SingleColumnPalette.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SingleColumnPalette.java?rev=1297585&view=auto
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SingleColumnPalette.java (added)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SingleColumnPalette.java Tue Mar  6 17:29:27 2012
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.syncope.console.wicket.markup.html.form;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.behavior.Behavior;
+import org.apache.wicket.extensions.markup.html.form.palette.Palette;
+import org.apache.wicket.extensions.markup.html.form.palette.component.Recorder;
+import org.apache.wicket.extensions.markup.html.form.palette.component.Selection;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.util.value.IValueMap;
+
+/**
+ * SingleColumnPalette is a components that allows the user to easily add, remove and order items in a single select
+ * box.
+ *
+ * @see org.apache.wicket.extensions.markup.html.form.palette.Palette
+ */
+public class SingleColumnPalette<T> extends Palette<T> {
+
+    private static final long serialVersionUID = -1126599052871074501L;
+
+    private AjaxLink addLink;
+
+    private AjaxLink editLink;
+
+    private AjaxLink removeLink;
+
+    private List<Behavior> recordBehaviors;
+
+    public SingleColumnPalette(final String id, final IModel<? extends List<? extends T>> model,
+            final IChoiceRenderer<T> choiceRenderer, final int rows, final boolean allowOrder) {
+
+        super(id, new ListModel<T>((List<T>) model.getObject()), model, choiceRenderer, rows, allowOrder);
+        recordBehaviors = new ArrayList<Behavior>();
+    }
+
+    @Override
+    protected void onBeforeRender() {
+        super.onBeforeRender();
+
+        if (editLink != null) {
+            add(editLink);
+        }
+
+        for (Behavior behavior : recordBehaviors) {
+            if (!getRecorderComponent().getBehaviors().contains(behavior)) {
+                getRecorderComponent().add(behavior);
+            }
+        }
+    }
+
+    public AjaxLink getAddLink() {
+        return addLink;
+    }
+
+    public void setAddLink(final AjaxLink addLink) {
+        this.addLink = addLink;
+    }
+
+    public AjaxLink getEditLink() {
+        return editLink;
+    }
+
+    public void setEditLink(final AjaxLink editLink) {
+        this.editLink = editLink;
+    }
+
+    public AjaxLink getRemoveLink() {
+        return removeLink;
+    }
+
+    public void setRemoveLink(final AjaxLink removeLink) {
+        this.removeLink = removeLink;
+    }
+
+    public List<Behavior> getRecordBehaviors() {
+        return recordBehaviors;
+    }
+
+    public T getSelectedItem() {
+        return ((SelectableRecorder<T>) getRecorderComponent()).getSelectedItem();
+    }
+
+    public boolean addRecordBehavior(final Behavior behavior) {
+        return !recordBehaviors.contains(behavior) && recordBehaviors.add(behavior);
+    }
+
+    public boolean removeRecordBehavior(final Behavior behavior) {
+        return recordBehaviors.remove(behavior);
+    }
+
+    public void setRecordBehaviors(final List<Behavior> recordBehaviors) {
+        this.recordBehaviors.clear();
+        if (recordBehaviors != null && !recordBehaviors.isEmpty()) {
+            this.recordBehaviors.addAll(recordBehaviors);
+        }
+    }
+
+    @Override
+    protected Component newAddComponent() {
+        return addLink == null ? super.newAddComponent() : addLink;
+    }
+
+    @Override
+    protected Component newRemoveComponent() {
+        return removeLink == null ? super.newRemoveComponent() : removeLink;
+    }
+
+    @Override
+    protected Recorder<T> newRecorderComponent() {
+        return new SelectableRecorder<T>("recorder", this) {
+
+            private static final long serialVersionUID = 3019792558927545591L;
+
+            @Override
+            public void updateModel() {
+                super.updateModel();
+                SingleColumnPalette.this.updateModel();
+            }
+        };
+    }
+
+    /**
+     * Overriden from parent with purpose of removing ondblclick event and multiple selection.
+     *
+     * @return selected items component
+     */
+    @Override
+    protected Component newSelectionComponent() {
+        return new Selection<T>("selection", this) {
+
+            private static final long serialVersionUID = -4146708301120705199L;
+
+            @Override
+            protected Map<String, String> getAdditionalAttributes(final Object choice) {
+                return SingleColumnPalette.this.getAdditionalAttributesForSelection(choice);
+            }
+
+            @Override
+            protected void onComponentTag(final ComponentTag tag) {
+                super.onComponentTag(tag);
+                IValueMap attrs = tag.getAttributes();
+
+                String onFocus = getPalette().getSelectionOnFocusJS();
+                if (onFocus != null) {
+                    attrs.put("onfocus", onFocus);
+                }
+
+                attrs.put("ondblclick", "");
+                attrs.remove("multiple");
+            }
+        };
+    }
+
+    @Override
+    protected Component newAvailableHeader(final String componentId) {
+        Component availableHeader = super.newAvailableHeader(componentId);
+        availableHeader.setVisible(false);
+        return availableHeader;
+    }
+
+    @Override
+    protected Component newSelectedHeader(final String componentId) {
+        Component selectedHeader = super.newSelectedHeader(componentId);
+        selectedHeader.setVisible(false);
+        return selectedHeader;
+    }
+
+    public String getEditOnClickJS() {
+        return buildJSCall("Syncope.SingleColumnPalette.choicesOnFocus");
+    }
+
+    @Override
+    public String getChoicesOnFocusJS() {
+        return "";
+    }
+
+    @Override
+    public String getSelectionOnFocusJS() {
+        return "";
+    }
+
+    @Override
+    public String getAddOnClickJS() {
+        return "";
+    }
+}

Propchange: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SingleColumnPalette.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SingleColumnPalette.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/syncope/trunk/console/src/main/java/org/syncope/console/wicket/markup/html/form/SingleColumnPalette.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/BaseModalPage.html
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/BaseModalPage.html?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/BaseModalPage.html (original)
+++ incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/BaseModalPage.html Tue Mar  6 17:29:27 2012
@@ -30,6 +30,8 @@
         <script type="text/javascript" src="scripts/jquery-1.4.2.min.js"></script>
         <script type="text/javascript" src="scripts/jquery-ui-1.8.5.custom.min.js"></script>
 
+        <script type="text/javascript" src="scripts/singlecolumnpalette.js"></script>
+
         <script type="text/javascript">
             $(function() {
                 $("#tabs").tabs();

Modified: incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/BasePage.html
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/BasePage.html?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/BasePage.html (original)
+++ incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/BasePage.html Tue Mar  6 17:29:27 2012
@@ -19,7 +19,7 @@
         <meta http-equiv="Content-Style-Type" content="text/css"/>
         <meta http-equiv="Content-Script-Type" content="text/javascript"/>
 
-        <title>Syncope</title>
+        <title>Apache Syncope</title>
 
         <link rel="shortcut icon" href="img/favicon.ico" />
 
@@ -40,6 +40,8 @@
 
         <script type="text/javascript" src="scripts/jquery-1.4.2.min.js"></script>
         <script type="text/javascript" src="scripts/jquery-ui-1.8.5.custom.min.js"></script>
+        
+        <script type="text/javascript" src="scripts/singlecolumnpalette.js"></script>
 
         <script type="text/javascript">
             $(document).ready(function() {

Modified: incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ConnectorModalPage.html
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ConnectorModalPage.html?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ConnectorModalPage.html (original)
+++ incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ConnectorModalPage.html Tue Mar  6 17:29:27 2012
@@ -50,7 +50,7 @@
                         <div class="tablecolumn_label short_dynamicsize">
                             <label for="bundleName"><wicket:message key="bundleName"/></label>
                         </div>
-                        <div class="tablecolumn_field short_dynamicsize">
+                        <div class="tablecolumn_field medium_dynamicsize">
                             <span wicket:id="bundle">[bundle]</span>
                         </div>
                     </div>
@@ -59,7 +59,7 @@
                         <div class="tablecolumn_label short_dynamicsize">
                             <label for="name"><wicket:message key="name"/></label>
                         </div>
-                        <div class="tablecolumn_field short_dynamicsize">
+                        <div class="tablecolumn_field medium_dynamicsize">
                             <span wicket:id="connectorName">[name]</span>
                         </div>
                     </div>

Modified: incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/Login.html
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/Login.html?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/Login.html (original)
+++ incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/Login.html Tue Mar  6 17:29:27 2012
@@ -18,7 +18,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
         <meta http-equiv="Content-Style-Type" content="text/css"/>
 
-        <title>Syncope - Login</title>
+        <title>Apache Syncope - Login</title>
 
         <link rel="shortcut icon" href="img/favicon.ico"/>
         <link rel="stylesheet" href="css/style.css" type="text/css" media="all"/>

Modified: incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ReportModalPage.html
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ReportModalPage.html?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ReportModalPage.html (original)
+++ incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ReportModalPage.html Tue Mar  6 17:29:27 2012
@@ -62,6 +62,15 @@
                                         <span wicket:id="nextExec">[nextExec]</span>
                                     </div>
                                 </div>
+
+                                <div class="tablerow">
+                                    <div class="tablecolumn_label short_dynamicsize">
+                                        <label for="reportlets"><wicket:message key="reportlets"/></label>
+                                    </div>
+                                    <div class="tablecolumn_field medium_dynamicsize">
+                                        <span wicket:id="reportlets">[reportlets]</span>
+                                    </div>
+                                </div>                                
                             </div>
 
                             <script type="text/javascript">
@@ -107,6 +116,7 @@
             </div>
         </form>
     </div>
+    <div wicket:id="reportletConfWin"/>
     <div wicket:id="reportExecMessageWin"/>
     <div wicket:id="reportExecExportWin"/>
 </wicket:extend>
\ No newline at end of file

Modified: incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ReportModalPage.properties
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ReportModalPage.properties?rev=1297585&r1=1297584&r2=1297585&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ReportModalPage.properties (original)
+++ incubator/syncope/trunk/console/src/main/resources/org/syncope/console/pages/ReportModalPage.properties Tue Mar  6 17:29:27 2012
@@ -31,3 +31,5 @@ taskExecutions=Task executions
 delete=Delete
 showMessage=Show
 chooseForTemplate=Use A Template
+reportlets=Reportlets
+create_reportletconf=Add new Reporlet