syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1553676 [2/2] - in /syncope/trunk: common/src/main/java/org/apache/syncope/common/types/ console/src/main/java/org/apache/syncope/console/ console/src/main/java/org/apache/syncope/console/commons/ console/src/main/java/org/apache/syncope/c...
Date Fri, 27 Dec 2013 14:23:52 GMT
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/NotificationTasks.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/NotificationTasks.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/NotificationTasks.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/NotificationTasks.java Fri Dec 27 14:23:50 2013
@@ -210,8 +210,10 @@ public class NotificationTasks extends A
         window.setInitialWidth(WIN_WIDTH);
         window.setCookieName(VIEW_TASK_WIN_COOKIE_NAME);
 
+        @SuppressWarnings("rawtypes")
         Form paginatorForm = new Form("PaginatorForm");
 
+        @SuppressWarnings({ "unchecked", "rawtypes" })
         final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
                 prefMan.getPaginatorChoices());
 
@@ -227,7 +229,7 @@ public class NotificationTasks extends A
                 table = Tasks.updateTaskTable(
                         columns,
                         new TasksProvider<NotificationTaskTO>(restClient, paginatorRows, getId(),
-                        NotificationTaskTO.class),
+                                NotificationTaskTO.class),
                         container,
                         table == null ? 0 : (int) table.getCurrentPage(),
                         pageRef,

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java Fri Dec 27 14:23:50 2013
@@ -92,7 +92,7 @@ public class PoliciesPanel extends Panel
 
     protected boolean modalResult = false;
 
-    private PolicyType policyType;
+    private final PolicyType policyType;
 
     public PoliciesPanel(final String id, final PageReference pageRef, final PolicyType policyType) {
         super(id);
@@ -146,7 +146,7 @@ public class PoliciesPanel extends Panel
             public void populateItem(final Item<ICellPopulator<AbstractPolicyTO>> cellItem, final String componentId,
                     final IModel<AbstractPolicyTO> model) {
 
-                final AbstractPolicyTO accountPolicyTO = model.getObject();
+                final AbstractPolicyTO policyTO = model.getObject();
 
                 final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);
 
@@ -161,9 +161,10 @@ public class PoliciesPanel extends Panel
 
                             private static final long serialVersionUID = -7834632442532690940L;
 
+                            @SuppressWarnings({ "unchecked", "rawtypes" })
                             @Override
                             public Page createPage() {
-                                return new PolicyModalPage(mwindow, accountPolicyTO);
+                                return new PolicyModalPage(mwindow, policyTO);
                             }
                         });
 
@@ -178,13 +179,13 @@ public class PoliciesPanel extends Panel
                     @Override
                     public void onClick(final AjaxRequestTarget target) {
                         try {
-                            policyRestClient.delete(accountPolicyTO.getId(), accountPolicyTO.getClass());
+                            policyRestClient.delete(policyTO.getId(), policyTO.getClass());
                             info(getString(Constants.OPERATION_SUCCEEDED));
                         } catch (SyncopeClientException e) {
                             error(getString(Constants.OPERATION_ERROR));
 
-                            LOG.error("While deleting resource {}({})",
-                                    accountPolicyTO.getId(), accountPolicyTO.getDescription(), e);
+                            LOG.error("While deleting policy {}({})",
+                                    policyTO.getId(), policyTO.getDescription(), e);
                         }
 
                         target.add(container);
@@ -196,12 +197,13 @@ public class PoliciesPanel extends Panel
             }
         });
 
+        @SuppressWarnings({ "unchecked", "rawtypes" })
         final AjaxFallbackDefaultDataTable table = new AjaxFallbackDefaultDataTable("datatable", columns,
                 new PolicyDataProvider(), paginatorRows);
 
         container.add(table);
 
-        final AjaxLink createButton = new ClearIndicatingAjaxLink("createLink", pageRef) {
+        final AjaxLink<Void> createButton = new ClearIndicatingAjaxLink<Void>("createLink", pageRef) {
 
             private static final long serialVersionUID = -7978723352517770644L;
 
@@ -211,6 +213,7 @@ public class PoliciesPanel extends Panel
 
                     private static final long serialVersionUID = -7834632442532690940L;
 
+                    @SuppressWarnings({ "unchecked", "rawtypes" })
                     @Override
                     public Page createPage() {
                         return new PolicyModalPage(mwindow, getPolicyTOInstance(policyType));
@@ -223,11 +226,13 @@ public class PoliciesPanel extends Panel
 
         add(createButton);
 
-        MetaDataRoleAuthorizationStrategy.authorize(createButton, ENABLE, xmlRolesReader.getAllAllowedRoles("Policies",
-                "create"));
+        MetaDataRoleAuthorizationStrategy.authorize(createButton, ENABLE,
+                xmlRolesReader.getAllAllowedRoles("Policies", "create"));
 
+        @SuppressWarnings("rawtypes")
         final Form paginatorForm = new Form("PaginatorForm");
 
+        @SuppressWarnings({ "unchecked", "rawtypes" })
         final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
                 prefMan.getPaginatorChoices());
 
@@ -250,7 +255,6 @@ public class PoliciesPanel extends Panel
     }
 
     private void setWindowClosedCallback(final ModalWindow window, final WebMarkupContainer container) {
-
         window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
 
             private static final long serialVersionUID = 8804221891699487139L;
@@ -266,7 +270,7 @@ public class PoliciesPanel extends Panel
 
         private static final long serialVersionUID = -6976327453925166730L;
 
-        private SortableDataProviderComparator<AbstractPolicyTO> comparator;
+        private final SortableDataProviderComparator<AbstractPolicyTO> comparator;
 
         public PolicyDataProvider() {
             super();
@@ -284,7 +288,6 @@ public class PoliciesPanel extends Panel
 
         @Override
         public Iterator<AbstractPolicyTO> iterator(final long first, final long count) {
-
             final List<AbstractPolicyTO> policies = policyRestClient.getPolicies(policyType, true);
 
             Collections.sort(policies, comparator);

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PolicyBeanPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PolicyBeanPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PolicyBeanPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PolicyBeanPanel.java Fri Dec 27 14:23:50 2013
@@ -39,7 +39,7 @@ import org.apache.syncope.console.wicket
 import org.apache.syncope.console.wicket.markup.html.form.AjaxPalettePanel;
 import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.console.wicket.markup.html.form.FieldPanel;
-import org.apache.syncope.console.wicket.markup.html.form.MultiValueSelectorPanel;
+import org.apache.syncope.console.wicket.markup.html.form.MultiFieldPanel;
 import org.apache.syncope.console.wicket.markup.html.form.SpinnerFieldPanel;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -132,14 +132,13 @@ public class PolicyBeanPanel extends Pan
             @Override
             @SuppressWarnings({ "unchecked", "rawtypes" })
             protected void populateItem(final ListItem<FieldWrapper> item) {
-
                 final FieldWrapper field = item.getModelObject();
 
                 final PropertyDescriptor propDesc = BeanUtils.getPropertyDescriptor(policy.getClass(), field.getName());
 
                 item.add(new Label("label", new ResourceModel(field.getName())));
 
-                final AbstractFieldPanel component;
+                AbstractFieldPanel component;
                 try {
                     if (field.getClassList() != null) {
                         component = new AjaxDropDownChoicePanel("field", field.getName(), new PropertyModel(policy,
@@ -212,7 +211,7 @@ public class PolicyBeanPanel extends Pan
                                     new Model<String>(null));
                             panel.setRequired(true);
 
-                            component = new MultiValueSelectorPanel<String>("field",
+                            component = new MultiFieldPanel<String>("field",
                                     new PropertyModel(policy, field.getName()), panel);
 
                             item.add(component);
@@ -254,10 +253,10 @@ public class PolicyBeanPanel extends Pan
         add(policies);
     }
 
-    private <T extends Serializable> AjaxCheckBoxPanel getActivationControl(final AbstractFieldPanel panel,
+    private <T extends Serializable> AjaxCheckBoxPanel getActivationControl(final AbstractFieldPanel<T> panel,
             final Boolean checked, final T defaultModelObject, final T reinitializedValue) {
 
-        final AjaxCheckBoxPanel check = new AjaxCheckBoxPanel("check", "check", new Model(checked));
+        final AjaxCheckBoxPanel check = new AjaxCheckBoxPanel("check", "check", new Model<Boolean>(checked));
 
         panel.setEnabled(checked);
 

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PropagationTasks.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PropagationTasks.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PropagationTasks.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/PropagationTasks.java Fri Dec 27 14:23:50 2013
@@ -229,8 +229,10 @@ public class PropagationTasks extends Ab
         window.setInitialWidth(WIN_WIDTH);
         window.setCookieName(VIEW_TASK_WIN_COOKIE_NAME);
 
+        @SuppressWarnings("rawtypes")
         Form paginatorForm = new Form("PaginatorForm");
 
+        @SuppressWarnings({ "unchecked", "rawtypes" })
         final DropDownChoice rowsChooser = new DropDownChoice(
                 "rowsChooser", new PropertyModel(this, "paginatorRows"), prefMan.getPaginatorChoices());
 
@@ -246,7 +248,7 @@ public class PropagationTasks extends Ab
                 table = Tasks.updateTaskTable(
                         columns,
                         new TasksProvider<PropagationTaskTO>(restClient, paginatorRows,
-                        getId(), PropagationTaskTO.class),
+                                getId(), PropagationTaskTO.class),
                         container,
                         table == null ? 0 : (int) table.getCurrentPage(),
                         pageRef,

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java Fri Dec 27 14:23:50 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.console.pages.panels;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -34,8 +35,8 @@ import org.apache.syncope.console.wicket
 import org.apache.syncope.console.wicket.markup.html.form.AjaxPasswordFieldPanel;
 import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.console.wicket.markup.html.form.FieldPanel;
-import org.apache.syncope.console.wicket.markup.html.form.MultiValueSelectorPanel;
-import org.apache.syncope.console.wicket.markup.html.form.MultiValueSelectorPanel.MultiValueSelectorEvent;
+import org.apache.syncope.console.wicket.markup.html.form.MultiFieldPanel;
+import org.apache.syncope.console.wicket.markup.html.form.MultiFieldPanel.MultiValueSelectorEvent;
 import org.apache.syncope.console.wicket.markup.html.form.SpinnerFieldPanel;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -77,7 +78,6 @@ public class ResourceConnConfPanel exten
 
     private ResourceTO resourceTO;
 
-    @SuppressWarnings({ "unchecked", "rawtypes" })
     public ResourceConnConfPanel(final String id, final ResourceTO resourceTO, final boolean createFlag) {
         super(id);
         setOutputMarkupId(true);
@@ -114,11 +114,12 @@ public class ResourceConnConfPanel exten
          * the list of overridable connector properties
          */
         connConfPropContainer.add(new AltListView<ConnConfProperty>("connectorProperties",
-                new PropertyModel(this, "connConfProperties")) {
+                new PropertyModel<List<ConnConfProperty>>(this, "connConfProperties")) {
 
                     private static final long serialVersionUID = 9101744072914090143L;
 
                     @Override
+                    @SuppressWarnings({ "unchecked", "rawtypes" })
                     protected void populateItem(final ListItem<ConnConfProperty> item) {
                         final ConnConfProperty property = item.getModelObject();
 
@@ -129,7 +130,7 @@ public class ResourceConnConfPanel exten
 
                         item.add(label);
 
-                        final FieldPanel field;
+                        FieldPanel<? extends Serializable> field;
 
                         boolean required = false;
 
@@ -139,32 +140,33 @@ public class ResourceConnConfPanel exten
                         || Constants.GUARDED_BYTE_ARRAY.equalsIgnoreCase(property.getSchema().getType())) {
 
                             field = new AjaxPasswordFieldPanel("panel", label.getDefaultModelObjectAsString(),
-                                    new Model());
+                                    new Model<String>());
                             ((PasswordTextField) field.getField()).setResetPassword(false);
 
                             required = property.getSchema().isRequired();
                         } else {
                             Class<?> propertySchemaClass;
-
                             try {
-                                propertySchemaClass = ClassUtils.forName(property.getSchema().getType(), ClassUtils.
-                                        getDefaultClassLoader());
+                                propertySchemaClass = ClassUtils.forName(property.getSchema().getType(),
+                                        ClassUtils.getDefaultClassLoader());
                             } catch (Exception e) {
                                 LOG.error("Error parsing attribute type", e);
                                 propertySchemaClass = String.class;
                             }
 
                             if (ClassUtils.isAssignable(Number.class, propertySchemaClass)) {
+                                @SuppressWarnings("unchecked")
+                                Class<Number> numberClass = (Class<Number>) propertySchemaClass;
                                 field = new SpinnerFieldPanel<Number>("panel", label.getDefaultModelObjectAsString(),
-                                        (Class<Number>) propertySchemaClass, new Model<Number>(), null, null, false);
+                                        numberClass, new Model<Number>(), null, null, false);
 
                                 required = property.getSchema().isRequired();
                             } else if (ClassUtils.isAssignable(Boolean.class, propertySchemaClass)) {
                                 field = new AjaxCheckBoxPanel("panel", label.getDefaultModelObjectAsString(),
-                                        new Model());
+                                        new Model<Boolean>());
                             } else {
                                 field = new AjaxTextFieldPanel("panel", label.getDefaultModelObjectAsString(),
-                                        new Model());
+                                        new Model<String>());
 
                                 required = property.getSchema().isRequired();
                             }
@@ -183,7 +185,7 @@ public class ResourceConnConfPanel exten
                                 property.getValues().add(null);
                             }
 
-                            final MultiValueSelectorPanel multiFields = new MultiValueSelectorPanel<String>("panel",
+                            final MultiFieldPanel multiFields = new MultiFieldPanel("panel",
                                     new PropertyModel<List<String>>(property, "values"), field, true);
 
                             item.add(multiFields);
@@ -203,7 +205,7 @@ public class ResourceConnConfPanel exten
                                 }
                             });
 
-                            field.setNewModel(property.getValues());
+                            field.setNewModel(toSerializableList(property.getValues()));
                             item.add(field);
                         }
 
@@ -212,6 +214,20 @@ public class ResourceConnConfPanel exten
                 });
     }
 
+    private List<Serializable> toSerializableList(final List<Object> values) {
+        List<Serializable> result = new ArrayList<Serializable>();
+
+        for (Object value : values) {
+            if (value instanceof Serializable) {
+                result.add((Serializable) value);
+            } else {
+                LOG.warn("Not serializable: {}", value);
+            }
+        }
+
+        return result;
+    }
+
     /**
      * Get overridable properties.
      *

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java Fri Dec 27 14:23:50 2013
@@ -289,7 +289,7 @@ public class ResourceMappingPanel extend
 
                 final AjaxDropDownChoicePanel<String> intAttrNames =
                         new AjaxDropDownChoicePanel<String>("intAttrNames", getString("intAttrNames"),
-                        new PropertyModel<String>(mapItem, "intAttrName"), false);
+                                new PropertyModel<String>(mapItem, "intAttrName"), false);
                 intAttrNames.setChoices(schemaNames);
                 intAttrNames.setRequired(true);
                 intAttrNames.setStyleSheet(FIELD_STYLE);
@@ -305,8 +305,8 @@ public class ResourceMappingPanel extend
 
                 final AjaxDropDownChoicePanel<IntMappingType> intMappingTypes =
                         new AjaxDropDownChoicePanel<IntMappingType>("intMappingTypes",
-                        new ResourceModel("intMappingTypes", "intMappingTypes").getObject(),
-                        new PropertyModel<IntMappingType>(mapItem, "intMappingType"));
+                                new ResourceModel("intMappingTypes", "intMappingTypes").getObject(),
+                                new PropertyModel<IntMappingType>(mapItem, "intMappingType"));
                 intMappingTypes.setRequired(true);
                 intMappingTypes.setChoices(attrTypes);
                 intMappingTypes.setStyleSheet(FIELD_STYLE);
@@ -314,7 +314,8 @@ public class ResourceMappingPanel extend
 
                 final AjaxDropDownChoicePanel<AttributableType> entitiesPanel =
                         new AjaxDropDownChoicePanel<AttributableType>("entities",
-                        new ResourceModel("entities", "entities").getObject(), new Model<AttributableType>(entity));
+                                new ResourceModel("entities", "entities").getObject(), new Model<AttributableType>(
+                                        entity));
                 entitiesPanel.setChoices(attrType == AttributableType.ROLE
                         ? Collections.<AttributableType>singletonList(AttributableType.ROLE)
                         : Arrays.asList(AttributableType.values()));
@@ -337,7 +338,7 @@ public class ResourceMappingPanel extend
                 });
                 item.add(entitiesPanel);
 
-                final FieldPanel extAttrNames = new AjaxTextFieldPanel("extAttrName",
+                final FieldPanel<String> extAttrNames = new AjaxTextFieldPanel("extAttrName",
                         new ResourceModel("extAttrNames", "extAttrNames").getObject(),
                         new PropertyModel<String>(mapItem, "extAttrName"));
                 ((AjaxTextFieldPanel) extAttrNames).setChoices(schemaNames);
@@ -357,7 +358,7 @@ public class ResourceMappingPanel extend
                 final AjaxTextFieldPanel mandatory = new AjaxTextFieldPanel("mandatoryCondition",
                         new ResourceModel("mandatoryCondition", "mandatoryCondition").getObject(),
                         new PropertyModel<String>(mapItem, "mandatoryCondition"));
-                mandatory.setChoices(Arrays.asList(new String[] {"true", "false"}));
+                mandatory.setChoices(Arrays.asList(new String[] { "true", "false" }));
                 mandatory.setStyleSheet(SHORT_FIELD_STYLE);
                 item.add(mandatory);
 
@@ -412,9 +413,9 @@ public class ResourceMappingPanel extend
 
                 final AjaxDropDownChoicePanel<MappingPurpose> purpose =
                         new AjaxDropDownChoicePanel<MappingPurpose>("purpose",
-                        new ResourceModel("purpose", "purpose").getObject(),
-                        new PropertyModel<MappingPurpose>(mapItem, "purpose"),
-                        false);
+                                new ResourceModel("purpose", "purpose").getObject(),
+                                new PropertyModel<MappingPurpose>(mapItem, "purpose"),
+                                false);
                 purpose.setChoices(Arrays.asList(MappingPurpose.values()));
                 purpose.setStyleSheet(FIELD_STYLE);
                 purpose.setRequired(true);

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleDetailsPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleDetailsPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleDetailsPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RoleDetailsPanel.java Fri Dec 27 14:23:50 2013
@@ -90,11 +90,12 @@ public class RoleDetailsPanel extends Pa
             parentFragment = new Fragment("parent", "parentFragment", this);
 
             parentModel = new ParentModel(roleTO);
+            @SuppressWarnings("unchecked")
             final AjaxTextFieldPanel parent = new AjaxTextFieldPanel("parent", "parent", parentModel);
             parent.setReadOnly(true);
             parent.setOutputMarkupId(true);
             parentFragment.add(parent);
-            final IndicatingAjaxLink parentSelect = new IndicatingAjaxLink("parentSelect") {
+            final AjaxLink<Void> parentSelect = new IndicatingAjaxLink<Void>("parentSelect") {
 
                 private static final long serialVersionUID = -7978723352517770644L;
 
@@ -147,11 +148,12 @@ public class RoleDetailsPanel extends Pa
         this.add(name);
 
         userOwnerModel = new OwnerModel(roleTO, AttributableType.USER);
+        @SuppressWarnings("unchecked")
         final AjaxTextFieldPanel userOwner = new AjaxTextFieldPanel("userOwner", "userOwner", userOwnerModel);
         userOwner.setReadOnly(true);
         userOwner.setOutputMarkupId(true);
         ownerContainer.add(userOwner);
-        final IndicatingAjaxLink<Void> userOwnerSelect = new IndicatingAjaxLink<Void>("userOwnerSelect") {
+        final AjaxLink<Void> userOwnerSelect = new IndicatingAjaxLink<Void>("userOwnerSelect") {
 
             private static final long serialVersionUID = -7978723352517770644L;
 
@@ -183,11 +185,12 @@ public class RoleDetailsPanel extends Pa
         ownerContainer.add(userOwnerReset);
 
         roleOwnerModel = new OwnerModel(roleTO, AttributableType.ROLE);
+        @SuppressWarnings("unchecked")
         final AjaxTextFieldPanel roleOwner = new AjaxTextFieldPanel("roleOwner", "roleOwner", roleOwnerModel);
         roleOwner.setReadOnly(true);
         roleOwner.setOutputMarkupId(true);
         ownerContainer.add(roleOwner);
-        final IndicatingAjaxLink<Void> roleOwnerSelect = new IndicatingAjaxLink<Void>("roleOwnerSelect") {
+        final AjaxLink<Void> roleOwnerSelect = new IndicatingAjaxLink<Void>("roleOwnerSelect") {
 
             private static final long serialVersionUID = -7978723352517770644L;
 

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/SchedTasks.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/SchedTasks.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/SchedTasks.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/SchedTasks.java Fri Dec 27 14:23:50 2013
@@ -189,7 +189,8 @@ public class SchedTasks extends Abstract
             }
 
             @Override
-            public Component getHeader(String componentId) {
+            public Component getHeader(final String componentId) {
+                @SuppressWarnings("rawtypes")
                 final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);
 
                 panel.add(new ActionLink() {
@@ -218,8 +219,10 @@ public class SchedTasks extends Abstract
 
         container.add(table);
 
+        @SuppressWarnings("rawtypes")
         Form paginatorForm = new Form("PaginatorForm");
 
+        @SuppressWarnings({ "unchecked", "rawtypes" })
         final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
                 prefMan.getPaginatorChoices());
 
@@ -247,7 +250,7 @@ public class SchedTasks extends Abstract
         paginatorForm.add(rowsChooser);
         add(paginatorForm);
 
-        AjaxLink createLink = new ClearIndicatingAjaxLink("createLink", pageRef) {
+        AjaxLink<Void> createLink = new ClearIndicatingAjaxLink<Void>("createLink", pageRef) {
 
             private static final long serialVersionUID = -7978723352517770644L;
 

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java Fri Dec 27 14:23:50 2013
@@ -38,7 +38,7 @@ import org.apache.syncope.console.rest.R
 import org.apache.syncope.console.rest.SchemaRestClient;
 import org.apache.syncope.console.wicket.markup.html.form.AjaxDecoratedCheckbox;
 import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
-import org.apache.syncope.console.wicket.markup.html.form.MultiValueSelectorPanel;
+import org.apache.syncope.console.wicket.markup.html.form.MultiFieldPanel;
 import org.apache.wicket.Component;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.attributes.AjaxCallListener;
@@ -210,7 +210,7 @@ public class VirtualAttributesPanel exte
                 }
 
                 final AjaxTextFieldPanel panel;
-                final MultiValueSelectorPanel multiPanel;
+                final MultiFieldPanel multiPanel;
                 if (templateMode) {
                     panel = new AjaxTextFieldPanel("values", "values", new Model<String>());
                     panel.setReadOnly(attributeTO.isReadonly());
@@ -218,7 +218,7 @@ public class VirtualAttributesPanel exte
                 } else {
                     panel = new AjaxTextFieldPanel("panel", "values", new Model<String>(null));
                     panel.setReadOnly(attributeTO.isReadonly());
-                    multiPanel = new MultiValueSelectorPanel("values",
+                    multiPanel = new MultiFieldPanel("values",
                             new PropertyModel<List<String>>(attributeTO, "values"), panel);
                 }
 

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRestClient.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRestClient.java Fri Dec 27 14:23:50 2013
@@ -51,13 +51,6 @@ public class UserRestClient extends Abst
         return getService(UserService.class).list(1, 1).getTotalCount();
     }
 
-    /**
-     * Get all stored users.
-     *
-     * @param page pagination element to fetch
-     * @param size maximum number to fetch
-     * @return list of TaskTO objects
-     */
     @Override
     public List<UserTO> list(final int page, final int size, final SortParam<String> sort) {
         return getService(UserService.class).list(page, size, toOrderBy(sort)).getResult();
@@ -68,8 +61,8 @@ public class UserRestClient extends Abst
         return response.readEntity(UserTO.class);
     }
 
-    public UserTO update(final UserMod userModTO) {
-        return getService(UserService.class).update(userModTO.getId(), userModTO).readEntity(UserTO.class);
+    public UserTO update(final UserMod userMod) {
+        return getService(UserService.class).update(userMod.getId(), userMod).readEntity(UserTO.class);
     }
 
     @Override

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java Fri Dec 27 14:23:50 2013
@@ -46,7 +46,7 @@ public class ActionResultColumn<T, S> ex
     private final String idFieldName;
 
     public ActionResultColumn(final BulkActionResult results, final String idFieldName) {
-        super(new Model());
+        super(new Model<String>());
         this.results = results;
         this.idFieldName = idFieldName;
     }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AbstractFieldPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AbstractFieldPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AbstractFieldPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AbstractFieldPanel.java Fri Dec 27 14:23:50 2013
@@ -18,13 +18,12 @@
  */
 package org.apache.syncope.console.wicket.markup.html.form;
 
-import java.io.Serializable;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.IModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class AbstractFieldPanel<T extends Serializable> extends Panel {
+public abstract class AbstractFieldPanel<T> extends Panel {
 
     /**
      * Logger.

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxCheckBoxPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxCheckBoxPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxCheckBoxPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxCheckBoxPanel.java Fri Dec 27 14:23:50 2013
@@ -20,11 +20,11 @@ package org.apache.syncope.console.wicke
 
 import java.io.Serializable;
 import java.util.List;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.console.commons.Constants;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
 import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.list.ListItem;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 
@@ -37,7 +37,7 @@ public class AjaxCheckBoxPanel extends F
         super(id, name, model);
 
         field = new CheckBox("checkboxField", model);
-        add(field.setLabel(new Model(name)).setOutputMarkupId(true));
+        add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
 
         if (!isReadOnly()) {
             field.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
@@ -65,30 +65,67 @@ public class AjaxCheckBoxPanel extends F
 
     @Override
     public FieldPanel<Boolean> setNewModel(final List<Serializable> list) {
-        setNewModel(new Model() {
+        setNewModel(new Model<Boolean>() {
 
             private static final long serialVersionUID = 527651414610325237L;
 
             @Override
-            public Serializable getObject() {
+            public Boolean getObject() {
                 Boolean value = null;
 
-                if (list != null && !list.isEmpty() && StringUtils.isNotBlank(list.get(0).toString())) {
-                    value = "true".equalsIgnoreCase(list.get(0).toString());
+                if (list != null && !list.isEmpty()) {
+                    value = Boolean.TRUE.toString().equalsIgnoreCase(list.get(0).toString());
                 }
 
                 return value;
             }
 
             @Override
-            public void setObject(final Serializable object) {
-                if (object instanceof Boolean) {
-                    list.clear();
-                    list.add(((Boolean) object).toString());
+            public void setObject(final Boolean object) {
+                list.clear();
+                if (object != null) {
+                    list.add(object.toString());
                 }
             }
         });
 
         return this;
     }
+
+    @SuppressWarnings("rawtypes")
+    @Override
+    public FieldPanel<Boolean> setNewModel(final ListItem item) {
+        IModel<Boolean> model = new Model<Boolean>() {
+
+            private static final long serialVersionUID = 6799404673615637845L;
+
+            @Override
+            public Boolean getObject() {
+                Boolean bool = null;
+
+                final Object obj = item.getModelObject();
+
+                if (obj != null && !obj.toString().isEmpty()) {
+                    if (obj instanceof String) {
+                        bool = Boolean.TRUE.toString().equalsIgnoreCase(obj.toString());
+                    } else if (obj instanceof Boolean) {
+                        // Don't parse anything
+                        bool = (Boolean) obj;
+                    }
+                }
+
+                return bool;
+            }
+
+            @Override
+            @SuppressWarnings("unchecked")
+            public void setObject(final Boolean object) {
+                item.setModelObject(object == null ? Boolean.FALSE.toString() : object.toString());
+            }
+        };
+
+        field.setModel(model);
+        return this;
+    }
+
 }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java Fri Dec 27 14:23:50 2013
@@ -44,7 +44,7 @@ public class AjaxDropDownChoicePanel<T e
         field = new DropDownChoice<T>(
                 "dropDownChoiceField", model, Collections.<T>emptyList(), new ChoiceRenderer<T>());
 
-        add(field.setLabel(new Model(name)).setOutputMarkupId(true));
+        add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
 
         if (enableOnBlur) {
             field.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
@@ -59,22 +59,26 @@ public class AjaxDropDownChoicePanel<T e
         }
     }
 
+    @SuppressWarnings("unchecked")
     public AjaxDropDownChoicePanel<T> setChoiceRenderer(final IChoiceRenderer renderer) {
         ((DropDownChoice) field).setChoiceRenderer(renderer);
         return this;
     }
 
+    @SuppressWarnings("unchecked")
     public AjaxDropDownChoicePanel<T> setChoices(final List<T> choices) {
         ((DropDownChoice) field).setChoices(choices);
         return this;
     }
 
+    @SuppressWarnings("unchecked")
     public AjaxDropDownChoicePanel<T> setChoices(final IModel<? extends List<? extends T>> choices) {
         ((DropDownChoice) field).setChoices(choices);
         return this;
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public FieldPanel clone() {
         final AjaxDropDownChoicePanel<T> panel = (AjaxDropDownChoicePanel<T>) super.clone();
         panel.setChoiceRenderer(((DropDownChoice) field).getChoiceRenderer());

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxPalettePanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxPalettePanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxPalettePanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxPalettePanel.java Fri Dec 27 14:23:50 2013
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.console.wicket.markup.html.form;
 
-import java.io.Serializable;
 import java.util.Collection;
 import java.util.List;
 import org.apache.syncope.console.commons.SelectChoiceRenderer;
@@ -27,7 +26,7 @@ import org.apache.wicket.markup.html.for
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.util.ListModel;
 
-public class AjaxPalettePanel<T> extends AbstractFieldPanel {
+public class AjaxPalettePanel<T> extends AbstractFieldPanel<List<T>> {
 
     private static final long serialVersionUID = 7738499668258805567L;
 
@@ -60,7 +59,7 @@ public class AjaxPalettePanel<T> extends
     }
 
     @Override
-    public AjaxPalettePanel<T> setModelObject(final Serializable object) {
+    public AjaxPalettePanel<T> setModelObject(final List<T> object) {
         palette.setDefaultModelObject(object);
         return this;
     }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java Fri Dec 27 14:23:50 2013
@@ -30,14 +30,13 @@ public class AjaxPasswordFieldPanel exte
     private static final long serialVersionUID = -5490115280336667460L;
 
     public AjaxPasswordFieldPanel(final String id, final String name, final IModel<String> model) {
-
         super(id, name, model);
 
         field = new PasswordTextField("passwordField", model);
 
         field.setRequired(false);
 
-        add(field.setLabel(new Model(name)).setOutputMarkupId(true));
+        add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
 
         if (!isReadOnly()) {
             field.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
@@ -53,8 +52,7 @@ public class AjaxPasswordFieldPanel exte
     }
 
     @Override
-    public FieldPanel addRequiredLabel() {
-
+    public FieldPanel<String> addRequiredLabel() {
         if (!isRequired()) {
             setRequired(true);
         }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxTextFieldPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxTextFieldPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxTextFieldPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxTextFieldPanel.java Fri Dec 27 14:23:50 2013
@@ -74,14 +74,14 @@ public class AjaxTextFieldPanel extends 
                 private static final long serialVersionUID = -1107858522700306810L;
 
                 @Override
-                protected void onUpdate(AjaxRequestTarget art) {
+                protected void onUpdate(final AjaxRequestTarget target) {
                     // nothing to do
                 }
             });
         }
     }
 
-    public void addValidator(final IValidator validator) {
+    public void addValidator(final IValidator<? super String> validator) {
         this.field.add(validator);
     }
 

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java Fri Dec 27 14:23:50 2013
@@ -18,29 +18,28 @@
  */
 package org.apache.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 {
+public class CheckBoxMultipleChoiceFieldPanel<E> extends AbstractFieldPanel<List<E>> {
 
     private static final long serialVersionUID = 4124935025837737298L;
 
-    private final CheckBoxMultipleChoice field;
+    private final CheckBoxMultipleChoice<E> field;
 
-    public CheckBoxMultipleChoiceFieldPanel(final String id, final IModel<Collection> model, final IModel<List> choices) {
+    public CheckBoxMultipleChoiceFieldPanel(
+            final String id, final IModel<List<E>> model, final IModel<List<E>> choices) {
 
         super(id, model);
 
-        field = new CheckBoxMultipleChoice("checkBoxMultipleChoice", model, choices);
+        field = new CheckBoxMultipleChoice<E>("checkBoxMultipleChoice", model, choices);
         add(field);
     }
 
     @Override
-    public AbstractFieldPanel setModelObject(final Serializable object) {
+    public AbstractFieldPanel<List<E>> setModelObject(final List<E> object) {
         field.setModelObject(object);
         return this;
     }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateFieldPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateFieldPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateFieldPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateFieldPanel.java Fri Dec 27 14:23:50 2013
@@ -31,7 +31,7 @@ import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.springframework.util.StringUtils;
 
-public class DateFieldPanel extends FieldPanel<Date> implements Cloneable {
+public class DateFieldPanel extends FieldPanel<Date> {
 
     private static final long serialVersionUID = -428975732068281726L;
 
@@ -43,39 +43,25 @@ public class DateFieldPanel extends Fiel
     }
 
     @Override
-    public FieldPanel setNewModel(final ListItem item) {
-        final SimpleDateFormat formatter;
+    public FieldPanel<Date> setNewModel(final List<Serializable> list) {
+        final SimpleDateFormat formatter = datePattern == null
+                ? new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN, Locale.getDefault())
+                : new SimpleDateFormat(datePattern, Locale.getDefault());
 
-        if (datePattern != null) {
-            formatter = new SimpleDateFormat(datePattern, Locale.getDefault());
-        } else {
-            formatter = new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN, Locale.getDefault());
-        }
+        setNewModel(new Model<Date>() {
 
-        IModel<Date> model = new Model() {
-
-            private static final long serialVersionUID = 6799404673615637845L;
+            private static final long serialVersionUID = 527651414610325237L;
 
             @Override
-            public Serializable getObject() {
+            public Date getObject() {
                 Date date = null;
 
-                final Object obj = item.getModelObject();
-
-                if (obj != null && !obj.toString().isEmpty()) {
-                    if (obj instanceof String) {
+                if (list != null && !list.isEmpty() && StringUtils.hasText(list.get(0).toString())) {
+                    try {
                         // Parse string using datePattern
-                        try {
-                            date = formatter.parse(obj.toString());
-                        } catch (ParseException e) {
-                            LOG.error("While parsing date", e);
-                        }
-                    } else if (obj instanceof Date) {
-                        // Don't parse anything
-                        date = (Date) obj;
-                    } else {
-                        // consider Long
-                        date = new Date((Long) obj);
+                        date = formatter.parse(list.get(0).toString());
+                    } catch (ParseException e) {
+                        LOG.error("invalid parse exception", e);
                     }
                 }
 
@@ -83,43 +69,48 @@ public class DateFieldPanel extends Fiel
             }
 
             @Override
-            public void setObject(final Serializable object) {
-                if (object instanceof Date) {
-                    item.setModelObject(formatter.format((Date) object));
-                } else {
-                    item.setModelObject(null);
+            public void setObject(final Date object) {
+                list.clear();
+                if (object != null) {
+                    list.add(formatter.format(object));
                 }
             }
-        };
+        });
 
-        field.setModel(model);
         return this;
     }
 
+    @SuppressWarnings("rawtypes")
     @Override
-    public FieldPanel setNewModel(final List<Serializable> list) {
-        final SimpleDateFormat formatter;
-
-        if (datePattern != null) {
-            formatter = new SimpleDateFormat(datePattern, Locale.getDefault());
-        } else {
-            formatter = new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN, Locale.getDefault());
-        }
+    public FieldPanel<Date> setNewModel(final ListItem item) {
+        final SimpleDateFormat formatter = datePattern == null
+                ? new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN, Locale.getDefault())
+                : new SimpleDateFormat(datePattern, Locale.getDefault());
 
-        setNewModel(new Model() {
+        IModel<Date> model = new Model<Date>() {
 
-            private static final long serialVersionUID = 527651414610325237L;
+            private static final long serialVersionUID = 6799404673615637845L;
 
             @Override
-            public Serializable getObject() {
+            public Date getObject() {
                 Date date = null;
 
-                if (list != null && !list.isEmpty() && StringUtils.hasText(list.get(0).toString())) {
-                    try {
+                final Object obj = item.getModelObject();
+
+                if (obj != null && !obj.toString().isEmpty()) {
+                    if (obj instanceof String) {
                         // Parse string using datePattern
-                        date = formatter.parse(list.get(0).toString());
-                    } catch (ParseException e) {
-                        LOG.error("invalid parse exception", e);
+                        try {
+                            date = formatter.parse(obj.toString());
+                        } catch (ParseException e) {
+                            LOG.error("While parsing date", e);
+                        }
+                    } else if (obj instanceof Date) {
+                        // Don't parse anything
+                        date = (Date) obj;
+                    } else {
+                        // consider Long
+                        date = new Date((Long) obj);
                     }
                 }
 
@@ -127,14 +118,13 @@ public class DateFieldPanel extends Fiel
             }
 
             @Override
-            public void setObject(final Serializable object) {
-                if (object != null && object instanceof Date) {
-                    list.clear();
-                    list.add((String) formatter.format((Date) object));
-                }
+            @SuppressWarnings("unchecked")
+            public void setObject(final Date object) {
+                item.setModelObject(formatter.format(object));
             }
-        });
+        };
 
+        field.setModel(model);
         return this;
     }
 }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateTextFieldPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateTextFieldPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateTextFieldPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateTextFieldPanel.java Fri Dec 27 14:23:50 2013
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.console.wicket.markup.html.form;
 
-
 import java.util.Date;
 import org.apache.syncope.console.commons.Constants;
 
@@ -45,7 +44,7 @@ public class DateTextFieldPanel extends 
                 private static final long serialVersionUID = -1107858522700306810L;
 
                 @Override
-                protected void onUpdate(AjaxRequestTarget art) {
+                protected void onUpdate(final AjaxRequestTarget target) {
                     // nothing to do
                 }
             });
@@ -53,7 +52,7 @@ public class DateTextFieldPanel extends 
 
         field.add(getDatePicker());
 
-        add(field.setLabel(new Model(name)).setOutputMarkupId(true));
+        add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
     }
 
     /**
@@ -76,8 +75,8 @@ public class DateTextFieldPanel extends 
     }
 
     @Override
-    public FieldPanel clone() {
-        final FieldPanel panel = new DateTextFieldPanel(id, name, new Model(), datePattern);
+    public FieldPanel<Date> clone() {
+        final FieldPanel<Date> panel = new DateTextFieldPanel(id, name, new Model<Date>(), datePattern);
         panel.setRequired(isRequired());
         panel.setReadOnly(isReadOnly());
         panel.setTitle(title);

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateTimeFieldPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateTimeFieldPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateTimeFieldPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/DateTimeFieldPanel.java Fri Dec 27 14:23:50 2013
@@ -107,7 +107,7 @@ public class DateTimeFieldPanel extends 
             }
         });
 
-        add(field.setLabel(new Model(name)).setOutputMarkupId(true));
+        add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
     }
 
     /**
@@ -124,7 +124,7 @@ public class DateTimeFieldPanel extends 
                 throw new IllegalArgumentException("argument dateTimeComponent cannot be null");
             }
 
-            dateTimeComponents = new FormComponent[]{dateTimeComponent};
+            dateTimeComponents = new FormComponent[] { dateTimeComponent };
         }
 
         @Override
@@ -152,7 +152,8 @@ public class DateTimeFieldPanel extends 
         }
     }
 
-    public FieldPanel setFormValidator(final Form form) {
+    @SuppressWarnings("rawtypes")
+    public FieldPanel<Date> setFormValidator(final Form form) {
         if (field == null) {
             LOG.error("Error setting form validator");
         } else {
@@ -164,7 +165,7 @@ public class DateTimeFieldPanel extends 
     }
 
     @Override
-    public FieldPanel setStyleSheet(final String classes) {
+    public FieldPanel<Date> setStyleSheet(final String classes) {
         field.get("date").add(AttributeModifier.replace("class", (classes == null ? "" : classes) + " date_size"));
 
         field.get("hours").add(AttributeModifier.replace("class", classes == null ? "" : classes));
@@ -177,8 +178,8 @@ public class DateTimeFieldPanel extends 
     }
 
     @Override
-    public FieldPanel clone() {
-        final FieldPanel panel = new DateTimeFieldPanel(id, name, new Model<Date>(null), datePattern);
+    public FieldPanel<Date> clone() {
+        final FieldPanel<Date> panel = new DateTimeFieldPanel(id, name, new Model<Date>(null), datePattern);
 
         panel.setRequired(isRequired());
         panel.setReadOnly(isReadOnly());

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/FieldPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/FieldPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/FieldPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/FieldPanel.java Fri Dec 27 14:23:50 2013
@@ -20,6 +20,7 @@ package org.apache.syncope.console.wicke
 
 import java.io.Serializable;
 import java.util.List;
+import org.apache.commons.lang3.SerializationUtils;
 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.FormComponent;
@@ -28,7 +29,7 @@ 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> implements Cloneable {
+public abstract class FieldPanel<T> extends AbstractFieldPanel<T> implements Cloneable {
 
     private static final long serialVersionUID = -198988924922541273L;
 
@@ -87,8 +88,41 @@ public abstract class FieldPanel<T exten
         return this;
     }
 
-    public FieldPanel<T> setNewModel(final IModel<T> model) {
-        field.setModel(model);
+    public boolean isRequired() {
+        return field.isRequired();
+    }
+
+    public boolean isReadOnly() {
+        return !field.isEnabled();
+    }
+
+    public FieldPanel<T> addRequiredLabel() {
+        if (!isRequired()) {
+            setRequired(true);
+        }
+
+        final Fragment fragment = new Fragment("required", "requiredFragment", this);
+
+        fragment.add(new Label("requiredLabel", "*"));
+
+        replace(fragment);
+
+        this.isRequiredLabelAdded = true;
+
+        return this;
+    }
+
+    public FieldPanel<T> removeRequiredLabel() {
+        if (isRequired()) {
+            setRequired(false);
+        }
+
+        final Fragment fragment = new Fragment("required", "notRequiredFragment", this);
+
+        replace(fragment);
+
+        this.isRequiredLabelAdded = false;
+
         return this;
     }
 
@@ -102,12 +136,9 @@ public abstract class FieldPanel<T exten
         return (T) field.getModelObject();
     }
 
-    public boolean isRequired() {
-        return field.isRequired();
-    }
-
-    public boolean isReadOnly() {
-        return !field.isEnabled();
+    public FieldPanel<T> setNewModel(final IModel<T> model) {
+        field.setModel(model);
+        return this;
     }
 
     /**
@@ -117,7 +148,7 @@ public abstract class FieldPanel<T exten
      * @return updated FieldPanel object.
      */
     public FieldPanel<T> setNewModel(final ListItem<T> item) {
-        setNewModel(new Model<T>() {
+        setNewModel(new IModel<T>() {
 
             private static final long serialVersionUID = 6799404673615637845L;
 
@@ -132,11 +163,16 @@ public abstract class FieldPanel<T exten
                     item.setModelObject(object);
                 }
             }
+
+            @Override
+            public void detach() {
+                // no detach
+            }
         });
         return this;
     }
 
-    @SuppressWarnings({"unchecked", "rawtypes"})
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public FieldPanel<T> setNewModel(final List<Serializable> list) {
         setNewModel(new Model() {
 
@@ -165,53 +201,8 @@ public abstract class FieldPanel<T exten
     @Override
     @SuppressWarnings("unchecked")
     public FieldPanel<T> clone() {
-        final FieldPanel<T> panel;
-        try {
-            panel = this.getClass().getConstructor(new Class<?>[] {String.class, String.class, IModel.class})
-                    .newInstance(id, name, new Model<T>(null));
-        } catch (Exception e) {
-            LOG.error("Error cloning field panel", e);
-            return null;
-        }
-
-        panel.setRequired(isRequired());
-        panel.setReadOnly(isReadOnly());
-        panel.setTitle(title);
-
-        if (isRequiredLabelAdded) {
-            panel.addRequiredLabel();
-        }
-
+        final FieldPanel<T> panel = SerializationUtils.clone(this);
+        panel.setModelObject(null);
         return panel;
     }
-
-    public FieldPanel<T> addRequiredLabel() {
-        if (!isRequired()) {
-            setRequired(true);
-        }
-
-        final Fragment fragment = new Fragment("required", "requiredFragment", this);
-
-        fragment.add(new Label("requiredLabel", "*"));
-
-        replace(fragment);
-
-        this.isRequiredLabelAdded = true;
-
-        return this;
-    }
-
-    public FieldPanel<T> removeRequiredLabel() {
-        if (isRequired()) {
-            setRequired(false);
-        }
-
-        final Fragment fragment = new Fragment("required", "notRequiredFragment", this);
-
-        replace(fragment);
-
-        this.isRequiredLabelAdded = false;
-
-        return this;
-    }
 }

Copied: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiFieldPanel.java (from r1553458, syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java)
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiFieldPanel.java?p2=syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiFieldPanel.java&p1=syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java&r1=1553458&r2=1553676&rev=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiFieldPanel.java Fri Dec 27 14:23:50 2013
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.console.wicket.markup.html.form;
 
-import java.io.Serializable;
 import java.util.List;
 import org.apache.syncope.console.commons.Constants;
 
@@ -33,7 +32,7 @@ import org.apache.wicket.markup.html.lis
 import org.apache.wicket.markup.html.panel.Fragment;
 import org.apache.wicket.model.IModel;
 
-public class MultiValueSelectorPanel<E> extends AbstractFieldPanel {
+public class MultiFieldPanel<E> extends AbstractFieldPanel<List<E>> {
 
     private static final long serialVersionUID = -6322397761456513324L;
 
@@ -41,11 +40,11 @@ public class MultiValueSelectorPanel<E> 
 
     private WebMarkupContainer container;
 
-    public MultiValueSelectorPanel(final String id, final IModel<List<E>> model, final FieldPanel panelTemplate) {
+    public MultiFieldPanel(final String id, final IModel<List<E>> model, final FieldPanel<E> panelTemplate) {
         this(id, model, panelTemplate, false);
     }
 
-    public MultiValueSelectorPanel(final String id, final IModel<List<E>> model, final FieldPanel panelTemplate,
+    public MultiFieldPanel(final String id, final IModel<List<E>> model, final FieldPanel<E> panelTemplate,
             final boolean eventTemplate) {
 
         super(id, model);
@@ -64,7 +63,7 @@ public class MultiValueSelectorPanel<E> 
 
             @Override
             protected void populateItem(final ListItem<E> item) {
-                final FieldPanel fieldPanel = panelTemplate.clone();
+                final FieldPanel<E> fieldPanel = panelTemplate.clone();
 
                 if (eventTemplate) {
                     fieldPanel.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
@@ -145,11 +144,8 @@ public class MultiValueSelectorPanel<E> 
     }
 
     @Override
-    public MultiValueSelectorPanel<E> setModelObject(Serializable object) {
-        if (!(object instanceof List)) {
-            throw new ClassCastException("object is expected to be List: " + object.getClass().getName());
-        }
-        view.setModelObject((List<E>) object);
+    public MultiFieldPanel<E> setModelObject(final List<E> object) {
+        view.setModelObject(object);
         return this;
     }
 

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SelectableRecorder.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SelectableRecorder.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SelectableRecorder.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SelectableRecorder.java Fri Dec 27 14:23:50 2013
@@ -47,7 +47,7 @@ public class SelectableRecorder<T> exten
     private static final String[] EMPTY_IDS = new String[0];
 
     /**
-     * conveniently maintained array of selected ids
+     * Conveniently maintained array of selected ids.
      */
     private String[] ids;
 
@@ -122,7 +122,7 @@ public class SelectableRecorder<T> exten
     public Iterator<T> getSelectedChoices() {
         IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
         if (ids.length == 0) {
-            return Collections.EMPTY_LIST.iterator();
+            return Collections.<T>emptyList().iterator();
         }
 
         List<T> selected = new ArrayList<T>(ids.length);
@@ -146,7 +146,7 @@ public class SelectableRecorder<T> exten
         Collection<? extends T> choices = getPalette().getChoices();
 
         if (choices.size() - ids.length == 0) {
-            return Collections.<T> emptyList().iterator();
+            return Collections.<T>emptyList().iterator();
         }
 
         List<T> unselected = new ArrayList<T>(Math.max(1, choices.size() - ids.length));

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SpinnerFieldPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SpinnerFieldPanel.java?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SpinnerFieldPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SpinnerFieldPanel.java Fri Dec 27 14:23:50 2013
@@ -18,13 +18,17 @@
  */
 package org.apache.syncope.console.wicket.markup.html.form;
 
+import java.io.Serializable;
+import java.util.List;
 import java.util.UUID;
+import org.apache.commons.lang3.math.NumberUtils;
 import org.apache.syncope.console.commons.Constants;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
 import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.list.ListItem;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 
@@ -32,7 +36,9 @@ public class SpinnerFieldPanel<T extends
 
     private static final long serialVersionUID = 6413819574530703577L;
 
-    private final String uuid;
+    private final Class<T> reference;
+
+    private final IModel<T> model;
 
     private final T min;
 
@@ -42,10 +48,12 @@ public class SpinnerFieldPanel<T extends
             final T min, final T max, final boolean disableVisible) {
 
         super(id, name, model);
+        this.reference = reference;
+        this.model = model;
         this.min = min;
         this.max = max;
 
-        uuid = UUID.randomUUID().toString();
+        String uuid = UUID.randomUUID().toString();
         field = new TextField<T>("spinnerField", model, reference);
         field.setMarkupId(uuid);
         add(field.setLabel(new Model<String>(name)));
@@ -79,7 +87,9 @@ public class SpinnerFieldPanel<T extends
 
         final StringBuilder statements = new StringBuilder();
         statements.append("jQuery(function() {").
-                append("var spinner = $('#").append(uuid).append("').spinner();");
+                append("var spinner = $('#").append(uuid).append("').spinner();").
+                append("$('#").append(uuid).append("').spinner(").
+                append("'option', 'stop', function(event, ui) { $(this).change(); });");
         if (this.min != null) {
             statements.
                     append("$('#").append(uuid).append("').spinner(").
@@ -105,4 +115,107 @@ public class SpinnerFieldPanel<T extends
         add(spinnerFieldJS);
     }
 
+    @Override
+    public SpinnerFieldPanel<T> setNewModel(final List<Serializable> list) {
+        setNewModel(new Model<T>() {
+
+            private static final long serialVersionUID = 527651414610325237L;
+
+            @Override
+            @SuppressWarnings("unchecked")
+            public T getObject() {
+                T value = null;
+
+                if (list != null && !list.isEmpty()) {
+                    value = reference.equals(Integer.class)
+                            ? (T) Integer.valueOf(NumberUtils.toInt(list.get(0).toString()))
+                            : reference.equals(Long.class)
+                            ? (T) Short.valueOf(NumberUtils.toShort(list.get(0).toString()))
+                            : reference.equals(Short.class)
+                            ? (T) Long.valueOf(NumberUtils.toLong(list.get(0).toString()))
+                            : reference.equals(Float.class)
+                            ? (T) Float.valueOf(NumberUtils.toFloat(list.get(0).toString()))
+                            : reference.equals(Byte.class)
+                            ? (T) Byte.valueOf(NumberUtils.toByte(list.get(0).toString()))
+                            : (T) Double.valueOf(NumberUtils.toDouble(list.get(0).toString()));
+                }
+
+                return value;
+            }
+
+            @Override
+            public void setObject(final T object) {
+                list.clear();
+                if (object != null) {
+                    list.add(object.toString());
+                }
+            }
+        });
+
+        return this;
+    }
+
+    @SuppressWarnings("rawtypes")
+    @Override
+    public SpinnerFieldPanel<T> setNewModel(final ListItem item) {
+        field.setModel(new Model<T>() {
+
+            private static final long serialVersionUID = 6799404673615637845L;
+
+            @Override
+            @SuppressWarnings("unchecked")
+            public T getObject() {
+                T number = null;
+
+                final Object obj = item.getModelObject();
+
+                if (obj != null && !obj.toString().isEmpty()) {
+                    if (obj instanceof String) {
+                        number = reference.equals(Integer.class)
+                                ? (T) Integer.valueOf((String) obj)
+                                : reference.equals(Long.class)
+                                ? (T) Short.valueOf((String) obj)
+                                : reference.equals(Short.class)
+                                ? (T) Long.valueOf((String) obj)
+                                : reference.equals(Float.class)
+                                ? (T) Float.valueOf((String) obj)
+                                : reference.equals(Byte.class)
+                                ? (T) Byte.valueOf((String) obj)
+                                : (T) Double.valueOf((String) obj);
+
+                    } else if (obj instanceof Number) {
+                        // Don't parse anything
+                        number = (T) obj;
+                    }
+                }
+
+                return number;
+            }
+
+            @Override
+            @SuppressWarnings("unchecked")
+            public void setObject(final T object) {
+                item.setModelObject(object == null ? null : object.toString());
+            }
+        });
+
+        return this;
+    }
+
+    @Override
+    public SpinnerFieldPanel<T> clone() {
+        SpinnerFieldPanel<T> panel = new SpinnerFieldPanel<T>(
+                id, name, reference, model, min, max, isRequiredLabelAdded);
+
+        panel.setRequired(isRequired());
+        panel.setReadOnly(isReadOnly());
+        panel.setTitle(title);
+
+        if (isRequiredLabelAdded) {
+            panel.addRequiredLabel();
+        }
+
+        return panel;
+    }
+
 }

Modified: syncope/trunk/console/src/main/webapp/css/fieldstyle.css
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/webapp/css/fieldstyle.css?rev=1553676&r1=1553675&r2=1553676&view=diff
==============================================================================
--- syncope/trunk/console/src/main/webapp/css/fieldstyle.css (original)
+++ syncope/trunk/console/src/main/webapp/css/fieldstyle.css Fri Dec 27 14:23:50 2013
@@ -74,13 +74,13 @@ div#formtable > span:first-of-type {
 div.tablerow {
   display: inline-table;
   padding: 5px;
-  width: 100%;
+  width: 99%;
 }
 
 div.tablerow2 {
   display: inline-table;
   padding: 5px 0px 5px 0px;
-  width: 100%;
+  width: 99%;
 }
 
 div.alt {



Mime
View raw message