syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] syncope git commit: [SYNCOPE-1167] Preliminary AnyType selection when adding new provision rule
Date Fri, 28 Jul 2017 07:50:27 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 6634daaee -> 2a2d8c836
  refs/heads/master 64ef5bf18 -> e06d18ae3


[SYNCOPE-1167] Preliminary AnyType selection when adding new provision rule


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/2a2d8c83
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/2a2d8c83
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/2a2d8c83

Branch: refs/heads/2_0_X
Commit: 2a2d8c836370bc23261e713405110839495cb8a1
Parents: 6634daa
Author: Matteo Alessandroni <matteo.alessandroni@tirasa.net>
Authored: Tue Jul 25 16:27:43 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Jul 28 09:01:55 2017 +0200

----------------------------------------------------------------------
 .../console/wizards/AjaxWizardBuilder.java      |  2 +-
 .../client/console/wizards/WizardMgtPanel.java  | 10 +++
 .../resources/ObjectTypeTogglePanel.java        | 85 ++++++++++++++++++
 .../resources/ProvisionWizardBuilder.java       | 84 ++++-------------
 .../resources/ResourceProvisionPanel.java       | 95 +++++++++++++++++++-
 .../resources/ObjectTypeTogglePanel.html        | 32 +++++++
 .../resources/ObjectTypeTogglePanel.properties  | 22 +++++
 .../ObjectTypeTogglePanel_it.properties         | 22 +++++
 .../ObjectTypeTogglePanel_pt_BR.properties      | 22 +++++
 .../ObjectTypeTogglePanel_ru.properties         | 22 +++++
 .../ProvisionWizardBuilder$ObjectType.html      |  3 -
 ...ProvisionWizardBuilder$ObjectType.properties |  7 +-
 ...visionWizardBuilder$ObjectType_it.properties |  6 +-
 ...ionWizardBuilder$ObjectType_pt_BR.properties |  8 +-
 ...visionWizardBuilder$ObjectType_ru.properties |  8 +-
 .../resources/ResourceProvisionPanel.html       |  5 +-
 .../syncope/fit/console/TopologyITCase.java     | 26 +++++-
 17 files changed, 362 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java
index 9e3c6e4..32514ad 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java
@@ -87,7 +87,7 @@ public abstract class AjaxWizardBuilder<T extends Serializable> extends
Abstract
     public AjaxWizard<T> build(final String id, final AjaxWizard.Mode mode) {
         this.mode = mode;
 
-        // ge the specified item if available
+        // get the specified item if available
         final T modelObject = newModelObject();
 
         return new AjaxWizard<T>(id, modelObject, buildModelSteps(modelObject, new
WizardModel()), mode, this.pageRef) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
index 0ade92c..509dd92 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
@@ -296,6 +296,16 @@ public abstract class WizardMgtPanel<T extends Serializable> extends
Panel imple
     public MarkupContainer addInnerObject(final Component... childs) {
         return initialFragment.add(childs);
     }
+    
+    /**
+     * Add or replace object inside the main container.
+     *
+     * @param childs components to be added.
+     * @return the current panel instance.
+     */
+    public MarkupContainer addOrReplaceInnerObject(final Component... childs) {
+        return initialFragment.addOrReplace(childs);
+    }
 
     /**
      * Add object outside the main container.

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.java
new file mode 100644
index 0000000..9e26700
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.java
@@ -0,0 +1,85 @@
+/*
+ * 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.wizards.resources;
+
+import java.io.Serializable;
+import java.util.List;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.panels.TogglePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.PropertyModel;
+
+public abstract class ObjectTypeTogglePanel extends TogglePanel<Serializable> {
+
+    private static final long serialVersionUID = -1366846136630731264L;
+
+    protected PropertyModel<String> typeModel;
+
+    private final Form<Object> form;
+
+    ObjectTypeTogglePanel(
+            final String id,
+            final ResourceProvision item,
+            final LoadableDetachableModel<List<String>> anyTypes,
+            final PageReference pageRef) {
+        super(id, pageRef);
+
+        form = new Form<>("objectTypeForm");
+        addInnerObject(form);
+
+        typeModel = new PropertyModel<>(item, "anyType");
+
+        form.add(new AjaxDropDownChoicePanel<>(
+                "type", "type", typeModel, false).
+                setNullValid(false).
+                setChoices(anyTypes).
+                setStyleSheet("form-control").
+                hideLabel());
+
+        form.add(new AjaxSubmitLink("changeit", form) {
+
+            private static final long serialVersionUID = -7978723352517770644L;
+
+            @Override
+            protected void onSubmit(final AjaxRequestTarget target, final Form<?> form)
{
+                ObjectTypeTogglePanel.this.onSubmit(typeModel.getObject(), target);
+                target.add(form);
+                toggle(target, false);
+
+                ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+            }
+
+            @Override
+            protected void onError(final AjaxRequestTarget target, final Form<?> form)
{
+                ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+            }
+        });
+    }
+
+    protected abstract void onSubmit(final String type, final AjaxRequestTarget target);
+
+    public void setHeaderLabel(final AjaxRequestTarget target) {
+        setHeader(target, getString("type"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
index e13d6bb..2ade6cf 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
@@ -19,25 +19,18 @@
 package org.apache.syncope.client.console.wizards.resources;
 
 import java.io.Serializable;
-import java.util.ArrayList;
 import java.util.List;
-import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.ListUtils;
 import org.apache.commons.collections4.Predicate;
-import org.apache.commons.collections4.Transformer;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.console.commons.ConnIdSpecialName;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.panels.ProvisionAuxClassesPanel;
-import org.apache.syncope.client.console.rest.AnyTypeRestClient;
 import org.apache.syncope.client.console.rest.ConnectorRestClient;
 import org.apache.syncope.client.console.wicket.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior;
 import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
-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.wicket.markup.html.form.FieldPanel;
 import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
-import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.MappingTO;
 import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
@@ -47,7 +40,6 @@ import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.extensions.wizard.WizardModel;
 import org.apache.wicket.extensions.wizard.WizardStep;
 import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.model.LoadableDetachableModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.ResourceModel;
@@ -61,36 +53,7 @@ public class ProvisionWizardBuilder extends AjaxWizardBuilder<ResourceProvision>
 
     private final ResourceTO resourceTO;
 
-    private final LoadableDetachableModel<List<String>> anyTypes = new LoadableDetachableModel<List<String>>()
{
-
-        private static final long serialVersionUID = 5275935387613157437L;
-
-        @Override
-        protected List<String> load() {
-            final List<String> currentlyAdded = new ArrayList<>();
-
-            CollectionUtils.collect(resourceTO.getProvisions(), new Transformer<ProvisionTO,
String>() {
-
-                @Override
-                public String transform(final ProvisionTO provisionTO) {
-                    return provisionTO.getAnyType();
-                }
-            }, currentlyAdded);
-
-            List<String> result = ListUtils.select(new AnyTypeRestClient().list(),
new Predicate<String>() {
-
-                @Override
-                public boolean evaluate(final String key) {
-                    return !currentlyAdded.contains(key);
-                }
-            });
-            if (resourceTO.getOrgUnit() == null) {
-                result.add(0, SyncopeConstants.REALM_ANYTYPE);
-            }
-
-            return result;
-        }
-    };
+    protected AjaxTextFieldPanel clazz;
 
     /**
      * The object type specification step.
@@ -100,41 +63,30 @@ public class ProvisionWizardBuilder extends AjaxWizardBuilder<ResourceProvision>
         private static final long serialVersionUID = -1657800545799468278L;
 
         ObjectType(final ResourceProvision item) {
-            super(new ResourceModel("type.title", StringUtils.EMPTY),
-                    new ResourceModel("type.summary", StringUtils.EMPTY), new Model<>(item));
+            super(new ResourceModel("clazz.title", StringUtils.EMPTY),
+                    new ResourceModel("clazz.summary", StringUtils.EMPTY), new Model<>(item));
 
             final WebMarkupContainer container = new WebMarkupContainer("container");
             container.setOutputMarkupId(true);
             add(container);
 
-            final FieldPanel<String> type = new AjaxDropDownChoicePanel<>(
-                    "type", "type", new PropertyModel<String>(item, "anyType"), false).
-                    setChoices(anyTypes).
-                    setStyleSheet("form-control").
-                    setRequired(true);
-            container.add(type);
-
-            final AjaxTextFieldPanel clazz = new AjaxTextFieldPanel(
+            clazz = new AjaxTextFieldPanel(
                     "clazz", "clazz", new PropertyModel<String>(item, "objectClass"));
             clazz.setRequired(true);
             clazz.setChoices(connectorRestClient.getObjectClasses(resourceTO.getConnector()));
             container.add(clazz);
+        }
+    }
 
-            type.getField().add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE)
{
-
-                private static final long serialVersionUID = -1107858522700306810L;
-
-                @Override
-                protected void onUpdate(final AjaxRequestTarget target) {
-                    if (AnyTypeKind.USER.name().equals(type.getModelObject())) {
-                        clazz.setModelObject(ConnIdSpecialName.ACCOUNT);
-                        target.add(container);
-                    } else if (AnyTypeKind.GROUP.name().equals(type.getModelObject())) {
-                        clazz.setModelObject(ConnIdSpecialName.GROUP);
-                        target.add(container);
-                    }
-                }
-            });
+    protected void setObjectClassModelObject(final String type) {
+        if (clazz != null) {
+            if (AnyTypeKind.USER.name().equals(type)) {
+                clazz.setModelObject(ConnIdSpecialName.ACCOUNT);
+            } else if (AnyTypeKind.GROUP.name().equals(type)) {
+                clazz.setModelObject(ConnIdSpecialName.GROUP);
+            } else {
+                clazz.setModelObject("");
+            }
         }
     }
 
@@ -230,12 +182,12 @@ public class ProvisionWizardBuilder extends AjaxWizardBuilder<ResourceProvision>
     /**
      * Construct.
      *
-     * @param resurceTO external resource to be updated.
+     * @param resourceTO external resource to be updated.
      * @param pageRef Caller page reference.
      */
-    public ProvisionWizardBuilder(final ResourceTO resurceTO, final PageReference pageRef)
{
+    public ProvisionWizardBuilder(final ResourceTO resourceTO, final PageReference pageRef)
{
         super(new ResourceProvision(), pageRef);
-        this.resourceTO = resurceTO;
+        this.resourceTO = resourceTO;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java
index 26ce5d5..fa13fc7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java
@@ -23,9 +23,12 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.IteratorUtils;
+import org.apache.commons.collections4.ListUtils;
 import org.apache.commons.collections4.Predicate;
+import org.apache.commons.collections4.Transformer;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.client.console.commons.Constants;
@@ -37,6 +40,7 @@ import org.apache.syncope.client.console.rest.AnyTypeRestClient;
 import org.apache.syncope.client.console.rest.ResourceRestClient;
 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.ActionLinksTogglePanel;
 import org.apache.syncope.client.console.wizards.AjaxWizard;
 import org.apache.syncope.client.console.wizards.WizardMgtPanel;
 import org.apache.syncope.common.lib.SyncopeClientException;
@@ -47,8 +51,10 @@ import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.event.Broadcast;
 import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.LoadableDetachableModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.StringResourceModel;
 
@@ -62,6 +68,14 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable>
{
 
     private final List<ResourceProvision> provisions;
 
+    private final ObjectTypeTogglePanel objectTypeTogglePanel;
+
+    private final WizardMgtPanel<ResourceProvision> list;
+
+    private final ProvisionWizardBuilder wizard;
+
+    private final AjaxLink<ResourceProvision> addAjaxLink;
+
     public ResourceProvisionPanel(
             final BaseModal<Serializable> modal,
             final ResourceTO resourceTO,
@@ -72,7 +86,7 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable>
{
 
         setOutputMarkupId(true);
 
-        final ProvisionWizardBuilder wizard = new ProvisionWizardBuilder(resourceTO, pageRef);
+        wizard = new ProvisionWizardBuilder(resourceTO, pageRef);
 
         final ListViewPanel.Builder<ResourceProvision> builder = new ListViewPanel.Builder<ResourceProvision>(
                 ResourceProvision.class, pageRef) {
@@ -111,6 +125,8 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable>
{
 
             @Override
             protected void customActionOnFinishCallback(final AjaxRequestTarget target) {
+                checkAddButton();
+
                 // keep list ordered - SYNCOPE-1154
                 sortProvisions();
 
@@ -141,7 +157,7 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable>
{
             public void onClick(final AjaxRequestTarget target, final ResourceProvision provision)
{
                 try {
                     send(ResourceProvisionPanel.this, Broadcast.DEPTH,
-                            new AjaxWizard.NewItemActionEvent<>(provision, 2, target).setResourceModel(
+                            new AjaxWizard.NewItemActionEvent<>(provision, 1, target).setResourceModel(
                                     new StringResourceModel("inner.provision.mapping",
                                             ResourceProvisionPanel.this,
                                             Model.of(provision))));
@@ -201,14 +217,53 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable>
{
                             resourceTO.getProvisions().remove(provision.getProvisionTO());
                         }
                         provisions.remove(provision);
+                        checkAddButton();
                         send(ResourceProvisionPanel.this, Broadcast.DEPTH, new ListViewReload<>(target));
                     }
                 }, ActionLink.ActionType.DELETE, StandardEntitlement.RESOURCE_UPDATE);
 
         builder.addNewItemPanelBuilder(wizard);
 
-        final WizardMgtPanel<ResourceProvision> list = builder.build("provision");
+        list = builder.build("provision");
+
+        addAjaxLink = new AjaxLink<ResourceProvision>("add") {
+
+            private static final long serialVersionUID = -7978723352517770644L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
+                objectTypeTogglePanel.setHeaderLabel(target);
+                objectTypeTogglePanel.toggle(target, true);
+            }
+        };
+        list.addOrReplaceInnerObject(addAjaxLink);
         add(list);
+
+        // ----------------------------------------------------------------------
+        // toggle panel, used to choose 'type' before starting wizard - SYNCOPE-1167
+        final ResourceProvision provision = new ResourceProvision();
+        provision.setAnyType("");
+        objectTypeTogglePanel =
+                new ObjectTypeTogglePanel("objectTypeToggle", provision, getAnyTypes(), pageRef)
{
+
+            private static final long serialVersionUID = 7878063325027015067L;
+
+            @Override
+            protected void onSubmit(final String type, final AjaxRequestTarget target) {
+
+                provision.setAnyType(type);
+
+                send(list, Broadcast.BREADTH,
+                        new ActionLinksTogglePanel.ActionLinkToggleCloseEventPayload(target));
+                send(list, Broadcast.DEPTH,
+                        new AjaxWizard.NewItemActionEvent<>(provision, target));
+
+                wizard.setObjectClassModelObject(type);
+            }
+
+        };
+        checkAddButton();
+        add(objectTypeTogglePanel);
     }
 
     private void checkConnObjectKeyCount(final String anyType, final List<ItemTO> items)
{
@@ -263,4 +318,38 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable>
{
             }
         });
     }
+
+    private LoadableDetachableModel<List<String>> getAnyTypes() {
+        return new LoadableDetachableModel<List<String>>() {
+
+            private static final long serialVersionUID = 5275935387613157437L;
+
+            @Override
+            protected List<String> load() {
+                final List<String> currentlyAdded = new ArrayList<>();
+
+                CollectionUtils.collect(resourceTO.getProvisions(), new Transformer<ProvisionTO,
String>() {
+
+                    @Override
+                    public String transform(final ProvisionTO provisionTO) {
+                        return provisionTO.getAnyType();
+                    }
+                }, currentlyAdded);
+
+                return ListUtils.select(new AnyTypeRestClient().list(), new Predicate<String>()
{
+
+                    @Override
+                    public boolean evaluate(final String key) {
+                        return !currentlyAdded.contains(key);
+                    }
+                });
+            }
+        };
+    }
+
+    private void checkAddButton() {
+        boolean test = !getAnyTypes().getObject().isEmpty();
+        addAjaxLink.setVisible(test);
+        objectTypeTogglePanel.setEnabled(test);
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.html
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.html
new file mode 100644
index 0000000..cea7a63
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.html
@@ -0,0 +1,32 @@
+<!--
+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:extend>
+    <div id="startAtContainer">
+      <form wicket:id="objectTypeForm">
+        <div class="input-group">
+          <span wicket:id="type"/>
+          <div class="input-group-addon">
+            <a wicket:id="changeit"><i class="fa fa-list-alt" alt="object type icon"
title="ObjectType"></i></a>
+          </div>
+        </div>
+      </form>
+    </div>
+  </wicket:extend>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.properties
new file mode 100644
index 0000000..e966cde
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel.properties
@@ -0,0 +1,22 @@
+# 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.
+
+type.title=Specify the type of the provisioning object
+type.summary=
+
+type=Type
+type.Required=Type is required

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_it.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_it.properties
new file mode 100644
index 0000000..263c9f1
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_it.properties
@@ -0,0 +1,22 @@
+# 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.
+
+type.title=Specifica il tipo del provisioning
+type.summary=
+
+type=Type
+type.Required=Type \u00e8 richiesto

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_pt_BR.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_pt_BR.properties
new file mode 100644
index 0000000..fe0c9f5
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_pt_BR.properties
@@ -0,0 +1,22 @@
+# 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.
+
+type.title=Especifique o tipo de objeto de provisioning
+type.summary=
+
+type=Type
+type.Required=Type \u00e9 necess\u00e1rio

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_ru.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_ru.properties
new file mode 100644
index 0000000..c1f2f27
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ObjectTypeTogglePanel_ru.properties
@@ -0,0 +1,22 @@
+# 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.
+
+type.title=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0442\u0438\u043f \u043e\u0431\u044a\u0435\u043a\u0442\u0430
\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438
+type.summary=
+
+type=Type
+type.Required=Type \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.html
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.html
index 285b25a..c5ff7b1 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.html
@@ -20,9 +20,6 @@ under the License.
   <wicket:panel>
     <div wicket:id="container">
       <div class="form-group">
-        <span wicket:id="type"/>
-      </div>
-      <div class="form-group">
         <span wicket:id="clazz"/>
       </div>
     </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.properties
index d981343..08d4d61 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType.properties
@@ -15,11 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-type.title=Specify the type of the provisioning object
-type.summary=
+clazz.title=Specify the object class of the provisioning object
+clazz.summary=
 
-type=Type
-type.Required=Type is required
 clazz=Object Class
 clazz.Required=Object class is required
-

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_it.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_it.properties
index 87079bc..3219b30 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_it.properties
@@ -15,10 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-type.title=Specifica il tipo del provisioning
-type.summary=
+clazz.title=Specifica il campo object class del provisioning
+clazz.summary=
 
-type=Type
-type.Required=Type \u00e8 richiesto
 clazz=Object Class
 clazz.Required=Object class \u00e8 richiesto

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_pt_BR.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_pt_BR.properties
index 9d4a687..7e16e5c 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_pt_BR.properties
@@ -15,10 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-type.title=Specify the type of the provisioning object
-type.summary=
+clazz.title=Especifique a classe de objeto do objeto de provisioning
+clazz.summary=
 
-type=Type
-type.Required=Type is required
 clazz=Object Class
-clazz.Required=Object class is required
+clazz.Required=Object class \u00e9 necess\u00e1ria

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_ru.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_ru.properties
index 9d4a687..dd86e10 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ObjectType_ru.properties
@@ -15,10 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-type.title=Specify the type of the provisioning object
-type.summary=
+clazz.title=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430
\u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438
+clazz.summary=
 
-type=Type
-type.Required=Type is required
 clazz=Object Class
-clazz.Required=Object class is required
+clazz.Required=Object class \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html
index ef243a8..1998775 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html
@@ -17,7 +17,8 @@ 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>
+    <wicket:extend>
     <span wicket:id="provision">[PROVISION]</span>
-  </wicket:panel>
+    <span wicket:id="objectTypeToggle"/>
+  </wicket:extend>
 </html>

http://git-wip-us.apache.org/repos/asf/syncope/blob/2a2d8c83/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java
index de883c8..d2da2e2 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java
@@ -119,6 +119,10 @@ public class TopologyITCase extends AbstractConsoleITCase {
                 "body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
         formTester.submit("buttons:next");
 
+        formTester = TESTER.newFormTester(
+                "body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
+        formTester.submit("buttons:next");
+
         TESTER.assertComponent("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:"
                 + "container:content:wizard:form:view:mapping:mappingContainer:mappings:1",
WebMarkupContainer.class);
 
@@ -166,23 +170,32 @@ public class TopologyITCase extends AbstractConsoleITCase {
         TESTER.executeAjaxEvent(component.getPageRelativePath() + ":res", Constants.ON_CLICK);
         TESTER.clickLink("body:toggle:container:content:togglePanelContainer:container:actions:provision");
 
+        // -- create new provision rules for the current resource
         TESTER.clickLink("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:add");
 
         formTester = TESTER.newFormTester(
-                "body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
+                "body:toggle:outerObjectsRepeater:3:outer:form:content:objectTypeToggle:container:"
+                + "content:togglePanelContainer:objectTypeForm");
+        formTester.select("type:dropDownChoiceField", 1);
+        formTester.submit("changeit");
+        TESTER.assertNoErrorMessage();
+        TESTER.assertNoInfoMessage();
 
-        formTester.setValue("view:container:type:dropDownChoiceField", "1");
-        formTester.setValue("view:container:clazz:textField", "__ACCOUNT__");
+        // choose object class
+        formTester = TESTER.newFormTester(
+                "body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
         formTester.submit("buttons:next");
         TESTER.assertNoErrorMessage();
         TESTER.assertNoInfoMessage();
 
+        // aux classes
         formTester = TESTER.newFormTester(
                 "body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
         formTester.submit("buttons:next");
         TESTER.assertNoErrorMessage();
         TESTER.assertNoInfoMessage();
 
+        // set a new mapping rule
         TESTER.executeAjaxEvent("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:"
                 + "content:wizard:form:view:mapping:mappingContainer:addMappingBtn", Constants.ON_CLICK);
 
@@ -202,6 +215,7 @@ public class TopologyITCase extends AbstractConsoleITCase {
         TESTER.assertNoErrorMessage();
         TESTER.assertNoInfoMessage();
 
+        // finish
         TESTER.cleanupFeedbackMessages();
         // ajax event required to retrieve AjaxRequestTarget (used into finish custom event)
         TESTER.executeAjaxEvent("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:"
@@ -211,9 +225,11 @@ public class TopologyITCase extends AbstractConsoleITCase {
         TESTER.assertComponent(
                 "body:toggle:outerObjectsRepeater:3:outer:dialog:footer:inputs:0:submit",
AjaxSubmitLink.class);
 
+        // save
         TESTER.cleanupFeedbackMessages();
         TESTER.executeAjaxEvent(
                 "body:toggle:outerObjectsRepeater:3:outer:dialog:footer:inputs:0:submit",
Constants.ON_CLICK);
+        TESTER.assertNoErrorMessage();
         TESTER.assertInfoMessages("Operation executed successfully");
 
         TESTER.clickLink("body:toggle:container:content:togglePanelContainer:container:actions:provision");
@@ -225,6 +241,10 @@ public class TopologyITCase extends AbstractConsoleITCase {
                 "body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
         formTester.submit("buttons:next");
 
+        formTester = TESTER.newFormTester(
+                "body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
+        formTester.submit("buttons:next");
+
         TESTER.assertComponent("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:"
                 + "container:content:wizard:form:view:mapping:mappingContainer:mappings:0",
WebMarkupContainer.class);
 


Mime
View raw message