syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1401252 [1/2] - in /incubator/syncope/trunk: client/src/main/java/org/apache/syncope/client/to/ client/src/main/java/org/apache/syncope/types/ console/src/main/java/org/apache/syncope/console/pages/ console/src/main/java/org/apache/syncope...
Date Tue, 23 Oct 2012 11:27:56 GMT
Author: ilgrosso
Date: Tue Oct 23 11:27:55 2012
New Revision: 1401252

URL: http://svn.apache.org/viewvc?rev=1401252&view=rev
Log:
[SYNCOPE-186] PropagationActions introduced, for executing custom actions before and after any PropagationTask execution

Added:
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/DefaultPropagationActions.java   (with props)
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationActions.java   (with props)
Modified:
    incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/PropagationTO.java
    incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/ResourceTO.java
    incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/AuditElements.java
    incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/EntityViolationType.java
    incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java
    incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/SyncTaskModalPage.java
    incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.java
    incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java
    incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserManagementResultPanel.java
    incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java
    incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java
    incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties
    incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties
    incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.html
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ExternalResource.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ExternalResourceValidator.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/SyncTaskValidator.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/AbstractPropagationTaskExecutor.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationHandler.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/report/ReportJob.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ConnInstanceDataBinder.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ResourceDataBinder.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/DefaultSyncActions.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncJob.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ApplicationContextProvider.java
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnObjectUtil.java
    incubator/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ResourceTestITCase.java

Modified: incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/PropagationTO.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/PropagationTO.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/PropagationTO.java (original)
+++ incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/PropagationTO.java Tue Oct 23 11:27:55 2012
@@ -34,12 +34,12 @@ public class PropagationTO extends Abstr
     /**
      * Object before propagation.
      */
-    private ConnObjectTO before;
+    private ConnObjectTO beforeObj;
 
     /**
      * Object after propagation.
      */
-    private ConnObjectTO after;
+    private ConnObjectTO afterObj;
 
     /**
      * Propagated resource name.
@@ -56,17 +56,17 @@ public class PropagationTO extends Abstr
      *
      * @return after object.
      */
-    public ConnObjectTO getAfter() {
-        return after;
+    public ConnObjectTO getAfterObj() {
+        return afterObj;
     }
 
     /**
      * After object setter.
      *
-     * @param after object.
+     * @param afterObj object.
      */
-    public void setAfter(final ConnObjectTO after) {
-        this.after = after;
+    public void setAfterObj(final ConnObjectTO afterObj) {
+        this.afterObj = afterObj;
     }
 
     /**
@@ -74,17 +74,17 @@ public class PropagationTO extends Abstr
      *
      * @return before object.
      */
-    public ConnObjectTO getBefore() {
-        return before;
+    public ConnObjectTO getBeforeObj() {
+        return beforeObj;
     }
 
     /**
      * Before object setter.
      *
-     * @param before object.
+     * @param beforeObj object.
      */
-    public void setBefore(final ConnObjectTO before) {
-        this.before = before;
+    public void setBeforeObj(final ConnObjectTO beforeObj) {
+        this.beforeObj = beforeObj;
     }
 
     /**

Modified: incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/ResourceTO.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/ResourceTO.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/ResourceTO.java (original)
+++ incubator/syncope/trunk/client/src/main/java/org/apache/syncope/client/to/ResourceTO.java Tue Oct 23 11:27:55 2012
@@ -74,6 +74,8 @@ public class ResourceTO extends Abstract
 
     private String syncToken;
 
+    private String actionsClassName;
+
     public ResourceTO() {
         mappings = new ArrayList<SchemaMappingTO>();
         connConfProperties = new HashSet<ConnConfProperty>();
@@ -218,7 +220,7 @@ public class ResourceTO extends Abstract
         return syncTraceLevel;
     }
 
-    public void setSyncTraceLevel(TraceLevel syncTraceLevel) {
+    public void setSyncTraceLevel(final TraceLevel syncTraceLevel) {
         this.syncTraceLevel = syncTraceLevel;
     }
 
@@ -226,7 +228,15 @@ public class ResourceTO extends Abstract
         return syncToken;
     }
 
-    public void setSyncToken(String syncToken) {
+    public void setSyncToken(final String syncToken) {
         this.syncToken = syncToken;
     }
+
+    public String getActionsClassName() {
+        return actionsClassName;
+    }
+
+    public void setActionsClassName(final String actionsClassName) {
+        this.actionsClassName = actionsClassName;
+    }
 }

Modified: incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/AuditElements.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/AuditElements.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/AuditElements.java (original)
+++ incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/AuditElements.java Tue Oct 23 11:27:55 2012
@@ -152,7 +152,8 @@ public final class AuditElements {
         update,
         delete,
         getObject,
-        getRoleResourcesMapping
+        getRoleResourcesMapping,
+        getPropagationActionsClasses
 
     }
 
@@ -231,8 +232,7 @@ public final class AuditElements {
         read,
         update,
         delete,
-        isCreateAllowed,
-    }
+        isCreateAllowed,}
 
     public enum WorkflowSubCategory {
 

Modified: incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/EntityViolationType.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/EntityViolationType.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/EntityViolationType.java (original)
+++ incubator/syncope/trunk/client/src/main/java/org/apache/syncope/types/EntityViolationType.java Tue Oct 23 11:27:55 2012
@@ -22,7 +22,6 @@ public enum EntityViolationType {
 
     Standard(""),
     MultivalueAndUniqueConstraint("org.apache.syncope.core.validation.schema.multivalueAndUniqueConstraint"),
-    InvalidAccountIdCount("org.apache.syncope.core.validation.externalresource.invalidAccountIdCount"),
     MoreThanOneNonNull("org.apache.syncope.core.validation.attrvalue.moreThanOneNonNull"),
     InvalidUSchema("org.apache.syncope.core.validation.attrvalue.invalidUSchema"),
     InvalidUDerSchema("org.apache.syncope.core.validation.attrvalue.invalidUDerSchema"),
@@ -37,12 +36,13 @@ public enum EntityViolationType {
     InvalidValueList("org.apache.syncope.core.validation.attr.invalidValueList"),
     InvalidEntitlementName("org.apache.syncope.core.validation.entitlement.invalidName"),
     InvalidPropagationTask("org.apache.syncope.core.validation.propagationtask.invalid"),
+    InvalidResource("org.apache.syncope.core.validation.externalresource.invalid"),
     InvalidSchedTask("org.apache.syncope.core.validation.schedtask.invalid"),
     InvalidSyncTask("org.apache.syncope.core.validation.synctask.invalid"),
     InvalidPassword("org.apache.syncope.core.validation.password.invalid"),
     InvalidUsername("org.apache.syncope.core.validation.username.invalid"),
-    InvalidPolicy(// not throwable using rest interface because the TO is typed
-            "org.apache.syncope.core.validation.policy.invalid"),
+    // not throwable using rest interface because the TO is typed
+    InvalidPolicy("org.apache.syncope.core.validation.policy.invalid"),
     InvalidPasswordPolicy("org.apache.syncope.core.validation.policy.invalid"),
     InvalidAccountPolicy("org.apache.syncope.core.validation.policy.invalid"),
     InvalidSyncPolicy("org.apache.syncope.core.validation.policy.invalid"),

Modified: incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java Tue Oct 23 11:27:55 2012
@@ -45,7 +45,7 @@ public class ResourceModalPage extends B
     private static final long serialVersionUID = 1734415311027284221L;
 
     @SpringBean
-    private ResourceRestClient resourceRestClient;
+    private ResourceRestClient restClient;
 
     public ResourceModalPage(final PageReference pageref, final ModalWindow window, final ResourceTO resourceTO,
             final boolean createFlag) {
@@ -58,7 +58,8 @@ public class ResourceModalPage extends B
         //--------------------------------
         // Resource details panel
         //--------------------------------
-        form.add(new ResourceDetailsPanel("details", resourceTO, createFlag));
+        form.add(new ResourceDetailsPanel("details", resourceTO,
+                restClient.getPropagationActionsClasses(), createFlag));
         //--------------------------------
 
         //--------------------------------
@@ -80,6 +81,7 @@ public class ResourceModalPage extends B
         //--------------------------------
 
         final AjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("submit", "submit")) {
+
             private static final long serialVersionUID = -958724007591692537L;
 
             @Override
@@ -102,9 +104,9 @@ public class ResourceModalPage extends B
                     try {
 
                         if (createFlag) {
-                            resourceRestClient.create(resourceTO);
+                            restClient.create(resourceTO);
                         } else {
-                            resourceRestClient.update(resourceTO);
+                            restClient.update(resourceTO);
                         }
 
                         ((Resources) pageref.getPage()).setModalResult(true);
@@ -128,6 +130,7 @@ public class ResourceModalPage extends B
         form.add(submit);
 
         final AjaxButton cancel = new IndicatingAjaxButton("cancel", new ResourceModel("cancel")) {
+
             private static final long serialVersionUID = -958724007591692537L;
 
             @Override

Modified: incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/SyncTaskModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/SyncTaskModalPage.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/SyncTaskModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/SyncTaskModalPage.java Tue Oct 23 11:27:55 2012
@@ -73,19 +73,9 @@ public class SyncTaskModalPage extends A
 
         profile.add(resource);
 
-        final IModel<List<String>> classNames = new LoadableDetachableModel<List<String>>() {
-
-            private static final long serialVersionUID = 5275935387613157437L;
-
-            @Override
-            protected List<String> load() {
-                return taskRestClient.getSyncActionsClasses();
-            }
-        };
-
         final AjaxDropDownChoicePanel<String> actionsClassName = new AjaxDropDownChoicePanel<String>(
                 "actionsClassName", getString("actionsClass"), new PropertyModel(taskTO, "actionsClassName"));
-        actionsClassName.setChoices(classNames.getObject());
+        actionsClassName.setChoices(taskRestClient.getSyncActionsClasses());
         actionsClassName.setStyleShet("ui-widget-content ui-corner-all long_dynamicsize");
         profile.add(actionsClassName);
 

Modified: incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.java Tue Oct 23 11:27:55 2012
@@ -58,7 +58,8 @@ public class ResourceDetailsPanel extend
 
     private ConnInstanceTO connInstanceTO;
 
-    public ResourceDetailsPanel(final String id, final ResourceTO resourceTO, final boolean createFlag) {
+    public ResourceDetailsPanel(final String id, final ResourceTO resourceTO, final List<String> actionClassNames,
+            final boolean createFlag) {
 
         super(id);
         setOutputMarkupId(true);
@@ -103,6 +104,13 @@ public class ResourceDetailsPanel extend
         propagationMode.setChoices(Arrays.asList(PropagationMode.values()));
         add(propagationMode);
 
+        final AjaxDropDownChoicePanel<String> actionsClassName = new AjaxDropDownChoicePanel<String>(
+                "actionsClassName", new ResourceModel("actionsClass", "actionsClass").getObject(),
+                new PropertyModel(resourceTO, "actionsClassName"));
+        actionsClassName.setChoices(actionClassNames);
+        actionsClassName.setStyleShet("ui-widget-content ui-corner-all long_dynamicsize");
+        add(actionsClassName);
+
         final AjaxDropDownChoicePanel<TraceLevel> createTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
                 "createTraceLevel", new ResourceModel("createTraceLevel", "createTraceLevel").getObject(),
                 new PropertyModel(resourceTO, "createTraceLevel"));

Modified: incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceSecurityPanel.java Tue Oct 23 11:27:55 2012
@@ -186,7 +186,7 @@ public class ResourceSecurityPanel exten
         }
 
         @Override
-        public String getIdValue(Long object, int index) {
+        public String getIdValue(final Long object, final int index) {
             return String.valueOf(object != null
                     ? object
                     : 0L);

Modified: incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserManagementResultPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserManagementResultPanel.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserManagementResultPanel.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserManagementResultPanel.java Tue Oct 23 11:27:55 2012
@@ -194,8 +194,8 @@ public class UserManagementResultPanel e
      * @return list view.
      */
     private ListView getConnObjectView(final PropagationTO propTO) {
-        final ConnObjectTO before = propTO.getBefore();
-        final ConnObjectTO after = propTO.getAfter();
+        final ConnObjectTO before = propTO.getBeforeObj();
+        final ConnObjectTO after = propTO.getAfterObj();
 
         // sorted in reversed presentation order
         final List<String> head = Arrays.asList(new String[] { "__PASSWORD__", "__ENABLE__", "__UID__", "__NAME__" });

Modified: incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java Tue Oct 23 11:27:55 2012
@@ -20,10 +20,10 @@ package org.apache.syncope.console.rest;
 
 import java.util.Arrays;
 import java.util.List;
-import org.springframework.stereotype.Component;
 import org.apache.syncope.client.to.ResourceTO;
 import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
 import org.apache.syncope.console.SyncopeSession;
+import org.springframework.stereotype.Component;
 
 /**
  * Console client for invoking Rest Resources services.
@@ -31,12 +31,24 @@ import org.apache.syncope.console.Syncop
 @Component
 public class ResourceRestClient extends AbstractBaseRestClient {
 
+    public List<String> getPropagationActionsClasses() {
+        List<String> actions = null;
+
+        try {
+            actions = Arrays.asList(SyncopeSession.get().getRestTemplate().getForObject(
+                    baseURL + "resource/propagationActionsClasses.json", String[].class));
+        } catch (SyncopeClientCompositeErrorException e) {
+            LOG.error("While getting all propagation actions classes", e);
+        }
+        return actions;
+    }
+
     public List<ResourceTO> getAllResources() {
         List<ResourceTO> resources = null;
 
         try {
-            resources = Arrays.asList(SyncopeSession.get().getRestTemplate().getForObject
-                    (baseURL + "resource/list.json", ResourceTO[].class));
+            resources = Arrays.asList(SyncopeSession.get().getRestTemplate().
+                    getForObject(baseURL + "resource/list.json", ResourceTO[].class));
         } catch (SyncopeClientCompositeErrorException e) {
             LOG.error("While reading all resources", e);
         }

Modified: incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java Tue Oct 23 11:27:55 2012
@@ -21,7 +21,6 @@ package org.apache.syncope.console.rest;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-import org.springframework.stereotype.Component;
 import org.apache.syncope.client.to.NotificationTaskTO;
 import org.apache.syncope.client.to.PropagationTaskTO;
 import org.apache.syncope.client.to.SchedTaskTO;
@@ -30,6 +29,7 @@ import org.apache.syncope.client.to.Task
 import org.apache.syncope.client.to.TaskTO;
 import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
 import org.apache.syncope.console.SyncopeSession;
+import org.springframework.stereotype.Component;
 
 /**
  * Console client for invoking Rest Tasks services.

Modified: incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties (original)
+++ incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage.properties Tue Oct 23 11:27:55 2012
@@ -53,4 +53,5 @@ resetToken=Reset Token
 
 success_connection=Successful connection
 error_connection=Connection failure
-check=Check connection
\ No newline at end of file
+check=Check connection
+actionsClass=Actions class

Modified: incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties (original)
+++ incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ResourceModalPage_it.properties Tue Oct 23 11:27:55 2012
@@ -55,3 +55,4 @@ resetToken=Reset Token
 success_connection=Connessione avvenuta con successo
 error_connection=Connessione non riuscita
 check=Verifica connessione
+actionsClass=Classe azioni

Modified: incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.html
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.html?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.html (original)
+++ incubator/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceDetailsPanel.html Tue Oct 23 11:27:55 2012
@@ -13,111 +13,120 @@
  under the License.
 -->
 <html>
-    <wicket:panel>
-        <div id="formtable">
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="name"><wicket:message key="name"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="name">[name]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="connector"><wicket:message key="connector"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="connector">[connector]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="enforceMandatoryCondition"><wicket:message key="enforceMandatoryCondition"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="enforceMandatoryCondition">[enforceMandatoryCondition]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="propagationPrimary"><wicket:message key="propagationPrimary"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="propagationPrimary">[propagationPrimary]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="propagationPriority"><wicket:message key="propagationPriority"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="propagationPriority">[propagationPriority]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="propagationMode"><wicket:message key="propagationMode"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="propagationMode">[propagationMode]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="createTraceLevel"><wicket:message key="createTraceLevel"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="createTraceLevel">[createTraceLevel]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="updateTraceLevel"><wicket:message key="updateTraceLevel"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="updateTraceLevel">[updateTraceLevel]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="deleteTraceLevel"><wicket:message key="deleteTraceLevel"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="deleteTraceLevel">[deleteTraceLevel]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="syncTraceLevel"><wicket:message key="syncTraceLevel"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="syncTraceLevel">[syncTraceLevel]</span>
-                </div>
-            </div>
-
-            <div class="tablerow">
-                <div class="tablecolumn_label medium_fixedsize">
-                    <label for="resetToken"><wicket:message key="resetToken"/></label>
-                </div>
-                <div class="tablecolumn_field medium_dynamicsize">
-                    <span wicket:id="resetToken">[resetToken]</span>
-                </div>
-            </div>
-        </div>
-        <script type="text/javascript">
-            $(function() {
-                $('div#resource div#formtable div.tablerow:even').addClass("alt");
-            });
-        </script>
-    </wicket:panel>
+  <wicket:panel>
+    <div id="formtable">
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="name"><wicket:message key="name"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="name">[name]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="connector"><wicket:message key="connector"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="connector">[connector]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="enforceMandatoryCondition"><wicket:message key="enforceMandatoryCondition"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="enforceMandatoryCondition">[enforceMandatoryCondition]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="propagationPrimary"><wicket:message key="propagationPrimary"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="propagationPrimary">[propagationPrimary]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="propagationPriority"><wicket:message key="propagationPriority"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="propagationPriority">[propagationPriority]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="propagationMode"><wicket:message key="propagationMode"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="propagationMode">[propagationMode]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label short_dynamicsize">
+          <label for="actionsClassName"><wicket:message key="actionsClass"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="actionsClassName">[actionsClassName]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="createTraceLevel"><wicket:message key="createTraceLevel"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="createTraceLevel">[createTraceLevel]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="updateTraceLevel"><wicket:message key="updateTraceLevel"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="updateTraceLevel">[updateTraceLevel]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="deleteTraceLevel"><wicket:message key="deleteTraceLevel"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="deleteTraceLevel">[deleteTraceLevel]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="syncTraceLevel"><wicket:message key="syncTraceLevel"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="syncTraceLevel">[syncTraceLevel]</span>
+        </div>
+      </div>
+
+      <div class="tablerow">
+        <div class="tablecolumn_label medium_fixedsize">
+          <label for="resetToken"><wicket:message key="resetToken"/></label>
+        </div>
+        <div class="tablecolumn_field medium_dynamicsize">
+          <span wicket:id="resetToken">[resetToken]</span>
+        </div>
+      </div>
+    </div>
+    <script type="text/javascript">
+      $(function() {
+        $('div#resource div#formtable div.tablerow:even').addClass("alt");
+      });
+    </script>
+  </wicket:panel>
 </html>

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java Tue Oct 23 11:27:55 2012
@@ -35,8 +35,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;
-import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -57,12 +55,6 @@ public class ConnInstanceLoader {
     @Autowired
     private ResourceDataBinder resourceDataBinder;
 
-    private DefaultListableBeanFactory getBeanFactory() {
-        ConfigurableApplicationContext context = ApplicationContextProvider.getApplicationContext();
-
-        return (DefaultListableBeanFactory) context.getBeanFactory();
-    }
-
     private String getBeanName(final ExternalResource resource) {
         return String.format("connInstance-%d-%s", resource.getConnector().getId(), resource.getName());
     }
@@ -72,18 +64,19 @@ public class ConnInstanceLoader {
      *
      * @param resource the resource.
      * @return live connector bran for given resource
-     * @throws BeansException in case the connector is not registered in the context
+     * @throws BeansException if there is any problem with Spring
+     * @throws NotFoundException if the connector is not registered in the context
      */
     public ConnectorFacadeProxy getConnector(final ExternalResource resource)
             throws BeansException, NotFoundException {
 
         // Try to re-create connector bean from underlying resource
         // (useful for managing failover scenarios)
-        if (!getBeanFactory().containsBean(getBeanName(resource))) {
+        if (!ApplicationContextProvider.getBeanFactory().containsBean(getBeanName(resource))) {
             registerConnector(resource);
         }
 
-        return (ConnectorFacadeProxy) getBeanFactory().getBean(getBeanName(resource));
+        return (ConnectorFacadeProxy) ApplicationContextProvider.getBeanFactory().getBean(getBeanName(resource));
     }
 
     public ConnectorFacadeProxy createConnectorBean(final ExternalResource resource)
@@ -121,16 +114,16 @@ public class ConnInstanceLoader {
 
         final String beanName = getBeanName(resource);
 
-        if (getBeanFactory().containsSingleton(beanName)) {
+        if (ApplicationContextProvider.getBeanFactory().containsSingleton(beanName)) {
             unregisterConnector(beanName);
         }
 
-        getBeanFactory().registerSingleton(beanName, connector);
+        ApplicationContextProvider.getBeanFactory().registerSingleton(beanName, connector);
         LOG.debug("Successfully registered bean {}", beanName);
     }
 
     public void unregisterConnector(final String id) {
-        getBeanFactory().destroySingleton(id);
+        ApplicationContextProvider.getBeanFactory().destroySingleton(id);
     }
 
     @Transactional(readOnly = true)
@@ -150,6 +143,7 @@ public class ConnInstanceLoader {
             }
         }
 
-        LOG.info("Done loading {} connectors.", getBeanFactory().getBeansOfType(ConnectorFacadeProxy.class).size());
+        LOG.info("Done loading {} connectors.", ApplicationContextProvider.getBeanFactory().
+                getBeansOfType(ConnectorFacadeProxy.class).size());
     }
 }

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java Tue Oct 23 11:27:55 2012
@@ -27,6 +27,7 @@ import java.util.Set;
 import org.apache.syncope.core.persistence.validation.attrvalue.Validator;
 import org.apache.syncope.core.report.Reportlet;
 import org.apache.syncope.core.notification.NotificationJob;
+import org.apache.syncope.core.propagation.PropagationActions;
 import org.apache.syncope.core.report.ReportJob;
 import org.apache.syncope.core.sync.SyncJob;
 import org.apache.syncope.core.sync.SyncActions;
@@ -52,6 +53,7 @@ public class ImplementationClassNamesLoa
         REPORTLET,
         JOB,
         SYNC_ACTIONS,
+        PROPAGATION_ACTIONS,
         VALIDATOR
 
     }
@@ -98,6 +100,10 @@ public class ImplementationClassNamesLoa
                         classNames.get(Type.SYNC_ACTIONS).add(metadata.getClassName());
                     }
 
+                    if (interfaces.contains(PropagationActions.class) && !metadata.isAbstract()) {
+                        classNames.get(Type.PROPAGATION_ACTIONS).add(metadata.getClassName());
+                    }
+
                     if (interfaces.contains(Validator.class) && !metadata.isAbstract()) {
                         classNames.get(Type.VALIDATOR).add(metadata.getClassName());
                     }

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/JobInstanceLoader.java Tue Oct 23 11:27:55 2012
@@ -51,8 +51,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;
-import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.scheduling.quartz.SchedulerFactoryBean;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -74,12 +72,6 @@ public class JobInstanceLoader {
     @Autowired
     private ConfDAO confDAO;
 
-    private DefaultListableBeanFactory getBeanFactory() {
-        ConfigurableApplicationContext ctx = ApplicationContextProvider.getApplicationContext();
-
-        return (DefaultListableBeanFactory) ctx.getBeanFactory();
-    }
-
     private static Long getIdFromJobName(final String name, final String pattern, final int prefixLength) {
         Long result = null;
 
@@ -143,7 +135,7 @@ public class JobInstanceLoader {
         unregisterJob(jobName);
 
         // 1. Job bean
-        getBeanFactory().registerSingleton(jobName, jobInstance);
+        ApplicationContextProvider.getBeanFactory().registerSingleton(jobName, jobInstance);
 
         // 2. JobDetail bean
         JobDetailImpl jobDetail = new JobDetailImpl();
@@ -167,7 +159,8 @@ public class JobInstanceLoader {
             throws ClassNotFoundException, SchedulerException, ParseException {
 
         Class jobClass = Class.forName(jobClassName);
-        Job jobInstance = (Job) getBeanFactory().createBean(jobClass, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
+        Job jobInstance = (Job) ApplicationContextProvider.getBeanFactory().
+                createBean(jobClass, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
         if (jobInstance instanceof AbstractTaskJob) {
             ((AbstractTaskJob) jobInstance).setTaskId(task.getId());
         }
@@ -182,8 +175,8 @@ public class JobInstanceLoader {
                                 syncActionsClass.getName(), e});
                 }
             }
-            SyncActions syncActions = (SyncActions) getBeanFactory().createBean(syncActionsClass,
-                    AbstractBeanDefinition.AUTOWIRE_BY_TYPE, true);
+            SyncActions syncActions = (SyncActions) ApplicationContextProvider.getBeanFactory().
+                    createBean(syncActionsClass, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, true);
 
             ((SyncJob) jobInstance).setActions(syncActions);
         }
@@ -192,8 +185,8 @@ public class JobInstanceLoader {
     }
 
     public void registerJob(final Report report) throws SchedulerException, ParseException {
-        Job jobInstance = (Job) getBeanFactory().createBean(ReportJob.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE,
-                false);
+        Job jobInstance = (Job) ApplicationContextProvider.getBeanFactory().
+                createBean(ReportJob.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
         ((ReportJob) jobInstance).setReportId(report.getId());
 
         registerJob(getJobName(report), jobInstance, report.getCronExpression());
@@ -207,8 +200,8 @@ public class JobInstanceLoader {
             LOG.error("Could not remove job " + jobName, e);
         }
 
-        if (getBeanFactory().containsSingleton(jobName)) {
-            getBeanFactory().destroySingleton(jobName);
+        if (ApplicationContextProvider.getBeanFactory().containsSingleton(jobName)) {
+            ApplicationContextProvider.getBeanFactory().destroySingleton(jobName);
         }
     }
 

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ExternalResource.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ExternalResource.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ExternalResource.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ExternalResource.java Tue Oct 23 11:27:55 2012
@@ -148,6 +148,11 @@ public class ExternalResource extends Ab
     private String serializedSyncToken;
 
     /**
+     * (Optional) class for PropagationAction.
+     */
+    private String actionsClassName;
+
+    /**
      * Default constructor.
      */
     public ExternalResource() {
@@ -349,4 +354,12 @@ public class ExternalResource extends Ab
     public void setSyncToken(final SyncToken syncToken) {
         serializedSyncToken = XMLSerializer.serialize(syncToken);
     }
+
+    public String getActionsClassName() {
+        return actionsClassName;
+    }
+
+    public void setActionsClassName(final String actionsClassName) {
+        this.actionsClassName = actionsClassName;
+    }
 }

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ExternalResourceValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ExternalResourceValidator.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ExternalResourceValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ExternalResourceValidator.java Tue Oct 23 11:27:55 2012
@@ -20,8 +20,10 @@ package org.apache.syncope.core.persiste
 
 import javax.validation.ConstraintValidator;
 import javax.validation.ConstraintValidatorContext;
-import org.apache.syncope.core.persistence.beans.SchemaMapping;
+import org.apache.commons.lang.StringUtils;
 import org.apache.syncope.core.persistence.beans.ExternalResource;
+import org.apache.syncope.core.persistence.beans.SchemaMapping;
+import org.apache.syncope.core.propagation.PropagationActions;
 import org.apache.syncope.types.EntityViolationType;
 
 public class ExternalResourceValidator extends AbstractValidator implements
@@ -51,9 +53,29 @@ public class ExternalResourceValidator e
                 LOG.error("Mappings for " + object + " have 0 or >1 account ids");
 
                 context.disableDefaultConstraintViolation();
-                context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidAccountIdCount.toString())
+                context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidResource.toString())
                         .addNode(object + ".accountIds.size==" + accountIds).addConstraintViolation();
             }
+
+            if (StringUtils.isNotBlank(object.getActionsClassName())) {
+                Class<?> actionsClass = null;
+                boolean isAssignable = false;
+                try {
+                    actionsClass = Class.forName(object.getActionsClassName());
+                    isAssignable = PropagationActions.class.isAssignableFrom(actionsClass);
+                } catch (Exception e) {
+                    LOG.error("Invalid PropagationActions specified", e);
+                    isValid = false;
+                }
+
+                if (actionsClass == null || !isAssignable) {
+                    isValid = false;
+
+                    context.disableDefaultConstraintViolation();
+                    context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidResource.toString())
+                            .addNode(object + ".actionsClassName is not valid").addConstraintViolation();
+                }
+            }
         }
 
         return isValid;

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/SyncTaskValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/SyncTaskValidator.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/SyncTaskValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/SyncTaskValidator.java Tue Oct 23 11:27:55 2012
@@ -60,17 +60,17 @@ public class SyncTaskValidator extends A
                 }
 
                 if (StringUtils.isNotBlank(object.getActionsClassName())) {
-                    Class<?> syncActionsClass = null;
+                    Class<?> actionsClass = null;
                     boolean isAssignable = false;
                     try {
-                        syncActionsClass = Class.forName(object.getActionsClassName());
-                        isAssignable = SyncActions.class.isAssignableFrom(syncActionsClass);
+                        actionsClass = Class.forName(object.getActionsClassName());
+                        isAssignable = SyncActions.class.isAssignableFrom(actionsClass);
                     } catch (Exception e) {
                         LOG.error("Invalid SyncActions specified", e);
                         isValid = false;
                     }
 
-                    if (syncActionsClass == null || !isAssignable) {
+                    if (actionsClass == null || !isAssignable) {
                         isValid = false;
 
                         context.disableDefaultConstraintViolation();

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/AbstractPropagationTaskExecutor.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/AbstractPropagationTaskExecutor.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/AbstractPropagationTaskExecutor.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/AbstractPropagationTaskExecutor.java Tue Oct 23 11:27:55 2012
@@ -27,11 +27,13 @@ import java.util.HashSet;
 import java.util.Set;
 import org.apache.commons.lang.StringUtils;
 import org.apache.syncope.core.init.ConnInstanceLoader;
+import org.apache.syncope.core.persistence.beans.ExternalResource;
 import org.apache.syncope.core.persistence.beans.PropagationTask;
 import org.apache.syncope.core.persistence.beans.TaskExec;
 import org.apache.syncope.core.persistence.beans.user.SyncopeUser;
 import org.apache.syncope.core.persistence.dao.TaskDAO;
 import org.apache.syncope.core.persistence.dao.UserDAO;
+import org.apache.syncope.core.util.ApplicationContextProvider;
 import org.apache.syncope.core.util.NotFoundException;
 import org.apache.syncope.types.PropagationMode;
 import org.apache.syncope.types.PropagationTaskExecStatus;
@@ -46,8 +48,8 @@ import org.identityconnectors.framework.
 import org.identityconnectors.framework.common.objects.Uid;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.springframework.transaction.annotation.Transactional;
 
 @Transactional(rollbackFor = {Throwable.class})
@@ -81,11 +83,34 @@ public abstract class AbstractPropagatio
         return execute(task, null);
     }
 
+    protected PropagationActions getPropagationActions(final ExternalResource resource) {
+        PropagationActions result = null;
+
+        if (StringUtils.isNotBlank(resource.getActionsClassName())) {
+            try {
+                Class<?> actionsClass = Class.forName(resource.getActionsClassName());
+                result = (PropagationActions) ApplicationContextProvider.getBeanFactory().
+                        createBean(actionsClass, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, true);
+            } catch (ClassNotFoundException e) {
+                LOG.error("Invalid PropagationAction class name '{}' for resource {}",
+                        new Object[]{resource, resource.getActionsClassName(), e});
+            }
+        }
+
+        if (result == null) {
+            result = new DefaultPropagationActions();
+        }
+
+        return result;
+    }
+
     @Override
     public TaskExec execute(final PropagationTask task, final PropagationHandler handler) {
+        final PropagationActions actions = getPropagationActions(task.getResource());
+
         final Date startDate = new Date();
 
-        TaskExec execution = new TaskExec();
+        final TaskExec execution = new TaskExec();
         execution.setStatus(PropagationTaskExecStatus.CREATED.name());
 
         String taskExecutionMessage = null;
@@ -93,142 +118,133 @@ public abstract class AbstractPropagatio
         // Flag to state whether any propagation has been attempted
         Set<String> propagationAttempted = new HashSet<String>();
 
-        ConnectorObject before = null;
-        ConnectorObject after = null;
+        ConnectorObject beforeObj = null;
+        ConnectorObject afterObj = null;
 
+        ConnectorFacadeProxy connector = null;
         try {
-            final ConnectorFacadeProxy connector = connLoader.getConnector(task.getResource());
-            if (connector == null) {
-                throw new NoSuchBeanDefinitionException(String.format(
-                        "Connector instance bean for resource %s not found", task.getResource()));
-            }
+            connector = connLoader.getConnector(task.getResource());
 
             // Try to read user BEFORE any actual operation
-            before = getRemoteObject(connector, task, false);
+            beforeObj = getRemoteObject(connector, task, false);
 
-            try {
-                switch (task.getPropagationOperation()) {
-                    case CREATE:
-                    case UPDATE:
-                        // set of attributes to be propagated
-                        final Set<Attribute> attributes = new HashSet<Attribute>(task.getAttributes());
-
-                        if (before == null) {
-                            // 1. get accountId
-                            final String accountId = task.getAccountId();
-
-                            // 2. get name
-                            final Name name = (Name) AttributeUtil.find(Name.NAME, attributes);
-
-                            // 3. check if:
-                            //      * accountId is not blank;
-                            //      * accountId is not equal to Name.
-                            if (StringUtils.isNotBlank(accountId)
-                                    && (name == null || !accountId.equals(name.getNameValue()))) {
-
-                                // 3.a retrieve uid
-                                final Uid uid = (Uid) AttributeUtil.find(Uid.NAME, attributes);
-
-                                // 3.b add Uid if not provided
-                                if (uid == null) {
-                                    attributes.add(AttributeBuilder.build(Uid.NAME, Collections.singleton(accountId)));
-                                }
-                            }
+            actions.before(task, beforeObj);
 
-                            // 4. provision entry
-                            connector.create(task.getPropagationMode(), ObjectClass.ACCOUNT, attributes, null,
-                                    propagationAttempted);
-                        } else {
-
-                            // 1. check if rename is really required
-                            final Name newName = (Name) AttributeUtil.find(Name.NAME, attributes);
+            switch (task.getPropagationOperation()) {
+                case CREATE:
+                case UPDATE:
+                    // set of attributes to be propagated
+                    final Set<Attribute> attributes = new HashSet<Attribute>(task.getAttributes());
+
+                    if (beforeObj == null) {
+                        // 1. get accountId
+                        final String accountId = task.getAccountId();
+
+                        // 2. get name
+                        final Name name = (Name) AttributeUtil.find(Name.NAME, attributes);
+
+                        // 3. check if:
+                        //      * accountId is not blank;
+                        //      * accountId is not equal to Name.
+                        if (StringUtils.isNotBlank(accountId)
+                                && (name == null || !accountId.equals(name.getNameValue()))) {
+
+                            // 3.a retrieve uid
+                            final Uid uid = (Uid) AttributeUtil.find(Uid.NAME, attributes);
+
+                            // 3.b add Uid if not provided
+                            if (uid == null) {
+                                attributes.add(AttributeBuilder.build(Uid.NAME, Collections.singleton(accountId)));
+                            }
+                        }
 
-                            LOG.debug("Rename required with value {}", newName);
+                        // 4. provision entry
+                        connector.create(task.getPropagationMode(), ObjectClass.ACCOUNT, attributes, null,
+                                propagationAttempted);
+                    } else {
 
-                            if (newName != null && newName.equals(before.getName())
-                                    && !before.getUid().getUidValue().equals(newName.getNameValue())) {
+                        // 1. check if rename is really required
+                        final Name newName = (Name) AttributeUtil.find(Name.NAME, attributes);
 
-                                LOG.debug("Remote object name unchanged");
-                                attributes.remove(newName);
-                            }
+                        LOG.debug("Rename required with value {}", newName);
 
-                            LOG.debug("Attributes to be replaced {}", attributes);
+                        if (newName != null && newName.equals(beforeObj.getName())
+                                && !beforeObj.getUid().getUidValue().equals(newName.getNameValue())) {
 
-                            // 2. update with a new "normalized" attribute set
-                            connector.update(task.getPropagationMode(), ObjectClass.ACCOUNT, before.getUid(),
-                                    attributes, null, propagationAttempted);
+                            LOG.debug("Remote object name unchanged");
+                            attributes.remove(newName);
                         }
-                        break;
 
-                    case DELETE:
-                        if (before == null) {
-                            LOG.debug("{} not found on external resource: ignoring delete", task.getAccountId());
-                        } else {
-                            /*
-                             * We must choose here whether to
-                             *  a. actually delete the provided user from the external resource
-                             *  b. just update the provided user data onto the external resource
-                             *
-                             * (a) happens when either there is no user associated with the PropagationTask (this takes
-                             * place when the task is generated via UserController.delete()) or the provided updated
-                             * user hasn't the current resource assigned (when the task is generated via
-                             * UserController.update()).
-                             *
-                             * (b) happens when the provided updated user does have the current resource assigned
-                             * (when the task is generated via UserController.update()): this basically means that
-                             * before such update, this user used to have the current resource assigned by more than
-                             * one mean (for example, two different memberships with the same resource).
-                             */
-
-                            SyncopeUser user = null;
-                            if (task.getSyncopeUser() != null) {
-                                try {
-                                    user = getSyncopeUser(task.getSyncopeUser().getId());
-                                } catch (NotFoundException e) {
-                                    LOG.warn("Requesting to delete a non-existing user from {}",
-                                            task.getResource().getName(), e);
-                                }
-                            }
+                        LOG.debug("Attributes to be replaced {}", attributes);
 
-                            if (user == null || !user.getResourceNames().contains(task.getResource().getName())) {
-                                LOG.debug("Perform deprovisioning on {}", task.getResource().getName());
-
-                                connector.delete(
-                                        task.getPropagationMode(),
-                                        ObjectClass.ACCOUNT,
-                                        before.getUid(),
-                                        null,
-                                        propagationAttempted);
-                            } else {
-                                LOG.debug("Update remote object on {}", task.getResource().getName());
-
-                                connector.update(
-                                        task.getPropagationMode(),
-                                        ObjectClass.ACCOUNT,
-                                        before.getUid(),
-                                        task.getAttributes(),
-                                        null,
-                                        propagationAttempted);
+                        // 2. update with a new "normalized" attribute set
+                        connector.update(task.getPropagationMode(), ObjectClass.ACCOUNT, beforeObj.getUid(),
+                                attributes, null, propagationAttempted);
+                    }
+                    break;
+
+                case DELETE:
+                    if (beforeObj == null) {
+                        LOG.debug("{} not found on external resource: ignoring delete", task.getAccountId());
+                    } else {
+                        /*
+                         * We must choose here whether to
+                         *  a. actually delete the provided user from the external resource
+                         *  b. just update the provided user data onto the external resource
+                         *
+                         * (a) happens when either there is no user associated with the PropagationTask (this takes
+                         * place when the task is generated via UserController.delete()) or the provided updated
+                         * user hasn't the current resource assigned (when the task is generated via
+                         * UserController.update()).
+                         *
+                         * (b) happens when the provided updated user does have the current resource assigned
+                         * (when the task is generated via UserController.update()): this basically means that
+                         * before such update, this user used to have the current resource assigned by more than
+                         * one mean (for example, two different memberships with the same resource).
+                         */
+
+                        SyncopeUser user = null;
+                        if (task.getSyncopeUser() != null) {
+                            try {
+                                user = getSyncopeUser(task.getSyncopeUser().getId());
+                            } catch (NotFoundException e) {
+                                LOG.warn("Requesting to delete a non-existing user from {}",
+                                        task.getResource().getName(), e);
                             }
                         }
 
-                        break;
+                        if (user == null || !user.getResourceNames().contains(task.getResource().getName())) {
+                            LOG.debug("Perform deprovisioning on {}", task.getResource().getName());
 
-                    default:
-                }
+                            connector.delete(
+                                    task.getPropagationMode(),
+                                    ObjectClass.ACCOUNT,
+                                    beforeObj.getUid(),
+                                    null,
+                                    propagationAttempted);
+                        } else {
+                            LOG.debug("Update remote object on {}", task.getResource().getName());
 
-                execution.setStatus(task.getPropagationMode() == PropagationMode.ONE_PHASE
-                        ? PropagationTaskExecStatus.SUCCESS.name()
-                        : PropagationTaskExecStatus.SUBMITTED.name());
+                            connector.update(
+                                    task.getPropagationMode(),
+                                    ObjectClass.ACCOUNT,
+                                    beforeObj.getUid(),
+                                    task.getAttributes(),
+                                    null,
+                                    propagationAttempted);
+                        }
+                    }
 
-                LOG.debug("Successfully propagated to {}", task.getResource());
+                    break;
 
-                // Try to read user AFTER any actual operation
-                after = getRemoteObject(connector, task, true);
-            } catch (Exception e) {
-                after = getRemoteObject(connector, task, false);
-                throw e;
+                default:
             }
+
+            execution.setStatus(task.getPropagationMode() == PropagationMode.ONE_PHASE
+                    ? PropagationTaskExecStatus.SUCCESS.name()
+                    : PropagationTaskExecStatus.SUBMITTED.name());
+
+            LOG.debug("Successfully propagated to {}", task.getResource());
         } catch (Exception e) {
             LOG.error("Exception during provision on resource " + task.getResource().getName(), e);
 
@@ -251,6 +267,11 @@ public abstract class AbstractPropagatio
 
             propagationAttempted.add(task.getPropagationOperation().name().toLowerCase());
         } finally {
+            // Try to read user AFTER any actual operation
+            if (connector != null) {
+                afterObj = getRemoteObject(connector, task, true);
+            }
+
             LOG.debug("Update execution for {}", task);
 
             execution.setStartDate(startDate);
@@ -281,10 +302,12 @@ public abstract class AbstractPropagatio
             handler.handle(
                     task.getResource().getName(),
                     PropagationTaskExecStatus.valueOf(execution.getStatus()),
-                    before,
-                    after);
+                    beforeObj,
+                    afterObj);
         }
 
+        actions.after(task, execution, afterObj);
+
         return execution;
     }
 
@@ -316,7 +339,6 @@ public abstract class AbstractPropagatio
      * @return true if execution has to be store, false otherwise
      */
     protected boolean hasToBeregistered(final PropagationTask task, final TaskExec execution) {
-
         boolean result;
 
         final boolean failed = !PropagationTaskExecStatus.valueOf(execution.getStatus()).isSuccessful();
@@ -346,7 +368,7 @@ public abstract class AbstractPropagatio
     }
 
     /**
-     * Get remote object.
+     * Get remote object for given task.
      *
      * @param connector connector facade proxy.
      * @param task current propagation task.
@@ -355,16 +377,19 @@ public abstract class AbstractPropagatio
      */
     protected ConnectorObject getRemoteObject(final ConnectorFacadeProxy connector, final PropagationTask task,
             final boolean latest) {
-        try {
 
-            return connector.getObject(task.getPropagationMode(), task.getPropagationOperation(), ObjectClass.ACCOUNT,
-                    new Uid(latest || task.getOldAccountId() == null
-                    ? task.getAccountId()
-                    : task.getOldAccountId()), connector.getOperationOptions(task.getResource()));
+        String accountId = latest || task.getOldAccountId() == null
+                ? task.getAccountId()
+                : task.getOldAccountId();
 
+        ConnectorObject obj = null;
+        try {
+            obj = connector.getObject(task.getPropagationMode(), task.getPropagationOperation(), ObjectClass.ACCOUNT,
+                    new Uid(accountId), connector.getOperationOptions(task.getResource()));
         } catch (RuntimeException ignore) {
-            LOG.debug("Resolving username", ignore);
-            return null;
+            LOG.debug("While resolving {}", accountId, ignore);
         }
+
+        return obj;
     }
 }

Added: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/DefaultPropagationActions.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/DefaultPropagationActions.java?rev=1401252&view=auto
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/DefaultPropagationActions.java (added)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/DefaultPropagationActions.java Tue Oct 23 11:27:55 2012
@@ -0,0 +1,37 @@
+/*
+ * 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.propagation;
+
+import org.apache.syncope.core.persistence.beans.PropagationTask;
+import org.apache.syncope.core.persistence.beans.TaskExec;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+
+/**
+ * Default (empty) implementation of PropagationActions.
+ */
+public class DefaultPropagationActions implements PropagationActions {
+
+    @Override
+    public void before(final PropagationTask task, final ConnectorObject beforeObj) {
+    }
+
+    @Override
+    public void after(final PropagationTask task, final TaskExec execution, final ConnectorObject afterObj) {
+    }
+}

Propchange: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/DefaultPropagationActions.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/DefaultPropagationActions.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/DefaultPropagationActions.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationActions.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationActions.java?rev=1401252&view=auto
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationActions.java (added)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationActions.java Tue Oct 23 11:27:55 2012
@@ -0,0 +1,30 @@
+/*
+ * 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.propagation;
+
+import org.apache.syncope.core.persistence.beans.PropagationTask;
+import org.apache.syncope.core.persistence.beans.TaskExec;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+
+public interface PropagationActions {
+
+    void before(PropagationTask task, ConnectorObject beforeObj);
+
+    void after(PropagationTask task, TaskExec execution, ConnectorObject afterObj);
+}

Propchange: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationActions.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationActions.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationActions.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationHandler.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationHandler.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationHandler.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationHandler.java Tue Oct 23 11:27:55 2012
@@ -18,23 +18,23 @@
  */
 package org.apache.syncope.core.propagation;
 
-import org.identityconnectors.framework.common.objects.ConnectorObject;
 import org.apache.syncope.types.PropagationTaskExecStatus;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
 
 /**
  * Handle propagation executions.
  */
-public abstract class PropagationHandler {
+public interface PropagationHandler {
 
     /**
      *
      * Handle propagation executions.
      *
      * @param resourceName resource name.
-     * @param executionStatus propagation execution status.
-     * @param before retrieved connector object before operation execution.
-     * @param after retrieved connector object after operation execution.
+     * @param execStatus propagation execution status.
+     * @param beforeObj retrieved connector object before operation execution.
+     * @param afterObj retrieved connector object after operation execution.
      */
-    public abstract void handle(final String resourceName, final PropagationTaskExecStatus executionStatus,
-            final ConnectorObject before, final ConnectorObject after);
+    void handle(String resourceName, PropagationTaskExecStatus execStatus,
+            ConnectorObject beforeObj, ConnectorObject afterObj);
 }

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/report/ReportJob.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/report/ReportJob.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/report/ReportJob.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/report/ReportJob.java Tue Oct 23 11:27:55 2012
@@ -36,12 +36,10 @@ import org.apache.syncope.core.persisten
 import org.apache.syncope.core.persistence.beans.ReportExec;
 import org.apache.syncope.core.persistence.dao.ReportDAO;
 import org.apache.syncope.core.persistence.dao.ReportExecDAO;
-import org.apache.syncope.core.report.ReportException;
-import org.apache.syncope.core.report.Reportlet;
-import org.apache.syncope.core.rest.data.ReportDataBinder;
 import static org.apache.syncope.core.report.ReportXMLConst.ATTR_NAME;
 import static org.apache.syncope.core.report.ReportXMLConst.ELEMENT_REPORT;
 import static org.apache.syncope.core.report.ReportXMLConst.XSD_STRING;
+import org.apache.syncope.core.rest.data.ReportDataBinder;
 import org.apache.syncope.core.util.ApplicationContextProvider;
 import org.apache.syncope.types.ReportExecStatus;
 import org.quartz.DisallowConcurrentExecution;
@@ -51,7 +49,6 @@ import org.quartz.JobExecutionException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.xml.sax.helpers.AttributesImpl;
 
@@ -78,6 +75,9 @@ public class ReportJob implements Job {
     @Autowired
     private ReportExecDAO reportExecDAO;
 
+    /**
+     * Report data binder.
+     */
     @Autowired
     private ReportDataBinder dataBinder;
 
@@ -97,7 +97,6 @@ public class ReportJob implements Job {
 
     @Override
     public void execute(final JobExecutionContext context) throws JobExecutionException {
-
         Report report = reportDAO.find(reportId);
         if (report == null) {
             throw new JobExecutionException("Report " + reportId + " not found");
@@ -120,8 +119,8 @@ public class ReportJob implements Job {
         ZipOutputStream zos = new ZipOutputStream(baos);
         zos.setLevel(Deflater.BEST_COMPRESSION);
         try {
-            SAXTransformerFactory transformerFactory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
-            handler = transformerFactory.newTransformerHandler();
+            SAXTransformerFactory tFactory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
+            handler = tFactory.newTransformerHandler();
             Transformer serializer = handler.getTransformer();
             serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
             serializer.setOutputProperty(OutputKeys.INDENT, "yes");
@@ -138,9 +137,6 @@ public class ReportJob implements Job {
         execution.setStatus(ReportExecStatus.RUNNING);
         execution = reportExecDAO.save(execution);
 
-        ConfigurableListableBeanFactory beanFactory =
-                ApplicationContextProvider.getApplicationContext().getBeanFactory();
-
         // 3. actual report execution
         StringBuilder reportExecutionMessage = new StringBuilder();
         StringWriter exceptionWriter = new StringWriter();
@@ -156,8 +152,8 @@ public class ReportJob implements Job {
                 Class<Reportlet> reportletClass =
                         dataBinder.findReportletClassHavingConfClass(reportletConf.getClass());
                 if (reportletClass != null) {
-                    Reportlet autowired = (Reportlet) beanFactory.createBean(reportletClass,
-                            AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
+                    Reportlet autowired = (Reportlet) ApplicationContextProvider.getBeanFactory().
+                            createBean(reportletClass, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
                     autowired.setConf(reportletConf);
 
                     // invoke reportlet

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java Tue Oct 23 11:27:55 2012
@@ -28,6 +28,7 @@ import org.apache.syncope.client.to.Sche
 import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
 import org.apache.syncope.core.audit.AuditManager;
 import org.apache.syncope.core.init.ConnInstanceLoader;
+import org.apache.syncope.core.init.ImplementationClassNamesLoader;
 import org.apache.syncope.core.persistence.beans.ConnInstance;
 import org.apache.syncope.core.persistence.beans.ExternalResource;
 import org.apache.syncope.core.persistence.beans.role.SyncopeRole;
@@ -35,7 +36,6 @@ import org.apache.syncope.core.persisten
 import org.apache.syncope.core.persistence.dao.ResourceDAO;
 import org.apache.syncope.core.persistence.dao.RoleDAO;
 import org.apache.syncope.core.propagation.ConnectorFacadeProxy;
-import org.apache.syncope.core.rest.data.ConnInstanceDataBinder;
 import org.apache.syncope.core.rest.data.ResourceDataBinder;
 import org.apache.syncope.core.util.ConnBundleManager;
 import org.apache.syncope.core.util.ConnObjectUtil;
@@ -81,7 +81,7 @@ public class ResourceController extends 
     private ResourceDataBinder binder;
 
     @Autowired
-    private ConnInstanceDataBinder connInstancebinder;
+    private ImplementationClassNamesLoader classNamesLoader;
 
     /**
      * ConnectorObject util.
@@ -169,6 +169,18 @@ public class ResourceController extends 
         return binder.getResourceTO(resource);
     }
 
+    @PreAuthorize("hasRole('RESOURCE_READ')")
+    @RequestMapping(method = RequestMethod.GET, value = "/propagationActionsClasses")
+    public ModelAndView getPropagationActionsClasses() {
+        Set<String> actionsClasses = classNamesLoader.getClassNames(
+                ImplementationClassNamesLoader.Type.PROPAGATION_ACTIONS);
+
+        auditManager.audit(Category.resource, AuditElements.ResourceSubCategory.getPropagationActionsClasses,
+                Result.success, "Successfully listed all PropagationActions classes: " + actionsClasses.size());
+
+        return new ModelAndView().addObject(actionsClasses);
+    }
+
     @Transactional(readOnly = true)
     @RequestMapping(method = RequestMethod.GET, value = "/list")
     public List<ResourceTO> list(@RequestParam(required = false, value = "connInstanceId") final Long connInstanceId)

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java?rev=1401252&r1=1401251&r2=1401252&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java Tue Oct 23 11:27:55 2012
@@ -300,18 +300,18 @@ public class UserController {
 
             @Override
             public void handle(final String resourceName, final PropagationTaskExecStatus executionStatus,
-                    final ConnectorObject before, final ConnectorObject after) {
+                    final ConnectorObject beforeObj, final ConnectorObject afterObj) {
 
                 final PropagationTO propagation = new PropagationTO();
                 propagation.setResourceName(resourceName);
                 propagation.setStatus(executionStatus);
 
-                if (before != null) {
-                    propagation.setBefore(connObjectUtil.getConnObjectTO(before));
+                if (beforeObj != null) {
+                    propagation.setBeforeObj(connObjectUtil.getConnObjectTO(beforeObj));
                 }
 
-                if (after != null) {
-                    propagation.setAfter(connObjectUtil.getConnObjectTO(after));
+                if (afterObj != null) {
+                    propagation.setAfterObj(connObjectUtil.getConnObjectTO(afterObj));
                 }
 
                 propagations.add(propagation);
@@ -357,11 +357,11 @@ public class UserController {
                 propagation.setStatus(executionStatus);
 
                 if (before != null) {
-                    propagation.setBefore(connObjectUtil.getConnObjectTO(before));
+                    propagation.setBeforeObj(connObjectUtil.getConnObjectTO(before));
                 }
 
                 if (after != null) {
-                    propagation.setAfter(connObjectUtil.getConnObjectTO(after));
+                    propagation.setAfterObj(connObjectUtil.getConnObjectTO(after));
                 }
 
                 propagations.add(propagation);
@@ -685,11 +685,11 @@ public class UserController {
                 propagation.setStatus(executionStatus);
 
                 if (before != null) {
-                    propagation.setBefore(connObjectUtil.getConnObjectTO(before));
+                    propagation.setBeforeObj(connObjectUtil.getConnObjectTO(before));
                 }
 
                 if (after != null) {
-                    propagation.setAfter(connObjectUtil.getConnObjectTO(after));
+                    propagation.setAfterObj(connObjectUtil.getConnObjectTO(after));
                 }
 
                 userTO.addPropagationTO(propagation);



Mime
View raw message