[SYNCOPE-681] Core, Console and Enduser
authorFrancesco Chicchiriccò <ilgrosso@apache.org>
Fri, 22 Jun 2018 14:06:40 +0000 (16:06 +0200)
committerFrancesco Chicchiriccò <ilgrosso@apache.org>
Fri, 22 Jun 2018 15:29:38 +0000 (17:29 +0200)
111 files changed:
client/console/src/main/java/org/apache/syncope/client/console/notifications/NotificationWizardBuilder.java
client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSchemaDetailsPanel.java
client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java
client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypesPanel.java
client/console/src/main/java/org/apache/syncope/client/console/panels/DerSchemaDetails.java
client/console/src/main/java/org/apache/syncope/client/console/panels/ParametersDetailsPanel.java
client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
client/console/src/main/java/org/apache/syncope/client/console/panels/RelationshipTypesPanel.java
client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java [deleted file]
client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java
client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder.java [new file with mode: 0644]
client/console/src/main/java/org/apache/syncope/client/console/panels/TypesDirectoryPanel.java
client/console/src/main/java/org/apache/syncope/client/console/panels/VirSchemaDetails.java
client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AbstractFieldPanel.java
client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.java
client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java
client/console/src/main/java/org/apache/syncope/client/console/wizards/AbstractMappingPanel.java
client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
client/console/src/main/java/org/apache/syncope/client/console/wizards/any/DerAttrs.java
client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
client/console/src/main/java/org/apache/syncope/client/console/wizards/any/VirAttrs.java
client/console/src/main/resources/org/apache/syncope/client/console/panels/DerSchemaDetails.html
client/console/src/main/resources/org/apache/syncope/client/console/panels/PlainSchemaDetails.html
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Details.html [moved from client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaModalPanel.html with 87% similarity]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Details.properties [moved from client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaModalPanel.properties with 100% similarity]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Details_it.properties [moved from client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaModalPanel_it.properties with 100% similarity]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Details_ja.properties [moved from client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaModalPanel_ja.properties with 100% similarity]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Details_pt_BR.properties [moved from client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaModalPanel_pt_BR.properties with 100% similarity]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Details_ru.properties [moved from client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaModalPanel_ru.properties with 100% similarity]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels.html [new file with mode: 0644]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels.properties [new file with mode: 0644]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_it.properties [new file with mode: 0644]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_ja.properties [new file with mode: 0644]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_pt_BR.properties [new file with mode: 0644]
client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_ru.properties [new file with mode: 0644]
client/console/src/main/resources/org/apache/syncope/client/console/panels/VirSchemaDetails.html
client/console/src/main/resources/org/apache/syncope/client/console/wizards/AbstractMappingPanel.html
client/enduser/src/main/resources/META-INF/resources/app/js/app.js
client/enduser/src/main/resources/META-INF/resources/app/js/directives/dynamicDerivedAttributes.js
client/enduser/src/main/resources/META-INF/resources/app/js/directives/dynamicPlainAttributes.js
client/enduser/src/main/resources/META-INF/resources/app/js/directives/dynamicVirtualAttributes.js
client/enduser/src/main/resources/META-INF/resources/app/languages/de/dynamic.json [deleted file]
client/enduser/src/main/resources/META-INF/resources/app/languages/de/static.json
client/enduser/src/main/resources/META-INF/resources/app/languages/en/dynamic.json [deleted file]
client/enduser/src/main/resources/META-INF/resources/app/languages/en/static.json
client/enduser/src/main/resources/META-INF/resources/app/languages/it/dynamic.json [deleted file]
client/enduser/src/main/resources/META-INF/resources/app/languages/it/static.json
client/enduser/src/main/resources/META-INF/resources/app/languages/ja/dynamic.json [deleted file]
client/enduser/src/main/resources/META-INF/resources/app/languages/ja/static.json
client/enduser/src/main/resources/META-INF/resources/app/views/dynamicDerivedAttributes.html
client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttributes.html
client/enduser/src/main/resources/META-INF/resources/app/views/dynamicVirtualAttributes.html
client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyPatch.java
common/lib/src/main/java/org/apache/syncope/common/lib/policy/PolicyTO.java
common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java
common/lib/src/main/java/org/apache/syncope/common/lib/to/SchemaTO.java
common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskTO.java
core/logic/src/main/java/org/apache/syncope/core/logic/SchemaLogic.java
core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Schema.java
core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/SchemaLabel.java [new file with mode: 0644]
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/AbstractAnyDAO.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPADerSchemaDAO.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainSchemaDAO.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskDAO.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAVirSchemaDAO.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractEntity.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractPlainAttrValue.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractSchema.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAEntityFactory.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAPlainSchema.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAReport.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASchemaLabel.java [new file with mode: 0644]
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAVirSchema.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAAccountPolicy.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAPasswordPolicy.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/AbstractItem.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAOrgUnit.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAOrgUnitItem.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAProvision.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/AbstractProvisioningTask.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPANotificationTask.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPullTask.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASchedTask.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUPlainAttrUniqueValue.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/openjpa/BooleanValueHandler.java [new file with mode: 0644]
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/openjpa/LocaleValueHandler.java [new file with mode: 0644]
core/persistence-jpa/src/main/resources/domains.xml
core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainSchemaTest.java
core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainSchemaTest.java
core/persistence-jpa/src/test/resources/domains/MasterContent.xml
core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/SchemaDataBinder.java
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DerAttrHandlerImpl.java
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConfigurationDataBinderImpl.java
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/SchemaDataBinderImpl.java
ext/oidcclient/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAOIDCProvider.java
ext/saml2sp/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASAML2IdP.java
ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/pages/SCIMConfPage.java
ext/scimv2/client-console/src/main/java/org/apache/syncope/client/console/panels/SCIMConfUserPanel.java
fit/core-reference/src/main/resources/jboss/domains.xml
fit/core-reference/src/test/java/org/apache/syncope/fit/core/DerSchemaITCase.java
fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirSchemaITCase.java

index 83f948f..733aaab 100644 (file)
@@ -287,8 +287,7 @@ public class NotificationWizardBuilder extends AjaxWizardBuilder<NotificationWra
             aboutContainer.setOutputMarkupId(true);
             add(aboutContainer);
 
-            final IModel<List<Pair<String, List<SearchClause>>>> model =
-                    new PropertyModel<>(modelObject, "aboutClauses");
+            IModel<List<Pair<String, List<SearchClause>>>> model = new PropertyModel<>(modelObject, "aboutClauses");
 
             aboutContainer.add(new MultiPanel<Pair<String, List<SearchClause>>>("abouts", "abouts", model) {
 
index b87ab2c..b113144 100644 (file)
@@ -39,7 +39,6 @@ import org.apache.syncope.common.lib.to.TemplatableTO;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.event.Broadcast;
 import org.apache.wicket.event.IEvent;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
 import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.WindowClosedCallback;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
@@ -187,26 +186,20 @@ public class Realms extends BasePage {
 
             @Override
             protected void setWindowClosedReloadCallback(final BaseModal<?> modal) {
-                modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
-                    private static final long serialVersionUID = 8804221891699487139L;
-
-                    @Override
-                    public void onClose(final AjaxRequestTarget target) {
-                        if (modal.getContent() instanceof ResultPage) {
-                            Serializable result = ResultPage.class.cast(modal.getContent()).getResult();
-
-                            RealmTO newRealmTO = RealmTO.class.cast(ProvisioningResult.class.cast(result).getEntity());
-                            // reload realmChoicePanel label too - SYNCOPE-1151
-                            target.add(realmChoicePanel.reloadRealmTree(target, Model.of(newRealmTO)));
-                            realmChoicePanel.setCurrentRealm(newRealmTO);
-                            send(Realms.this, Broadcast.DEPTH, new ChosenRealm<>(newRealmTO, target));
-                        } else {
-                            target.add(realmChoicePanel.reloadRealmTree(target));
-                        }
-                        target.add(content);
-                        modal.show(false);
+                modal.setWindowClosedCallback(target -> {
+                    if (modal.getContent() instanceof ResultPage) {
+                        Serializable result = ResultPage.class.cast(modal.getContent()).getResult();
+
+                        RealmTO newRealmTO = RealmTO.class.cast(ProvisioningResult.class.cast(result).getEntity());
+                        // reload realmChoicePanel label too - SYNCOPE-1151
+                        target.add(realmChoicePanel.reloadRealmTree(target, Model.of(newRealmTO)));
+                        realmChoicePanel.setCurrentRealm(newRealmTO);
+                        send(Realms.this, Broadcast.DEPTH, new ChosenRealm<>(newRealmTO, target));
+                    } else {
+                        target.add(realmChoicePanel.reloadRealmTree(target));
                     }
+                    target.add(content);
+                    modal.show(false);
                 });
             }
 
index ff39d88..c3a4bb7 100644 (file)
@@ -20,10 +20,7 @@ package org.apache.syncope.client.console.panels;
 
 import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.common.lib.to.SchemaTO;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.CompoundPropertyModel;
 import org.apache.wicket.model.PropertyModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -34,30 +31,12 @@ public abstract class AbstractSchemaDetailsPanel extends Panel {
 
     protected static final Logger LOG = LoggerFactory.getLogger(AbstractSchemaDetailsPanel.class);
 
-    protected static final String FORM = "form";
-
-    protected final Form<SchemaTO> schemaForm;
-
-    protected final SchemaTO schemaTO;
-
-    public AbstractSchemaDetailsPanel(
-            final String id,
-            final PageReference pageReference,
-            final SchemaTO schemaTO) {
+    public AbstractSchemaDetailsPanel(final String id, final SchemaTO schemaTO) {
         super(id);
 
-        this.schemaTO = schemaTO;
-
-        schemaForm = new Form<>(FORM);
-        schemaForm.setModel(new CompoundPropertyModel<>(schemaTO));
-        schemaForm.setOutputMarkupId(true);
-
-        final AjaxTextFieldPanel name =
-                new AjaxTextFieldPanel("key", getString("key"), new PropertyModel<>(schemaTO, "key"));
-        name.addRequiredLabel();
-        name.setEnabled(schemaTO == null || schemaTO.getKey() == null || schemaTO.getKey().isEmpty());
-
-        schemaForm.add(name);
-        add(schemaForm);
+        AjaxTextFieldPanel key = new AjaxTextFieldPanel("key", getString("key"), new PropertyModel<>(schemaTO, "key"));
+        key.addRequiredLabel();
+        key.setEnabled(schemaTO == null || schemaTO.getKey() == null || schemaTO.getKey().isEmpty());
+        add(key);
     }
 }
index fcfe82d..8754d01 100644 (file)
@@ -56,7 +56,7 @@ public class AnyTypeClassesPanel extends TypesDirectoryPanel<
     private static final long serialVersionUID = -2356760296223908382L;
 
     public AnyTypeClassesPanel(final String id, final PageReference pageRef) {
-        super(id, pageRef);
+        super(id, false, pageRef);
         this.restClient = new AnyTypeClassRestClient();
         disableCheckBoxes();
 
index 22cdb72..132a05a 100644 (file)
@@ -55,7 +55,7 @@ public class AnyTypesPanel extends TypesDirectoryPanel<AnyTypeTO, AnyTypesPanel.
     private static final long serialVersionUID = 3905038169553185171L;
 
     public AnyTypesPanel(final String id, final PageReference pageRef) {
-        super(id, pageRef);
+        super(id, false, pageRef);
         this.restClient = new AnyTypeRestClient();
         disableCheckBoxes();
 
index eae157c..2f7d7ea 100644 (file)
@@ -21,7 +21,6 @@ package org.apache.syncope.client.console.panels;
 import de.agilecoders.wicket.core.markup.html.bootstrap.components.TooltipConfig;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.common.lib.to.DerSchemaTO;
-import org.apache.wicket.PageReference;
 import org.apache.wicket.markup.html.form.TextField;
 import org.apache.wicket.model.PropertyModel;
 
@@ -29,16 +28,13 @@ public class DerSchemaDetails extends AbstractSchemaDetailsPanel {
 
     private static final long serialVersionUID = 6668789770131753386L;
 
-    public DerSchemaDetails(final String id,
-            final PageReference pageReference,
-            final DerSchemaTO schemaTO) {
-
-        super(id, pageReference, schemaTO);
+    public DerSchemaDetails(final String id, final DerSchemaTO schemaTO) {
+        super(id, schemaTO);
 
         TextField<String> expression = new TextField<>("expression", new PropertyModel<>(schemaTO, "expression"));
         expression.setRequired(true);
-        schemaForm.add(expression);
+        add(expression);
 
-        schemaForm.add(Constants.getJEXLPopover(this, TooltipConfig.Placement.right));
+        add(Constants.getJEXLPopover(this, TooltipConfig.Placement.right));
     }
 }
index 187b172..c7e01fb 100644 (file)
@@ -155,12 +155,12 @@ public class ParametersDetailsPanel extends Panel {
 
             case Long:
                 panel = new AjaxSpinnerFieldPanel.Builder<Long>()
-                        .build(id, valueHeaderName, Long.class, new Model<Long>());
+                        .build(id, valueHeaderName, Long.class, new Model<>());
                 break;
 
             case Double:
                 panel = new AjaxSpinnerFieldPanel.Builder<Double>()
-                        .build(id, valueHeaderName, Double.class, new Model<Double>());
+                        .build(id, valueHeaderName, Double.class, new Model<>());
                 break;
 
             case Binary:
index 3ec3c62..310864d 100644 (file)
@@ -42,7 +42,6 @@ import org.apache.syncope.common.lib.to.PlainSchemaTO;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
 import org.apache.syncope.common.lib.types.ImplementationType;
-import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField;
 import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -67,33 +66,28 @@ public class PlainSchemaDetails extends AbstractSchemaDetailsPanel {
     private final MultiFieldPanel<String> enumerationKeys;
 
     private final AjaxDropDownChoicePanel<String> validator;
-    
+
     private final AjaxDropDownChoicePanel<AttrSchemaType> type;
 
-    public PlainSchemaDetails(
-            final String id,
-            final PageReference pageReference,
-            final PlainSchemaTO schemaTO) {
+    public PlainSchemaDetails(final String id, final PlainSchemaTO schemaTO) {
+        super(id, schemaTO);
 
-        super(id, pageReference, schemaTO);
-        
-        type = new AjaxDropDownChoicePanel<>(
-                "type", getString("type"), new PropertyModel<AttrSchemaType>(schemaTO, "type"));
+        type = new AjaxDropDownChoicePanel<>("type", getString("type"), new PropertyModel<>(schemaTO, "type"));
 
         type.setChoices(Arrays.asList(AttrSchemaType.values()));
         type.setEnabled(schemaTO == null || schemaTO.getKey() == null || schemaTO.getKey().isEmpty());
         type.addRequiredLabel();
-        schemaForm.add(type);
+        add(type);
 
         // long, double, date
         final AjaxTextFieldPanel conversionPattern = new AjaxTextFieldPanel("conversionPattern",
                 getString("conversionPattern"), new PropertyModel<>(schemaTO, "conversionPattern"));
-        schemaForm.add(conversionPattern);
+        add(conversionPattern);
 
         final WebMarkupContainer conversionParams = new WebMarkupContainer("conversionParams");
         conversionParams.setOutputMarkupPlaceholderTag(true);
         conversionParams.add(conversionPattern);
-        schemaForm.add(conversionParams);
+        add(conversionParams);
 
         final WebMarkupContainer typeParams = new WebMarkupContainer("typeParams");
         typeParams.setOutputMarkupPlaceholderTag(true);
@@ -211,7 +205,7 @@ public class PlainSchemaDetails extends AbstractSchemaDetailsPanel {
         binaryParams.setOutputMarkupPlaceholderTag(true);
         binaryParams.add(mimeType);
         typeParams.add(binaryParams);
-        schemaForm.add(typeParams);
+        add(typeParams);
 
         // show or hide
         showHide(schemaTO, type,
@@ -252,9 +246,10 @@ public class PlainSchemaDetails extends AbstractSchemaDetailsPanel {
         validator.setOutputMarkupId(true);
         ((DropDownChoice) validator.getField()).setNullValid(true);
         validator.setChoices(validators.getObject());
-        schemaForm.add(validator);
+        add(validator);
 
-        AutoCompleteTextField<String> mandatoryCondition = new AutoCompleteTextField<String>("mandatoryCondition") {
+        AutoCompleteTextField<String> mandatoryCondition = new AutoCompleteTextField<String>(
+                "mandatoryCondition", new PropertyModel<>(schemaTO, "mandatoryCondition")) {
 
             private static final long serialVersionUID = -2428903969518079100L;
 
@@ -281,19 +276,18 @@ public class PlainSchemaDetails extends AbstractSchemaDetailsPanel {
             protected void onUpdate(final AjaxRequestTarget target) {
             }
         });
-        schemaForm.add(mandatoryCondition);
+        add(mandatoryCondition);
 
-        schemaForm.add(Constants.getJEXLPopover(this, TooltipConfig.Placement.right));
+        add(Constants.getJEXLPopover(this, TooltipConfig.Placement.right));
 
-        schemaForm.add(new AjaxCheckBoxPanel(
+        add(new AjaxCheckBoxPanel(
                 "multivalue", getString("multivalue"), new PropertyModel<>(schemaTO, "multivalue")));
 
-        schemaForm.add(new AjaxCheckBoxPanel(
+        add(new AjaxCheckBoxPanel(
                 "readonly", getString("readonly"), new PropertyModel<>(schemaTO, "readonly")));
 
-        schemaForm.add(new AjaxCheckBoxPanel("uniqueConstraint",
+        add(new AjaxCheckBoxPanel("uniqueConstraint",
                 getString("uniqueConstraint"), new PropertyModel<>(schemaTO, "uniqueConstraint")));
-
     }
 
     private void showHide(final PlainSchemaTO schema, final AjaxDropDownChoicePanel<AttrSchemaType> type,
index 1f35056..939ac8c 100644 (file)
@@ -57,7 +57,7 @@ public class RelationshipTypesPanel extends TypesDirectoryPanel<
     private static final long serialVersionUID = -3731778000138547357L;
 
     public RelationshipTypesPanel(final String id, final PageReference pageRef) {
-        super(id, pageRef);
+        super(id, false, pageRef);
         this.restClient = new RelationshipTypeRestClient();
         disableCheckBoxes();
 
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java
deleted file mode 100644 (file)
index 8cb1817..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.apache.syncope.client.console.panels;
-
-import java.util.Arrays;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.common.lib.to.SchemaTO;
-import org.apache.syncope.common.lib.to.DerSchemaTO;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.to.VirSchemaTO;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.model.Model;
-
-public class SchemaModalPanel extends AbstractModalPanel<SchemaTO> {
-
-    private static final long serialVersionUID = -4681998932778822125L;
-
-    private final AbstractSchemaDetailsPanel schemaPanel;
-
-    private final SchemaTO schemaTO;
-
-    public SchemaModalPanel(
-            final BaseModal<SchemaTO> modal,
-            final SchemaTO schemaTO,
-            final PageReference pageRef) {
-        super(modal, pageRef);
-
-        this.schemaTO = schemaTO;
-
-        final Form<SchemaType> kindForm = new Form<>("kindForm");
-        add(kindForm);
-
-        final AjaxDropDownChoicePanel<SchemaType> kind = new AjaxDropDownChoicePanel<>(
-                "kind", getString("kind"), new Model<>());
-        kind.setChoices(Arrays.asList(SchemaType.values()));
-        kind.setOutputMarkupId(true);
-
-        kind.setModelObject(SchemaType.fromToClass(schemaTO.getClass()));
-        kind.setEnabled(false);
-        kindForm.add(kind);
-
-        schemaPanel = getSchemaPanel("details", SchemaType.fromToClass(schemaTO.getClass()), modal);
-        schemaPanel.setOutputMarkupId(true);
-        addOrReplace(schemaPanel);
-    }
-
-    private AbstractSchemaDetailsPanel getSchemaPanel(final String id,
-            final SchemaType schemaType, final BaseModal<SchemaTO> modal) {
-        final AbstractSchemaDetailsPanel panel;
-
-        if (schemaTO.getKey() != null) {
-            try {
-                final Class<? extends SchemaTO> schemaTOClass = schemaType.getToClass();
-                modal.setFormModel((SchemaTO) schemaTOClass.newInstance());
-            } catch (InstantiationException | IllegalAccessException ex) {
-                LOG.error("SchemaType not found", ex);
-            }
-        }
-
-        switch (schemaType) {
-            case DERIVED:
-                panel = new DerSchemaDetails(id, pageRef, (DerSchemaTO) schemaTO);
-                break;
-
-            case VIRTUAL:
-                panel = new VirSchemaDetails(id, pageRef, (VirSchemaTO) schemaTO);
-                break;
-
-            case PLAIN:
-            default:
-                panel = new PlainSchemaDetails(id, pageRef, (PlainSchemaTO) schemaTO);
-        }
-        panel.setOutputMarkupId(true);
-        return panel;
-    }
-}
index 654fec9..e3737ec 100644 (file)
@@ -39,9 +39,9 @@ import org.apache.syncope.client.console.panels.SchemaTypePanel.SchemaProvider;
 import org.apache.syncope.client.console.rest.ConfRestClient;
 import org.apache.syncope.client.console.rest.SchemaRestClient;
 import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
-import org.apache.syncope.client.console.wizards.AbstractModalPanelBuilder;
 import org.apache.syncope.client.console.wizards.AjaxWizard;
 import org.apache.syncope.common.lib.to.SchemaTO;
 import org.apache.syncope.common.lib.to.AttrTO;
@@ -83,55 +83,29 @@ public class SchemaTypePanel extends TypesDirectoryPanel<SchemaTO, SchemaProvide
     private String keyword;
 
     public SchemaTypePanel(final String id, final SchemaType schemaType, final PageReference pageRef) {
-        super(id, pageRef);
-        this.restClient = new SchemaRestClient();
-        disableCheckBoxes();
-
+        super(id, true, pageRef);
         this.schemaType = schemaType;
 
-        try {
-            this.addNewItemPanelBuilder(
-                    new AbstractModalPanelBuilder<SchemaTO>(schemaType.getToClass().newInstance(), pageRef) {
-
-                private static final long serialVersionUID = -6388405037134399367L;
-
-                @Override
-                public WizardModalPanel<SchemaTO> build(
-                        final String id, final int index, final AjaxWizard.Mode mode) {
+        disableCheckBoxes();
 
-                    final SchemaTO modelObject = newModelObject();
-                    return new SchemaModalPanel(modal, modelObject, pageRef) {
+        try {
+            addNewItemPanelBuilder(new SchemaTypeWizardBuilder(schemaType.getToClass().newInstance(), pageRef), true);
+        } catch (IllegalAccessException | InstantiationException e) {
+            LOG.error("Error creating instance of {}", schemaType, e);
+        }
 
-                        private static final long serialVersionUID = -6227956682141146095L;
+        this.restClient = new SchemaRestClient();
 
-                        @Override
-                        public void onSubmit(final AjaxRequestTarget target) {
-                            try {
-                                if (getOriginalItem() == null || StringUtils.isBlank(getOriginalItem().getKey())) {
-                                    restClient.create(schemaType, modelObject);
-                                } else {
-                                    restClient.update(schemaType, modelObject);
-                                }
-
-                                SchemaTypePanel.this.updateResultTable(target);
-                                SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
-                                modal.close(target);
-                            } catch (Exception e) {
-                                LOG.error("While creating or updating {}", modelObject, e);
-                                SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().
-                                        getName() : e.getMessage());
-                            }
-                            ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
-                        }
-                    };
-                }
-            }, true);
+        initResultTable();
+        MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.SCHEMA_CREATE);
+    }
 
-            initResultTable();
-            MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.SCHEMA_CREATE);
-        } catch (InstantiationException | IllegalAccessException e) {
-            LOG.error("Error create new schema", e);
-        }
+    @Override
+    protected void setWindowClosedReloadCallback(final BaseModal<?> modal) {
+        modal.setWindowClosedCallback(target -> {
+            target.add(SchemaTypePanel.this);
+            modal.show(false);
+        });
     }
 
     @Override
@@ -153,14 +127,14 @@ public class SchemaTypePanel extends TypesDirectoryPanel<SchemaTO, SchemaProvide
     protected List<IColumn<SchemaTO, String>> getColumns() {
         final List<IColumn<SchemaTO, String>> columns = new ArrayList<>();
 
-        for (final String field : COL_NAMES.get(schemaType)) {
-            final Field clazzField = ReflectionUtils.findField(schemaType.getToClass(), field);
+        for (String field : COL_NAMES.get(schemaType)) {
+            Field clazzField = ReflectionUtils.findField(schemaType.getToClass(), field);
 
             if (clazzField != null) {
                 if (clazzField.getType().equals(Boolean.class) || clazzField.getType().equals(boolean.class)) {
                     columns.add(new BooleanPropertyColumn<>(new ResourceModel(field), field, field));
                 } else {
-                    final IColumn<SchemaTO, String> column = new PropertyColumn<SchemaTO, String>(
+                    IColumn<SchemaTO, String> column = new PropertyColumn<SchemaTO, String>(
                             new ResourceModel(field), field, field) {
 
                         private static final long serialVersionUID = 3282547854226892169L;
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder.java
new file mode 100644 (file)
index 0000000..099cb25
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+ * 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.apache.syncope.client.console.panels;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Locale;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import org.apache.commons.lang3.LocaleUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.MutablePair;
+import org.apache.syncope.client.console.SyncopeConsoleApplication;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
+import org.apache.syncope.common.lib.to.DerSchemaTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
+import org.apache.syncope.common.lib.to.VirSchemaTO;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.wizard.WizardModel;
+import org.apache.wicket.extensions.wizard.WizardStep;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.apache.wicket.validation.ValidationError;
+
+public class SchemaTypeWizardBuilder extends AjaxWizardBuilder<SchemaTO> {
+
+    private static final long serialVersionUID = -3893521796674873644L;
+
+    private final SchemaRestClient restClient = new SchemaRestClient();
+
+    private final SchemaType schemaType;
+
+    private final ListModel<MutablePair<Locale, String>> translations = new ListModel<>(new ArrayList<>());
+
+    public SchemaTypeWizardBuilder(final SchemaTO schemaTO, final PageReference pageRef) {
+        super(schemaTO, pageRef);
+        this.schemaType = SchemaType.fromToClass(schemaTO.getClass());
+    }
+
+    @Override
+    protected Serializable onApplyInternal(final SchemaTO modelObject) {
+        modelObject.getLabels().clear();
+        modelObject.getLabels().putAll(translations.getObject().stream().
+                filter(Objects::nonNull).
+                filter(translation -> translation.getKey() != null).
+                filter(translation -> translation.getValue() != null).
+                collect(Collectors.toMap(MutablePair::getKey, MutablePair::getValue)));
+
+        if (getOriginalItem() == null || StringUtils.isBlank(getOriginalItem().getKey())) {
+            restClient.create(schemaType, modelObject);
+        } else {
+            restClient.update(schemaType, modelObject);
+        }
+
+        return null;
+    }
+
+    @Override
+    protected WizardModel buildModelSteps(final SchemaTO modelObject, final WizardModel wizardModel) {
+        wizardModel.add(new Details(modelObject));
+        wizardModel.add(new Labels(modelObject));
+        return wizardModel;
+    }
+
+    public class Details extends WizardStep {
+
+        private static final long serialVersionUID = 382498949020534783L;
+
+        public Details(final SchemaTO modelObject) {
+            AjaxDropDownChoicePanel<SchemaType> kind =
+                    new AjaxDropDownChoicePanel<>("kind", getString("kind"), new Model<>());
+            kind.setChoices(Arrays.asList(SchemaType.values()));
+            kind.setOutputMarkupId(true);
+            kind.setModelObject(schemaType);
+            kind.setEnabled(false);
+            add(kind);
+
+            AbstractSchemaDetailsPanel detailsPanel;
+            switch (schemaType) {
+                case DERIVED:
+                    detailsPanel = new DerSchemaDetails("details", (DerSchemaTO) modelObject);
+                    break;
+
+                case VIRTUAL:
+                    detailsPanel = new VirSchemaDetails("details", (VirSchemaTO) modelObject);
+                    break;
+
+                case PLAIN:
+                default:
+                    detailsPanel = new PlainSchemaDetails("details", (PlainSchemaTO) modelObject);
+            }
+            detailsPanel.setOutputMarkupId(true);
+            add(detailsPanel);
+        }
+    }
+
+    public class Labels extends WizardStep {
+
+        private static final long serialVersionUID = -3130973642912822270L;
+
+        public Labels(final SchemaTO modelObject) {
+            setTitleModel(new ResourceModel("translations"));
+            setOutputMarkupId(true);
+
+            translations.getObject().clear();
+            modelObject.getLabels().forEach((locale, display) -> {
+                translations.getObject().add(MutablePair.of(locale, display));
+            });
+
+            ListView<MutablePair<Locale, String>> labels =
+                    new ListView<MutablePair<Locale, String>>("labels", translations) {
+
+                private static final long serialVersionUID = -8746795666847966508L;
+
+                @Override
+                protected void populateItem(final ListItem<MutablePair<Locale, String>> item) {
+                    MutablePair<Locale, String> entry = item.getModelObject();
+
+                    AjaxTextFieldPanel locale = new AjaxTextFieldPanel("locale", "locale", new Model<>(), true);
+                    locale.getField().setModel(new IModel<String>() {
+
+                        private static final long serialVersionUID = 1500045101360533133L;
+
+                        @Override
+                        public String getObject() {
+                            return entry.getLeft() == null ? null : entry.getLeft().toString();
+                        }
+
+                        @Override
+                        public void setObject(final String object) {
+                            entry.setLeft(LocaleUtils.toLocale(object));
+                        }
+                    });
+                    locale.setRequired(true).hideLabel();
+                    locale.setChoices(SyncopeConsoleApplication.SUPPORTED_LOCALES.stream().
+                            map(Objects::toString).collect(Collectors.toList()));
+                    locale.addValidator(validatable -> {
+                        try {
+                            LocaleUtils.toLocale(validatable.getValue());
+                        } catch (Exception e) {
+                            LOG.error("Invalid Locale: {}", validatable.getValue(), e);
+                            validatable.error(new ValidationError("Invalid Locale: " + validatable.getValue()));
+
+                            RequestCycle.get().find(AjaxRequestTarget.class).ifPresent(target -> {
+                                target.add(Labels.this);
+                            });
+                        }
+                    });
+                    item.add(locale);
+
+                    AjaxTextFieldPanel display = new AjaxTextFieldPanel("display", "display", new Model<>());
+                    display.getField().setModel(new IModel<String>() {
+
+                        private static final long serialVersionUID = 1500045101360533133L;
+
+                        @Override
+                        public String getObject() {
+                            return entry.getRight();
+                        }
+
+                        @Override
+                        public void setObject(final String object) {
+                            entry.setRight(object);
+                        }
+                    });
+                    display.setRequired(true).hideLabel();
+                    item.add(display);
+
+                    ActionsPanel<Serializable> actions = new ActionsPanel<>("toRemove", null);
+                    actions.add(new ActionLink<Serializable>() {
+
+                        private static final long serialVersionUID = -3722207913631435501L;
+
+                        @Override
+                        public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
+                            int index = -1;
+                            for (int i = 0; i < translations.getObject().size() && index == -1; i++) {
+                                if (entry.equals(translations.getObject().get(i))) {
+                                    index = i;
+                                }
+                            }
+
+                            if (index != -1) {
+                                translations.getObject().remove(index);
+                                item.getParent().removeAll();
+                                target.add(Labels.this);
+                            }
+                        }
+                    }, ActionLink.ActionType.DELETE, StandardEntitlement.SCHEMA_UPDATE, true).hideLabel();
+                    item.add(actions);
+                }
+            };
+            labels.setReuseItems(true);
+            add(labels);
+
+            IndicatingAjaxButton addLabel = new IndicatingAjaxButton("addLabel") {
+
+                private static final long serialVersionUID = -4804368561204623354L;
+
+                @Override
+                protected void onSubmit(final AjaxRequestTarget target) {
+                    translations.getObject().add(MutablePair.of(null, null));
+                    target.add(Labels.this);
+                }
+            };
+            addLabel.setDefaultFormProcessing(false);
+            add(addLabel);
+        }
+    }
+}
index 119af0a..8aa4b80 100644 (file)
@@ -30,10 +30,13 @@ public abstract class TypesDirectoryPanel<
 
     private static final long serialVersionUID = 7890071604330629259L;
 
-    public TypesDirectoryPanel(final String id, final PageReference pageRef) {
+    public TypesDirectoryPanel(final String id, final boolean withWizard, final PageReference pageRef) {
         super(id, pageRef);
-        setFooterVisibility(true);
-        modal.addSubmitButton();
+
+        if (!withWizard) {
+            setFooterVisibility(true);
+            modal.addSubmitButton();
+        }
         modal.size(Modal.Size.Large);
     }
 }
index ef30352..5b27c83 100644 (file)
@@ -39,7 +39,6 @@ import org.apache.syncope.common.lib.to.EntityTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.lib.to.VirSchemaTO;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.model.PropertyModel;
 
@@ -47,6 +46,8 @@ public class VirSchemaDetails extends AbstractSchemaDetailsPanel {
 
     private static final long serialVersionUID = 5979623248182851337L;
 
+    private final ConnectorRestClient connectorRestClient = new ConnectorRestClient();
+
     private final ResourceRestClient resourceRestClient = new ResourceRestClient();
 
     private final ConnectorRestClient connRestClient = new ConnectorRestClient();
@@ -57,15 +58,12 @@ public class VirSchemaDetails extends AbstractSchemaDetailsPanel {
 
     private ResourceTO selectedResource;
 
-    public VirSchemaDetails(final String id,
-            final PageReference pageReference,
-            final VirSchemaTO schemaTO) {
-
-        super(id, pageReference, schemaTO);
+    public VirSchemaDetails(final String id, final VirSchemaTO schemaTO) {
+        super(id, schemaTO);
 
         AjaxCheckBoxPanel readonly = new AjaxCheckBoxPanel("readonly", getString("readonly"),
                 new PropertyModel<>(schemaTO, "readonly"));
-        schemaForm.add(readonly);
+        add(readonly);
 
         final AjaxDropDownChoicePanel<String> resource = new AjaxDropDownChoicePanel<>(
                 "resource", getString("resource"), new PropertyModel<String>(schemaTO, "resource"), false).
@@ -76,7 +74,7 @@ public class VirSchemaDetails extends AbstractSchemaDetailsPanel {
         if (resource.getModelObject() != null) {
             populateAnyTypes(resource.getModelObject());
         }
-        schemaForm.add(resource);
+        add(resource);
 
         anyType = new AjaxDropDownChoicePanel<>(
                 "anyType", getString("anyType"), new PropertyModel<String>(schemaTO, "anyType"), false).
@@ -88,7 +86,7 @@ public class VirSchemaDetails extends AbstractSchemaDetailsPanel {
         if (resource.getModelObject() == null) {
             anyType.setEnabled(false);
         }
-        schemaForm.add(anyType);
+        add(anyType);
 
         final AjaxTextFieldPanel extAttrName = new AjaxTextFieldPanel(
                 "extAttrName", getString("extAttrName"), new PropertyModel<>(schemaTO, "extAttrName"));
@@ -97,9 +95,7 @@ public class VirSchemaDetails extends AbstractSchemaDetailsPanel {
         if (selectedResource != null) {
             extAttrName.setChoices(getExtAttrNames());
         }
-        schemaForm.add(extAttrName);
-
-        add(schemaForm);
+        add(extAttrName);
 
         resource.getField().add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
 
@@ -125,7 +121,7 @@ public class VirSchemaDetails extends AbstractSchemaDetailsPanel {
             @Override
             protected void onUpdate(final AjaxRequestTarget target) {
                 if (selectedResource != null) {
-                    String adminRealm = getAdminRealm(selectedResource.getKey());
+                    String adminRealm = getAdminRealm(selectedResource.getConnector());
 
                     if (SyncopeConsoleSession.get().owns(StandardEntitlement.CONNECTOR_READ, adminRealm)) {
                         extAttrName.setChoices(getExtAttrNames());
@@ -139,7 +135,7 @@ public class VirSchemaDetails extends AbstractSchemaDetailsPanel {
     private String getAdminRealm(final String connectorKey) {
         String adminRealm = null;
         try {
-            adminRealm = new ConnectorRestClient().read(connectorKey).getAdminRealm();
+            adminRealm = connectorRestClient.read(connectorKey).getAdminRealm();
         } catch (Exception e) {
             LOG.error("Could not read Admin Realm for External Resource {}", selectedResource.getKey());
         }
index 305a97b..115349b 100644 (file)
@@ -34,7 +34,7 @@ public abstract class AbstractFieldPanel<T> extends Panel {
 
     private static final long serialVersionUID = 5958017546318855690L;
 
-    private static final String LABEL = "field-label";
+    public static final String LABEL = "field-label";
 
     protected boolean isRequiredLabelAdded = false;
 
index 16b7db5..8d0c665 100644 (file)
@@ -19,7 +19,6 @@
 package org.apache.syncope.client.console.wicket.markup.html.form;
 
 import de.agilecoders.wicket.core.markup.html.bootstrap.components.TooltipConfig;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
@@ -115,17 +114,8 @@ public class AjaxTextFieldPanel extends FieldPanel<String> implements Cloneable
     }
 
     protected Iterator<String> getChoices(final String input) {
-        final Pattern pattern = Pattern.compile(".*" + Pattern.quote(input) + ".*", Pattern.CASE_INSENSITIVE);
-
-        final List<String> result = new ArrayList<>();
-
-        for (String choice : choices) {
-            if (pattern.matcher(choice).matches()) {
-                result.add(choice);
-            }
-        }
-
-        return result.iterator();
+        Pattern pattern = Pattern.compile(".*" + Pattern.quote(input) + ".*", Pattern.CASE_INSENSITIVE);
+        return choices.stream().filter(choice -> pattern.matcher(choice).matches()).iterator();
     }
 
     @Override
index 2da1fa7..367591e 100644 (file)
@@ -41,7 +41,7 @@ public abstract class MultiFieldPanel<E extends Serializable> extends AbstractMu
 
     public static class Builder<E extends Serializable> implements Serializable {
 
-        private static final long serialVersionUID = 1L;
+        private static final long serialVersionUID = -5304396077613727937L;
 
         private final IModel<List<E>> model;
 
index 18170d7..5e96300 100644 (file)
@@ -365,7 +365,7 @@ public abstract class AbstractMappingPanel extends Panel {
         mappings.setReuseItems(true);
         mappingContainer.add(mappings);
 
-        addMappingBtn = new IndicatingAjaxButton("addMappingBtn", new ResourceModel("add")) {
+        addMappingBtn = new IndicatingAjaxButton("addMappingBtn") {
 
             private static final long serialVersionUID = -4804368561204623354L;
 
index 7f52dd1..9cca5ae 100644 (file)
@@ -37,7 +37,6 @@ import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.event.Broadcast;
 import org.apache.wicket.event.IEvent;
 import org.apache.wicket.event.IEventSource;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.list.ListItem;
 import org.apache.wicket.markup.html.list.ListView;
@@ -360,14 +359,8 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple
      * @param modal target modal.
      */
     protected void setWindowClosedReloadCallback(final BaseModal<?> modal) {
-        modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
-            private static final long serialVersionUID = 8804221891699487139L;
-
-            @Override
-            public void onClose(final AjaxRequestTarget target) {
-                modal.show(false);
-            }
+        modal.setWindowClosedCallback(target -> {
+            modal.show(false);
         });
     }
 
index ccb378e..f064402 100644 (file)
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.tabs.Accordion;
 import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.common.lib.EntityTOUtils;
@@ -64,13 +65,13 @@ public class DerAttrs extends AbstractAttrs<DerSchemaTO> {
 
             @Override
             public WebMarkupContainer getPanel(final String panelId) {
-                return new DerAttrs.DerSchemas(panelId, attrTOs);
+                return new DerAttrs.DerSchemas(panelId, schemas, attrTOs);
             }
         }), Model.of(0)).setOutputMarkupId(true));
 
         add(new ListView<MembershipTO>("membershipsDerSchemas", membershipTOs) {
 
-            private static final long serialVersionUID = 1L;
+            private static final long serialVersionUID = 6741044372185745296L;
 
             @Override
             protected void populateItem(final ListItem<MembershipTO> item) {
@@ -85,7 +86,10 @@ public class DerAttrs extends AbstractAttrs<DerSchemaTO> {
 
                     @Override
                     public WebMarkupContainer getPanel(final String panelId) {
-                        return new DerAttrs.DerSchemas(panelId, new ListModel<>(getAttrsFromTO(membershipTO)));
+                        return new DerAttrs.DerSchemas(
+                                panelId,
+                                membershipSchemas.get(membershipTO.getGroupKey()),
+                                new ListModel<>(getAttrsFromTO(membershipTO)));
                     }
                 }), Model.of(-1)).setOutputMarkupId(true));
             }
@@ -133,7 +137,7 @@ public class DerAttrs extends AbstractAttrs<DerSchemaTO> {
 
         Map<String, AttrTO> attrMap = EntityTOUtils.buildAttrMap(anyTO.getDerAttrs());
 
-        for (DerSchemaTO schema : membershipSchemas.get(membershipTO.getGroupKey()).values()) {
+        membershipSchemas.get(membershipTO.getGroupKey()).values().forEach(schema -> {
             AttrTO attrTO = new AttrTO();
             attrTO.setSchema(schema.getKey());
             if (attrMap.containsKey(schema.getKey())) {
@@ -141,7 +145,7 @@ public class DerAttrs extends AbstractAttrs<DerSchemaTO> {
             }
 
             attrs.add(attrTO);
-        }
+        });
 
         membershipTO.getDerAttrs().clear();
         membershipTO.getDerAttrs().addAll(attrs);
@@ -151,7 +155,10 @@ public class DerAttrs extends AbstractAttrs<DerSchemaTO> {
 
         private static final long serialVersionUID = -4730563859116024676L;
 
-        public DerSchemas(final String id, final IModel<List<AttrTO>> attrTOs) {
+        public DerSchemas(
+                final String id,
+                final Map<String, DerSchemaTO> schemas,
+                final IModel<List<AttrTO>> attrTOs) {
             super(id);
 
             add(new ListView<AttrTO>("schemas", attrTOs) {
@@ -176,7 +183,11 @@ public class DerAttrs extends AbstractAttrs<DerSchemaTO> {
                         model = new Model<>(values.get(0));
                     }
 
-                    AjaxTextFieldPanel panel = new AjaxTextFieldPanel("panel", attrTO.getSchema(), model, false);
+                    AjaxTextFieldPanel panel = new AjaxTextFieldPanel(
+                            "panel",
+                            schemas.get(attrTO.getSchema()).getLabel(SyncopeConsoleSession.get().getLocale()),
+                            model,
+                            false);
                     panel.setEnabled(false);
                     panel.setRequired(true);
                     panel.setOutputMarkupId(true);
index d25d0f0..3fcecf5 100644 (file)
@@ -25,6 +25,7 @@ import java.util.Map;
 import java.util.stream.Collectors;
 import org.apache.commons.collections4.ListUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.client.console.commons.SchemaUtils;
 import org.apache.syncope.client.console.wicket.ajax.markup.html.LabelInfo;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.tabs.Accordion;
@@ -166,7 +167,7 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
 
         Map<String, AttrTO> attrMap = EntityTOUtils.buildAttrMap(anyTO.getPlainAttrs());
 
-        schemas.values().stream().map(schema -> {
+        attrs.addAll(schemas.values().stream().map(schema -> {
             AttrTO attrTO = new AttrTO();
             attrTO.setSchema(schema.getKey());
             if (attrMap.get(schema.getKey()) == null || attrMap.get(schema.getKey()).getValues().isEmpty()) {
@@ -178,9 +179,7 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 attrTO = attrMap.get(schema.getKey());
             }
             return attrTO;
-        }).forEachOrdered(attrTO -> {
-            attrs.add(attrTO);
-        });
+        }).collect(Collectors.toList()));
 
         anyTO.getPlainAttrs().clear();
         anyTO.getPlainAttrs().addAll(attrs);
@@ -192,7 +191,7 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
 
         Map<String, AttrTO> attrMap = EntityTOUtils.buildAttrMap(membershipTO.getPlainAttrs());
 
-        membershipSchemas.get(membershipTO.getGroupKey()).values().stream().
+        attrs.addAll(membershipSchemas.get(membershipTO.getGroupKey()).values().stream().
                 map(schema -> {
                     AttrTO attrTO = new AttrTO();
                     attrTO.setSchema(schema.getKey());
@@ -205,9 +204,7 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                         attrTO.getValues().addAll(attrMap.get(schema.getKey()).getValues());
                     }
                     return attrTO;
-                }).forEachOrdered(attrTO -> {
-            attrs.add(attrTO);
-        });
+                }).collect(Collectors.toList()));
 
         membershipTO.getPlainAttrs().clear();
         membershipTO.getPlainAttrs().addAll(attrs);
@@ -236,19 +233,31 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
         FieldPanel panel;
         switch (type) {
             case Boolean:
-                panel = new AjaxCheckBoxPanel("panel", schemaTO.getKey(), new Model<>(), true);
+                panel = new AjaxCheckBoxPanel(
+                        "panel",
+                        schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()),
+                        new Model<>(),
+                        true);
                 panel.setRequired(required);
                 break;
 
             case Date:
-                String dataPattern = schemaTO.getConversionPattern() == null
+                String datePattern = schemaTO.getConversionPattern() == null
                         ? SyncopeConstants.DEFAULT_DATE_PATTERN
                         : schemaTO.getConversionPattern();
 
-                if (dataPattern.contains("H")) {
-                    panel = new AjaxDateTimeFieldPanel("panel", schemaTO.getKey(), new Model<>(), dataPattern);
+                if (datePattern.contains("H")) {
+                    panel = new AjaxDateTimeFieldPanel(
+                            "panel",
+                            schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()),
+                            new Model<>(),
+                            datePattern);
                 } else {
-                    panel = new AjaxDateFieldPanel("panel", schemaTO.getKey(), new Model<>(), dataPattern);
+                    panel = new AjaxDateFieldPanel(
+                            "panel",
+                            schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()),
+                            new Model<>(),
+                            datePattern);
                 }
 
                 if (required) {
@@ -258,7 +267,8 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 break;
 
             case Enum:
-                panel = new AjaxDropDownChoicePanel<>("panel", schemaTO.getKey(), new Model<>(), true);
+                panel = new AjaxDropDownChoicePanel<>("panel",
+                        schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), new Model<>(), true);
                 ((AjaxDropDownChoicePanel<String>) panel).setChoices(SchemaUtils.getEnumeratedValues(schemaTO));
 
                 if (StringUtils.isNotBlank(schemaTO.getEnumerationKeys())) {
@@ -292,8 +302,11 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 break;
 
             case Long:
-                panel = new AjaxSpinnerFieldPanel.Builder<Long>().enableOnChange().
-                        build("panel", schemaTO.getKey(), Long.class, new Model<Long>());
+                panel = new AjaxSpinnerFieldPanel.Builder<Long>().enableOnChange().build(
+                        "panel",
+                        schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()),
+                        Long.class,
+                        new Model<>());
 
                 if (required) {
                     panel.addRequiredLabel();
@@ -301,8 +314,11 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 break;
 
             case Double:
-                panel = new AjaxSpinnerFieldPanel.Builder<Double>().enableOnChange().step(0.1).
-                        build("panel", schemaTO.getKey(), Double.class, new Model<Double>());
+                panel = new AjaxSpinnerFieldPanel.Builder<Double>().enableOnChange().step(0.1).build(
+                        "panel",
+                        schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()),
+                        Double.class,
+                        new Model<>());
 
                 if (required) {
                     panel.addRequiredLabel();
@@ -310,15 +326,19 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 break;
 
             case Binary:
-                final PageReference pageReference = getPageReference();
-                panel = new BinaryFieldPanel("panel", schemaTO.getKey(), new Model<>(), schemaTO.getMimeType(),
+                final PageReference pageRef = getPageReference();
+                panel = new BinaryFieldPanel(
+                        "panel",
+                        schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()),
+                        new Model<>(),
+                        schemaTO.getMimeType(),
                         fileKey) {
 
                     private static final long serialVersionUID = -3268213909514986831L;
 
                     @Override
                     protected PageReference getPageReference() {
-                        return pageReference;
+                        return pageRef;
                     }
 
                 };
@@ -328,7 +348,8 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 break;
 
             case Encrypted:
-                panel = new EncryptedFieldPanel("panel", schemaTO.getKey(), new Model<>(), true);
+                panel = new EncryptedFieldPanel("panel",
+                        schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), new Model<>(), true);
 
                 if (required) {
                     panel.addRequiredLabel();
@@ -336,7 +357,8 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 break;
 
             default:
-                panel = new AjaxTextFieldPanel("panel", schemaTO.getKey(), new Model<>(), true);
+                panel = new AjaxTextFieldPanel("panel",
+                        schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), new Model<>(), true);
 
                 if (jexlHelp) {
                     AjaxTextFieldPanel.class.cast(panel).enableJexlHelp();
@@ -358,7 +380,7 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
 
         public PlainSchemas(
                 final String id,
-                final Map<String, PlainSchemaTO> availableSchemas,
+                final Map<String, PlainSchemaTO> schemas,
                 final IModel<List<AttrTO>> attrTOs) {
             super(id);
 
@@ -371,9 +393,9 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 protected void populateItem(final ListItem<AttrTO> item) {
                     AttrTO attrTO = item.getModelObject();
 
-                    AbstractFieldPanel<?> panel = getFieldPanel(availableSchemas.get(attrTO.getSchema()));
+                    AbstractFieldPanel<?> panel = getFieldPanel(schemas.get(attrTO.getSchema()));
                     if (mode == AjaxWizard.Mode.TEMPLATE
-                            || !availableSchemas.get(attrTO.getSchema()).isMultivalue()) {
+                            || !schemas.get(attrTO.getSchema()).isMultivalue()) {
                         FieldPanel.class.cast(panel).setNewModel(attrTO.getValues());
                     } else {
                         panel = new MultiFieldPanel.Builder<>(
@@ -382,7 +404,7 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                                 attrTO.getSchema(),
                                 FieldPanel.class.cast(panel));
                         // SYNCOPE-1215 the entire multifield panel must be readonly, not only its field
-                        ((MultiFieldPanel) panel).setReadOnly(availableSchemas.get(attrTO.getSchema()).isReadonly());
+                        ((MultiFieldPanel) panel).setReadOnly(schemas.get(attrTO.getSchema()).isReadonly());
                     }
                     item.add(panel);
 
index ebea4b7..7850fe9 100644 (file)
@@ -23,8 +23,8 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
-import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.client.console.wicket.ajax.markup.html.LabelInfo;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.tabs.Accordion;
 import org.apache.syncope.client.console.wicket.markup.html.form.AbstractFieldPanel;
@@ -76,7 +76,7 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
 
             @Override
             public WebMarkupContainer getPanel(final String panelId) {
-                return new VirAttrs.VirSchemas(panelId, attrTOs);
+                return new VirAttrs.VirSchemas(panelId, schemas, attrTOs);
             }
         }), Model.of(0)).setOutputMarkupId(true));
 
@@ -95,7 +95,10 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
 
                             @Override
                             public WebMarkupContainer getPanel(final String panelId) {
-                                return new VirAttrs.VirSchemas(panelId, new ListModel<>(getAttrsFromTO(membershipTO)));
+                                return new VirAttrs.VirSchemas(
+                                        panelId,
+                                        membershipSchemas.get(membershipTO.getGroupKey()),
+                                        new ListModel<>(getAttrsFromTO(membershipTO)));
                             }
                         }), Model.of(-1)).setOutputMarkupId(true));
             }
@@ -123,7 +126,7 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
 
         Map<String, AttrTO> attrMap = EntityTOUtils.buildAttrMap(anyTO.getVirAttrs());
 
-        schemas.values().stream().map(schema -> {
+        attrs.addAll(schemas.values().stream().map(schema -> {
             AttrTO attrTO = new AttrTO();
             attrTO.setSchema(schema.getKey());
             if (attrMap.containsKey(schema.getKey())) {
@@ -132,9 +135,7 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
                 attrTO.getValues().add(StringUtils.EMPTY);
             }
             return attrTO;
-        }).forEachOrdered(attrTO -> {
-            attrs.add(attrTO);
-        });
+        }).collect(Collectors.toList()));
 
         anyTO.getVirAttrs().clear();
         anyTO.getVirAttrs().addAll(attrs);
@@ -146,7 +147,7 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
 
         Map<String, AttrTO> attrMap = EntityTOUtils.buildAttrMap(anyTO.getVirAttrs());
 
-        membershipSchemas.get(membershipTO.getGroupKey()).values().stream().map(schema -> {
+        attrs.addAll(membershipSchemas.get(membershipTO.getGroupKey()).values().stream().map(schema -> {
             AttrTO attrTO = new AttrTO();
             attrTO.setSchema(schema.getKey());
             if (attrMap.containsKey(schema.getKey())) {
@@ -155,9 +156,7 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
                 attrTO.getValues().add(StringUtils.EMPTY);
             }
             return attrTO;
-        }).forEachOrdered(attrTO -> {
-            attrs.add(attrTO);
-        });
+        }).collect(Collectors.toList()));
 
         membershipTO.getVirAttrs().clear();
         membershipTO.getVirAttrs().addAll(attrs);
@@ -167,7 +166,10 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
 
         private static final long serialVersionUID = -4730563859116024676L;
 
-        public VirSchemas(final String id, final IModel<List<AttrTO>> attrTOs) {
+        public VirSchemas(
+                final String id,
+                final Map<String, VirSchemaTO> schemas,
+                final IModel<List<AttrTO>> attrTOs) {
             super(id);
 
             add(new ListView<AttrTO>("schemas", attrTOs) {
@@ -179,8 +181,11 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
                 protected void populateItem(final ListItem<AttrTO> item) {
                     AttrTO attrTO = item.getModelObject();
 
-                    AbstractFieldPanel<?> panel =
-                            new AjaxTextFieldPanel("panel", attrTO.getSchema(), new Model<>(), false);
+                    AbstractFieldPanel<?> panel = new AjaxTextFieldPanel(
+                            "panel",
+                            schemas.get(attrTO.getSchema()).getLabel(SyncopeConsoleSession.get().getLocale()),
+                            new Model<>(),
+                            false);
 
                     boolean readonly = attrTO.getSchemaInfo() == null
                             ? false
@@ -192,21 +197,21 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
                         panel = new MultiFieldPanel.Builder<>(
                                 new PropertyModel<List<String>>(attrTO, "values")).build(
                                 "panel",
-                                attrTO.getSchema(),
+                                schemas.get(attrTO.getSchema()).getLabel(SyncopeConsoleSession.get().getLocale()),
                                 AjaxTextFieldPanel.class.cast(panel));
                         panel.setEnabled(!readonly);
                     }
 
                     item.add(panel);
 
-                    if (CollectionUtils.isNotEmpty(attrTO.getValues())
+                    if (!attrTO.getValues().isEmpty()
                             && VirAttrs.this.modelObject instanceof UserWrapper
                             && UserWrapper.class.cast(VirAttrs.this.modelObject).getPreviousUserTO() != null) {
+
                         panel.showExternAction(new LabelInfo("externalAction", StringUtils.EMPTY));
                     }
                 }
-            }
-            );
+            });
         }
     }
 }
index 2e8e59f..f78b16f 100644 (file)
@@ -18,19 +18,13 @@ under the License.
 -->
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
   <wicket:panel>
-    <div style="margin: 5px;">
-      <form wicket:id="form">
-        <div id="formtable">
-          <div class="form-group">
-            <span wicket:id="key">[name]</span>
-          </div>
-          <div class="form-group">
-            <label for="expression"><wicket:message key="expression"/> *</label>
-            <input type="text" id="expression" class="form-control col-xs-4" wicket:id="expression"/>
-            <span id="popover" wicket:id="jexlInfo" class="glyphicon glyphicon-info-sign"></span>
-          </div>
-        </div>
-      </form>
+    <div class="form-group">
+      <span wicket:id="key">[name]</span>
+    </div>
+    <div class="form-group">
+      <label for="expression"><wicket:message key="expression"/> *</label>
+      <input type="text" id="expression" class="form-control col-xs-4" wicket:id="expression"/>
+      <span id="popover" wicket:id="jexlInfo" class="glyphicon glyphicon-info-sign"></span>
     </div>
   </wicket:panel>
 </html>
index d4fff44..ac334de 100644 (file)
@@ -18,62 +18,60 @@ under the License.
 -->
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
   <wicket:panel>
-    <form wicket:id="form">
-      <div class="form-group">
-        <span wicket:id="key">[name]</span>
-      </div>
-      <div class="form-group">
-        <span wicket:id="type">[type]</span>
-      </div>
+    <div class="form-group">
+      <span wicket:id="key">[name]</span>
+    </div>
+    <div class="form-group">
+      <span wicket:id="type">[type]</span>
+    </div>
 
-      <div class="form-group" wicket:id="conversionParams">
-        <span wicket:id="conversionPattern">[conversionPattern]</span>
-      </div>
+    <div class="form-group" wicket:id="conversionParams">
+      <span wicket:id="conversionPattern">[conversionPattern]</span>
+    </div>
 
-      <div class="form-group" wicket:id="typeParams">
-        <div wicket:id="enumParams">
-          <div class="form-group">
-            <span wicket:id="enumerationValues">[enumerationValues]</span>
-          </div>
-          <div class="form-group">
-            <span wicket:id="enumerationKeys">[enumerationKeys]</span>
-          </div>
+    <div class="form-group" wicket:id="typeParams">
+      <div wicket:id="enumParams">
+        <div class="form-group">
+          <span wicket:id="enumerationValues">[enumerationValues]</span>
+        </div>
+        <div class="form-group">
+          <span wicket:id="enumerationKeys">[enumerationKeys]</span>
+        </div>
+      </div>
+      <div wicket:id="encryptedParams">
+        <div class="form-group">
+          <span wicket:id="secretKey">[secretKey]</span>
         </div>
-        <div wicket:id="encryptedParams">
-          <div class="form-group">
-            <span wicket:id="secretKey">[secretKey]</span>
-          </div>
-          <div class="form-group">
-            <span wicket:id="cipherAlgorithm">[cipherAlgorithm]</span>
-          </div>
+        <div class="form-group">
+          <span wicket:id="cipherAlgorithm">[cipherAlgorithm]</span>
         </div>
-        <div wicket:id="binaryParams">
-          <div class="form-group">
-            <span wicket:id="mimeType">[mimeType]</span>
-          </div>
+      </div>
+      <div wicket:id="binaryParams">
+        <div class="form-group">
+          <span wicket:id="mimeType">[mimeType]</span>
         </div>
       </div>
+    </div>
 
+    <div class="form-group">
+      <span wicket:id="validator">[validator]</span>
+    </div>
+
+    <div class="form-group">
+      <label for="mandatoryCondition"><wicket:message key="mandatoryCondition"/></label>
+      <input type="text" id="mandatoryCondition" class="form-control col-xs-4" wicket:id="mandatoryCondition"/>
+      <span id="popover" wicket:id="jexlInfo" class="glyphicon glyphicon-info-sign"></span>
+    </div>
+    <div class="form-group">
       <div class="form-group">
-        <span wicket:id="validator">[validator]</span>
+        <span wicket:id="uniqueConstraint">[uniqueConstraint]</span>
       </div>
-
       <div class="form-group">
-        <label for="mandatoryCondition"><wicket:message key="mandatoryCondition"/></label>
-        <input type="text" id="mandatoryCondition" class="form-control col-xs-4" wicket:id="mandatoryCondition"/>
-        <span id="popover" wicket:id="jexlInfo" class="glyphicon glyphicon-info-sign"></span>
+        <span wicket:id="multivalue">[multivalue]</span>
       </div>
       <div class="form-group">
-        <div class="form-group">
-          <span wicket:id="uniqueConstraint">[uniqueConstraint]</span>
-        </div>
-        <div class="form-group">
-          <span wicket:id="multivalue">[multivalue]</span>
-        </div>
-        <div class="form-group">
-          <span wicket:id="readonly">[readonly]</span>
-        </div>
+        <span wicket:id="readonly">[readonly]</span>
       </div>
-    </form>
+    </div>
   </wicket:panel>
 </html>
@@ -17,12 +17,10 @@ specific language governing permissions and limitations
 under the License.
 -->
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
-  <wicket:extend>
+  <wicket:panel>
     <div class="form-group">
-      <form wicket:id="kindForm">
-        <span wicket:id="kind">[kind]</span>
-      </form>
+      <span wicket:id="kind">[kind]</span>
     </div>
     <div wicket:id="details">[details]</div>
-  </wicket:extend>
+  </wicket:panel>
 </html>
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels.html
new file mode 100644 (file)
index 0000000..b58d771
--- /dev/null
@@ -0,0 +1,53 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+  <wicket:panel>
+    <table class="table table-hover">
+      <tbody>
+        <tr>
+          <th>Locale</th>
+          <th>Display</th>
+        </tr>
+        <tr wicket:id="labels">
+          <td>
+            <span wicket:id="locale"/>
+          </td>
+          <td>
+            <span wicket:id="display"/>
+          </td>
+          <td>
+            <div id="inline-actions">
+              <span wicket:id="toRemove"/>
+            </div>
+          </td>
+        </tr>
+      </tbody>
+
+      <tfoot>
+        <tr>
+          <td colspan="3" style="padding: 5px; text-align: right">
+            <button type="submit" class="btn btn-primary btn-circle btn-lg" wicket:id="addLabel">
+              <i class="glyphicon glyphicon-plus"></i>
+            </button>
+          </td>
+        </tr>
+      </tfoot>
+    </table>
+  </wicket:panel>
+</html>
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels.properties
new file mode 100644 (file)
index 0000000..280cb4e
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+translations=Translations
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_it.properties
new file mode 100644 (file)
index 0000000..50804c0
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+translations=Traduzioni
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_ja.properties
new file mode 100644 (file)
index 0000000..280cb4e
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+translations=Translations
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_pt_BR.properties
new file mode 100644 (file)
index 0000000..280cb4e
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+translations=Translations
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemaTypeWizardBuilder$Labels_ru.properties
new file mode 100644 (file)
index 0000000..280cb4e
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+translations=Translations
index 86d2ed6..b5d83e8 100644 (file)
@@ -19,25 +19,21 @@ under the License.
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
   <wicket:panel>
     <div class="form-group">
-      <form wicket:id="form">
-        <div class="form-group">
-          <div class="form-group">
-            <span wicket:id="key">[name]</span>
-          </div>
-          <div class="form-group">
-            <span wicket:id="readonly">[readonly]</span>
-          </div>
-          <div class="form-group">
-            <span wicket:id="resource">[resource]</span>
-          </div>
-          <div class="form-group">
-            <span wicket:id="anyType">[anyType]</span>
-          </div>
-          <div class="form-group">
-            <span wicket:id="extAttrName">[extAttrName]</span>
-          </div>
-        </div>
-      </form>
+      <div class="form-group">
+        <span wicket:id="key">[name]</span>
+      </div>
+      <div class="form-group">
+        <span wicket:id="readonly">[readonly]</span>
+      </div>
+      <div class="form-group">
+        <span wicket:id="resource">[resource]</span>
+      </div>
+      <div class="form-group">
+        <span wicket:id="anyType">[anyType]</span>
+      </div>
+      <div class="form-group">
+        <span wicket:id="extAttrName">[extAttrName]</span>
+      </div>
     </div>
   </wicket:panel>
 </html>
index 6df2828..3b9dbc9 100644 (file)
@@ -74,7 +74,7 @@ under the License.
             </td>
             <td>
               <div id="inline-actions">
-                <span  wicket:id="toRemove"/>
+                <span wicket:id="toRemove"/>
               </div>
             </td>
           </tr>
@@ -83,7 +83,9 @@ under the License.
         <tfoot>
           <tr>
             <td colspan="10" style="padding: 5px; text-align: right">
-              <input type="submit" class="btn btn-primary" wicket:id="addMappingBtn" />
+              <button type="submit" class="btn btn-primary btn-circle btn-lg" wicket:id="addMappingBtn">
+                <i class="glyphicon glyphicon-plus"></i>
+              </button>
             </td>
           </tr>
         </tfoot>
index 475f74b..93a4fea 100644 (file)
@@ -57,7 +57,6 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$translate
      * i18n provider
      */
     $translatePartialLoaderProvider.addPart('static');
-    $translatePartialLoaderProvider.addPart('dynamic');
     $translateProvider.useLoader('$translatePartialLoader', {
       urlTemplate: 'languages/{lang}/{part}.json'
     }).preferredLanguage('en');
@@ -86,7 +85,7 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$translate
               }
             })
             /* </Extensions> */
-            
+
             /* <Extensions> */
             .state('self-oidcclient', {
               url: '/self-oidcclient',
index 79869b0..e1ecabc 100644 (file)
@@ -29,7 +29,8 @@ angular.module('self')
             templateUrl: getTemplateUrl(),
             scope: {
               dynamicForm: "=form",
-              user: "="
+              user: "=",
+              language: "="
             },
             controller: function ($scope) {
 
index 7f39147..0dd1124 100644 (file)
@@ -28,7 +28,8 @@ angular.module('self')
             templateUrl: getTemplateUrl(),
             scope: {
               dynamicForm: "=form",
-              user: "="
+              user: "=",
+              language: "="
             },
             controller: function ($scope) {
 
index 7aeb3d4..300c73d 100644 (file)
@@ -29,7 +29,8 @@ angular.module('self')
             templateUrl: getTemplateUrl(),
             scope: {
               dynamicForm: "=form",
-              user: "="
+              user: "=",
+              language: "="
             },
             controller: function ($scope) {
 
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/languages/de/dynamic.json b/client/enduser/src/main/resources/META-INF/resources/app/languages/de/dynamic.json
deleted file mode 100644 (file)
index e4f50d3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-  "credentials": "Anmeldedaten",
-  "groups": "Gruppen",
-  "plainSchemas": "PlainSchemas",
-  "derivedSchemas": "DerivedSchemas",
-  "virtualSchemas": "VirtualSchemas",
-  "resources": "Ressourcen",
-  "finish": "Ende",
-  "fullname": "vollständiger Name",
-  "userId": "Benutzer-ID",
-  "loginDate": "Login-Datum",
-  "firstname": "Vorname",
-  "surname": "Familien- oder Nachname",
-  "ctype": "ctype",
-  "email": "email",
-  "activationDate": "Aktivierungsdatum ",
-  "uselessReadonly": "unnötig, nur zum lesen",
-  "cool": "cool",
-  "gender": "Geschlecht",
-  "aLong": "aLong",
-  "makeItDouble": "verdoppeln",
-  "obscure": "undeutlich",
-  "photo": "Foto",
-  "GROUPS": "Gruppen",
-  "AUXILIARY CLASSES": "Hilfsklassen"
-}
\ No newline at end of file
index 4ba2f16..9b0c4c2 100644 (file)
   "ITALIAN": "Italienisch",
   "GERMAN": "Deutsch",
   "JAPANESE": "Japanisch",
-  "GROUPS": "Gruppen",
+  "groups": "Gruppen",
   "GROUPS_PLACEHOLDER": "Klicken sie auf Gruppen um auszuwählen...",
   "AUXILIARY CLASSES": "Hilfsklassen",
   "AUXILIARY_CLASSES_PLACEHOLDER": "Klicken sie auf Hilfsklasse um auszuwählen",
-  "CREDENZIALI": "Anmeldedaten",
-  "PLAINSCHEMAS": "PlainSchemas",
-  "DERIVEDSCHEMAS": "DerivedSchemas",
-  "VIRTUALSCHEMAS": "VirtualSchemas",
-  "RESOURCES": "Ressourcen",
+  "credentials": "Anmeldedaten",
+  "plainSchemas": "PlainSchemas",
+  "derivedSchemas": "DerivedSchemas",
+  "virtualSchemas": "VirtualSchemas",
+  "resources": "Ressourcen",
+  "finish": "Finish",
   "RESOURCES_PLACEHOLDER": "Wählen Sie ressourcen...",
   "REALM": "Realm",
   "NEWUSER": "Neuer Benutzer",
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/languages/en/dynamic.json b/client/enduser/src/main/resources/META-INF/resources/app/languages/en/dynamic.json
deleted file mode 100644 (file)
index 5583eb7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-  "credentials": "Details",
-  "groups": "Groups",
-  "plainSchemas": "PlainSchemas",
-  "derivedSchemas": "DerivedSchemas",
-  "virtualSchemas": "VirtualSchemas",
-  "resources": "Resources",
-  "finish": "Finish",
-  "fullname": "fullname",
-  "userId": "userId",
-  "loginDate": "loginDate",
-  "firstname": "firstname",
-  "surname": "surname",
-  "ctype": "ctype",
-  "email": "email",
-  "activationDate": "activationDate",
-  "uselessReadonly": "uselessReadonly",
-  "cool": "cool",
-  "gender": "gender",
-  "aLong": "aLong",
-  "makeItDouble": "makeItDouble",
-  "obscure": "obscure",
-  "photo": "photo"
-}
index 5d09f29..e580e26 100644 (file)
   "ITALIAN": "Italian",
   "GERMAN": "German",
   "JAPANESE": "Japanese",
-  "GROUPS": "Groups",
+  "groups": "Groups",
   "GROUPS_PLACEHOLDER": "Click to select groups...",
   "AUXILIARY CLASSES": "Auxiliary classes",
   "AUXILIARY_CLASSES_PLACEHOLDER": "Click to select auxclasses...",
-  "CREDENZIALI": "Details",
-  "PLAINSCHEMAS": "PlainSchemas",
-  "DERIVEDSCHEMAS": "DerivedSchemas",
-  "VIRTUALSCHEMAS": "VirtualSchemas",
-  "RESOURCES": "Resources",
+  "credentials": "Details",
+  "plainSchemas": "PlainSchemas",
+  "derivedSchemas": "DerivedSchemas",
+  "virtualSchemas": "VirtualSchemas",
+  "resources": "Resources",
+  "finish": "Finish",
   "RESOURCES_PLACEHOLDER": "Click to select resources...",
   "REALM": "Realm",
   "NEWUSER": "New User",
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/languages/it/dynamic.json b/client/enduser/src/main/resources/META-INF/resources/app/languages/it/dynamic.json
deleted file mode 100644 (file)
index 8ad757a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-  "credentials": "Dettagli",
-  "groups": "Gruppi",
-  "plainSchemas": "PlainSchemas",
-  "derivedSchemas": "DerivedSchemas",
-  "virtualSchemas": "VirtualSchemas",
-  "resources": "Risorse",
-  "finish": "Fine",
-  "fullname": "nome completo",
-  "userId": "Id utente",
-  "loginDate": "data di login",
-  "firstname": "nome",
-  "surname": "cognome",
-  "ctype": "ctype",
-  "email": "email",
-  "activationDate": "data di attivazione",
-  "uselessReadonly": "uselessReadonly",
-  "cool": "cool",
-  "gender": "genere",
-  "aLong": "aLong",
-  "makeItDouble": "makeItDouble",
-  "obscure": "obscure",
-  "photo": "foto"
-}
index 25c3713..55b16f5 100644 (file)
   "ITALIAN": "Italiano",
   "GERMAN": "Tedesco",
   "JAPANESE": "Giapponese",
-  "GROUPS": "Gruppi",
+  "groups": "Gruppi",
   "GROUPS_PLACEHOLDER": "Clicca per selezionare i gruppi...",
-  "AUXILIARY CLASSES": "Classi Ausiliari",
+  "AUXILIARY CLASSES": "Classi Ausiliarie",
   "AUXILIARY_CLASSES_PLACEHOLDER": "Clicca per selezionare le classi ausiliarie...",
-  "CREDENZIALI": "Dettagli",
-  "PLAINSCHEMAS": "PlainSchemas",
-  "DERIVEDSCHEMAS": "DerivedSchemas",
-  "VIRTUALSCHEMAS": "VirtualSchemas",
-  "RESOURCES": "Risorse",
+  "credentials": "Dettagli",
+  "plainSchemas": "PlainSchemas",
+  "derivedSchemas": "DerivedSchemas",
+  "virtualSchemas": "VirtualSchemas",
+  "resources": "Risorse",
+  "finish": "Fine",
   "RESOURCES_PLACEHOLDER": "Clicca per selezionare risorse...",
   "NEWUSER": "Nuovo utente",
   "REALM": "Realm",
@@ -54,4 +55,4 @@
   "GOBACKHOME": "Clicca su questo link per tornare alla home page",
   "CONFIRM_REMOVE": "Questa azione rimuoverà il valore corrente. Continuare?",
   "own": "Propri"
-}
\ No newline at end of file
+}
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/languages/ja/dynamic.json b/client/enduser/src/main/resources/META-INF/resources/app/languages/ja/dynamic.json
deleted file mode 100644 (file)
index 1c7e984..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-  "credentials": "詳細",
-  "groups": "グループ",
-  "plainSchemas": "プレーンスキーマ",
-  "derivedSchemas": "派生スキーマ",
-  "virtualSchemas": "仮想スキーマ",
-  "resources": "リソース",
-  "finish": "完了",
-  "fullname": "氏名",
-  "userId": "ユーザーId",
-  "loginDate": "ログイン日",
-  "firstname": "名",
-  "surname": "姓",
-  "ctype": "ctype",
-  "email": "メール",
-  "activationDate": "アクティベーション日",
-  "uselessReadonly": "不要読み取り専用",
-  "cool": "クール",
-  "gender": "性別",
-  "aLong": "一緒",
-  "makeItDouble": "倍にする",
-  "obscure": "不明",
-  "photo": "写真"
-}
index 3a665bb..046b29d 100644 (file)
   "ITALIAN": "イタリア語",
   "GERMAN": "ドイツ語",
   "JAPANESE": "日本語",
-  "GROUPS": "グループ",
+  "groups": "グループ",
   "GROUPS_PLACEHOLDER": "クリックしてグループを選択...",
   "AUXILIARY CLASSES": "補助クラス",
   "AUXILIARY_CLASSES_PLACEHOLDER": "クリックして補助クラスを選択...",
-  "CREDENZIALI": "詳細",
-  "PLAINSCHEMAS": "プレーンスキーマ",
-  "DERIVEDSCHEMAS": "派生スキーマ",
-  "VIRTUALSCHEMAS": "仮想スキーマ",
-  "RESOURCES": "リソース",
+  "credentials": "詳細",
+  "plainSchemas": "プレーンスキーマ",
+  "derivedSchemas": "派生スキーマ",
+  "virtualSchemas": "仮想スキーマ",
+  "resources": "リソース",
+  "finish": "Finish",
   "RESOURCES_PLACEHOLDER": "クリックしてリソースを選択...",
   "REALM": "レルム",
   "NEWUSER": "新しいユーザー",
index c64fcbb..fed3678 100644 (file)
@@ -22,10 +22,10 @@ under the License.
          ng-init="status = {isOpen: (groupSchema == 'own')}" is-open="status.isOpen"
          class="breadcrumb-header">
       <div id="attribute" class="form-group" ng-repeat="derSchema in getByGroup(groupSchema) track by $index">
-        <label for="derSchema.key">{{derSchema.simpleKey| translate}} <span ng-if="derSchema.mandatoryCondition === 'true'">*</span></label>
+        <label for="derSchema.key">{{derSchema.labels[language] || derSchema.simpleKey}} <span ng-if="derSchema.mandatoryCondition === 'true'">*</span></label>
         <div ng-if="!derSchema.multivalue">
           <dynamic-derived-attribute schema="derSchema" user="user" index="0"></dynamic-derived-attribute>
-          <validation-message name="{{derSchema.key| translate}}"/>
+          <validation-message name="{{derSchema.simpleKey}}"/>
         </div>
         <div ng-if="derSchema.multivalue">
           <div ng-repeat="field in dynamicForm.attributeTable[derSchema.key].fields track by $index" 
index 9932f8b..4f220aa 100644 (file)
@@ -23,10 +23,10 @@ under the License.
          class="breadcrumb-header">
 
       <div id="attribute" class="form-group" ng-repeat="plainSchema in getByGroup(groupSchema) track by $index">
-        <label for="plainSchema.key">{{plainSchema.simpleKey| translate}} <span ng-if="plainSchema.mandatoryCondition === 'true'">*</span></label>
+        <label for="plainSchema.key">{{plainSchema.labels[language] || plainSchema.simpleKey}} <span ng-if="plainSchema.mandatoryCondition === 'true'">*</span></label>
         <div ng-if="!plainSchema.multivalue">
           <dynamic-plain-attribute schema="plainSchema" user="user" index="0"></dynamic-plain-attribute>
-          <validation-message name="{{plainSchema.key| translate}}"/>
+          <validation-message name="{{plainSchema.key}}"/>
         </div>
         
         <div ng-if="plainSchema.multivalue">
index 4dcca94..f4c9325 100644 (file)
@@ -22,10 +22,10 @@ under the License.
          ng-init="status = {isOpen: (groupSchema == 'own')}" is-open="status.isOpen"
          class="breadcrumb-header">
       <div id="attribute" class="form-group" ng-repeat="virSchema in getByGroup(groupSchema) track by $index">
-        <label for="virSchema.key">{{virSchema.simpleKey| translate}} <span ng-if="virSchema.mandatoryCondition === 'true'">*</span></label>
+        <label for="virSchema.key">{{virSchema.labels[language] || virSchema.simpleKey}} <span ng-if="virSchema.mandatoryCondition === 'true'">*</span></label>
         <div ng-if="!virSchema.multivalue">
           <dynamic-virtual-attribute schema="virSchema" user="user" index="0"></dynamic-virtual-attribute>
-          <validation-message name="{{virSchema.key| translate}}"/>
+          <validation-message name="{{virSchema.simpleKey}}"/>
         </div>
         <div ng-if="virSchema.multivalue">
           <div ng-repeat="field in dynamicForm.attributeTable[virSchema.key].fields track by $index" 
index 5836742..a788a2b 100644 (file)
@@ -17,7 +17,7 @@ specific language governing permissions and limitations
 under the License.
 -->
 <div>
-  <dynamic-derived-attributes user="user" form="dynamicForm"></dynamic-derived-attributes>
+  <dynamic-derived-attributes user="user" form="dynamicForm" language="languages.selectedLanguage.code"></dynamic-derived-attributes>
 </div>
 <div id="attribute" class="form-group row">
   <div class="pull-right">
index 70c3030..c95f4df 100644 (file)
@@ -25,7 +25,7 @@ under the License.
   </select>
 </div>
 <div id="attribute" class="form-group row upper-select">
-  <label>{{"GROUPS"|translate}}</label><br/>
+  <label>{{"groups"|translate}}</label><br/>
   <groups form="dynamicForm" user="user"></groups>
 </div>
 <div id="attribute" class="form-group row upper-select">
index b7d93eb..c7cae6d 100644 (file)
@@ -17,7 +17,7 @@ specific language governing permissions and limitations
 under the License.
 -->
 <div>
-  <dynamic-plain-attributes form="dynamicForm" user="user"></dynamic-plain-attributes>
+  <dynamic-plain-attributes form="dynamicForm" user="user" language="languages.selectedLanguage.code"></dynamic-plain-attributes>
 </div>
 <div id="attribute" class="form-group row">
   <div class="pull-right">
index 81e4e78..257a950 100644 (file)
@@ -17,7 +17,7 @@ specific language governing permissions and limitations
 under the License.
 -->
 <div>
-  <dynamic-virtual-attributes form="dynamicForm" user="user"></dynamic-virtual-attributes>
+  <dynamic-virtual-attributes form="dynamicForm" user="user" language="languages.selectedLanguage.code"></dynamic-virtual-attributes>
 </div>
 <div id="attribute" class="form-group row">
   <div class="pull-right">
index 136c8ce..f9b0a7f 100644 (file)
@@ -59,7 +59,7 @@ public abstract class AnyPatch extends AbstractBaseBean implements AttributableP
 
     private final Set<StringPatchItem> resources = new HashSet<>();
 
-    @Schema(name = "@class", required = true, readOnly = false)
+    @Schema(name = "@class", required = true)
     public abstract String getDiscriminator();
 
     public void setDiscriminator(final String discriminator) {
index 98b79d6..472d194 100644 (file)
@@ -58,7 +58,7 @@ public abstract class PolicyTO extends AbstractBaseBean implements EntityTO {
 
     private final List<String> usedByRealms = new ArrayList<>();
 
-    @Schema(name = "@class", required = true, readOnly = false)
+    @Schema(name = "@class", required = true)
     public abstract String getDiscriminator();
 
     public void setDiscriminator(final String discriminator) {
index 928e877..727092f 100644 (file)
@@ -67,7 +67,7 @@ public abstract class AnyTO extends AbstractAnnotatedBean implements EntityTO, A
 
     private final Set<String> resources = new HashSet<>();
 
-    @Schema(name = "@class", required = true, readOnly = false)
+    @Schema(name = "@class", required = true)
     public abstract String getDiscriminator();
 
     public void setDiscriminator(final String discriminator) {
index 99b5768..4659a65 100644 (file)
  */
 package org.apache.syncope.common.lib.to;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
 import io.swagger.v3.oas.annotations.media.Schema;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
 import javax.ws.rs.PathParam;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
 
 @XmlRootElement(name = "schema")
 @XmlType
@@ -47,7 +53,10 @@ public abstract class SchemaTO extends AbstractBaseBean implements EntityTO {
 
     private String anyTypeClass;
 
-    @Schema(name = "@class", required = true, readOnly = false)
+    @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+    private final Map<Locale, String> labels = new HashMap<>();
+
+    @Schema(name = "@class", required = true)
     public abstract String getDiscriminator();
 
     public void setDiscriminator(final String discriminator) {
@@ -73,4 +82,13 @@ public abstract class SchemaTO extends AbstractBaseBean implements EntityTO {
         this.anyTypeClass = anyTypeClass;
     }
 
+    @JsonIgnore
+    public String getLabel(final Locale locale) {
+        return labels.getOrDefault(locale, key);
+    }
+
+    @JsonProperty
+    public Map<Locale, String> getLabels() {
+        return labels;
+    }
 }
index d3f9820..5c73c5c 100644 (file)
@@ -54,7 +54,7 @@ public abstract class TaskTO extends AbstractStartEndBean implements EntityTO {
 
     private final List<ExecTO> executions = new ArrayList<>();
 
-    @Schema(name = "@class", required = true, readOnly = false)
+    @Schema(name = "@class", required = true)
     public abstract String getDiscriminator();
 
     public void setDiscriminator(final String discriminator) {
index 34b7d08..932d136 100644 (file)
@@ -107,18 +107,18 @@ public class SchemaLogic extends AbstractTransactionalLogic<SchemaTO> {
         switch (schemaType) {
             case VIRTUAL:
                 VirSchema virSchema = virSchemaDAO.save(binder.create((VirSchemaTO) schemaTO));
-                created = (T) binder.getVirSchemaTO(virSchema);
+                created = (T) binder.getVirSchemaTO(virSchema.getKey());
                 break;
 
             case DERIVED:
                 DerSchema derSchema = derSchemaDAO.save(binder.create((DerSchemaTO) schemaTO));
-                created = (T) binder.getDerSchemaTO(derSchema);
+                created = (T) binder.getDerSchemaTO(derSchema.getKey());
                 break;
 
             case PLAIN:
             default:
                 PlainSchema plainSchema = plainSchemaDAO.save(binder.create((PlainSchemaTO) schemaTO));
-                created = (T) binder.getPlainSchemaTO(plainSchema);
+                created = (T) binder.getPlainSchemaTO(plainSchema.getKey());
         }
         return created;
     }
@@ -172,7 +172,7 @@ public class SchemaLogic extends AbstractTransactionalLogic<SchemaTO> {
                                 ? virSchemaDAO.findAll()
                                 : virSchemaDAO.findByKeyword(keyword)
                         : virSchemaDAO.findByAnyTypeClasses(classes)).stream().
-                        map(schema -> (T) binder.getVirSchemaTO(schema)).collect(Collectors.toList());
+                        map(schema -> (T) binder.getVirSchemaTO(schema.getKey())).collect(Collectors.toList());
                 break;
 
             case DERIVED:
@@ -181,7 +181,7 @@ public class SchemaLogic extends AbstractTransactionalLogic<SchemaTO> {
                                 ? derSchemaDAO.findAll()
                                 : derSchemaDAO.findByKeyword(keyword)
                         : derSchemaDAO.findByAnyTypeClasses(classes)).stream().
-                        map(schema -> (T) binder.getDerSchemaTO(schema)).collect(Collectors.toList());
+                        map(schema -> (T) binder.getDerSchemaTO(schema.getKey())).collect(Collectors.toList());
                 break;
 
             case PLAIN:
@@ -191,7 +191,7 @@ public class SchemaLogic extends AbstractTransactionalLogic<SchemaTO> {
                                 ? plainSchemaDAO.findAll()
                                 : plainSchemaDAO.findByKeyword(keyword)
                         : plainSchemaDAO.findByAnyTypeClasses(classes)).stream().
-                        map(schema -> (T) binder.getPlainSchemaTO(schema)).collect(Collectors.toList());
+                        map(schema -> (T) binder.getPlainSchemaTO(schema.getKey())).collect(Collectors.toList());
         }
 
         return result;
@@ -203,31 +203,16 @@ public class SchemaLogic extends AbstractTransactionalLogic<SchemaTO> {
         T read;
         switch (schemaType) {
             case VIRTUAL:
-                VirSchema virSchema = virSchemaDAO.find(schemaKey);
-                if (virSchema == null) {
-                    throw new NotFoundException("Virtual Schema '" + schemaKey + "'");
-                }
-
-                read = (T) binder.getVirSchemaTO(virSchema);
+                read = (T) binder.getVirSchemaTO(schemaKey);
                 break;
 
             case DERIVED:
-                DerSchema derSchema = derSchemaDAO.find(schemaKey);
-                if (derSchema == null) {
-                    throw new NotFoundException("Derived schema '" + schemaKey + "'");
-                }
-
-                read = (T) binder.getDerSchemaTO(derSchema);
+                read = (T) binder.getDerSchemaTO(schemaKey);
                 break;
 
             case PLAIN:
             default:
-                PlainSchema schema = plainSchemaDAO.find(schemaKey);
-                if (schema == null) {
-                    throw new NotFoundException("Schema '" + schemaKey + "'");
-                }
-
-                read = (T) binder.getPlainSchemaTO(schema);
+                read = (T) binder.getPlainSchemaTO(schemaKey);
         }
 
         return read;
@@ -294,13 +279,13 @@ public class SchemaLogic extends AbstractTransactionalLogic<SchemaTO> {
                     if (derSchema == null) {
                         VirSchema virSchema = virSchemaDAO.find(key);
                         if (virSchema != null) {
-                            result = binder.getVirSchemaTO(virSchema);
+                            result = binder.getVirSchemaTO(key);
                         }
                     } else {
-                        result = binder.getDerSchemaTO(derSchema);
+                        result = binder.getDerSchemaTO(key);
                     }
                 } else {
-                    result = binder.getPlainSchemaTO(plainSchema);
+                    result = binder.getPlainSchemaTO(key);
                 }
 
                 return result;
index 544408f..ec80bae 100644 (file)
@@ -18,6 +18,9 @@
  */
 package org.apache.syncope.core.persistence.api.entity;
 
+import java.util.List;
+import java.util.Locale;
+import java.util.Optional;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
 
 public interface Schema extends ProvidedKeyEntity {
@@ -36,4 +39,9 @@ public interface Schema extends ProvidedKeyEntity {
 
     boolean isUniqueConstraint();
 
+    boolean add(SchemaLabel label);
+
+    Optional<? extends SchemaLabel> getLabel(Locale locale);
+
+    List<? extends SchemaLabel> getLabels();
 }
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/SchemaLabel.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/SchemaLabel.java
new file mode 100644 (file)
index 0000000..1ba2f7c
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * 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.apache.syncope.core.persistence.api.entity;
+
+import java.util.Locale;
+
+public interface SchemaLabel extends Entity {
+
+    Schema getSchema();
+
+    void setSchema(Schema schema);
+
+    Locale getLocale();
+
+    void setLocale(Locale locale);
+
+    String getDisplay();
+
+    void setDisplay(String display);
+}
index a59b33a..180c395 100644 (file)
@@ -58,7 +58,6 @@ import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
 import org.apache.syncope.core.persistence.api.entity.group.Group;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.persistence.jpa.entity.AbstractPlainAttrValue;
 import org.apache.syncope.core.persistence.jpa.entity.user.JPAUser;
 import org.apache.syncope.core.spring.ApplicationContextProvider;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -228,9 +227,7 @@ public abstract class AbstractAnyDAO<A extends Any<?>> extends AbstractDAO<A> im
         Query query = findByPlainAttrValueQuery(entityName, ignoreCaseMatch);
         query.setParameter("schemaKey", schemaKey);
         query.setParameter("stringValue", attrValue.getStringValue());
-        query.setParameter("booleanValue", attrValue.getBooleanValue() == null
-                ? null
-                : ((AbstractPlainAttrValue) attrValue).getBooleanAsInteger(attrValue.getBooleanValue()));
+        query.setParameter("booleanValue", attrValue.getBooleanValue());
         if (attrValue.getDateValue() == null) {
             query.setParameter("dateValue", null);
         } else {
index d0a1ade..1d01d75 100644 (file)
@@ -45,9 +45,9 @@ public class JPADerSchemaDAO extends AbstractDAO<DerSchema> implements DerSchema
         StringBuilder queryString = new StringBuilder("SELECT e FROM ").
                 append(JPADerSchema.class.getSimpleName()).
                 append(" e WHERE ");
-        for (AnyTypeClass anyTypeClass : anyTypeClasses) {
+        anyTypeClasses.forEach(anyTypeClass -> {
             queryString.append("e.anyTypeClass.id='").append(anyTypeClass.getKey()).append("' OR ");
-        }
+        });
 
         TypedQuery<DerSchema> query = entityManager().createQuery(
                 queryString.substring(0, queryString.length() - 4), DerSchema.class);
@@ -83,6 +83,8 @@ public class JPADerSchemaDAO extends AbstractDAO<DerSchema> implements DerSchema
             return;
         }
 
+        schema.getLabels().forEach(label -> label.setSchema(null));
+
         resourceDAO.deleteMapping(key);
 
         if (schema.getAnyTypeClass() != null) {
index b431b1f..458cf41 100644 (file)
@@ -64,9 +64,9 @@ public class JPAPlainSchemaDAO extends AbstractDAO<PlainSchema> implements Plain
         StringBuilder queryString = new StringBuilder("SELECT e FROM ").
                 append(JPAPlainSchema.class.getSimpleName()).
                 append(" e WHERE ");
-        for (AnyTypeClass anyTypeClass : anyTypeClasses) {
+        anyTypeClasses.forEach(anyTypeClass -> {
             queryString.append("e.anyTypeClass.id='").append(anyTypeClass.getKey()).append("' OR ");
-        }
+        });
 
         TypedQuery<PlainSchema> query = entityManager().createQuery(
                 queryString.substring(0, queryString.length() - 4), PlainSchema.class);
@@ -122,13 +122,15 @@ public class JPAPlainSchemaDAO extends AbstractDAO<PlainSchema> implements Plain
             return;
         }
 
+        schema.getLabels().forEach(label -> label.setSchema(null));
+
         AnyUtilsFactory anyUtilsFactory = new JPAAnyUtilsFactory();
         for (AnyTypeKind anyTypeKind : AnyTypeKind.values()) {
             AnyUtils anyUtils = anyUtilsFactory.getInstance(anyTypeKind);
 
-            for (PlainAttr<?> attr : findAttrs(schema, anyUtils.plainAttrClass())) {
+            findAttrs(schema, anyUtils.plainAttrClass()).forEach(attr -> {
                 plainAttrDAO.delete(attr.getKey(), anyUtils.plainAttrClass());
-            }
+            });
 
             resourceDAO().deleteMapping(key);
         }
index fc9dbb0..72a2e30 100644 (file)
@@ -191,7 +191,7 @@ public class JPATaskDAO extends AbstractDAO<Task> implements TaskDAO {
         StringBuilder queryString = buildFindAllQueryJPA(type).append("AND ");
 
         if (type == TaskType.NOTIFICATION) {
-            queryString.append("t.executed = 0 ");
+            queryString.append("t.executed = false ");
         } else {
             queryString.append("t.executions IS EMPTY ");
         }
index 8a669d4..65702a4 100644 (file)
@@ -65,9 +65,9 @@ public class JPAVirSchemaDAO extends AbstractDAO<VirSchema> implements VirSchema
         StringBuilder queryString = new StringBuilder("SELECT e FROM ").
                 append(JPAVirSchema.class.getSimpleName()).
                 append(" e WHERE ");
-        for (AnyTypeClass anyTypeClass : anyTypeClasses) {
+        anyTypeClasses.forEach(anyTypeClass -> {
             queryString.append("e.anyTypeClass.id='").append(anyTypeClass.getKey()).append("' OR ");
-        }
+        });
 
         TypedQuery<VirSchema> query = entityManager().createQuery(
                 queryString.substring(0, queryString.length() - 4), VirSchema.class);
@@ -135,6 +135,8 @@ public class JPAVirSchemaDAO extends AbstractDAO<VirSchema> implements VirSchema
             return;
         }
 
+        schema.getLabels().forEach(label -> label.setSchema(null));
+
         resourceDAO().deleteMapping(key);
 
         if (schema.getAnyTypeClass() != null) {
index edc21db..7c9fdf7 100644 (file)
@@ -50,24 +50,6 @@ public abstract class AbstractEntity implements Entity {
     }
 
     /**
-     * @param property the integer representing a boolean value
-     * @return the boolean value corresponding to the property param
-     */
-    public final boolean isBooleanAsInteger(final Integer property) {
-        return property != null && property == 1;
-    }
-
-    /**
-     * @param value the boolean value to be represented as integer
-     * @return the integer corresponding to the property param
-     */
-    public final Integer getBooleanAsInteger(final Boolean value) {
-        return Boolean.TRUE.equals(value)
-                ? 1
-                : 0;
-    }
-
-    /**
      * @return fields to be excluded when computing equals() or hashcode()
      */
     private String[] getExcludeFields() {
index f259eb6..b8566a7 100644 (file)
@@ -20,13 +20,10 @@ package org.apache.syncope.core.persistence.jpa.entity;
 
 import java.util.Base64;
 import java.util.Date;
-import javax.persistence.Basic;
 import javax.persistence.Lob;
 import javax.persistence.MappedSuperclass;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
@@ -50,10 +47,7 @@ public abstract class AbstractPlainAttrValue extends AbstractGeneratedKeyEntity
     @Temporal(TemporalType.TIMESTAMP)
     private Date dateValue;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer booleanValue;
+    private Boolean booleanValue;
 
     private Long longValue;
 
@@ -64,16 +58,12 @@ public abstract class AbstractPlainAttrValue extends AbstractGeneratedKeyEntity
 
     @Override
     public Boolean getBooleanValue() {
-        return booleanValue == null
-                ? null
-                : isBooleanAsInteger(booleanValue);
+        return booleanValue;
     }
 
     @Override
     public void setBooleanValue(final Boolean booleanValue) {
-        this.booleanValue = booleanValue == null
-                ? null
-                : getBooleanAsInteger(booleanValue);
+        this.booleanValue = booleanValue;
     }
 
     @Override
index 81c972b..6b66e51 100644 (file)
  */
 package org.apache.syncope.core.persistence.jpa.entity;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Optional;
 import javax.persistence.Cacheable;
+import javax.persistence.CascadeType;
 import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.Inheritance;
 import javax.persistence.InheritanceType;
+import javax.persistence.OneToMany;
 import javax.persistence.Table;
 import org.apache.syncope.core.persistence.api.entity.Schema;
+import org.apache.syncope.core.persistence.api.entity.SchemaLabel;
 import org.apache.syncope.core.persistence.jpa.validation.entity.SchemaKeyCheck;
 
 @Entity
@@ -37,4 +45,22 @@ public abstract class AbstractSchema extends AbstractProvidedKeyEntity implement
 
     private static final long serialVersionUID = -9222344997225831269L;
 
+    @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY, mappedBy = "schema")
+    private List<JPASchemaLabel> labels = new ArrayList<>();
+
+    @Override
+    public boolean add(final SchemaLabel label) {
+        checkType(label, JPASchemaLabel.class);
+        return this.labels.add((JPASchemaLabel) label);
+    }
+
+    @Override
+    public Optional<? extends SchemaLabel> getLabel(final Locale locale) {
+        return labels.stream().filter(label -> label.getLocale().equals(locale)).findFirst();
+    }
+
+    @Override
+    public List<? extends SchemaLabel> getLabels() {
+        return labels;
+    }
 }
index 0ec1538..0f60dd7 100644 (file)
@@ -131,6 +131,7 @@ import org.apache.syncope.core.persistence.api.entity.DynRealmMembership;
 import org.apache.syncope.core.persistence.api.entity.Implementation;
 import org.apache.syncope.core.persistence.api.entity.Privilege;
 import org.apache.syncope.core.persistence.api.entity.Remediation;
+import org.apache.syncope.core.persistence.api.entity.SchemaLabel;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResourceHistoryConf;
 import org.apache.syncope.core.persistence.api.entity.resource.OrgUnitItem;
 import org.apache.syncope.core.persistence.jpa.entity.policy.JPAPullCorrelationRuleEntity;
@@ -218,6 +219,8 @@ public class JPAEntityFactory implements EntityFactory {
             result = (E) new JPAConnInstance();
         } else if (reference.equals(ConnInstanceHistoryConf.class)) {
             result = (E) new JPAConnInstanceHistoryConf();
+        } else if (reference.equals(SchemaLabel.class)) {
+            result = (E) new JPASchemaLabel();
         } else if (reference.equals(PlainSchema.class)) {
             result = (E) new JPAPlainSchema();
         } else if (reference.equals(APlainAttr.class)) {
index aec4e9b..5543ef8 100644 (file)
@@ -21,7 +21,6 @@ package org.apache.syncope.core.persistence.jpa.entity;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
-import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.CollectionTable;
 import javax.persistence.Column;
@@ -34,8 +33,6 @@ import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.persistence.Table;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.ImplementationType;
 import org.apache.syncope.common.lib.types.TraceLevel;
@@ -58,10 +55,10 @@ public class JPANotification extends AbstractGeneratedKeyEntity implements Notif
     @CollectionTable(name = "Notification_events",
             joinColumns =
             @JoinColumn(name = "notification_id", referencedColumnName = "id"))
-    private List<String> events;
+    private List<String> events = new ArrayList<>();
 
     @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER, mappedBy = "notification")
-    private List<JPAAnyAbout> abouts;
+    private List<JPAAnyAbout> abouts = new ArrayList<>();
 
     private String recipientsFIQL;
 
@@ -70,7 +67,7 @@ public class JPANotification extends AbstractGeneratedKeyEntity implements Notif
             joinColumns =
             @JoinColumn(name = "notification_id", referencedColumnName = "id"))
     @Column(name = "staticRecipients")
-    private List<String> staticRecipients;
+    private List<String> staticRecipients = new ArrayList<>();
 
     @NotNull
     private String recipientAttrName;
@@ -79,10 +76,7 @@ public class JPANotification extends AbstractGeneratedKeyEntity implements Notif
     private JPAImplementation recipientsProvider;
 
     @NotNull
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer selfAsRecipient;
+    private Boolean selfAsRecipient = false;
 
     @NotNull
     private String sender;
@@ -96,22 +90,10 @@ public class JPANotification extends AbstractGeneratedKeyEntity implements Notif
 
     @NotNull
     @Enumerated(EnumType.STRING)
-    private TraceLevel traceLevel;
+    private TraceLevel traceLevel = TraceLevel.ALL;
 
     @NotNull
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer active;
-
-    public JPANotification() {
-        events = new ArrayList<>();
-        abouts = new ArrayList<>();
-        staticRecipients = new ArrayList<>();
-        selfAsRecipient = getBooleanAsInteger(false);
-        active = getBooleanAsInteger(true);
-        traceLevel = TraceLevel.ALL;
-    }
+    private Boolean active = true;
 
     @Override
     public String getRecipientsFIQL() {
@@ -173,12 +155,12 @@ public class JPANotification extends AbstractGeneratedKeyEntity implements Notif
 
     @Override
     public boolean isSelfAsRecipient() {
-        return isBooleanAsInteger(selfAsRecipient);
+        return selfAsRecipient;
     }
 
     @Override
     public void setSelfAsRecipient(final boolean selfAsRecipient) {
-        this.selfAsRecipient = getBooleanAsInteger(selfAsRecipient);
+        this.selfAsRecipient = selfAsRecipient;
     }
 
     @Override
@@ -225,11 +207,11 @@ public class JPANotification extends AbstractGeneratedKeyEntity implements Notif
 
     @Override
     public boolean isActive() {
-        return isBooleanAsInteger(active);
+        return active;
     }
 
     @Override
     public void setActive(final boolean active) {
-        this.active = getBooleanAsInteger(active);
+        this.active = active;
     }
 }
index d4c7bb7..e26f5e9 100644 (file)
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.core.persistence.jpa.entity;
 
-import javax.persistence.Basic;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
@@ -29,8 +28,6 @@ import javax.persistence.OneToOne;
 import javax.persistence.PrimaryKeyJoinColumn;
 import javax.persistence.Table;
 import javax.persistence.Transient;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
@@ -58,25 +55,16 @@ public class JPAPlainSchema extends AbstractSchema implements PlainSchema {
 
     @NotNull
     @Enumerated(EnumType.STRING)
-    private AttrSchemaType type;
+    private AttrSchemaType type = AttrSchemaType.String;
 
     @NotNull
-    private String mandatoryCondition;
+    private String mandatoryCondition = Boolean.FALSE.toString();
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer multivalue;
+    private Boolean multivalue = false;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer uniqueConstraint;
+    private Boolean uniqueConstraint = false;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer readonly;
+    private Boolean readonly = false;
 
     @Column(nullable = true)
     private String conversionPattern;
@@ -105,16 +93,6 @@ public class JPAPlainSchema extends AbstractSchema implements PlainSchema {
     @Transient
     private Validator validatorImpl;
 
-    public JPAPlainSchema() {
-        super();
-
-        type = AttrSchemaType.String;
-        mandatoryCondition = Boolean.FALSE.toString();
-        multivalue = getBooleanAsInteger(false);
-        uniqueConstraint = getBooleanAsInteger(false);
-        readonly = getBooleanAsInteger(false);
-    }
-
     @Override
     public AnyTypeClass getAnyTypeClass() {
         return anyTypeClass;
@@ -148,32 +126,32 @@ public class JPAPlainSchema extends AbstractSchema implements PlainSchema {
 
     @Override
     public boolean isMultivalue() {
-        return isBooleanAsInteger(multivalue);
+        return multivalue;
     }
 
     @Override
     public void setMultivalue(final boolean multivalue) {
-        this.multivalue = getBooleanAsInteger(multivalue);
+        this.multivalue = multivalue;
     }
 
     @Override
     public boolean isUniqueConstraint() {
-        return isBooleanAsInteger(uniqueConstraint);
+        return uniqueConstraint;
     }
 
     @Override
     public void setUniqueConstraint(final boolean uniquevalue) {
-        this.uniqueConstraint = getBooleanAsInteger(uniquevalue);
+        this.uniqueConstraint = uniquevalue;
     }
 
     @Override
     public boolean isReadonly() {
-        return isBooleanAsInteger(readonly);
+        return readonly;
     }
 
     @Override
     public void setReadonly(final boolean readonly) {
-        this.readonly = getBooleanAsInteger(readonly);
+        this.readonly = readonly;
     }
 
     public Validator validator() {
index 29e7bf7..bed6e36 100644 (file)
@@ -20,7 +20,6 @@ package org.apache.syncope.core.persistence.jpa.entity;
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -31,8 +30,6 @@ import javax.persistence.ManyToMany;
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.persistence.Table;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.ImplementationType;
 import org.apache.syncope.core.persistence.api.entity.Implementation;
@@ -67,10 +64,7 @@ public class JPAReport extends AbstractGeneratedKeyEntity implements Report {
     private List<JPAReportExec> executions = new ArrayList<>();
 
     @NotNull
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer active;
+    private Boolean active = true;
 
     @ManyToOne(fetch = FetchType.EAGER, optional = false)
     @JoinColumn(name = "template_id")
@@ -121,12 +115,12 @@ public class JPAReport extends AbstractGeneratedKeyEntity implements Report {
 
     @Override
     public boolean isActive() {
-        return isBooleanAsInteger(active);
+        return active;
     }
 
     @Override
     public void setActive(final boolean active) {
-        this.active = getBooleanAsInteger(active);
+        this.active = active;
     }
 
     @Override
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASchemaLabel.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPASchemaLabel.java
new file mode 100644 (file)
index 0000000..53330b1
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * 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.apache.syncope.core.persistence.jpa.entity;
+
+import java.util.Locale;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+import org.apache.syncope.core.persistence.api.entity.Schema;
+import org.apache.syncope.core.persistence.api.entity.SchemaLabel;
+
+@Entity
+@Table(name = JPASchemaLabel.TABLE, uniqueConstraints =
+        @UniqueConstraint(columnNames = { "schema_id", "locale" }))
+public class JPASchemaLabel extends AbstractGeneratedKeyEntity implements SchemaLabel {
+
+    public static final String TABLE = "SchemaLabel";
+
+    private static final long serialVersionUID = -546019894866607764L;
+
+    @ManyToOne
+    private AbstractSchema schema;
+
+    @Column(nullable = false)
+    private Locale locale;
+
+    @Column(nullable = false)
+    private String display;
+
+    @Override
+    public AbstractSchema getSchema() {
+        return schema;
+    }
+
+    @Override
+    public void setSchema(final Schema schema) {
+        checkType(schema, AbstractSchema.class);
+        this.schema = (AbstractSchema) schema;
+    }
+
+    @Override
+    public Locale getLocale() {
+        return locale;
+    }
+
+    @Override
+    public void setLocale(final Locale locale) {
+        this.locale = locale;
+    }
+
+    @Override
+    public String getDisplay() {
+        return display;
+    }
+
+    @Override
+    public void setDisplay(final String display) {
+        this.display = display;
+    }
+}
index 1325ca7..2d79ea3 100644 (file)
  */
 package org.apache.syncope.core.persistence.jpa.entity;
 
-import javax.persistence.Basic;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToOne;
 import javax.persistence.PrimaryKeyJoinColumn;
 import javax.persistence.Table;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
 import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
@@ -48,10 +45,7 @@ public class JPAVirSchema extends AbstractSchema implements VirSchema {
     @OneToOne(fetch = FetchType.EAGER)
     private JPAAnyTypeClass anyTypeClass;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer readonly;
+    private Boolean readonly = false;
 
     @NotNull
     @ManyToOne
@@ -60,12 +54,6 @@ public class JPAVirSchema extends AbstractSchema implements VirSchema {
     @NotNull
     private String extAttrName;
 
-    public JPAVirSchema() {
-        super();
-
-        readonly = getBooleanAsInteger(false);
-    }
-
     @Override
     public AnyTypeClass getAnyTypeClass() {
         return anyTypeClass;
@@ -89,22 +77,22 @@ public class JPAVirSchema extends AbstractSchema implements VirSchema {
 
     @Override
     public boolean isMultivalue() {
-        return Boolean.TRUE;
+        return true;
     }
 
     @Override
     public boolean isUniqueConstraint() {
-        return Boolean.FALSE;
+        return false;
     }
 
     @Override
     public boolean isReadonly() {
-        return isBooleanAsInteger(readonly);
+        return readonly;
     }
 
     @Override
     public void setReadonly(final boolean readonly) {
-        this.readonly = getBooleanAsInteger(readonly);
+        this.readonly = readonly;
     }
 
     @Override
index aebad0b..24b1a2e 100644 (file)
@@ -22,15 +22,13 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import javax.persistence.Basic;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.JoinColumn;
 import javax.persistence.JoinTable;
 import javax.persistence.ManyToMany;
 import javax.persistence.Table;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.ImplementationType;
 import org.apache.syncope.core.persistence.api.entity.Implementation;
 import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
@@ -46,10 +44,8 @@ public class JPAAccountPolicy extends AbstractPolicy implements AccountPolicy {
 
     public static final String TABLE = "AccountPolicy";
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer propagateSuspension;
+    @NotNull
+    private Boolean propagateSuspension = false;
 
     private int maxAuthenticationAttempts;
 
@@ -73,12 +69,12 @@ public class JPAAccountPolicy extends AbstractPolicy implements AccountPolicy {
 
     @Override
     public boolean isPropagateSuspension() {
-        return isBooleanAsInteger(propagateSuspension);
+        return propagateSuspension;
     }
 
     @Override
     public void setPropagateSuspension(final boolean propagateSuspension) {
-        this.propagateSuspension = getBooleanAsInteger(propagateSuspension);
+        this.propagateSuspension = propagateSuspension;
     }
 
     @Override
index fddf5ed..c3de4e2 100644 (file)
@@ -20,15 +20,13 @@ package org.apache.syncope.core.persistence.jpa.entity.policy;
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Basic;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.JoinColumn;
 import javax.persistence.JoinTable;
 import javax.persistence.ManyToMany;
 import javax.persistence.Table;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.ImplementationType;
 import org.apache.syncope.core.persistence.api.entity.Implementation;
 import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
@@ -42,10 +40,8 @@ public class JPAPasswordPolicy extends AbstractPolicy implements PasswordPolicy
 
     public static final String TABLE = "PasswordPolicy";
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer allowNullPassword;
+    @NotNull
+    private Boolean allowNullPassword = false;
 
     private int historyLength;
 
@@ -59,12 +55,12 @@ public class JPAPasswordPolicy extends AbstractPolicy implements PasswordPolicy
 
     @Override
     public boolean isAllowNullPassword() {
-        return isBooleanAsInteger(allowNullPassword);
+        return allowNullPassword;
     }
 
     @Override
     public void setAllowNullPassword(final boolean allowNullPassword) {
-        this.allowNullPassword = getBooleanAsInteger(allowNullPassword);
+        this.allowNullPassword = allowNullPassword;
     }
 
     @Override
index 5bb91b9..f252dd3 100644 (file)
  */
 package org.apache.syncope.core.persistence.jpa.entity.resource;
 
-import javax.persistence.Basic;
 import javax.persistence.Column;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
 import javax.persistence.MappedSuperclass;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.MappingPurpose;
 import org.apache.syncope.core.persistence.api.entity.resource.Item;
@@ -48,25 +45,19 @@ public abstract class AbstractItem extends AbstractGeneratedKeyEntity implements
      * Specify if the mapped target resource's field is nullable.
      */
     @NotNull
-    private String mandatoryCondition;
+    private String mandatoryCondition = Boolean.FALSE.toString();
 
     /**
      * Specify if the mapped target resource's field is the id.
      */
     @NotNull
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer connObjectKey;
+    private Boolean connObjectKey = false;
 
     /**
      * Specify if the mapped target resource's field is the password.
      */
     @NotNull
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer password;
+    private Boolean password = false;
 
     @NotNull
     @Enumerated(EnumType.STRING)
@@ -84,15 +75,6 @@ public abstract class AbstractItem extends AbstractGeneratedKeyEntity implements
     @Column(name = "pullJEXL")
     private String pullJEXLTransformer;
 
-    public AbstractItem() {
-        super();
-
-        mandatoryCondition = Boolean.FALSE.toString();
-
-        connObjectKey = getBooleanAsInteger(false);
-        password = getBooleanAsInteger(false);
-    }
-
     @Override
     public String getExtAttrName() {
         return extAttrName;
@@ -125,22 +107,22 @@ public abstract class AbstractItem extends AbstractGeneratedKeyEntity implements
 
     @Override
     public boolean isConnObjectKey() {
-        return isBooleanAsInteger(connObjectKey);
+        return connObjectKey;
     }
 
     @Override
     public void setConnObjectKey(final boolean connObjectKey) {
-        this.connObjectKey = getBooleanAsInteger(connObjectKey);
+        this.connObjectKey = connObjectKey;
     }
 
     @Override
     public boolean isPassword() {
-        return isBooleanAsInteger(password);
+        return password;
     }
 
     @Override
     public void setPassword(final boolean password) {
-        this.password = getBooleanAsInteger(password);
+        this.password = password;
     }
 
     @Override
index b8e218f..10e406a 100644 (file)
@@ -25,7 +25,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
-import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.CollectionTable;
 import javax.persistence.Column;
@@ -42,8 +41,6 @@ import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
@@ -87,10 +84,7 @@ public class JPAExternalResource extends AbstractProvidedKeyEntity implements Ex
      * Should this resource enforce the mandatory constraints?
      */
     @NotNull
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer enforceMandatoryCondition;
+    private Boolean enforceMandatoryCondition = false;
 
     /**
      * The resource type is identified by the associated connector.
@@ -113,26 +107,31 @@ public class JPAExternalResource extends AbstractProvidedKeyEntity implements Ex
      * Generate random password, if not provided.
      */
     @NotNull
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer randomPwdIfNotProvided;
+    private Boolean randomPwdIfNotProvided = false;
 
     @Enumerated(EnumType.STRING)
     @NotNull
-    private TraceLevel createTraceLevel;
+    private TraceLevel createTraceLevel = TraceLevel.FAILURES;
+
+    ;
 
     @Enumerated(EnumType.STRING)
     @NotNull
-    private TraceLevel updateTraceLevel;
+    private TraceLevel updateTraceLevel = TraceLevel.FAILURES;
+
+    ;
 
     @Enumerated(EnumType.STRING)
     @NotNull
-    private TraceLevel deleteTraceLevel;
+    private TraceLevel deleteTraceLevel = TraceLevel.FAILURES;
+
+    ;
 
     @Enumerated(EnumType.STRING)
     @NotNull
-    private TraceLevel provisioningTraceLevel;
+    private TraceLevel provisioningTraceLevel = TraceLevel.FAILURES;
+
+    ;
 
     @ManyToOne(fetch = FetchType.EAGER)
     private JPAPasswordPolicy passwordPolicy;
@@ -153,10 +152,7 @@ public class JPAExternalResource extends AbstractProvidedKeyEntity implements Ex
     private String jsonConf;
 
     @NotNull
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer overrideCapabilities;
+    private Boolean overrideCapabilities = false;
 
     @ElementCollection(fetch = FetchType.EAGER)
     @Enumerated(EnumType.STRING)
@@ -174,27 +170,14 @@ public class JPAExternalResource extends AbstractProvidedKeyEntity implements Ex
             @JoinColumn(name = "implementation_id"))
     private List<JPAImplementation> propagationActions = new ArrayList<>();
 
-    public JPAExternalResource() {
-        super();
-
-        enforceMandatoryCondition = getBooleanAsInteger(false);
-        randomPwdIfNotProvided = getBooleanAsInteger(false);
-        overrideCapabilities = getBooleanAsInteger(false);
-
-        createTraceLevel = TraceLevel.FAILURES;
-        updateTraceLevel = TraceLevel.FAILURES;
-        deleteTraceLevel = TraceLevel.FAILURES;
-        provisioningTraceLevel = TraceLevel.FAILURES;
-    }
-
     @Override
     public boolean isEnforceMandatoryCondition() {
-        return isBooleanAsInteger(enforceMandatoryCondition);
+        return enforceMandatoryCondition;
     }
 
     @Override
     public void setEnforceMandatoryCondition(final boolean enforceMandatoryCondition) {
-        this.enforceMandatoryCondition = getBooleanAsInteger(enforceMandatoryCondition);
+        this.enforceMandatoryCondition = enforceMandatoryCondition;
     }
 
     @Override
@@ -260,12 +243,12 @@ public class JPAExternalResource extends AbstractProvidedKeyEntity implements Ex
 
     @Override
     public boolean isRandomPwdIfNotProvided() {
-        return isBooleanAsInteger(randomPwdIfNotProvided);
+        return randomPwdIfNotProvided;
     }
 
     @Override
     public void setRandomPwdIfNotProvided(final boolean randomPwdIfNotProvided) {
-        this.randomPwdIfNotProvided = getBooleanAsInteger(randomPwdIfNotProvided);
+        this.randomPwdIfNotProvided = randomPwdIfNotProvided;
     }
 
     @Override
@@ -370,12 +353,12 @@ public class JPAExternalResource extends AbstractProvidedKeyEntity implements Ex
 
     @Override
     public boolean isOverrideCapabilities() {
-        return isBooleanAsInteger(overrideCapabilities);
+        return overrideCapabilities;
     }
 
     @Override
     public void setOverrideCapabilities(final boolean overrideCapabilities) {
-        this.overrideCapabilities = getBooleanAsInteger(overrideCapabilities);
+        this.overrideCapabilities = overrideCapabilities;
     }
 
     @Override
@@ -395,5 +378,4 @@ public class JPAExternalResource extends AbstractProvidedKeyEntity implements Ex
     public List<? extends Implementation> getPropagationActions() {
         return propagationActions;
     }
-
 }
index 89939fb..aace97d 100644 (file)
@@ -21,7 +21,6 @@ package org.apache.syncope.core.persistence.jpa.entity.resource;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
-import javax.persistence.Basic;
 import javax.persistence.Cacheable;
 import javax.persistence.CascadeType;
 import javax.persistence.Entity;
@@ -30,8 +29,6 @@ import javax.persistence.Lob;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.api.entity.resource.OrgUnitItem;
@@ -59,10 +56,8 @@ public class JPAOrgUnit extends AbstractGeneratedKeyEntity implements OrgUnit {
     @Lob
     private String serializedSyncToken;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer ignoreCaseMatch;
+    @NotNull
+    private Boolean ignoreCaseMatch = false;
 
     @NotNull
     private String connObjectLink;
@@ -112,12 +107,12 @@ public class JPAOrgUnit extends AbstractGeneratedKeyEntity implements OrgUnit {
 
     @Override
     public boolean isIgnoreCaseMatch() {
-        return isBooleanAsInteger(ignoreCaseMatch);
+        return ignoreCaseMatch;
     }
 
     @Override
     public void setIgnoreCaseMatch(final boolean ignoreCaseMatch) {
-        this.ignoreCaseMatch = getBooleanAsInteger(ignoreCaseMatch);
+        this.ignoreCaseMatch = ignoreCaseMatch;
     }
 
     @Override
index 769ca9f..49b8cdd 100644 (file)
@@ -66,6 +66,11 @@ public class JPAOrgUnitItem extends AbstractItem implements OrgUnitItem {
     }
 
     @Override
+    public boolean isPassword() {
+        return false;
+    }
+
+    @Override
     public boolean add(final Implementation transformer) {
         checkType(transformer, JPAImplementation.class);
         checkImplementationType(transformer, ImplementationType.ITEM_TRANSFORMER);
index e5fc935..df194b4 100644 (file)
@@ -32,8 +32,6 @@ import javax.persistence.ManyToOne;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import javax.persistence.UniqueConstraint;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.core.provisioning.api.serialization.POJOHelper;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
@@ -78,9 +76,7 @@ public class JPAProvision extends AbstractGeneratedKeyEntity implements Provisio
     private String serializedSyncToken;
 
     @Basic
-    @Min(0)
-    @Max(1)
-    private Integer ignoreCaseMatch;
+    private Boolean ignoreCaseMatch = false;
 
     @ManyToOne
     private JPAPlainSchema uidOnCreate;
@@ -152,12 +148,12 @@ public class JPAProvision extends AbstractGeneratedKeyEntity implements Provisio
 
     @Override
     public boolean isIgnoreCaseMatch() {
-        return isBooleanAsInteger(ignoreCaseMatch);
+        return ignoreCaseMatch;
     }
 
     @Override
     public void setIgnoreCaseMatch(final boolean ignoreCaseMatch) {
-        this.ignoreCaseMatch = getBooleanAsInteger(ignoreCaseMatch);
+        this.ignoreCaseMatch = ignoreCaseMatch;
     }
 
     @Override
index dc35f9d..3b30375 100644 (file)
  */
 package org.apache.syncope.core.persistence.jpa.entity.task;
 
-import javax.persistence.Basic;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
 import javax.persistence.ManyToOne;
 import javax.persistence.MappedSuperclass;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.MatchingRule;
 import org.apache.syncope.common.lib.types.UnmatchingRule;
@@ -45,25 +42,17 @@ public abstract class AbstractProvisioningTask extends JPASchedTask implements P
     @ManyToOne
     private JPAExternalResource resource;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer performCreate;
+    @NotNull
+    private Boolean performCreate = false;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer performUpdate;
+    @NotNull
+    private Boolean performUpdate = false;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer performDelete;
+    @NotNull
+    private Boolean performDelete = false;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer syncStatus;
+    @NotNull
+    private Boolean syncStatus = false;
 
     /**
      * @see UnmatchingRule
@@ -92,45 +81,45 @@ public abstract class AbstractProvisioningTask extends JPASchedTask implements P
 
     @Override
     public boolean isPerformCreate() {
-        return isBooleanAsInteger(performCreate);
+        return performCreate;
     }
 
     @Override
 
     public void setPerformCreate(final boolean performCreate) {
-        this.performCreate = getBooleanAsInteger(performCreate);
+        this.performCreate = performCreate;
     }
 
     @Override
 
     public boolean isPerformUpdate() {
-        return isBooleanAsInteger(performUpdate);
+        return performUpdate;
     }
 
     @Override
 
     public void setPerformUpdate(final boolean performUpdate) {
-        this.performUpdate = getBooleanAsInteger(performUpdate);
+        this.performUpdate = performUpdate;
     }
 
     @Override
     public boolean isPerformDelete() {
-        return isBooleanAsInteger(performDelete);
+        return performDelete;
     }
 
     @Override
     public void setPerformDelete(final boolean performDelete) {
-        this.performDelete = getBooleanAsInteger(performDelete);
+        this.performDelete = performDelete;
     }
 
     @Override
     public boolean isSyncStatus() {
-        return isBooleanAsInteger(syncStatus);
+        return syncStatus;
     }
 
     @Override
     public void setSyncStatus(final boolean syncStatus) {
-        this.syncStatus = getBooleanAsInteger(syncStatus);
+        this.syncStatus = syncStatus;
     }
 
     @Override
index aad2aa0..c25c7bb 100644 (file)
@@ -20,7 +20,6 @@ package org.apache.syncope.core.persistence.jpa.entity.task;
 
 import java.util.HashSet;
 import java.util.Set;
-import javax.persistence.Basic;
 import javax.persistence.CollectionTable;
 import javax.persistence.Column;
 import javax.persistence.DiscriminatorValue;
@@ -32,8 +31,6 @@ import javax.persistence.FetchType;
 import javax.persistence.JoinColumn;
 import javax.persistence.Lob;
 import javax.persistence.ManyToOne;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.TraceLevel;
@@ -77,10 +74,8 @@ public class JPANotificationTask extends AbstractTask implements NotificationTas
     @Lob
     private String htmlBody;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer executed = getBooleanAsInteger(false);
+    @NotNull
+    private Boolean executed = false;
 
     @Enumerated(EnumType.STRING)
     @NotNull
@@ -164,12 +159,12 @@ public class JPANotificationTask extends AbstractTask implements NotificationTas
 
     @Override
     public boolean isExecuted() {
-        return isBooleanAsInteger(executed);
+        return executed;
     }
 
     @Override
     public void setExecuted(final boolean executed) {
-        this.executed = getBooleanAsInteger(executed);
+        this.executed = executed;
     }
 
     @Override
index 5974800..3dc7ee6 100644 (file)
@@ -21,7 +21,6 @@ package org.apache.syncope.core.persistence.jpa.entity.task;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
-import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.DiscriminatorValue;
 import javax.persistence.Entity;
@@ -34,8 +33,6 @@ import javax.persistence.ManyToMany;
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.ImplementationType;
 import org.apache.syncope.common.lib.types.PullMode;
@@ -74,10 +71,8 @@ public class JPAPullTask extends AbstractProvisioningTask implements PullTask {
     @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER, mappedBy = "pullTask")
     private List<JPAAnyTemplatePullTask> templates = new ArrayList<>();
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer remediation;
+    @NotNull
+    private Boolean remediation = false;
 
     @Override
     public PullMode getPullMode() {
@@ -144,12 +139,11 @@ public class JPAPullTask extends AbstractProvisioningTask implements PullTask {
 
     @Override
     public void setRemediation(final boolean remediation) {
-        this.remediation = getBooleanAsInteger(remediation);
+        this.remediation = remediation;
     }
 
     @Override
     public boolean isRemediation() {
-        return isBooleanAsInteger(remediation);
+        return remediation;
     }
-
 }
index e69d5ef..16b2bb7 100644 (file)
 package org.apache.syncope.core.persistence.jpa.entity.task;
 
 import java.util.Date;
-import javax.persistence.Basic;
 import javax.persistence.DiscriminatorValue;
 import javax.persistence.Entity;
 import javax.persistence.OneToOne;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.ImplementationType;
 import org.apache.syncope.core.persistence.api.entity.Implementation;
@@ -55,10 +52,7 @@ public class JPASchedTask extends AbstractTask implements SchedTask {
     private String description;
 
     @NotNull
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer active;
+    private Boolean active = true;
 
     @Override
     public Date getStartAt() {
@@ -121,11 +115,11 @@ public class JPASchedTask extends AbstractTask implements SchedTask {
 
     @Override
     public boolean isActive() {
-        return isBooleanAsInteger(active);
+        return active;
     }
 
     @Override
     public void setActive(final boolean active) {
-        this.active = getBooleanAsInteger(active);
+        this.active = active;
     }
 }
index b6ce0c8..640d250 100644 (file)
@@ -23,7 +23,6 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Optional;
-import javax.persistence.Basic;
 import javax.persistence.Cacheable;
 import javax.persistence.CascadeType;
 import javax.persistence.CollectionTable;
@@ -44,8 +43,6 @@ import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
 import javax.validation.Valid;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
 import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
@@ -154,15 +151,9 @@ public class JPAUser
     @Temporal(TemporalType.TIMESTAMP)
     private Date lastRecertification;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer suspended = getBooleanAsInteger(Boolean.FALSE);
+    private Boolean suspended = false;
 
-    @Basic
-    @Min(0)
-    @Max(1)
-    private Integer mustChangePassword = getBooleanAsInteger(Boolean.FALSE);
+    private Boolean mustChangePassword = false;
 
     /**
      * Provisioning external resources.
@@ -419,11 +410,9 @@ public class JPAUser
 
     @Override
     public void setLastRecertification(final Date lastRecertification) {
-        if (lastRecertification != null) {
-            this.lastRecertification = new Date(lastRecertification.getTime());
-        } else {
-            this.lastRecertification = null;
-        }
+        this.lastRecertification = lastRecertification == null
+                ? null
+                : new Date(lastRecertification.getTime());
     }
 
     @Override
@@ -438,22 +427,22 @@ public class JPAUser
 
     @Override
     public void setSuspended(final Boolean suspended) {
-        this.suspended = getBooleanAsInteger(suspended);
+        this.suspended = suspended;
     }
 
     @Override
     public Boolean isSuspended() {
-        return suspended == null ? null : isBooleanAsInteger(suspended);
+        return suspended;
     }
 
     @Override
     public void setMustChangePassword(final boolean mustChangePassword) {
-        this.mustChangePassword = getBooleanAsInteger(mustChangePassword);
+        this.mustChangePassword = mustChangePassword;
     }
 
     @Override
     public boolean isMustChangePassword() {
-        return isBooleanAsInteger(mustChangePassword);
+        return mustChangePassword;
     }
 
     @Override
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/openjpa/BooleanValueHandler.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/openjpa/BooleanValueHandler.java
new file mode 100644 (file)
index 0000000..ab0f319
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * 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.apache.syncope.core.persistence.jpa.openjpa;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.openjpa.jdbc.identifier.DBIdentifier;
+import org.apache.openjpa.jdbc.kernel.JDBCStore;
+import org.apache.openjpa.jdbc.meta.ValueMapping;
+import org.apache.openjpa.jdbc.meta.strats.AbstractValueHandler;
+import org.apache.openjpa.jdbc.schema.Column;
+import org.apache.openjpa.jdbc.schema.ColumnIO;
+import org.apache.openjpa.jdbc.sql.DBDictionary;
+import org.apache.openjpa.meta.JavaTypes;
+
+public class BooleanValueHandler extends AbstractValueHandler {
+
+    private static final long serialVersionUID = -6742506201236646294L;
+
+    private static final BooleanValueHandler INSTANCE = new BooleanValueHandler();
+
+    public static BooleanValueHandler getInstance() {
+        return INSTANCE;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @deprecated
+     */
+    @Override
+    public Column[] map(final ValueMapping vm, final String name, final ColumnIO io, final boolean adapt) {
+        DBDictionary dict = vm.getMappingRepository().getDBDictionary();
+        DBIdentifier colName = DBIdentifier.newColumn(name, dict != null ? dict.delimitAll() : false);
+        return map(vm, colName, io, adapt);
+    }
+
+    public Column[] map(final ValueMapping vm, final DBIdentifier name, final ColumnIO io, final boolean adapt) {
+        Column col = new Column();
+        col.setIdentifier(name);
+        col.setJavaType(JavaTypes.INT);
+        return new Column[] { col };
+    }
+
+    @Override
+    public Object toDataStoreValue(final ValueMapping vm, final Object val, final JDBCStore store) {
+        return val == null ? null : BooleanUtils.isTrue((Boolean) val) ? 1 : 0;
+    }
+
+    @Override
+    public Object toObjectValue(final ValueMapping vm, final Object val) {
+        return val == null ? null : BooleanUtils.toBoolean((int) val);
+    }
+}
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/openjpa/LocaleValueHandler.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/openjpa/LocaleValueHandler.java
new file mode 100644 (file)
index 0000000..a96ca2a
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * 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.apache.syncope.core.persistence.jpa.openjpa;
+
+import java.util.Locale;
+import org.apache.commons.lang3.LocaleUtils;
+import org.apache.openjpa.jdbc.identifier.DBIdentifier;
+import org.apache.openjpa.jdbc.kernel.JDBCStore;
+import org.apache.openjpa.jdbc.meta.ValueMapping;
+import org.apache.openjpa.jdbc.meta.strats.AbstractValueHandler;
+import org.apache.openjpa.jdbc.schema.Column;
+import org.apache.openjpa.jdbc.schema.ColumnIO;
+import org.apache.openjpa.jdbc.sql.DBDictionary;
+import org.apache.openjpa.meta.JavaTypes;
+
+public class LocaleValueHandler extends AbstractValueHandler {
+
+    private static final long serialVersionUID = 487849441377630981L;
+
+    private static final LocaleValueHandler INSTANCE = new LocaleValueHandler();
+
+    public static LocaleValueHandler getInstance() {
+        return INSTANCE;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @deprecated
+     */
+    @Override
+    public Column[] map(final ValueMapping vm, final String name, final ColumnIO io, final boolean adapt) {
+        DBDictionary dict = vm.getMappingRepository().getDBDictionary();
+        DBIdentifier colName = DBIdentifier.newColumn(name, dict != null ? dict.delimitAll() : false);
+        return map(vm, colName, io, adapt);
+    }
+
+    public Column[] map(final ValueMapping vm, final DBIdentifier name, final ColumnIO io, final boolean adapt) {
+        Column col = new Column();
+        col.setIdentifier(name);
+        col.setJavaType(JavaTypes.STRING);
+        return new Column[] { col };
+    }
+
+    @Override
+    public Object toDataStoreValue(final ValueMapping vm, final Object val, final JDBCStore store) {
+        return val == null ? null : ((Locale) val).toString();
+    }
+
+    @Override
+    public Object toObjectValue(final ValueMapping vm, final Object val) {
+        return val == null ? null : LocaleUtils.toLocale((String) val);
+    }
+}
index 69ba98e..75cba84 100644 (file)
@@ -46,7 +46,10 @@ under the License.
         <!-- Removed: see https://s.apache.org/openjpaSchemaFactory for more information
         <entry key="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)"/>-->
         <entry key="openjpa.jdbc.MappingDefaults" 
-               value="ForeignKeyDeleteAction=restrict, JoinForeignKeyDeleteAction=restrict"/>
+               value="ForeignKeyDeleteAction=restrict, JoinForeignKeyDeleteAction=restrict,
+                      FieldStrategies='
+                        java.util.Locale=org.apache.syncope.core.persistence.jpa.openjpa.LocaleValueHandler,
+                        java.lang.Boolean=org.apache.syncope.core.persistence.jpa.openjpa.BooleanValueHandler'"/>
                 
         <entry key="openjpa.DataCache" value="true"/>
         <entry key="openjpa.QueryCache" value="true"/>
index 8901016..94fbf40 100644 (file)
@@ -27,6 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.List;
+import java.util.Locale;
 import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
 import org.apache.syncope.common.lib.types.EntityViolationType;
@@ -59,12 +60,17 @@ public class PlainSchemaTest extends AbstractTest {
     public void search() {
         List<PlainSchema> schemas = plainSchemaDAO.findByKeyword("fullna%");
         assertEquals(1, schemas.size());
+        assertEquals(0, schemas.get(0).getLabels().size());
     }
 
     @Test
     public void findByName() {
-        PlainSchema schema = plainSchemaDAO.find("fullname");
+        PlainSchema schema = plainSchemaDAO.find("firstname");
         assertNotNull(schema);
+
+        assertEquals(3, schema.getLabels().size());
+        assertTrue(schema.getLabel(Locale.ITALIAN).isPresent());
+        assertFalse(schema.getLabel(Locale.KOREAN).isPresent());
     }
 
     @Test
index 0203a06..faaede5 100644 (file)
@@ -41,10 +41,12 @@ import org.apache.syncope.core.persistence.api.dao.PlainAttrDAO;
 import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
 import org.apache.syncope.core.persistence.api.dao.UserDAO;
 import org.apache.syncope.core.persistence.api.entity.PlainSchema;
+import org.apache.syncope.core.persistence.api.entity.SchemaLabel;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
 import org.apache.syncope.core.persistence.api.entity.user.UPlainAttr;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
+import org.apache.syncope.core.persistence.jpa.entity.JPASchemaLabel;
 import org.apache.syncope.core.spring.security.SyncopeAuthenticationDetails;
 import org.apache.syncope.core.spring.security.SyncopeGrantedAuthority;
 import org.junit.jupiter.api.AfterAll;
@@ -189,15 +191,21 @@ public class PlainSchemaTest extends AbstractTest {
             if (resource.getProvision(anyTypeDAO.findUser()).isPresent()
                     && resource.getProvision(anyTypeDAO.findUser()).get().getMapping() != null) {
 
-                for (MappingItem mapItem : resource.getProvision(anyTypeDAO.findUser()).get().getMapping().getItems()) {
-                    if (schema.getKey().equals(mapItem.getIntAttrName())) {
-                        mappings.add(mapItem);
+                for (MappingItem item : resource.getProvision(anyTypeDAO.findUser()).get().getMapping().getItems()) {
+                    if (schema.getKey().equals(item.getIntAttrName())) {
+                        mappings.add(item);
                     }
                 }
             }
         }
         assertFalse(mappings.isEmpty());
 
+        // check for labels
+        List<SchemaLabel> labels = entityManager().createQuery(
+                "SELECT e FROM " + JPASchemaLabel.class.getSimpleName() + " e", SchemaLabel.class).getResultList();
+        assertEquals(5, labels.size());
+        assertEquals(2, schema.getLabels().size());
+
         // delete user schema fullname
         plainSchemaDAO.delete("surname");
 
@@ -206,6 +214,10 @@ public class PlainSchemaTest extends AbstractTest {
         // check for schema deletion
         schema = plainSchemaDAO.find("surname");
         assertNull(schema);
+
+        labels = entityManager().createQuery(
+                "SELECT e FROM " + JPASchemaLabel.class.getSimpleName() + " e", SchemaLabel.class).getResultList();
+        assertEquals(3, labels.size());
     }
 
     @Test
index 3c33586..d82ad86 100644 (file)
@@ -290,30 +290,30 @@ under the License.
   <SyncopeRole_Realm role_id="Connector and Resource for realm evenTwo"
                      realm_id="0679e069-7355-4b20-bd11-a5a0a5453c7c"/>
 
-  <SyncopeUser id="1417acbe-cbf6-4277-9372-e75e04f97000" workflowId="4" status="active"
+  <SyncopeUser mustChangePassword="0" id="1417acbe-cbf6-4277-9372-e75e04f97000" workflowId="4" status="active"
                password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
                realm_id="c5b75db1-fce7-470f-b780-3b9934d82a9d"
                username="rossini" creator="admin" lastModifier="admin"
                creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
   <SyncopeUser_SyncopeRole user_id="1417acbe-cbf6-4277-9372-e75e04f97000" role_id="Other"/>
-  <SyncopeUser id="74cd8ece-715a-44a4-a736-e17b46c4e7e6" workflowId="6" status="active"
+  <SyncopeUser mustChangePassword="0" id="74cd8ece-715a-44a4-a736-e17b46c4e7e6" workflowId="6" status="active"
                password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
                realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
                username="verdi" creator="admin" lastModifier="admin"
                creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
-  <SyncopeUser id="b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee" workflowId="8" status="active"
+  <SyncopeUser mustChangePassword="0" id="b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee" workflowId="8" status="active"
                password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
                realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
                username="vivaldi" creator="admin" lastModifier="admin"
                creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
-  <SyncopeUser id="c9b2dec2-00a7-4855-97c0-d854842b4b24" workflowId="10" status="active"
+  <SyncopeUser mustChangePassword="0" id="c9b2dec2-00a7-4855-97c0-d854842b4b24" workflowId="10" status="active"
                password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
                realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
                username="bellini" creator="admin" lastModifier="admin"
                creationDate="2010-10-20 11:00:00" lastChangeDate="2010-10-20 11:00:00" suspended="0"/>
   <SyncopeUser_SyncopeRole user_id="c9b2dec2-00a7-4855-97c0-d854842b4b24" role_id="User reviewer"/>
   <SyncopeUser_SyncopeRole user_id="c9b2dec2-00a7-4855-97c0-d854842b4b24" role_id="User manager"/>
-  <SyncopeUser id="823074dc-d280-436d-a7dd-07399fae48ec" workflowId="12" status="active"
+  <SyncopeUser mustChangePassword="0" id="823074dc-d280-436d-a7dd-07399fae48ec" workflowId="12" status="active"
                password="5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" cipherAlgorithm="SHA1"
                realm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28"
                username="puccini" creator="admin" lastModifier="admin" 
@@ -428,9 +428,14 @@ under the License.
   <SyncopeSchema id="firstname"/>
   <PlainSchema id="firstname" type="String" anyTypeClass_id="minimal user"
                mandatoryCondition="false" multivalue="0" uniqueConstraint="0" readonly="0"/>
+  <SchemaLabel id="d90f90d0-cf15-407e-bac7-d46a8eb57c05" schema_id="firstname" locale="en" display="Firstname"/>
+  <SchemaLabel id="a9465ef0-b8b4-4af4-840d-77031a6b54a0" schema_id="firstname" locale="it" display="Nome"/>
+  <SchemaLabel id="ac8b7383-62df-490d-9364-88dbd3d301aa" schema_id="firstname" locale="pt_BR" display="Nome próprio"/>
   <SyncopeSchema id="surname"/>
   <PlainSchema id="surname" type="String" anyTypeClass_id="minimal user"
                mandatoryCondition="true" multivalue="0" uniqueConstraint="0" readonly="0"/>
+  <SchemaLabel id="69712058-162a-4e2a-b07e-c78d82dc286d" schema_id="surname" locale="en" display="Surname"/>
+  <SchemaLabel id="77e7bbbb-d30c-47e1-b6d2-e0a9e8c11fe2" schema_id="surname" locale="it" display="Cognome"/>
   <SyncopeSchema id="ctype"/>
   <PlainSchema id="ctype" type="String" anyTypeClass_id="other"
                mandatoryCondition="false" multivalue="0" uniqueConstraint="0" readonly="0"/>
@@ -805,8 +810,9 @@ under the License.
                     randomPwdIfNotProvided="0" enforceMandatoryCondition="0" overrideCapabilities="0"
                     pullPolicy_id="880f8553-069b-4aed-9930-2cd53873f544"
                     createTraceLevel="ALL" deleteTraceLevel="ALL" updateTraceLevel="ALL" provisioningTraceLevel="ALL"/>
-  <ExternalResource id="ws-target-resource-update-resetsynctoken" connector_id="88a7a819-dab5-46b4-9b90-0b9769eabdb8" enforceMandatoryCondition="1"
-                    randomPwdIfNotProvided="0" createTraceLevel="ALL" deleteTraceLevel="ALL" updateTraceLevel="ALL" provisioningTraceLevel="ALL"/>
+  <ExternalResource id="ws-target-resource-update-resetsynctoken" connector_id="88a7a819-dab5-46b4-9b90-0b9769eabdb8"
+                    randomPwdIfNotProvided="0" enforceMandatoryCondition="1" overrideCapabilities="0"
+                    createTraceLevel="ALL" deleteTraceLevel="ALL" updateTraceLevel="ALL" provisioningTraceLevel="ALL"/>
   <ExternalResource id="resource-ldap" connector_id="74141a3b-0762-4720-a4aa-fc3e374ef3ef"
                     randomPwdIfNotProvided="1" enforceMandatoryCondition="1" overrideCapabilities="0"
                     propagationPriority="1"
@@ -820,7 +826,7 @@ under the License.
                     createTraceLevel="ALL" deleteTraceLevel="ALL" updateTraceLevel="ALL" provisioningTraceLevel="ALL"
                     jsonConf='[{"schema":{"name":"uidAttribute","displayName":"Uid Attribute","helpMessage":"The name of the LDAP attribute which is mapped to the Uid attribute. Default is \"entryUUID\".","type":"java.lang.String","required":false,"order":21,"confidential":false,"defaultValues":["entryUUID"]},"overridable":true,"values":["l"]},{"schema":{"name":"baseContexts","displayName":"Base Contexts","helpMessage":"One or more starting points in the LDAP tree that will be used when searching the tree. Searches are performed when discovering users from the LDAP server or when looking for the groups of which a user is a member.","type":"[Ljava.lang.String;","required":true,"order":7,"confidential":false,"defaultValues":[]},"overridable":true,"values":["o=isp"]}]'/>
   <OrgUnit id="599a59cf-9a23-4447-9a59-cf9a2334473a" connObjectLink="syncope:fullPath2Dn(fullPath, 'ou') + ',o=isp'"
-           objectClass="organizationalUnit" resource_id="resource-ldap-orgunit"/>
+           objectClass="organizationalUnit" resource_id="resource-ldap-orgunit" ignoreCaseMatch="0"/>
   <OrgUnitItem id="5d0e7ad0-9026-42ad-be8a-32539389e7bd" connObjectKey="1" extAttrName="l"
                intAttrName="fullpath" mandatoryCondition="true" purpose="BOTH"
                orgUnit_id="599a59cf-9a23-4447-9a59-cf9a2334473a"/>
@@ -879,7 +885,7 @@ under the License.
   <SyncopeGroup_ExternalResource group_id="0626100b-a4ba-4e00-9971-86fad52a6216" resource_id="resource-csv"/>
   <SyncopeGroup_ExternalResource group_id="ba9ed509-b1f5-48ab-a334-c8530a6422dc" resource_id="resource-csv"/>
      
-  <Provision id="209ea85f-f964-49c7-a498-6c9c2baa3bd8" resource_id="ws-target-resource-1" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="209ea85f-f964-49c7-a498-6c9c2baa3bd8" resource_id="ws-target-resource-1" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="bc0cf27b-16b7-4e83-a4b0-09af7ea4aacc" provision_id="209ea85f-f964-49c7-a498-6c9c2baa3bd8"/>
   <MappingItem id="96aad4e0-2678-4903-a52f-0a7d090a2863" mapping_id="bc0cf27b-16b7-4e83-a4b0-09af7ea4aacc" extAttrName="userId"
                intAttrName="username" mandatoryCondition="true"
@@ -903,7 +909,7 @@ under the License.
                extAttrName="name" intAttrName="firstname" mandatoryCondition="false"
                connObjectKey="0" password="0" purpose="NONE"/>
   
-  <Provision id="41a53a00-0b35-4047-831a-d5238f74c7ba" resource_id="ws-target-resource-list-mappings-1" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="41a53a00-0b35-4047-831a-d5238f74c7ba" resource_id="ws-target-resource-list-mappings-1" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="bf8afa4a-1522-44b9-91d0-c7b035e4fd99" provision_id="41a53a00-0b35-4047-831a-d5238f74c7ba"/>
   <MappingItem id="6f8d7b42-44f4-4697-aff5-1736c4b01ee4" mapping_id="bf8afa4a-1522-44b9-91d0-c7b035e4fd99"
                extAttrName="email" intAttrName="email" mandatoryCondition="true"
@@ -913,13 +919,13 @@ under the License.
                intAttrName="surname" mandatoryCondition="true"
                connObjectKey="0" password="0" purpose="PROPAGATION"/>
 
-  <Provision id="09a65250-d9de-44b1-9412-11ed996d356d" resource_id="ws-target-resource-list-mappings-2" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="09a65250-d9de-44b1-9412-11ed996d356d" resource_id="ws-target-resource-list-mappings-2" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="b12c4fad-f0f1-406d-b143-f2d68ed28e3a" provision_id="09a65250-d9de-44b1-9412-11ed996d356d"/>
   <MappingItem id="55a4cf7f-ac96-4e8b-931c-2d0eab6a6bca" mapping_id="b12c4fad-f0f1-406d-b143-f2d68ed28e3a"
                extAttrName="userId" intAttrName="userId" mandatoryCondition="true"
                connObjectKey="1" password="0" purpose="PROPAGATION"/>
 
-  <Provision id="3d75991b-caee-4993-8e46-afb13d1bfbd4" resource_id="ws-target-resource-2" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="3d75991b-caee-4993-8e46-afb13d1bfbd4" resource_id="ws-target-resource-2" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="240a0291-f89d-4557-a547-2a3b9aad625b" provision_id="3d75991b-caee-4993-8e46-afb13d1bfbd4"/>
   <MappingItem id="d5c4d467-cd18-4148-8195-015808b4b3e6" mapping_id="240a0291-f89d-4557-a547-2a3b9aad625b"
                extAttrName="fullname" intAttrName="fullname" mandatoryCondition="true"
@@ -940,7 +946,7 @@ under the License.
                intAttrName="cn" mandatoryCondition="true"
                connObjectKey="0" password="0" purpose="PROPAGATION"/>
     
-  <Provision id="9ebc3237-49fa-4dce-9a4c-3070e931812f" resource_id="ws-target-resource-update" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="9ebc3237-49fa-4dce-9a4c-3070e931812f" resource_id="ws-target-resource-update" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="c17813c0-4e90-4118-bb28-cd36ad6d5a4d" provision_id="9ebc3237-49fa-4dce-9a4c-3070e931812f"/>
   <MappingItem id="cc973ed6-d031-4790-adab-fc059ac0c818" extAttrName="email" mapping_id="c17813c0-4e90-4118-bb28-cd36ad6d5a4d"
                intAttrName="email" mandatoryCondition="false"
@@ -952,31 +958,31 @@ under the License.
                intAttrName="fullname" mandatoryCondition="false"
                connObjectKey="0" password="0" purpose="PROPAGATION"/>
     
-  <Provision id="8680bc79-dfa1-4719-9886-1d582bf1124f" resource_id="ws-target-resource-nopropagation" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="8680bc79-dfa1-4719-9886-1d582bf1124f" resource_id="ws-target-resource-nopropagation" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="63ddd4c8-efed-4a22-a4b4-1f4e6f47c8d0" provision_id="8680bc79-dfa1-4719-9886-1d582bf1124f"/>
   <MappingItem id="ffcfbb5e-7bbd-489a-a69e-2dd84f00731a" mapping_id="63ddd4c8-efed-4a22-a4b4-1f4e6f47c8d0" extAttrName="fullname" 
                intAttrName="fullname" mandatoryCondition="true"
                connObjectKey="1" password="0" purpose="PROPAGATION"/>
                      
-  <Provision id="0bfa7c3e-2bb3-43d7-ac0e-d57cff7a18c8" resource_id="ws-target-resource-nopropagation2" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="0bfa7c3e-2bb3-43d7-ac0e-d57cff7a18c8" resource_id="ws-target-resource-nopropagation2" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="3f636292-6edb-4d20-ab24-fe0c5fc3dec3" provision_id="0bfa7c3e-2bb3-43d7-ac0e-d57cff7a18c8"/>
   <MappingItem id="e34928b8-ca57-4b6c-81c1-70bc87ff3fdc" mapping_id="3f636292-6edb-4d20-ab24-fe0c5fc3dec3" extAttrName="fullname" 
                intAttrName="fullname" mandatoryCondition="true"
                connObjectKey="1" password="0" purpose="PROPAGATION"/>
                      
-  <Provision id="5bd76fec-f8d7-4ab9-acd7-89e099d534e8" resource_id="ws-target-resource-nopropagation3" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="5bd76fec-f8d7-4ab9-acd7-89e099d534e8" resource_id="ws-target-resource-nopropagation3" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="c2a0cec1-32c4-4493-8f01-d1176e557fc1" provision_id="5bd76fec-f8d7-4ab9-acd7-89e099d534e8"/>
   <MappingItem id="f3ba0859-b0f0-44a5-abfd-4a1a5ca29fbf" mapping_id="c2a0cec1-32c4-4493-8f01-d1176e557fc1" extAttrName="fullname"
                intAttrName="fullname" mandatoryCondition="true"
                connObjectKey="1" password="0" purpose="PROPAGATION"/>
                      
-  <Provision id="18de6376-7051-4216-96f0-26629076abb9" resource_id="ws-target-resource-nopropagation4" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="18de6376-7051-4216-96f0-26629076abb9" resource_id="ws-target-resource-nopropagation4" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="906452d9-3eeb-4ef7-ac90-5ffc14513fbf" provision_id="18de6376-7051-4216-96f0-26629076abb9"/>
   <MappingItem id="118" mapping_id="906452d9-3eeb-4ef7-ac90-5ffc14513fbf"
                extAttrName="fullname" intAttrName="fullname" mandatoryCondition="true"
                connObjectKey="1" password="0" purpose="PROPAGATION"/>
                        
-  <Provision id="779fefb5-dd25-4078-915d-3c199ee32158" resource_id="resource-testdb" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="779fefb5-dd25-4078-915d-3c199ee32158" resource_id="resource-testdb" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="cb624b93-874b-40a0-8021-3b8116b781ab" provision_id="779fefb5-dd25-4078-915d-3c199ee32158"/>
   <MappingItem id="1e0d30cd-2569-4a80-b9dc-af1467bd1c0b" mapping_id="cb624b93-874b-40a0-8021-3b8116b781ab"
                extAttrName="ID" intAttrName="username" mandatoryCondition="true"
@@ -985,7 +991,7 @@ under the License.
                extAttrName="__PASSWORD__" intAttrName="password" mandatoryCondition="true"
                connObjectKey="0" password="1" purpose="BOTH"/>
                      
-  <Provision id="0359084d-68fe-4bf8-b42b-2ebe4f578ae7" resource_id="resource-testdb2" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="0359084d-68fe-4bf8-b42b-2ebe4f578ae7" resource_id="resource-testdb2" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="935a0fc2-4a0b-4d82-9931-3c5ce44a33c1" provision_id="0359084d-68fe-4bf8-b42b-2ebe4f578ae7"/>
   <MappingItem id="6d90658a-f470-4450-912d-6fe7d3bcda46" mapping_id="935a0fc2-4a0b-4d82-9931-3c5ce44a33c1" extAttrName="ID" 
                intAttrName="username" mandatoryCondition="true"
@@ -994,7 +1000,7 @@ under the License.
                intAttrName="password" mandatoryCondition="true"
                connObjectKey="0" password="1" purpose="PROPAGATION"/>
                          
-  <Provision id="2adb6537-e207-4d9b-804f-90bf18cd6f48" resource_id="resource-csv" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="2adb6537-e207-4d9b-804f-90bf18cd6f48" resource_id="resource-csv" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Provision_AnyTypeClass provision_id="2adb6537-e207-4d9b-804f-90bf18cd6f48" anyTypeClass_id="csv"/>
   <Provision_AnyTypeClass provision_id="2adb6537-e207-4d9b-804f-90bf18cd6f48" anyTypeClass_id="generic membership"/>
   <Provision_AnyTypeClass provision_id="2adb6537-e207-4d9b-804f-90bf18cd6f48" anyTypeClass_id="minimal group"/>
@@ -1027,7 +1033,7 @@ under the License.
                intAttrName="groups[root].rderToBePropagated" mandatoryCondition="false"
                connObjectKey="0" password="0" purpose="PROPAGATION"/>
                          
-  <Provision id="1b53c74e-6a63-49ef-b2f1-96eeb7f1bbb8" resource_id="ws-target-resource-update-resetsynctoken" anyType_id="USER" objectClass="__ACCOUNT__"
+  <Provision ignoreCaseMatch="0" id="1b53c74e-6a63-49ef-b2f1-96eeb7f1bbb8" resource_id="ws-target-resource-update-resetsynctoken" anyType_id="USER" objectClass="__ACCOUNT__"
              serializedSyncToken='{"value":null}'/>
   <Mapping id="23e20ce6-1ff9-495e-aa59-a58e5127a008" provision_id="1b53c74e-6a63-49ef-b2f1-96eeb7f1bbb8"/>
   <MappingItem id="608f01c5-eb7c-462a-b4d6-b7c3c9632a50" mapping_id="23e20ce6-1ff9-495e-aa59-a58e5127a008"
@@ -1037,7 +1043,7 @@ under the License.
                extAttrName="__PASSWORD__" intAttrName="fullname" mandatoryCondition="false"
                connObjectKey="0" password="1" purpose="BOTH"/>
 
-  <Provision id="8b938d63-aa92-448c-89a8-a685fc0a67c8" resource_id="resource-ldap" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="8b938d63-aa92-448c-89a8-a685fc0a67c8" resource_id="resource-ldap" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Provision_AnyTypeClass provision_id="8b938d63-aa92-448c-89a8-a685fc0a67c8" anyTypeClass_id="generic membership"/>
   <Provision_AnyTypeClass provision_id="8b938d63-aa92-448c-89a8-a685fc0a67c8" anyTypeClass_id="minimal group"/>
   <Mapping id="ae1c77c3-2f1d-4258-ad06-710bb09041a9" provision_id="8b938d63-aa92-448c-89a8-a685fc0a67c8"
@@ -1077,7 +1083,7 @@ under the License.
   <VirSchema id="virtualReadOnly" READONLY="1" anyTypeClass_id="minimal user"
              provision_id="8b938d63-aa92-448c-89a8-a685fc0a67c8" extAttrName="givenname"/>
 
-  <Provision id="20a75199-3f2e-4b9a-9510-c68dd7fc7b3d" resource_id="resource-ldap" anyType_id="GROUP" objectClass="__GROUP__"/>
+  <Provision ignoreCaseMatch="0" id="20a75199-3f2e-4b9a-9510-c68dd7fc7b3d" resource_id="resource-ldap" anyType_id="GROUP" objectClass="__GROUP__"/>
   <Mapping id="128412c8-be4f-4d7b-8bed-5ab89134f718" provision_id="20a75199-3f2e-4b9a-9510-c68dd7fc7b3d"
            connObjectLink="&apos;cn=&apos; + name + &apos;,ou=groups,o=isp&apos;"/>
   <MappingItem id="a2bf43c8-74cb-4250-92cf-fb8889409ac1"
@@ -1094,9 +1100,10 @@ under the License.
                mandatoryCondition="false" purpose="BOTH"/>
   
   <SyncopeSchema id="rvirtualdata"/>
-  <VirSchema id="rvirtualdata" anyTypeClass_id="minimal group" provision_id="20a75199-3f2e-4b9a-9510-c68dd7fc7b3d" extAttrName="businessCategory"/>
+  <VirSchema id="rvirtualdata" READONLY="0" anyTypeClass_id="minimal group"
+             provision_id="20a75199-3f2e-4b9a-9510-c68dd7fc7b3d" extAttrName="businessCategory"/>
 
-  <Provision id="46b54e2a-e43e-4cd7-8c13-1af1bd65c3d3" resource_id="resource-db-pull" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="46b54e2a-e43e-4cd7-8c13-1af1bd65c3d3" resource_id="resource-db-pull" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="cda910bd-fc28-4f63-890e-66edc62d428b" provision_id="46b54e2a-e43e-4cd7-8c13-1af1bd65c3d3"/>
   <MappingItem id="1a345706-a498-41bb-a948-820307a4365e" connObjectKey="0" mapping_id="cda910bd-fc28-4f63-890e-66edc62d428b"
                extAttrName="EMAIL" intAttrName="email" 
@@ -1120,28 +1127,29 @@ under the License.
                extAttrName="MUSTCHANGEPASSWORD" intAttrName="mustChangePassword" 
                mandatoryCondition="false" password="0" purpose="PULL"/>
               
-  <Provision id="6d7cb60a-c4ad-4a70-94ae-e5b88eb24930" resource_id="resource-db-virattr" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="6d7cb60a-c4ad-4a70-94ae-e5b88eb24930" resource_id="resource-db-virattr" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="45280585-308f-4571-9788-c7a4734b3614" provision_id="6d7cb60a-c4ad-4a70-94ae-e5b88eb24930"/>
   <MappingItem id="6cb2f9f0-5fb4-4686-a375-31e2c34a6cd8" mapping_id="45280585-308f-4571-9788-c7a4734b3614" connObjectKey="1" password="0"
                extAttrName="ID" intAttrName="key" 
                mandatoryCondition="true" purpose="BOTH"/>
                 
   <SyncopeSchema id="virtualdata"/>
-  <VirSchema id="virtualdata" anyTypeClass_id="minimal user" provision_id="6d7cb60a-c4ad-4a70-94ae-e5b88eb24930" extAttrName="USERNAME"/>
+  <VirSchema id="virtualdata" READONLY="0" anyTypeClass_id="minimal user"
+             provision_id="6d7cb60a-c4ad-4a70-94ae-e5b88eb24930" extAttrName="USERNAME"/>
   
-  <Provision id="cfa86cbe-94b6-4712-a40a-a4861be1d425" resource_id="ws-target-resource-timeout" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="cfa86cbe-94b6-4712-a40a-a4861be1d425" resource_id="ws-target-resource-timeout" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="c71d690a-3dd9-48a5-b76f-32805186c4dc" provision_id="cfa86cbe-94b6-4712-a40a-a4861be1d425"/>
   <MappingItem id="321bc904-e1fc-4a54-bf7c-74c8cbcc0815" mapping_id="c71d690a-3dd9-48a5-b76f-32805186c4dc" connObjectKey="1" password="0"
                extAttrName="fullname" intAttrName="fullname"
                mandatoryCondition="true" purpose="PROPAGATION"/>
   
-  <Provision id="ac1659dc-3ea3-45eb-8ae6-626e3d916492" resource_id="ws-target-resource-delete" anyType_id="USER" objectClass="__ACCOUNT__"/>
+  <Provision ignoreCaseMatch="0" id="ac1659dc-3ea3-45eb-8ae6-626e3d916492" resource_id="ws-target-resource-delete" anyType_id="USER" objectClass="__ACCOUNT__"/>
   <Mapping id="72f590ae-2754-456b-aabb-eda7d8459dd3" provision_id="ac1659dc-3ea3-45eb-8ae6-626e3d916492"/>
   <MappingItem id="4c98536f-10df-4953-b2df-59d7cd057fd2" mapping_id="72f590ae-2754-456b-aabb-eda7d8459dd3" extAttrName="userId" 
                intAttrName="username" mandatoryCondition="true"
                connObjectKey="1" password="0" purpose="PROPAGATION"/>
 
-  <Provision id="f1b55b66-eb13-4a93-a49c-448e93756eb6" resource_id="resource-db-scripted" anyType_id="PRINTER" objectClass="__PRINTER__"/>
+  <Provision ignoreCaseMatch="0" id="f1b55b66-eb13-4a93-a49c-448e93756eb6" resource_id="resource-db-scripted" anyType_id="PRINTER" objectClass="__PRINTER__"/>
   <Mapping id="16439b5f-50c3-4604-97e9-f4004933abd8" provision_id="f1b55b66-eb13-4a93-a49c-448e93756eb6"/>
   <MappingItem id="23aa0299-ddbb-4e59-8918-0ab2a32465fa" mapping_id="16439b5f-50c3-4604-97e9-f4004933abd8" extAttrName="ID" 
                intAttrName="key" mandatoryCondition="true"
@@ -1153,7 +1161,7 @@ under the License.
                intAttrName="location"
                mandatoryCondition="false" connObjectKey="0" password="0" purpose="BOTH"/>
     
-  <Provision id="2e372858-f43c-4e1c-b728-58f43c5e1c23" objectClass="__ACCOUNT__" anyType_id="USER" resource_id="rest-target-resource"/>
+  <Provision ignoreCaseMatch="0" id="2e372858-f43c-4e1c-b728-58f43c5e1c23" objectClass="__ACCOUNT__" anyType_id="USER" resource_id="rest-target-resource"/>
   <Mapping id="e6b64584-94a2-4890-b645-8494a2089011" provision_id="2e372858-f43c-4e1c-b728-58f43c5e1c23"/>
   <MappingItem id="14726efb-09e1-441e-b26e-fb09e1841eb2" connObjectKey="0"
                extAttrName="firstName" intAttrName="firstname" mandatoryCondition="true" password="0" purpose="BOTH"
@@ -1188,7 +1196,7 @@ under the License.
   <Task DTYPE="PropagationTask" id="316285cc-ae52-4ea2-a33b-7355e189ac3f" operation="DELETE"
         objectClassName="__ACCOUNT__" resource_id="ws-target-resource-2" anyTypeKind="USER" entityKey="1417acbe-cbf6-4277-9372-e75e04f97000"
         attributes='[{"name":"__PASSWORD__","value":[{"readOnly":false,"disposed":false,"encryptedBytes":"m9nh2US0Sa6m+cXccCq0Xw==","base64SHA1Hash":"GFJ69qfjxEOdrmt+9q+0Cw2uz60="}]},{"name":"__NAME__","value":["userId"],"nameValue":"userId"},{"name":"type","value":["type"]}]'/>
-  <Task DTYPE="PullTask" id="c41b9b71-9bfa-4f90-89f2-84787def4c5c" name="CSV (update matching; assign unmatching)" resource_id="resource-csv"
+  <Task DTYPE="PullTask" remediation="0" id="c41b9b71-9bfa-4f90-89f2-84787def4c5c" name="CSV (update matching; assign unmatching)" resource_id="resource-csv"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="1" performUpdate="1" performDelete="1" syncStatus="1"
         pullMode="INCREMENTAL" unmatchingRule="ASSIGN" matchingRule="UPDATE" active="1"
         jobDelegate_id="PullJobDelegate"/>
@@ -1214,20 +1222,20 @@ under the License.
         objectClassName="__ACCOUNT__" resource_id="ws-target-resource-nopropagation" anyTypeKind="USER" entityKey="1417acbe-cbf6-4277-9372-e75e04f97000"
         attributes='[{"name":"__PASSWORD__","value":[{"readOnly":false,"disposed":false,"encryptedBytes":"m9nh2US0Sa6m+cXccCq0Xw==","base64SHA1Hash":"GFJ69qfjxEOdrmt+9q+0Cw2uz60="}]},{"name":"__NAME__","value":["userId"],"nameValue":"userId"},{"name":"fullname","value":["fullname"]},{"name":"type","value":["type"]}]'/>
   <TaskExec id="d789462f-e395-424f-bd8e-0db44a93222f" task_id="d6c2d6d3-6329-44c1-9187-f1469ead1cfa" startDate="2015-12-17 09:40:00.506" endDate="2015-12-17 09:42:00.506" status="SUCCESS"/>
-  <Task DTYPE="PullTask" id="83f7e85d-9774-43fe-adba-ccd856312994" name="TestDB Task" resource_id="resource-testdb"
+  <Task DTYPE="PullTask" remediation="0" id="83f7e85d-9774-43fe-adba-ccd856312994" name="TestDB Task" resource_id="resource-testdb"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="1" performUpdate="1" performDelete="0" syncStatus="1" pullMode="FULL_RECONCILIATION"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1" jobDelegate_id="PullJobDelegate"/>
   <AnyTemplatePullTask id="6c3f578d-327b-4a7c-8037-6f5ba24eb770" pullTask_id="83f7e85d-9774-43fe-adba-ccd856312994" anyType_id="USER"
                        template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":null,"status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"relationships":[],"memberships":[],"dynMemberships":[],"roles":[],"dynRoles":[],"plainAttrs":[{"schema":"ctype","values":["&apos;type a&apos;"]},{"schema":"userId","values":["&apos;reconciled@syncope.apache.org&apos;"]},{"schema":"fullname","values":["&apos;reconciled fullname&apos;"]},{"schema":"surname","values":["&apos;surname&apos;"]}]}'/>
   <AnyTemplatePullTask id="45b61137-c7c3-49ee-86e0-9efffa75ae68" pullTask_id="83f7e85d-9774-43fe-adba-ccd856312994" anyType_id="GROUP"
                        template='{"@class":"org.apache.syncope.common.lib.to.GroupTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"GROUP","realm":null,"status":null,"name":null,"userOwner":null,"groupOwner":null,"udynMembershipCond":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"plainAttrs":[]}'/>
-  <Task DTYPE="PullTask" id="81d88f73-d474-4450-9031-605daa4e313f" name="TestDB2 Task" resource_id="resource-testdb2"
+  <Task DTYPE="PullTask" remediation="0" id="81d88f73-d474-4450-9031-605daa4e313f" name="TestDB2 Task" resource_id="resource-testdb2"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="1" performUpdate="1" performDelete="0" syncStatus="1" pullMode="FULL_RECONCILIATION"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1" jobDelegate_id="PullJobDelegate"/>
-  <Task DTYPE="PullTask" id="7c2242f4-14af-4ab5-af31-cdae23783655" name="TestDB Pull Task" resource_id="resource-db-pull"
+  <Task DTYPE="PullTask" remediation="0" id="7c2242f4-14af-4ab5-af31-cdae23783655" name="TestDB Pull Task" resource_id="resource-db-pull"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" pullMode="FULL_RECONCILIATION" performCreate="1" performDelete="1" performUpdate="1" syncStatus="0"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1" jobDelegate_id="PullJobDelegate"/>
-  <Task DTYPE="PullTask" id="1e419ca4-ea81-4493-a14f-28b90113686d" name="LDAP Pull Task" resource_id="resource-ldap"
+  <Task DTYPE="PullTask" remediation="0" id="1e419ca4-ea81-4493-a14f-28b90113686d" name="LDAP Pull Task" resource_id="resource-ldap"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" pullMode="FULL_RECONCILIATION" performCreate="1" performDelete="1" performUpdate="1" syncStatus="0"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1" jobDelegate_id="PullJobDelegate"/>
   <AnyTemplatePullTask id="df655a2a-40c0-43b1-a157-3f4988802f58" pullTask_id="1e419ca4-ea81-4493-a14f-28b90113686d" anyType_id="USER"
@@ -1237,7 +1245,7 @@ under the License.
   <Implementation id="LDAPMembershipPullActions" type="PULL_ACTIONS"  engine="JAVA"
                   body="org.apache.syncope.core.provisioning.java.pushpull.LDAPMembershipPullActions"/>
   <PullTaskAction task_id="1e419ca4-ea81-4493-a14f-28b90113686d" implementation_id="LDAPMembershipPullActions"/>
-  <Task DTYPE="PullTask" id="38abbf9e-a1a3-40a1-a15f-7d0ac02f47f1" name="VirAttrCache test" resource_id="resource-csv"
+  <Task DTYPE="PullTask" remediation="0" id="38abbf9e-a1a3-40a1-a15f-7d0ac02f47f1" name="VirAttrCache test" resource_id="resource-csv"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="0" performUpdate="1" performDelete="0" syncStatus="0" pullMode="FULL_RECONCILIATION"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1" jobDelegate_id="PullJobDelegate"/>
   <Task DTYPE="PushTask" id="af558be4-9d2f-4359-bf85-a554e6e90be1" name="Export on resource-testdb2" resource_id="resource-testdb2"
@@ -1306,23 +1314,23 @@ under the License.
         unmatchingRule="ASSIGN" matchingRule="UNLINK" active="1" jobDelegate_id="PushJobDelegate"/>
   <PushTaskAnyFilter id="30842acc-f2dd-4d47-b359-20db06c30803" anyType_id="USER" pushTask_id="fd905ba5-9d56-4f51-83e2-859096a67b75" fiql="username==_NO_ONE_"/>
   <PushTaskAnyFilter id="9e4c0233-440e-4b5b-9563-11ec0f55a334" anyType_id="GROUP" pushTask_id="fd905ba5-9d56-4f51-83e2-859096a67b75" fiql="name==citizen"/>
-  <Task DTYPE="PullTask" id="986867e2-993b-430e-8feb-aa9abb4c1dcd" name="CSV Task (update matching; provision unmatching)" resource_id="resource-csv"
+  <Task DTYPE="PullTask" remediation="0" id="986867e2-993b-430e-8feb-aa9abb4c1dcd" name="CSV Task (update matching; provision unmatching)" resource_id="resource-csv"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="1" performUpdate="1" performDelete="1" syncStatus="1" pullMode="INCREMENTAL"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1" jobDelegate_id="PullJobDelegate"/>
   <AnyTemplatePullTask id="8bc41ba1-cc1d-4ee0-bb43-61cd148b414f" pullTask_id="986867e2-993b-430e-8feb-aa9abb4c1dcd" anyType_id="USER"
                        template='{"@class":"org.apache.syncope.common.lib.to.UserTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"USER","realm":null,"status":null,"password":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"securityQuestion":null,"securityAnswer":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":["resource-testdb"],"roles":[],"dynRoles":[],"relationships":[],"memberships":[],"dynMemberships":[],"plainAttrs":[{"schema":"firstname","values":[""]},{"schema":"userId","values":["&apos;test&apos;"]},{"schema":"fullname","values":["&apos;test&apos;"]},{"schema":"surname","values":["&apos;test&apos;"]}]}'/>
   <AnyTemplatePullTask id="9af0e343-8a37-42d2-9bc7-6e2e3b103219" pullTask_id="986867e2-993b-430e-8feb-aa9abb4c1dcd" anyType_id="GROUP"
                        template='{"@class":"org.apache.syncope.common.lib.to.GroupTO","creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":null,"type":"GROUP","realm":null,"status":null,"name":null,"userOwner":null,"groupOwner":null,"udynMembershipCond":null,"auxClasses":[],"derAttrs":[],"virAttrs":[],"resources":[],"plainAttrs":[]}'/>
-  <Task DTYPE="PullTask" id="feae4e57-15ca-40d9-b973-8b9015efca49" name="CSV (unlink matching; ignore unmatching)" resource_id="resource-csv"
+  <Task DTYPE="PullTask" remediation="0" id="feae4e57-15ca-40d9-b973-8b9015efca49" name="CSV (unlink matching; ignore unmatching)" resource_id="resource-csv"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="1" performUpdate="1" performDelete="1" syncStatus="1" pullMode="FULL_RECONCILIATION"
         unmatchingRule="IGNORE" matchingRule="UNLINK" active="1" jobDelegate_id="PullJobDelegate"/>
-  <Task DTYPE="PullTask" id="55d5e74b-497e-4bc0-9156-73abef4b9adc" name="CSV (ignore matching; assign unmatching)" resource_id="resource-csv"
+  <Task DTYPE="PullTask" remediation="0" id="55d5e74b-497e-4bc0-9156-73abef4b9adc" name="CSV (ignore matching; assign unmatching)" resource_id="resource-csv"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="1" performUpdate="1" performDelete="1" syncStatus="1" pullMode="FULL_RECONCILIATION"
         unmatchingRule="ASSIGN" matchingRule="IGNORE" active="1" jobDelegate_id="PullJobDelegate"/>
   <Task DTYPE="PropagationTask" id="0f618183-17ce-48bc-80bc-cc535f38983a" operation="CREATE"
         objectClassName="__ACCOUNT__" resource_id="resource-testdb" anyTypeKind="USER" entityKey="1417acbe-cbf6-4277-9372-e75e04f97000"
         attributes='[{"name":"__PASSWORD__","value":[{"readOnly":false,"disposed":false,"encryptedBytes":"m9nh2US0Sa6m+cXccCq0Xw==","base64SHA1Hash":"GFJ69qfjxEOdrmt+9q+0Cw2uz60="}]},{"name":"__NAME__","value":["userId"],"nameValue":"userId"},{"name":"fullname","value":["fullname"]},{"name":"type","value":["type"]}]'/>
-  <Task DTYPE="PullTask" id="30cfd653-257b-495f-8665-281281dbcb3d" name="Scripted SQL" resource_id="resource-db-scripted"
+  <Task DTYPE="PullTask" remediation="0" id="30cfd653-257b-495f-8665-281281dbcb3d" name="Scripted SQL" resource_id="resource-db-scripted"
         destinationRealm_id="e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" performCreate="1" performUpdate="1" performDelete="0" syncStatus="0" pullMode="INCREMENTAL"
         unmatchingRule="PROVISION" matchingRule="UPDATE" active="1" jobDelegate_id="PullJobDelegate"/>
 
index b185ca8..1368fec 100644 (file)
@@ -33,16 +33,15 @@ public interface SchemaDataBinder {
 
     VirSchema create(VirSchemaTO schemaTO);
 
-    DerSchemaTO getDerSchemaTO(DerSchema schema);
-
-    PlainSchemaTO getPlainSchemaTO(PlainSchema schema);
-
-    VirSchemaTO getVirSchemaTO(VirSchema schema);
-
     PlainSchema update(PlainSchemaTO schemaTO, PlainSchema schema);
 
     DerSchema update(DerSchemaTO schemaTO, DerSchema derSchema);
 
     VirSchema update(VirSchemaTO schemaTO, VirSchema virSchema);
 
+    PlainSchemaTO getPlainSchemaTO(String key);
+
+    DerSchemaTO getDerSchemaTO(String key);
+
+    VirSchemaTO getVirSchemaTO(String key);
 }
index 1673372..af4f57a 100644 (file)
@@ -49,13 +49,13 @@ public class DerAttrHandlerImpl implements DerAttrHandler {
     private Map<DerSchema, String> getValues(final Any<?> any, final Set<DerSchema> schemas) {
         Map<DerSchema, String> result = new HashMap<>(schemas.size());
 
-        for (DerSchema schema : schemas) {
+        schemas.forEach(schema -> {
             JexlContext jexlContext = new MapContext();
             JexlUtils.addPlainAttrsToContext(any.getPlainAttrs(), jexlContext);
             JexlUtils.addFieldsToContext(any, jexlContext);
 
             result.put(schema, JexlUtils.evaluate(schema.getExpression(), jexlContext));
-        }
+        });
 
         return result;
     }
@@ -96,13 +96,13 @@ public class DerAttrHandlerImpl implements DerAttrHandler {
 
         Map<DerSchema, String> result = new HashMap<>(schemas.size());
 
-        for (DerSchema schema : schemas) {
+        schemas.forEach(schema -> {
             JexlContext jexlContext = new MapContext();
             JexlUtils.addPlainAttrsToContext(any.getPlainAttrs(membership), jexlContext);
             JexlUtils.addFieldsToContext(any, jexlContext);
 
             result.put(schema, JexlUtils.evaluate(schema.getExpression(), jexlContext));
-        }
+        });
 
         return result;
     }
index a06d54a..4f51593 100644 (file)
@@ -556,41 +556,31 @@ abstract class AbstractAnyDataBinder {
 
         anyTO.setRealm(realmFullPath);
 
-        anyTO.getAuxClasses().addAll(auxClasses.stream().map(cls -> cls.getKey()).collect(Collectors.toList()));
+        anyTO.getAuxClasses().addAll(auxClasses.stream().map(Entity::getKey).collect(Collectors.toList()));
 
-        plainAttrs.stream().map(plainAttr -> {
+        plainAttrs.forEach(plainAttr -> {
             AttrTO.Builder attrTOBuilder = new AttrTO.Builder().
                     schema(plainAttr.getSchema().getKey()).
                     values(plainAttr.getValuesAsStrings());
             if (details) {
-                attrTOBuilder.schemaInfo(schemaDataBinder.getPlainSchemaTO(plainAttr.getSchema()));
+                attrTOBuilder.schemaInfo(schemaDataBinder.getPlainSchemaTO(plainAttr.getSchema().getKey()));
             }
-            return attrTOBuilder;
-        }).forEachOrdered(attrTOBuilder -> {
             anyTO.getPlainAttrs().add(attrTOBuilder.build());
         });
 
-        derAttrs.entrySet().stream().map(entry -> {
-            AttrTO.Builder attrTOBuilder = new AttrTO.Builder().
-                    schema(entry.getKey().getKey()).
-                    value(entry.getValue());
+        derAttrs.forEach((schema, value) -> {
+            AttrTO.Builder attrTOBuilder = new AttrTO.Builder().schema(schema.getKey()).value(value);
             if (details) {
-                attrTOBuilder.schemaInfo(schemaDataBinder.getDerSchemaTO(entry.getKey()));
+                attrTOBuilder.schemaInfo(schemaDataBinder.getDerSchemaTO(schema.getKey()));
             }
-            return attrTOBuilder;
-        }).forEachOrdered(attrTOBuilder -> {
             anyTO.getDerAttrs().add(attrTOBuilder.build());
         });
 
-        virAttrs.entrySet().stream().map(entry -> {
-            AttrTO.Builder attrTOBuilder = new AttrTO.Builder().
-                    schema(entry.getKey().getKey()).
-                    values(entry.getValue());
+        virAttrs.forEach((schema, values) -> {
+            AttrTO.Builder attrTOBuilder = new AttrTO.Builder().schema(schema.getKey()).values(values);
             if (details) {
-                attrTOBuilder.schemaInfo(schemaDataBinder.getVirSchemaTO(entry.getKey()));
+                attrTOBuilder.schemaInfo(schemaDataBinder.getVirSchemaTO(schema.getKey()));
             }
-            return attrTOBuilder;
-        }).forEachOrdered(attrTOBuilder -> {
             anyTO.getVirAttrs().add(attrTOBuilder.build());
         });
 
@@ -617,7 +607,7 @@ abstract class AbstractAnyDataBinder {
             membershipTO.getPlainAttrs().add(new AttrTO.Builder().
                     schema(plainAttr.getSchema().getKey()).
                     values(plainAttr.getValuesAsStrings()).
-                    schemaInfo(schemaDataBinder.getPlainSchemaTO(plainAttr.getSchema())).
+                    schemaInfo(schemaDataBinder.getPlainSchemaTO(plainAttr.getSchema().getKey())).
                     build());
         });
 
@@ -625,7 +615,7 @@ abstract class AbstractAnyDataBinder {
             membershipTO.getDerAttrs().add(new AttrTO.Builder().
                     schema(schema.getKey()).
                     value(value).
-                    schemaInfo(schemaDataBinder.getDerSchemaTO(schema)).
+                    schemaInfo(schemaDataBinder.getDerSchemaTO(schema.getKey())).
                     build());
         });
 
@@ -633,7 +623,7 @@ abstract class AbstractAnyDataBinder {
             membershipTO.getVirAttrs().add(new AttrTO.Builder().
                     schema(schema.getKey()).
                     values(values).
-                    schemaInfo(schemaDataBinder.getVirSchemaTO(schema)).
+                    schemaInfo(schemaDataBinder.getVirSchemaTO(schema.getKey())).
                     build());
         });
 
index 56b0b92..e71c54f 100644 (file)
  */
 package org.apache.syncope.core.provisioning.java.data;
 
-import java.util.ArrayList;
 import org.apache.syncope.core.provisioning.api.data.ConfigurationDataBinder;
 import java.util.Collections;
 import java.util.List;
+import java.util.stream.Collectors;
 import org.apache.commons.jexl3.JexlContext;
 import org.apache.commons.jexl3.MapContext;
 import org.apache.syncope.common.lib.SyncopeClientException;
@@ -48,17 +48,13 @@ public class ConfigurationDataBinderImpl extends AbstractAnyDataBinder implement
 
     @Override
     public List<AttrTO> getConfTO() {
-        List<AttrTO> attrTOs = new ArrayList<>();
-        for (CPlainAttr attr : confDAO.get().getPlainAttrs()) {
-            attrTOs.add(getAttrTO(attr));
-        }
-        return attrTOs;
+        return confDAO.get().getPlainAttrs().stream().map(attr -> getAttrTO(attr)).collect(Collectors.toList());
     }
 
     @Override
     public AttrTO getAttrTO(final CPlainAttr attr) {
         return new AttrTO.Builder().
-                schemaInfo(schemaDataBinder.getPlainSchemaTO(attr.getSchema())).
+                schemaInfo(schemaDataBinder.getPlainSchemaTO(attr.getSchema().getKey())).
                 schema(attr.getSchema().getKey()).
                 values(attr.getValuesAsStrings()).
                 build();
index 0632e2c..f91378f 100644 (file)
  */
 package org.apache.syncope.core.provisioning.java.data;
 
+import java.util.stream.Collectors;
 import org.apache.syncope.core.provisioning.api.data.SchemaDataBinder;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.SyncopeClientCompositeException;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.DerSchemaTO;
 import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
 import org.apache.syncope.common.lib.to.VirSchemaTO;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
@@ -38,6 +40,7 @@ import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
 import org.apache.syncope.core.persistence.api.dao.DerSchemaDAO;
 import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
 import org.apache.syncope.core.persistence.api.dao.ImplementationDAO;
+import org.apache.syncope.core.persistence.api.dao.NotFoundException;
 import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
 import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
@@ -45,6 +48,8 @@ import org.apache.syncope.core.persistence.api.entity.AnyUtils;
 import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory;
 import org.apache.syncope.core.persistence.api.entity.EntityFactory;
 import org.apache.syncope.core.persistence.api.entity.Implementation;
+import org.apache.syncope.core.persistence.api.entity.Schema;
+import org.apache.syncope.core.persistence.api.entity.SchemaLabel;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.api.entity.resource.Provision;
 import org.slf4j.Logger;
@@ -86,6 +91,26 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
     @Autowired
     private AnyUtilsFactory anyUtilsFactory;
 
+    private <S extends Schema, T extends SchemaTO> void labels(final T src, final S dst) {
+        src.getLabels().forEach((locale, display) -> {
+            SchemaLabel label = dst.getLabel(locale).orElse(null);
+            if (label == null) {
+                label = entityFactory.newEntity(SchemaLabel.class);
+                label.setLocale(locale);
+                label.setSchema(dst);
+                dst.add(label);
+            }
+            label.setDisplay(display);
+        });
+
+        dst.getLabels().removeIf(label -> !src.getLabels().containsKey(label.getLocale()));
+    }
+
+    private <S extends Schema, T extends SchemaTO> void labels(final S src, final T dst) {
+        dst.getLabels().putAll(src.getLabels().stream().
+                collect(Collectors.toMap(SchemaLabel::getLocale, SchemaLabel::getDisplay)));
+    }
+
     // --------------- PLAIN -----------------
     private PlainSchema fill(final PlainSchema schema, final PlainSchemaTO schemaTO) {
         if (!JexlUtils.isExpressionValid(schemaTO.getMandatoryCondition())) {
@@ -95,6 +120,7 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
         }
 
         BeanUtils.copyProperties(schemaTO, schema, IGNORE_PROPERTIES);
+        labels(schemaTO, schema);
 
         if (schemaTO.getValidator() == null) {
             schema.setValidator(null);
@@ -168,9 +194,17 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
     }
 
     @Override
-    public PlainSchemaTO getPlainSchemaTO(final PlainSchema schema) {
+    public PlainSchemaTO getPlainSchemaTO(final String key) {
+        PlainSchema schema = plainSchemaDAO.find(key);
+        if (schema == null) {
+            throw new NotFoundException("Schema '" + key + "'");
+        }
+
         PlainSchemaTO schemaTO = new PlainSchemaTO();
+
         BeanUtils.copyProperties(schema, schemaTO, IGNORE_PROPERTIES);
+        labels(schema, schemaTO);
+
         schemaTO.setAnyTypeClass(schema.getAnyTypeClass() == null ? null : schema.getAnyTypeClass().getKey());
         if (schema.getValidator() != null) {
             schemaTO.setValidator(schema.getValidator().getKey());
@@ -201,6 +235,7 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
         }
 
         BeanUtils.copyProperties(schemaTO, schema, IGNORE_PROPERTIES);
+        labels(schemaTO, schema);
 
         DerSchema merged = derSchemaDAO.save(schema);
 
@@ -235,9 +270,17 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
     }
 
     @Override
-    public DerSchemaTO getDerSchemaTO(final DerSchema schema) {
+    public DerSchemaTO getDerSchemaTO(final String key) {
+        DerSchema schema = derSchemaDAO.find(key);
+        if (schema == null) {
+            throw new NotFoundException("Derived schema '" + key + "'");
+        }
+
         DerSchemaTO schemaTO = new DerSchemaTO();
+
         BeanUtils.copyProperties(schema, schemaTO, IGNORE_PROPERTIES);
+        labels(schema, schemaTO);
+
         schemaTO.setAnyTypeClass(schema.getAnyTypeClass() == null ? null : schema.getAnyTypeClass().getKey());
 
         return schemaTO;
@@ -246,6 +289,7 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
     // --------------- VIRTUAL -----------------
     private VirSchema fill(final VirSchema schema, final VirSchemaTO schemaTO) {
         BeanUtils.copyProperties(schemaTO, schema, IGNORE_PROPERTIES);
+        labels(schemaTO, schema);
 
         if (schemaTO.getAnyTypeClass() != null
                 && (schema.getAnyTypeClass() == null
@@ -299,9 +343,17 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
     }
 
     @Override
-    public VirSchemaTO getVirSchemaTO(final VirSchema schema) {
+    public VirSchemaTO getVirSchemaTO(final String key) {
+        VirSchema schema = virSchemaDAO.find(key);
+        if (schema == null) {
+            throw new NotFoundException("Virtual Schema '" + key + "'");
+        }
+
         VirSchemaTO schemaTO = new VirSchemaTO();
+
         BeanUtils.copyProperties(schema, schemaTO, IGNORE_PROPERTIES);
+        labels(schema, schemaTO);
+
         schemaTO.setAnyTypeClass(schema.getAnyTypeClass() == null ? null : schema.getAnyTypeClass().getKey());
         schemaTO.setResource(schema.getProvision().getResource().getKey());
         schemaTO.setAnyType(schema.getProvision().getAnyType().getKey());
index b161241..ab85cfd 100644 (file)
@@ -34,8 +34,7 @@ import javax.persistence.JoinColumn;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
 import org.apache.syncope.core.persistence.api.entity.OIDCProvider;
 import org.apache.syncope.core.persistence.api.entity.OIDCProviderItem;
 import org.apache.syncope.core.persistence.api.entity.OIDCUserTemplate;
@@ -87,20 +86,14 @@ public class JPAOIDCProvider extends AbstractGeneratedKeyEntity implements OIDCP
     @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER, mappedBy = "op")
     private List<JPAOIDCProviderItem> items = new ArrayList<>();
 
-    @Min(0)
-    @Max(1)
-    @Column(nullable = false)
-    private Integer createUnmatching;
+    @NotNull
+    private Boolean createUnmatching = false;
 
-    @Min(0)
-    @Max(1)
-    @Column(nullable = false)
-    private Integer selfRegUnmatching;
+    @NotNull
+    private Boolean selfRegUnmatching = false;
 
-    @Min(0)
-    @Max(1)
-    @Column(nullable = false)
-    private Integer updateMatching;
+    @NotNull
+    private Boolean updateMatching = false;
 
     @ElementCollection(fetch = FetchType.EAGER)
     @Column(name = "actionClassName")
@@ -211,32 +204,32 @@ public class JPAOIDCProvider extends AbstractGeneratedKeyEntity implements OIDCP
 
     @Override
     public boolean isCreateUnmatching() {
-        return isBooleanAsInteger(createUnmatching);
+        return createUnmatching;
     }
 
     @Override
     public void setCreateUnmatching(final boolean createUnmatching) {
-        this.createUnmatching = getBooleanAsInteger(createUnmatching);
+        this.createUnmatching = createUnmatching;
     }
 
     @Override
     public boolean isSelfRegUnmatching() {
-        return isBooleanAsInteger(selfRegUnmatching);
+        return selfRegUnmatching;
     }
 
     @Override
     public void setSelfRegUnmatching(final boolean selfRegUnmatching) {
-        this.selfRegUnmatching = getBooleanAsInteger(selfRegUnmatching);
+        this.selfRegUnmatching = selfRegUnmatching;
     }
 
     @Override
     public boolean isUpdateMatching() {
-        return isBooleanAsInteger(updateMatching);
+        return updateMatching;
     }
 
     @Override
     public void setUpdateMatching(final boolean updateMatching) {
-        this.updateMatching = getBooleanAsInteger(updateMatching);
+        this.updateMatching = updateMatching;
     }
 
     @Override
index 2705f5e..54e76be 100644 (file)
@@ -34,8 +34,7 @@ import javax.persistence.Lob;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.syncope.common.lib.types.SAML2BindingType;
 import org.apache.syncope.core.persistence.api.entity.SAML2IdP;
@@ -66,30 +65,20 @@ public class JPASAML2IdP extends AbstractGeneratedKeyEntity implements SAML2IdP
     @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER, mappedBy = "idp")
     private List<JPASAML2IdPItem> items = new ArrayList<>();
 
-    @Min(0)
-    @Max(1)
-    @Column(nullable = false)
-    private Integer createUnmatching;
+    @NotNull
+    private Boolean createUnmatching = false;
 
-    @Min(0)
-    @Max(1)
-    @Column(nullable = false)
-    private Integer selfRegUnmatching;
+    @NotNull
+    private Boolean selfRegUnmatching = false;
 
-    @Min(0)
-    @Max(1)
-    @Column(nullable = false)
-    private Integer updateMatching;
+    @NotNull
+    private Boolean updateMatching = false;
 
-    @Min(0)
-    @Max(1)
-    @Column(nullable = false)
-    private Integer useDeflateEncoding;
+    @NotNull
+    private Boolean useDeflateEncoding = false;
 
-    @Min(0)
-    @Max(1)
-    @Column(nullable = false)
-    private Integer supportUnsolicited;
+    @NotNull
+    private Boolean supportUnsolicited = false;
 
     @Column(nullable = false)
     private SAML2BindingType bindingType;
@@ -136,52 +125,52 @@ public class JPASAML2IdP extends AbstractGeneratedKeyEntity implements SAML2IdP
 
     @Override
     public boolean isCreateUnmatching() {
-        return isBooleanAsInteger(createUnmatching);
+        return createUnmatching;
     }
 
     @Override
     public void setCreateUnmatching(final boolean createUnmatching) {
-        this.createUnmatching = getBooleanAsInteger(createUnmatching);
+        this.createUnmatching = createUnmatching;
     }
 
     @Override
     public boolean isSelfRegUnmatching() {
-        return isBooleanAsInteger(selfRegUnmatching);
+        return selfRegUnmatching;
     }
 
     @Override
     public void setSelfRegUnmatching(final boolean selfRegUnmatching) {
-        this.selfRegUnmatching = getBooleanAsInteger(selfRegUnmatching);
+        this.selfRegUnmatching = selfRegUnmatching;
     }
 
     @Override
     public boolean isUpdateMatching() {
-        return isBooleanAsInteger(updateMatching);
+        return updateMatching;
     }
 
     @Override
     public void setUpdateMatching(final boolean updateMatching) {
-        this.updateMatching = getBooleanAsInteger(updateMatching);
+        this.updateMatching = updateMatching;
     }
 
     @Override
     public boolean isUseDeflateEncoding() {
-        return isBooleanAsInteger(useDeflateEncoding);
+        return useDeflateEncoding;
     }
 
     @Override
     public void setUseDeflateEncoding(final boolean useDeflateEncoding) {
-        this.useDeflateEncoding = getBooleanAsInteger(useDeflateEncoding);
+        this.useDeflateEncoding = useDeflateEncoding;
     }
 
     @Override
     public boolean isSupportUnsolicited() {
-        return isBooleanAsInteger(supportUnsolicited);
+        return supportUnsolicited;
     }
 
     @Override
     public void setSupportUnsolicited(final boolean supportUnsolicited) {
-        this.supportUnsolicited = getBooleanAsInteger(supportUnsolicited);
+        this.supportUnsolicited = supportUnsolicited;
     }
 
     @Override
index 4eded72..f243bb5 100644 (file)
@@ -31,8 +31,6 @@ import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.Bas
 import org.apache.syncope.client.console.wizards.any.ResultPage;
 import org.apache.syncope.common.lib.scim.SCIMConf;
 import org.apache.syncope.common.lib.scim.types.SCIMEntitlement;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
@@ -76,34 +74,26 @@ public class SCIMConfPage extends BaseExtPage {
 
             @Override
             protected void setWindowClosedReloadCallback(final BaseModal<?> modal) {
-                modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
-                    private static final long serialVersionUID = 8804221891699487139L;
-
-                    @Override
-                    public void onClose(final AjaxRequestTarget target) {
-                        if (modal.getContent() instanceof ResultPage) {
-                            Serializable result = ResultPage.class.cast(modal.getContent()).getResult();
-                            try {
-                                restClient.set(MAPPER.readValue(result.toString(), SCIMConf.class));
-
-                                SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
-                                modal.show(false);
-                                target.add(content);
-                            } catch (Exception e) {
-                                LOG.error("While setting SCIM configuration", e);
-                                SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
-                                        ? e.getClass().getName() : e.getMessage());
-                            }
-                            ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+                modal.setWindowClosedCallback(target -> {
+                    if (modal.getContent() instanceof ResultPage) {
+                        Serializable result = ResultPage.class.cast(modal.getContent()).getResult();
+                        try {
+                            restClient.set(MAPPER.readValue(result.toString(), SCIMConf.class));
+
+                            SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+                            modal.show(false);
+                            target.add(content);
+                        } catch (Exception e) {
+                            LOG.error("While setting SCIM configuration", e);
+                            SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
+                                    ? e.getClass().getName() : e.getMessage());
                         }
+                        ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
                     }
                 });
             }
-
         });
 
         return content;
     }
-
 }
index ab5fbdb..7740dcf 100644 (file)
@@ -22,8 +22,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-import org.apache.commons.collections4.IterableUtils;
-import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.tabs.Accordion;
 import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
@@ -57,9 +55,7 @@ public class SCIMConfUserPanel extends SCIMConfTabPanel {
 
     private final SCIMUserConf scimUserConf;
 
-    public SCIMConfUserPanel(
-            final String id,
-            final SCIMConf scimConf) {
+    public SCIMConfUserPanel(final String id, final SCIMConf scimConf) {
         super(id, scimConf);
 
         if (scimConf.getUserConf() == null) {
@@ -75,156 +71,148 @@ public class SCIMConfUserPanel extends SCIMConfTabPanel {
         settings.setShowListOnEmptyInput(true);
         settings.setCssClassName("custom-autocomplete-box");
 
-        AjaxTextFieldPanel displayNamePanel =
-                new AjaxTextFieldPanel("displayName", "displayName",
-                        new PropertyModel<String>("displayName", "displayName") {
+        AjaxTextFieldPanel displayNamePanel = new AjaxTextFieldPanel("displayName", "displayName",
+                new PropertyModel<String>("displayName", "displayName") {
 
-                    private static final long serialVersionUID = -6427731218492117883L;
+            private static final long serialVersionUID = -6427731218492117883L;
 
-                    @Override
-                    public String getObject() {
-                        return scimUserConf.getDisplayName();
-                    }
+            @Override
+            public String getObject() {
+                return scimUserConf.getDisplayName();
+            }
 
-                    @Override
-                    public void setObject(final String object) {
-                        scimUserConf.setDisplayName(object);
-                    }
+            @Override
+            public void setObject(final String object) {
+                scimUserConf.setDisplayName(object);
+            }
 
-                });
+        });
         displayNamePanel.setChoices(plainSchemaNames);
 
-        AjaxTextFieldPanel localePanel =
-                new AjaxTextFieldPanel("locale", "locale",
-                        new PropertyModel<String>("locale", "locale") {
+        AjaxTextFieldPanel localePanel = new AjaxTextFieldPanel("locale", "locale",
+                new PropertyModel<String>("locale", "locale") {
 
-                    private static final long serialVersionUID = -6427731218492117883L;
+            private static final long serialVersionUID = -6427731218492117883L;
 
-                    @Override
-                    public String getObject() {
-                        return scimUserConf.getLocale();
-                    }
+            @Override
+            public String getObject() {
+                return scimUserConf.getLocale();
+            }
 
-                    @Override
-                    public void setObject(final String object) {
-                        scimUserConf.setLocale(object);
-                    }
+            @Override
+            public void setObject(final String object) {
+                scimUserConf.setLocale(object);
+            }
 
-                });
+        });
         localePanel.setChoices(plainSchemaNames);
 
-        AjaxTextFieldPanel nickNamePanel =
-                new AjaxTextFieldPanel("nickName", "nickName",
-                        new PropertyModel<String>("nickName", "nickName") {
+        AjaxTextFieldPanel nickNamePanel = new AjaxTextFieldPanel("nickName", "nickName",
+                new PropertyModel<String>("nickName", "nickName") {
 
-                    private static final long serialVersionUID = -6427731218492117883L;
+            private static final long serialVersionUID = -6427731218492117883L;
 
-                    @Override
-                    public String getObject() {
-                        return scimUserConf.getNickName();
-                    }
+            @Override
+            public String getObject() {
+                return scimUserConf.getNickName();
+            }
 
-                    @Override
-                    public void setObject(final String object) {
-                        scimUserConf.setNickName(object);
-                    }
+            @Override
+            public void setObject(final String object) {
+                scimUserConf.setNickName(object);
+            }
 
-                });
+        });
         nickNamePanel.setChoices(plainSchemaNames);
 
-        AjaxTextFieldPanel preferredLanguagePanel =
-                new AjaxTextFieldPanel("preferredLanguage", "preferredLanguage",
-                        new PropertyModel<String>("preferredLanguage", "preferredLanguage") {
+        AjaxTextFieldPanel preferredLanguagePanel = new AjaxTextFieldPanel("preferredLanguage", "preferredLanguage",
+                new PropertyModel<String>("preferredLanguage", "preferredLanguage") {
 
-                    private static final long serialVersionUID = -6427731218492117883L;
+            private static final long serialVersionUID = -6427731218492117883L;
 
-                    @Override
-                    public String getObject() {
-                        return scimUserConf.getPreferredLanguage();
-                    }
+            @Override
+            public String getObject() {
+                return scimUserConf.getPreferredLanguage();
+            }
 
-                    @Override
-                    public void setObject(final String object) {
-                        scimUserConf.setPreferredLanguage(object);
-                    }
+            @Override
+            public void setObject(final String object) {
+                scimUserConf.setPreferredLanguage(object);
+            }
 
-                });
+        });
         preferredLanguagePanel.setChoices(plainSchemaNames);
 
-        AjaxTextFieldPanel profileUrlPanel =
-                new AjaxTextFieldPanel("profileUrl", "profileUrl",
-                        new PropertyModel<String>("profileUrl", "profileUrl") {
+        AjaxTextFieldPanel profileUrlPanel = new AjaxTextFieldPanel("profileUrl", "profileUrl",
+                new PropertyModel<String>("profileUrl", "profileUrl") {
 
-                    private static final long serialVersionUID = -6427731218492117883L;
+            private static final long serialVersionUID = -6427731218492117883L;
 
-                    @Override
-                    public String getObject() {
-                        return scimUserConf.getProfileUrl();
-                    }
+            @Override
+            public String getObject() {
+                return scimUserConf.getProfileUrl();
+            }
 
-                    @Override
-                    public void setObject(final String object) {
-                        scimUserConf.setProfileUrl(object);
-                    }
+            @Override
+            public void setObject(final String object) {
+                scimUserConf.setProfileUrl(object);
+            }
 
-                });
+        });
         profileUrlPanel.setChoices(plainSchemaNames);
 
-        AjaxTextFieldPanel timezonePanel =
-                new AjaxTextFieldPanel("timezone", "timezone",
-                        new PropertyModel<String>("timezone", "timezone") {
+        AjaxTextFieldPanel timezonePanel = new AjaxTextFieldPanel("timezone", "timezone",
+                new PropertyModel<String>("timezone", "timezone") {
 
-                    private static final long serialVersionUID = -6427731218492117883L;
+            private static final long serialVersionUID = -6427731218492117883L;
 
-                    @Override
-                    public String getObject() {
-                        return scimUserConf.getTimezone();
-                    }
+            @Override
+            public String getObject() {
+                return scimUserConf.getTimezone();
+            }
 
-                    @Override
-                    public void setObject(final String object) {
-                        scimUserConf.setTimezone(object);
-