syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [10/12] syncope git commit: [SYNCOPE-620] IT with Activiti
Date Mon, 26 Jan 2015 14:48:16 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/TaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/TaskITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/TaskITCase.java
index c144dbd..0c191f4 100644
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/TaskITCase.java
+++ b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/TaskITCase.java
@@ -77,10 +77,7 @@ import org.apache.syncope.common.lib.types.SubjectType;
 import org.apache.syncope.common.lib.types.TaskType;
 import org.apache.syncope.common.lib.types.TraceLevel;
 import org.apache.syncope.common.lib.types.UnmatchingRule;
-import org.apache.syncope.common.lib.wrap.JobClass;
-import org.apache.syncope.common.lib.wrap.PushActionClass;
 import org.apache.syncope.common.lib.wrap.ResourceName;
-import org.apache.syncope.common.lib.wrap.SyncActionClass;
 import org.apache.syncope.common.rest.api.CollectionWrapper;
 import org.apache.syncope.common.rest.api.service.NotificationService;
 import org.apache.syncope.common.rest.api.service.ResourceService;
@@ -151,21 +148,21 @@ public class TaskITCase extends AbstractITCase {
 
     @Test
     public void getJobClasses() {
-        List<JobClass> jobClasses = taskService.getJobClasses();
+        List<String> jobClasses = syncopeService.info().getTaskJobs();
         assertNotNull(jobClasses);
         assertFalse(jobClasses.isEmpty());
     }
 
     @Test
     public void getSyncActionsClasses() {
-        List<SyncActionClass> actions = taskService.getSyncActionsClasses();
+        List<String> actions = syncopeService.info().getSyncActions();
         assertNotNull(actions);
         assertFalse(actions.isEmpty());
     }
 
     @Test
     public void getPushActionsClasses() {
-        List<PushActionClass> actions = taskService.getPushActionsClasses();
+        List<String> actions = syncopeService.info().getPushActions();
         assertNotNull(actions);
     }
 
@@ -382,7 +379,8 @@ public class TaskITCase extends AbstractITCase {
             UserTO userTO = userService.read(inUserTO.getKey());
             assertNotNull(userTO);
             assertEquals(userName, userTO.getUsername());
-            assertEquals(ActivitiDetector.isActivitiEnabledForUsers() ? "active" : "created", userTO.getStatus());
+            assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
+                    ? "active" : "created", userTO.getStatus());
             assertEquals("test9@syncope.apache.org", userTO.getPlainAttrMap().get("email").getValues().get(0));
             assertEquals("test9@syncope.apache.org", userTO.getPlainAttrMap().get("userId").getValues().get(0));
             assertTrue(Integer.valueOf(userTO.getPlainAttrMap().get("fullname").getValues().get(0)) <= 10);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
index 96ca3de..5df855a 100644
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
+++ b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
@@ -806,7 +806,7 @@ public class UserITCase extends AbstractITCase {
 
     @Test
     public void createActivate() {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
 
         UserTO userTO = getUniqueSampleTO("createActivate@syncope.apache.org");
 
@@ -844,7 +844,7 @@ public class UserITCase extends AbstractITCase {
         userTO = createUser(userTO);
 
         assertNotNull(userTO);
-        assertEquals(ActivitiDetector.isActivitiEnabledForUsers()
+        assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
                 ? "active"
                 : "created", userTO.getStatus());
 
@@ -877,7 +877,7 @@ public class UserITCase extends AbstractITCase {
         userTO.getResources().add(RESOURCE_NAME_LDAP);
         userTO = createUser(userTO);
         assertNotNull(userTO);
-        assertEquals(ActivitiDetector.isActivitiEnabledForUsers()
+        assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
                 ? "active"
                 : "created", userTO.getStatus());
         long userId = userTO.getKey();

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
index 8795f06..1847422 100644
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
+++ b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
@@ -63,7 +63,7 @@ public class UserSelfITCase extends AbstractITCase {
 
     @Test
     public void create() {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
 
         // 1. self-registration as admin: failure
         try {
@@ -84,7 +84,7 @@ public class UserSelfITCase extends AbstractITCase {
 
     @Test
     public void createAndApprove() {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
 
         // self-create user with membership: goes 'createApproval' with resources and membership but no propagation
         UserTO userTO = UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org");
@@ -153,13 +153,14 @@ public class UserSelfITCase extends AbstractITCase {
         UserTO updated = authClient.getService(UserSelfService.class).update(created.getKey(), userMod).
                 readEntity(UserTO.class);
         assertNotNull(updated);
-        assertEquals(ActivitiDetector.isActivitiEnabledForUsers() ? "active" : "created", updated.getStatus());
+        assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
+                ? "active" : "created", updated.getStatus());
         assertTrue(updated.getUsername().endsWith("XX"));
     }
 
     @Test
     public void updateWitApproval() {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
 
         // 1. create user as admin
         UserTO created = createUser(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"));
@@ -227,7 +228,8 @@ public class UserSelfITCase extends AbstractITCase {
         SyncopeClient authClient = clientFactory.create(created.getUsername(), "password123");
         UserTO deleted = authClient.getService(UserSelfService.class).delete().readEntity(UserTO.class);
         assertNotNull(deleted);
-        assertEquals(ActivitiDetector.isActivitiEnabledForUsers() ? "deleteApproval" : null, deleted.getStatus());
+        assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
+                ? "deleteApproval" : null, deleted.getStatus());
     }
 
     @Test
@@ -238,7 +240,7 @@ public class UserSelfITCase extends AbstractITCase {
 
     @Test
     public void noContent() throws IOException {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
 
         SyncopeClient anonClient = clientFactory.createAnonymous();
         UserSelfService noContentService = anonClient.prefer(UserSelfService.class, Preference.RETURN_NO_CONTENT);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
index 9c81d0f..c7354dd 100644
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
+++ b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
@@ -49,7 +49,7 @@ public class UserWorkflowITCase extends AbstractITCase {
 
     @Test
     public void createWithReject() {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
 
         UserTO userTO = UserITCase.getUniqueSampleTO("createWithReject@syncope.apache.org");
         userTO.getResources().add(RESOURCE_NAME_TESTDB);
@@ -118,7 +118,7 @@ public class UserWorkflowITCase extends AbstractITCase {
 
     @Test
     public void createWithApproval() {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
 
         // read forms *before* any operation
         List<WorkflowFormTO> forms = userWorkflowService.getForms();
@@ -201,7 +201,7 @@ public class UserWorkflowITCase extends AbstractITCase {
 
     @Test
     public void issueSYNCOPE15() {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
 
         // read forms *before* any operation
         List<WorkflowFormTO> forms = userWorkflowService.getForms();

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
index 161a23c..2f203e6 100644
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
+++ b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.fit.server.reference;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
@@ -33,14 +32,6 @@ import org.junit.Test;
 
 public class WorkflowITCase extends AbstractITCase {
 
-    @Test
-    public void isActivitiEnabled() {
-        assertEquals(ActivitiDetector.isActivitiEnabledForUsers(),
-                adminClient.isActivitiEnabledFor(SubjectType.USER));
-        assertEquals(ActivitiDetector.isActivitiEnabledForRoles(),
-                adminClient.isActivitiEnabledFor(SubjectType.ROLE));
-    }
-
     private void exportDefinition(final SubjectType type) throws IOException {
         Response response = workflowService.exportDefinition(type);
         assertTrue(response.getMediaType().toString().
@@ -53,13 +44,13 @@ public class WorkflowITCase extends AbstractITCase {
 
     @Test
     public void exportUserDefinition() throws IOException {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
         exportDefinition(SubjectType.USER);
     }
 
     @Test
     public void getRoleDefinition() throws IOException {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles(syncopeService));
         exportDefinition(SubjectType.ROLE);
     }
 
@@ -72,14 +63,14 @@ public class WorkflowITCase extends AbstractITCase {
 
     @Test
     public void updateUserDefinition() throws IOException {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
 
         importDefinition(SubjectType.USER);
     }
 
     @Test
     public void updateRoleDefinition() throws IOException {
-        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles());
+        Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles(syncopeService));
 
         importDefinition(SubjectType.ROLE);
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/fit/reference/src/test/resources/addActivitiToContent.xsl
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/resources/addActivitiToContent.xsl b/syncope620/fit/reference/src/test/resources/addActivitiToContent.xsl
new file mode 100644
index 0000000..44fd18e
--- /dev/null
+++ b/syncope620/fit/reference/src/test/resources/addActivitiToContent.xsl
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  
+  <xsl:template match="/dataset">
+    <dataset>
+      <xsl:apply-templates/>
+      
+      <ACT_RU_EXECUTION ID_="4" REV_="2" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+      <ACT_RU_TASK ID_="5" REV_="2" EXECUTION_ID_="4" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+
+      <ACT_RU_EXECUTION ID_="6" REV_="2" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+      <ACT_RU_TASK ID_="7" REV_="2" EXECUTION_ID_="6" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+
+      <ACT_RU_EXECUTION ID_="8" REV_="2" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+      <ACT_RU_TASK ID_="9" REV_="2" EXECUTION_ID_="8" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+
+      <ACT_RU_EXECUTION ID_="10" REV_="2" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+      <ACT_RU_TASK ID_="11" REV_="2" EXECUTION_ID_="10" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+
+      <ACT_RU_EXECUTION ID_="12" REV_="2" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+      <ACT_RU_TASK ID_="13" REV_="2" EXECUTION_ID_="12" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+    </dataset>
+  </xsl:template>
+  
+  <xsl:template match="node()|@*|comment()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/pom.xml b/syncope620/pom.xml
index e5f86d3..c7e6cf2 100644
--- a/syncope620/pom.xml
+++ b/syncope620/pom.xml
@@ -337,7 +337,7 @@ under the License.
 
     <cocoon.version>3.0.0-alpha-3</cocoon.version>
 
-    <groovy.version>2.3.9</groovy.version>
+    <groovy.version>2.4.0</groovy.version>
 
     <activiti.version>5.16.4</activiti.version>
 
@@ -986,6 +986,19 @@ under the License.
         </plugin>
         
         <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>xml-maven-plugin</artifactId>
+          <version>1.0</version>
+          <dependencies>
+            <dependency>
+              <groupId>xalan</groupId>
+              <artifactId>xalan</artifactId>
+              <version>2.7.1</version>
+            </dependency>
+          </dependencies>
+        </plugin>
+        
+        <plugin>
           <groupId>org.codehaus.cargo</groupId>
           <artifactId>cargo-maven2-plugin</artifactId>
           <version>1.4.12</version>

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ConfigurationLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ConfigurationLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ConfigurationLogic.java
index 7c6e43f..ac6b816 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ConfigurationLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ConfigurationLogic.java
@@ -18,14 +18,10 @@
  */
 package org.apache.syncope.server.logic;
 
-import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Set;
 import org.apache.syncope.common.lib.to.AttrTO;
 import org.apache.syncope.common.lib.to.ConfTO;
-import org.apache.syncope.common.lib.wrap.Validator;
 import org.apache.syncope.server.persistence.api.content.ContentExporter;
 import org.apache.syncope.server.persistence.api.dao.ConfDAO;
 import org.apache.syncope.server.persistence.api.dao.NotFoundException;
@@ -33,12 +29,8 @@ import org.apache.syncope.server.persistence.api.dao.PlainSchemaDAO;
 import org.apache.syncope.server.persistence.api.entity.conf.CPlainAttr;
 import org.apache.syncope.server.persistence.api.entity.conf.CPlainSchema;
 import org.apache.syncope.server.provisioning.api.data.ConfigurationDataBinder;
-import org.apache.syncope.server.logic.init.ImplementationClassNamesLoader;
 import org.apache.syncope.server.logic.init.WorkflowAdapterLoader;
-import org.apache.syncope.server.provisioning.java.notification.NotificationManagerImpl;
-import org.apache.syncope.server.misc.spring.ResourceWithFallbackLoader;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.Resource;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -59,12 +51,6 @@ public class ConfigurationLogic extends AbstractTransactionalLogic<ConfTO> {
     private ContentExporter exporter;
 
     @Autowired
-    private ImplementationClassNamesLoader classNamesLoader;
-
-    @javax.annotation.Resource(name = "velocityResourceLoader")
-    private ResourceWithFallbackLoader resourceLoader;
-
-    @Autowired
     private WorkflowAdapterLoader wfAdapterLoader;
 
     @PreAuthorize("hasRole('CONFIGURATION_DELETE')")
@@ -102,39 +88,6 @@ public class ConfigurationLogic extends AbstractTransactionalLogic<ConfTO> {
         confDAO.save(binder.getAttribute(value));
     }
 
-    @PreAuthorize("hasRole('CONFIGURATION_LIST')")
-    public Set<String> getValidators() {
-        return classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.VALIDATOR);
-    }
-
-    @PreAuthorize("hasRole('CONFIGURATION_LIST')")
-    public Set<String> getMailTemplates() {
-        Set<String> htmlTemplates = new HashSet<>();
-        Set<String> textTemplates = new HashSet<>();
-
-        try {
-            for (Resource resource : resourceLoader.getResources(NotificationManagerImpl.MAIL_TEMPLATES + "*.vm")) {
-                String template = resource.getURL().toExternalForm();
-                if (template.endsWith(NotificationManagerImpl.MAIL_TEMPLATE_HTML_SUFFIX)) {
-                    htmlTemplates.add(template.substring(template.indexOf(NotificationManagerImpl.MAIL_TEMPLATES) + 14,
-                                    template.indexOf(NotificationManagerImpl.MAIL_TEMPLATE_HTML_SUFFIX)));
-                } else if (template.endsWith(NotificationManagerImpl.MAIL_TEMPLATE_TEXT_SUFFIX)) {
-                    textTemplates.add(template.substring(template.indexOf(NotificationManagerImpl.MAIL_TEMPLATES) + 14,
-                                    template.indexOf(NotificationManagerImpl.MAIL_TEMPLATE_TEXT_SUFFIX)));
-                } else {
-                    LOG.warn("Unexpected template found: {}, ignoring...", template);
-                }
-            }
-        } catch (IOException e) {
-            LOG.error("While searching for class implementing {}", Validator.class.getName(), e);
-        }
-
-        // Only templates available both as HTML and TEXT are considered
-        htmlTemplates.retainAll(textTemplates);
-
-        return htmlTemplates;
-    }
-
     @PreAuthorize("hasRole('CONFIGURATION_EXPORT')")
     @Transactional(readOnly = true)
     public void export(final OutputStream os) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/EntitlementLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/EntitlementLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/EntitlementLogic.java
index d0b051c..0a890ad 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/EntitlementLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/EntitlementLogic.java
@@ -37,7 +37,7 @@ public class EntitlementLogic extends AbstractTransactionalLogic<EntitlementTO>
 
     public List<String> getAll() {
         List<Entitlement> entitlements = entitlementDAO.findAll();
-        List<String> result = new ArrayList<String>(entitlements.size());
+        List<String> result = new ArrayList<>(entitlements.size());
         for (Entitlement entitlement : entitlements) {
             result.add(entitlement.getKey());
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/LoggerLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/LoggerLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/LoggerLogic.java
index 3c9a614..49050fc 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/LoggerLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/LoggerLogic.java
@@ -295,7 +295,7 @@ public class LoggerLogic extends AbstractTransactionalLogic<LoggerTO> {
             LOG.error("Failure retrieving audit/notification events", e);
         }
 
-        return new ArrayList<EventCategoryTO>(events);
+        return new ArrayList<>(events);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/NotificationLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/NotificationLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/NotificationLogic.java
index 3e4ce46..bfd0137 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/NotificationLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/NotificationLogic.java
@@ -101,21 +101,21 @@ public class NotificationLogic extends AbstractTransactionalLogic<NotificationTO
     protected NotificationTO resolveReference(final Method method, final Object... args)
             throws UnresolvedReferenceException {
 
-        Long id = null;
+        Long key = null;
 
         if (ArrayUtils.isNotEmpty(args)) {
-            for (int i = 0; id == null && i < args.length; i++) {
+            for (int i = 0; key == null && i < args.length; i++) {
                 if (args[i] instanceof Long) {
-                    id = (Long) args[i];
+                    key = (Long) args[i];
                 } else if (args[i] instanceof NotificationTO) {
-                    id = ((NotificationTO) args[i]).getKey();
+                    key = ((NotificationTO) args[i]).getKey();
                 }
             }
         }
 
-        if ((id != null) && !id.equals(0l)) {
+        if ((key != null) && !key.equals(0l)) {
             try {
-                return binder.getNotificationTO(notificationDAO.find(id));
+                return binder.getNotificationTO(notificationDAO.find(key));
             } catch (Throwable ignore) {
                 LOG.debug("Unresolved reference", ignore);
                 throw new UnresolvedReferenceException(ignore);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/PolicyLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/PolicyLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/PolicyLogic.java
index 1bc03de..062886e 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/PolicyLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/PolicyLogic.java
@@ -21,7 +21,6 @@ package org.apache.syncope.server.logic;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Set;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.syncope.common.lib.to.AbstractPolicyTO;
 import org.apache.syncope.common.lib.to.AccountPolicyTO;
@@ -35,7 +34,6 @@ import org.apache.syncope.server.persistence.api.entity.PasswordPolicy;
 import org.apache.syncope.server.persistence.api.entity.Policy;
 import org.apache.syncope.server.persistence.api.entity.SyncPolicy;
 import org.apache.syncope.server.provisioning.api.data.PolicyDataBinder;
-import org.apache.syncope.server.logic.init.ImplementationClassNamesLoader;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Component;
@@ -44,9 +42,6 @@ import org.springframework.stereotype.Component;
 public class PolicyLogic extends AbstractTransactionalLogic<AbstractPolicyTO> {
 
     @Autowired
-    private ImplementationClassNamesLoader classNamesLoader;
-
-    @Autowired
     private PolicyDAO policyDAO;
 
     @Autowired
@@ -160,11 +155,6 @@ public class PolicyLogic extends AbstractTransactionalLogic<AbstractPolicyTO> {
         return policyToDelete;
     }
 
-    @PreAuthorize("hasRole('POLICY_LIST')")
-    public Set<String> getSyncCorrelationRuleClasses() {
-        return classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.SYNC_CORRELATION_RULES);
-    }
-
     /**
      * {@inheritDoc}
      */

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ReportLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ReportLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ReportLogic.java
index e8502ec..22ebff9 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ReportLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ReportLogic.java
@@ -161,18 +161,6 @@ public class ReportLogic extends AbstractTransactionalLogic<ReportTO> {
         return result;
     }
 
-    public Class<Reportlet> findReportletClassHavingConfClass(final Class<? extends ReportletConf> reportletConfClass) {
-        Class<Reportlet> result = null;
-        for (Class<Reportlet> reportletClass : getAllReportletClasses()) {
-            Class<? extends ReportletConf> found = getReportletConfClass(reportletClass);
-            if (found != null && found.equals(reportletConfClass)) {
-                result = reportletClass;
-            }
-        }
-
-        return result;
-    }
-
     @SuppressWarnings({ "unchecked", "rawtypes" })
     private Set<Class<Reportlet>> getAllReportletClasses() {
         Set<Class<Reportlet>> reportletClasses = new HashSet<>();
@@ -191,7 +179,6 @@ public class ReportLogic extends AbstractTransactionalLogic<ReportTO> {
     }
 
     @PreAuthorize("hasRole('REPORT_LIST')")
-    @SuppressWarnings("rawtypes")
     public Set<String> getReportletConfClasses() {
         Set<String> reportletConfClasses = new HashSet<>();
 
@@ -205,6 +192,18 @@ public class ReportLogic extends AbstractTransactionalLogic<ReportTO> {
         return reportletConfClasses;
     }
 
+    public Class<Reportlet> findReportletClassHavingConfClass(final Class<? extends ReportletConf> reportletConfClass) {
+        Class<Reportlet> result = null;
+        for (Class<Reportlet> reportletClass : getAllReportletClasses()) {
+            Class<? extends ReportletConf> found = getReportletConfClass(reportletClass);
+            if (found != null && found.equals(reportletConfClass)) {
+                result = reportletClass;
+            }
+        }
+
+        return result;
+    }
+
     @PreAuthorize("hasRole('REPORT_READ')")
     public ReportTO read(final Long reportKey) {
         Report report = reportDAO.find(reportKey);
@@ -360,30 +359,27 @@ public class ReportLogic extends AbstractTransactionalLogic<ReportTO> {
         return reportExecToDelete;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected ReportTO resolveReference(final Method method, final Object... args)
             throws UnresolvedReferenceException {
 
-        Long id = null;
+        Long key = null;
 
         if (ArrayUtils.isNotEmpty(args) && ("create".equals(method.getName())
                 || "update".equals(method.getName())
                 || "delete".equals(method.getName()))) {
-            for (int i = 0; id == null && i < args.length; i++) {
+            for (int i = 0; key == null && i < args.length; i++) {
                 if (args[i] instanceof Long) {
-                    id = (Long) args[i];
+                    key = (Long) args[i];
                 } else if (args[i] instanceof ReportTO) {
-                    id = ((ReportTO) args[i]).getKey();
+                    key = ((ReportTO) args[i]).getKey();
                 }
             }
         }
 
-        if ((id != null) && !id.equals(0l)) {
+        if ((key != null) && !key.equals(0l)) {
             try {
-                return binder.getReportTO(reportDAO.find(id));
+                return binder.getReportTO(reportDAO.find(key));
             } catch (Throwable ignore) {
                 LOG.debug("Unresolved reference", ignore);
                 throw new UnresolvedReferenceException(ignore);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ResourceLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ResourceLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ResourceLogic.java
index d18fc15..07d2795 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ResourceLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/ResourceLogic.java
@@ -46,7 +46,6 @@ import org.apache.syncope.server.persistence.api.entity.Subject;
 import org.apache.syncope.server.provisioning.api.Connector;
 import org.apache.syncope.server.provisioning.api.ConnectorFactory;
 import org.apache.syncope.server.provisioning.api.data.ResourceDataBinder;
-import org.apache.syncope.server.logic.init.ImplementationClassNamesLoader;
 import org.apache.syncope.server.misc.ConnObjectUtil;
 import org.apache.syncope.server.misc.MappingUtil;
 import org.identityconnectors.framework.common.objects.Attribute;
@@ -79,9 +78,6 @@ public class ResourceLogic extends AbstractTransactionalLogic<ResourceTO> {
     private ResourceDataBinder binder;
 
     @Autowired
-    private ImplementationClassNamesLoader classNamesLoader;
-
-    @Autowired
     private ConnObjectUtil connObjectUtil;
 
     @Autowired
@@ -162,14 +158,6 @@ public class ResourceLogic extends AbstractTransactionalLogic<ResourceTO> {
         return binder.getResourceTO(resource);
     }
 
-    @PreAuthorize("hasRole('RESOURCE_READ')")
-    public Set<String> getPropagationActionsClasses() {
-        Set<String> actionsClasses = classNamesLoader.getClassNames(
-                ImplementationClassNamesLoader.Type.PROPAGATION_ACTIONS);
-
-        return actionsClasses;
-    }
-
     @PreAuthorize("isAuthenticated()")
     @Transactional(readOnly = true)
     public List<ResourceTO> list(final Long connInstanceId) {
@@ -268,28 +256,25 @@ public class ResourceLogic extends AbstractTransactionalLogic<ResourceTO> {
         return res;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected ResourceTO resolveReference(final Method method, final Object... args)
             throws UnresolvedReferenceException {
 
-        String name = null;
+        String key = null;
 
         if (ArrayUtils.isNotEmpty(args)) {
-            for (int i = 0; name == null && i < args.length; i++) {
+            for (int i = 0; key == null && i < args.length; i++) {
                 if (args[i] instanceof String) {
-                    name = (String) args[i];
+                    key = (String) args[i];
                 } else if (args[i] instanceof ResourceTO) {
-                    name = ((ResourceTO) args[i]).getKey();
+                    key = ((ResourceTO) args[i]).getKey();
                 }
             }
         }
 
-        if (name != null) {
+        if (key != null) {
             try {
-                return binder.getResourceTO(resourceDAO.find(name));
+                return binder.getResourceTO(resourceDAO.find(key));
             } catch (Throwable ignore) {
                 LOG.debug("Unresolved reference", ignore);
                 throw new UnresolvedReferenceException(ignore);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/RoleLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/RoleLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/RoleLogic.java
index 838827c..f2175b9 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/RoleLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/RoleLogic.java
@@ -377,23 +377,23 @@ public class RoleLogic extends AbstractSubjectLogic<RoleTO, RoleMod> {
 
     @Override
     protected RoleTO resolveReference(final Method method, final Object... args) throws UnresolvedReferenceException {
-        Long id = null;
+        Long key = null;
 
         if (ArrayUtils.isNotEmpty(args)) {
-            for (int i = 0; id == null && i < args.length; i++) {
+            for (int i = 0; key == null && i < args.length; i++) {
                 if (args[i] instanceof Long) {
-                    id = (Long) args[i];
+                    key = (Long) args[i];
                 } else if (args[i] instanceof RoleTO) {
-                    id = ((RoleTO) args[i]).getKey();
+                    key = ((RoleTO) args[i]).getKey();
                 } else if (args[i] instanceof RoleMod) {
-                    id = ((RoleMod) args[i]).getKey();
+                    key = ((RoleMod) args[i]).getKey();
                 }
             }
         }
 
-        if ((id != null) && !id.equals(0l)) {
+        if ((key != null) && !key.equals(0l)) {
             try {
-                return binder.getRoleTO(id);
+                return binder.getRoleTO(key);
             } catch (Throwable ignore) {
                 LOG.debug("Unresolved reference", ignore);
                 throw new UnresolvedReferenceException(ignore);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SchemaLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SchemaLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SchemaLogic.java
index ccf191f..7f70be0 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SchemaLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SchemaLogic.java
@@ -272,40 +272,37 @@ public class SchemaLogic extends AbstractTransactionalLogic<AbstractSchemaTO> {
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected AbstractSchemaTO resolveReference(final Method method, final Object... args)
             throws UnresolvedReferenceException {
 
         String kind = null;
-        String name = null;
+        String key = null;
         if (ArrayUtils.isNotEmpty(args)) {
-            for (int i = 0; (name == null || kind == null) && i < args.length; i++) {
+            for (int i = 0; (key == null || kind == null) && i < args.length; i++) {
                 if (args[i] instanceof String) {
                     if (kind == null) {
                         kind = (String) args[i];
                     } else {
-                        name = (String) args[i];
+                        key = (String) args[i];
                     }
                 } else if (args[i] instanceof AbstractSchemaTO) {
-                    name = ((AbstractSchemaTO) args[i]).getKey();
+                    key = ((AbstractSchemaTO) args[i]).getKey();
                 }
             }
         }
 
-        if (name != null) {
+        if (key != null) {
             try {
                 final AttributableUtil attrUtil = attrUtilFactory.getInstance(kind);
 
                 AbstractSchemaTO result = null;
 
-                PlainSchema plainSchema = plainSchemaDAO.find(name, attrUtil.plainSchemaClass());
+                PlainSchema plainSchema = plainSchemaDAO.find(key, attrUtil.plainSchemaClass());
                 if (plainSchema == null) {
-                    DerSchema derSchema = derSchemaDAO.find(name, attrUtil.derSchemaClass());
+                    DerSchema derSchema = derSchemaDAO.find(key, attrUtil.derSchemaClass());
                     if (derSchema == null) {
-                        VirSchema virSchema = virSchemaDAO.find(name, attrUtil.virSchemaClass());
+                        VirSchema virSchema = virSchemaDAO.find(key, attrUtil.virSchemaClass());
                         if (virSchema != null) {
                             result = binder.getVirSchemaTO(virSchema);
                         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SecurityQuestionLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SecurityQuestionLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SecurityQuestionLogic.java
index 65f3ce2..749ee81 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SecurityQuestionLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SecurityQuestionLogic.java
@@ -124,21 +124,21 @@ public class SecurityQuestionLogic extends AbstractTransactionalLogic<SecurityQu
     protected SecurityQuestionTO resolveReference(final Method method, final Object... args)
             throws UnresolvedReferenceException {
 
-        Long id = null;
+        Long key = null;
 
         if (ArrayUtils.isNotEmpty(args)) {
-            for (int i = 0; id == null && i < args.length; i++) {
+            for (int i = 0; key == null && i < args.length; i++) {
                 if (args[i] instanceof Long) {
-                    id = (Long) args[i];
+                    key = (Long) args[i];
                 } else if (args[i] instanceof SecurityQuestionTO) {
-                    id = ((SecurityQuestionTO) args[i]).getKey();
+                    key = ((SecurityQuestionTO) args[i]).getKey();
                 }
             }
         }
 
-        if ((id != null) && !id.equals(0l)) {
+        if ((key != null) && !key.equals(0l)) {
             try {
-                return binder.getSecurityQuestionTO(securityQuestionDAO.find(id));
+                return binder.getSecurityQuestionTO(securityQuestionDAO.find(key));
             } catch (Throwable ignore) {
                 LOG.debug("Unresolved reference", ignore);
                 throw new UnresolvedReferenceException(ignore);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SyncopeLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SyncopeLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SyncopeLogic.java
new file mode 100644
index 0000000..b706efd
--- /dev/null
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SyncopeLogic.java
@@ -0,0 +1,143 @@
+/*
+ * 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.server.logic;
+
+import static org.apache.syncope.server.logic.AbstractLogic.LOG;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Set;
+import javax.annotation.Resource;
+import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.server.logic.init.ImplementationClassNamesLoader;
+import org.apache.syncope.server.misc.spring.ResourceWithFallbackLoader;
+import org.apache.syncope.server.provisioning.api.AttributableTransformer;
+import org.apache.syncope.server.provisioning.api.ConnIdBundleManager;
+import org.apache.syncope.server.provisioning.api.RoleProvisioningManager;
+import org.apache.syncope.server.provisioning.api.UserProvisioningManager;
+import org.apache.syncope.server.provisioning.java.notification.NotificationManagerImpl;
+import org.apache.syncope.server.workflow.api.RoleWorkflowAdapter;
+import org.apache.syncope.server.workflow.api.UserWorkflowAdapter;
+import org.springframework.aop.support.AopUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SyncopeLogic extends AbstractLogic<SyncopeTO> {
+
+    @Resource(name = "version")
+    private String version;
+
+    @Autowired
+    private ConnIdBundleManager bundleManager;
+
+    @Autowired
+    private AttributableTransformer attrTransformer;
+
+    @Autowired
+    private UserWorkflowAdapter uwfAdapter;
+
+    @Autowired
+    private RoleWorkflowAdapter rwfAdapter;
+
+    @Autowired
+    private UserProvisioningManager uProvisioningManager;
+
+    @Autowired
+    private RoleProvisioningManager rProvisioningManager;
+
+    @Autowired
+    private ImplementationClassNamesLoader classNamesLoader;
+
+    @Resource(name = "velocityResourceLoader")
+    private ResourceWithFallbackLoader resourceLoader;
+
+    @PreAuthorize("isAuthenticated()")
+    public SyncopeTO info() {
+        SyncopeTO syncopeTO = new SyncopeTO();
+        syncopeTO.setVersion(version);
+
+        if (bundleManager.getLocations() != null) {
+            for (URI location : bundleManager.getLocations()) {
+                syncopeTO.getConnIdLocations().add(location.toASCIIString());
+            }
+        }
+
+        syncopeTO.setAttributableTransformer(attrTransformer.getClass().getName());
+
+        syncopeTO.setUserWorkflowAdapter(AopUtils.getTargetClass(uwfAdapter).getName());
+        syncopeTO.setRoleWorkflowAdapter(AopUtils.getTargetClass(rwfAdapter).getName());
+
+        syncopeTO.setUserProvisioningManager(uProvisioningManager.getClass().getName());
+        syncopeTO.setRoleProvisioningManager(rProvisioningManager.getClass().getName());
+
+        syncopeTO.getReportlets().addAll(
+                classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.REPORTLET));
+        syncopeTO.getTaskJobs().addAll(
+                classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.TASKJOB));
+        syncopeTO.getPropagationActions().addAll(
+                classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.PROPAGATION_ACTIONS));
+        syncopeTO.getSyncActions().addAll(
+                classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.SYNC_ACTIONS));
+        syncopeTO.getPushActions().addAll(
+                classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.PUSH_ACTIONS));
+        syncopeTO.getSyncCorrelationRules().addAll(
+                classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.SYNC_CORRELATION_RULE));
+        syncopeTO.getPushCorrelationRules().addAll(
+                classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.PUSH_CORRELATION_RULE));
+        syncopeTO.getValidators().addAll(
+                classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.VALIDATOR));
+
+        Set<String> htmlTemplates = new HashSet<>();
+        Set<String> textTemplates = new HashSet<>();
+        try {
+            for (org.springframework.core.io.Resource resource : resourceLoader.getResources(
+                    NotificationManagerImpl.MAIL_TEMPLATES + "*.vm")) {
+
+                String template = resource.getURL().toExternalForm();
+                if (template.endsWith(NotificationManagerImpl.MAIL_TEMPLATE_HTML_SUFFIX)) {
+                    htmlTemplates.add(template.substring(template.indexOf(NotificationManagerImpl.MAIL_TEMPLATES) + 14,
+                            template.indexOf(NotificationManagerImpl.MAIL_TEMPLATE_HTML_SUFFIX)));
+                } else if (template.endsWith(NotificationManagerImpl.MAIL_TEMPLATE_TEXT_SUFFIX)) {
+                    textTemplates.add(template.substring(template.indexOf(NotificationManagerImpl.MAIL_TEMPLATES) + 14,
+                            template.indexOf(NotificationManagerImpl.MAIL_TEMPLATE_TEXT_SUFFIX)));
+                } else {
+                    LOG.warn("Unexpected template found: {}, ignoring...", template);
+                }
+            }
+        } catch (IOException e) {
+            LOG.error("While searching for mail templates", e);
+        }
+        // Only templates available both as HTML and TEXT are considered
+        htmlTemplates.retainAll(textTemplates);
+        syncopeTO.getMailTemplates().addAll(htmlTemplates);
+
+        return syncopeTO;
+    }
+
+    @Override
+    protected SyncopeTO resolveReference(final Method method, final Object... args)
+            throws UnresolvedReferenceException {
+
+        throw new UnresolvedReferenceException();
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/TaskLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/TaskLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/TaskLogic.java
index f97bc83..a7f9725 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/TaskLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/TaskLogic.java
@@ -22,7 +22,6 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-import java.util.Set;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.AbstractTaskTO;
@@ -50,7 +49,6 @@ import org.apache.syncope.server.provisioning.api.data.TaskDataBinder;
 import org.apache.syncope.server.provisioning.api.job.JobNamer;
 import org.apache.syncope.server.provisioning.api.job.TaskJob;
 import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor;
-import org.apache.syncope.server.logic.init.ImplementationClassNamesLoader;
 import org.apache.syncope.server.provisioning.api.job.JobInstanceLoader;
 import org.apache.syncope.server.logic.notification.NotificationJob;
 import org.quartz.JobDataMap;
@@ -86,9 +84,6 @@ public class TaskLogic extends AbstractTransactionalLogic<AbstractTaskTO> {
     private SchedulerFactoryBean scheduler;
 
     @Autowired
-    private ImplementationClassNamesLoader classNamesLoader;
-
-    @Autowired
     private TaskUtilFactory taskUtilFactory;
 
     @PreAuthorize("hasRole('TASK_CREATE')")
@@ -162,21 +157,6 @@ public class TaskLogic extends AbstractTransactionalLogic<AbstractTaskTO> {
         return taskTOs;
     }
 
-    @PreAuthorize("hasRole('TASK_LIST')")
-    public Set<String> getJobClasses() {
-        return classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.TASKJOB);
-    }
-
-    @PreAuthorize("hasRole('TASK_LIST')")
-    public Set<String> getSyncActionsClasses() {
-        return classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.SYNC_ACTIONS);
-    }
-
-    @PreAuthorize("hasRole('TASK_LIST')")
-    public Set<String> getPushActionsClasses() {
-        return classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.PUSH_ACTIONS);
-    }
-
     @PreAuthorize("hasRole('TASK_READ')")
     public <T extends AbstractTaskTO> T read(final Long taskId) {
         Task task = taskDAO.find(taskId);
@@ -378,23 +358,23 @@ public class TaskLogic extends AbstractTransactionalLogic<AbstractTaskTO> {
     protected AbstractTaskTO resolveReference(final Method method, final Object... args)
             throws UnresolvedReferenceException {
 
-        Long id = null;
+        Long key = null;
 
         if (ArrayUtils.isNotEmpty(args)
                 && !"deleteExecution".equals(method.getName()) && !"readExecution".equals(method.getName())) {
 
-            for (int i = 0; id == null && i < args.length; i++) {
+            for (int i = 0; key == null && i < args.length; i++) {
                 if (args[i] instanceof Long) {
-                    id = (Long) args[i];
+                    key = (Long) args[i];
                 } else if (args[i] instanceof AbstractTaskTO) {
-                    id = ((AbstractTaskTO) args[i]).getKey();
+                    key = ((AbstractTaskTO) args[i]).getKey();
                 }
             }
         }
 
-        if ((id != null) && !id.equals(0l)) {
+        if ((key != null) && !key.equals(0l)) {
             try {
-                final Task task = taskDAO.find(id);
+                final Task task = taskDAO.find(key);
                 return binder.getTaskTO(task, taskUtilFactory.getInstance(task));
             } catch (Throwable ignore) {
                 LOG.debug("Unresolved reference", ignore);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java
index 3e0de7e..c9b9249 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java
@@ -508,25 +508,25 @@ public class UserLogic extends AbstractSubjectLogic<UserTO, UserMod> {
 
     @Override
     protected UserTO resolveReference(final Method method, final Object... args) throws UnresolvedReferenceException {
-        Object id = null;
+        Object key = null;
 
         if (!"confirmPasswordReset".equals(method.getName()) && ArrayUtils.isNotEmpty(args)) {
-            for (int i = 0; id == null && i < args.length; i++) {
+            for (int i = 0; key == null && i < args.length; i++) {
                 if (args[i] instanceof Long) {
-                    id = (Long) args[i];
+                    key = (Long) args[i];
                 } else if (args[i] instanceof String) {
-                    id = (String) args[i];
+                    key = (String) args[i];
                 } else if (args[i] instanceof UserTO) {
-                    id = ((UserTO) args[i]).getKey();
+                    key = ((UserTO) args[i]).getKey();
                 } else if (args[i] instanceof UserMod) {
-                    id = ((UserMod) args[i]).getKey();
+                    key = ((UserMod) args[i]).getKey();
                 }
             }
         }
 
-        if ((id != null) && !id.equals(0l)) {
+        if ((key != null) && !key.equals(0l)) {
             try {
-                return id instanceof Long ? binder.getUserTO((Long) id) : binder.getUserTO((String) id);
+                return key instanceof Long ? binder.getUserTO((Long) key) : binder.getUserTO((String) key);
             } catch (Throwable ignore) {
                 LOG.debug("Unresolved reference", ignore);
                 throw new UnresolvedReferenceException(ignore);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/ImplementationClassNamesLoader.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/ImplementationClassNamesLoader.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/ImplementationClassNamesLoader.java
index f7f608f..3546089 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/ImplementationClassNamesLoader.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/ImplementationClassNamesLoader.java
@@ -24,7 +24,6 @@ import java.util.EnumMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import org.apache.syncope.common.lib.wrap.Validator;
 import org.apache.syncope.server.provisioning.api.job.PushJob;
 import org.apache.syncope.server.provisioning.api.job.SyncJob;
 import org.apache.syncope.server.provisioning.api.job.TaskJob;
@@ -34,6 +33,7 @@ import org.apache.syncope.server.provisioning.api.sync.SyncActions;
 import org.apache.syncope.server.provisioning.api.sync.SyncCorrelationRule;
 import org.apache.syncope.server.logic.report.Reportlet;
 import org.apache.syncope.server.persistence.api.SyncopeLoader;
+import org.apache.syncope.server.persistence.api.attrvalue.validation.Validator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -54,11 +54,11 @@ public class ImplementationClassNamesLoader implements SyncopeLoader {
 
         REPORTLET,
         TASKJOB,
+        PROPAGATION_ACTIONS,
         SYNC_ACTIONS,
         PUSH_ACTIONS,
-        SYNC_CORRELATION_RULES,
-        PUSH_CORRELATION_RULES,
-        PROPAGATION_ACTIONS,
+        SYNC_CORRELATION_RULE,
+        PUSH_CORRELATION_RULE,
         VALIDATOR
 
     }
@@ -116,10 +116,13 @@ public class ImplementationClassNamesLoader implements SyncopeLoader {
                     }
 
                     if (interfaces.contains(SyncCorrelationRule.class) && !metadata.isAbstract()) {
-                        classNames.get(Type.SYNC_CORRELATION_RULES).add(metadata.getClassName());
+                        classNames.get(Type.SYNC_CORRELATION_RULE).add(metadata.getClassName());
                     }
 
-                    // TODO: add push correlation rules management
+                    // TODO: SYNCOPE-631
+                    /* if (interfaces.contains(PushCorrelationRule.class) && !metadata.isAbstract()) {
+                     * classNames.get(Type.PUSH_CORRELATION_RULES).add(metadata.getClassName());
+                     * } */
                     if (interfaces.contains(PropagationActions.class) && !metadata.isAbstract()) {
                         classNames.get(Type.PROPAGATION_ACTIONS).add(metadata.getClassName());
                     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/logic/src/main/resources/logicContext.xml
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/resources/logicContext.xml b/syncope620/server/logic/src/main/resources/logicContext.xml
index 273b8a2..6b9aa08 100644
--- a/syncope620/server/logic/src/main/resources/logicContext.xml
+++ b/syncope620/server/logic/src/main/resources/logicContext.xml
@@ -28,6 +28,10 @@ under the License.
                            http://www.springframework.org/schema/context
                            http://www.springframework.org/schema/context/spring-context.xsd">
   
+  <bean id="version" class="java.lang.String">
+    <constructor-arg value="${syncope.version}"/>
+  </bean>
+
   <aop:aspectj-autoproxy/>
 
   <context:component-scan base-package="org.apache.syncope.server.logic"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/persistence-jpa/src/test/resources/content.xml
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-jpa/src/test/resources/content.xml b/syncope620/server/persistence-jpa/src/test/resources/content.xml
index ecbf06d..4d34efc 100644
--- a/syncope620/server/persistence-jpa/src/test/resources/content.xml
+++ b/syncope620/server/persistence-jpa/src/test/resources/content.xml
@@ -1014,7 +1014,7 @@ under the License.
                          serializedInstance='{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttributes":["fullname","gender"],"derivedAttributes":["cn"],"virtualAttributes":["virtualdata"],"features":["key","username","workflowId","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}'/>
   <ReportExec Report_id="1" id="1" status="SUCCESS" startDate="2012-02-26 15:40:04" endDate="2012-02-26 15:41:04"/>
   
-  <SyncopeLogger logName="syncope.audit.[REST]:[EntitlementController]:[]:[getOwn]:[SUCCESS]" logLevel="DEBUG" logType="AUDIT"/>
+  <SyncopeLogger logName="syncope.audit.[REST]:[EntitlementLogic]:[]:[getOwn]:[SUCCESS]" logLevel="DEBUG" logType="AUDIT"/>
 
   <!-- Authentication and authorization -->
   <Entitlement name="base"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnIdBundleManager.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnIdBundleManager.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnIdBundleManager.java
index 764f76e..68587af 100644
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnIdBundleManager.java
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnIdBundleManager.java
@@ -41,6 +41,8 @@ public interface ConnIdBundleManager {
 
     void resetConnManagers();
 
+    List<URI> getLocations();
+
     void setStringLocations(final String stringLocations);
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/ConnIdBundleManagerImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/ConnIdBundleManagerImpl.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/ConnIdBundleManagerImpl.java
index 78591e6..bf9dc02 100644
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/ConnIdBundleManagerImpl.java
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/ConnIdBundleManagerImpl.java
@@ -65,6 +65,13 @@ public class ConnIdBundleManagerImpl implements ConnIdBundleManager {
             Collections.synchronizedMap(new LinkedHashMap<URI, ConnectorInfoManager>());
 
     @Override
+    public List<URI> getLocations() {
+        init();
+
+        return locations;
+    }
+
+    @Override
     public void setStringLocations(final String stringLocations) {
         this.stringLocations = stringLocations;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java
index 47a118f..94a6a4a 100644
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java
@@ -177,8 +177,8 @@ public class SyncJobImpl extends AbstractProvisioningJob<SyncTask, SyncActions>
                     throw new JobExecutionException("While updating SyncToken", e);
                 }
             }
-        } catch (Exception e) {
-            throw new JobExecutionException("While syncing on connector", e);
+        } catch (Throwable t) {
+            throw new JobExecutionException("While syncing on connector", t);
         }
 
         try {

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ConfigurationServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ConfigurationServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ConfigurationServiceImpl.java
index 3a06c51..11c6bfd 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ConfigurationServiceImpl.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ConfigurationServiceImpl.java
@@ -20,16 +20,12 @@ package org.apache.syncope.server.rest.cxf.service;
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.List;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.StreamingOutput;
 import org.apache.syncope.common.lib.to.AttrTO;
 import org.apache.syncope.common.lib.to.ConfTO;
-import org.apache.syncope.common.lib.wrap.MailTemplate;
-import org.apache.syncope.common.lib.wrap.Validator;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
 import org.apache.syncope.common.rest.api.service.ConfigurationService;
 import org.apache.syncope.server.logic.ConfigurationLogic;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -64,16 +60,6 @@ public class ConfigurationServiceImpl extends AbstractServiceImpl implements Con
     }
 
     @Override
-    public List<MailTemplate> getMailTemplates() {
-        return CollectionWrapper.wrap(logic.getMailTemplates(), MailTemplate.class);
-    }
-
-    @Override
-    public List<Validator> getValidators() {
-        return CollectionWrapper.wrap(logic.getValidators(), Validator.class);
-    }
-
-    @Override
     public ConfTO list() {
         return logic.list();
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/PolicyServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/PolicyServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/PolicyServiceImpl.java
index da50761..976e9b6 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/PolicyServiceImpl.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/PolicyServiceImpl.java
@@ -27,8 +27,6 @@ import org.apache.syncope.common.lib.to.AccountPolicyTO;
 import org.apache.syncope.common.lib.to.PasswordPolicyTO;
 import org.apache.syncope.common.lib.to.SyncPolicyTO;
 import org.apache.syncope.common.lib.types.PolicyType;
-import org.apache.syncope.common.lib.wrap.CorrelationRuleClass;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
 import org.apache.syncope.common.rest.api.RESTHeaders;
 import org.apache.syncope.common.rest.api.service.PolicyService;
 import org.apache.syncope.server.logic.PolicyLogic;
@@ -46,7 +44,7 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
         AbstractPolicyTO policy = logic.create(policyTO);
         URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(policy.getKey())).build();
         return Response.created(location).
-                header(RESTHeaders.RESOURCE_ID.toString(), policy.getKey()).
+                header(RESTHeaders.RESOURCE_ID, policy.getKey()).
                 build();
     }
 
@@ -117,9 +115,4 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
                 break;
         }
     }
-
-    @Override
-    public List<CorrelationRuleClass> getSyncCorrelationRuleClasses() {
-        return CollectionWrapper.wrap(logic.getSyncCorrelationRuleClasses(), CorrelationRuleClass.class);
-    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java
index 82da1a9..cc28c50 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java
@@ -30,9 +30,7 @@ import org.apache.syncope.common.lib.to.ConnObjectTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
 import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.lib.wrap.PropagationActionClass;
 import org.apache.syncope.common.lib.wrap.SubjectId;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
 import org.apache.syncope.common.rest.api.RESTHeaders;
 import org.apache.syncope.common.rest.api.service.ResourceService;
 import org.apache.syncope.server.logic.AbstractResourceAssociator;
@@ -80,11 +78,6 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements Resource
     }
 
     @Override
-    public List<PropagationActionClass> getPropagationActionsClasses() {
-        return CollectionWrapper.wrap(logic.getPropagationActionsClasses(), PropagationActionClass.class);
-    }
-
-    @Override
     public List<ResourceTO> list() {
         return logic.list(null);
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/SyncopeServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/SyncopeServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/SyncopeServiceImpl.java
new file mode 100644
index 0000000..d3e6334
--- /dev/null
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/SyncopeServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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.server.rest.cxf.service;
+
+import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.common.rest.api.service.SyncopeService;
+import org.apache.syncope.server.logic.SyncopeLogic;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class SyncopeServiceImpl extends AbstractServiceImpl implements SyncopeService {
+
+    @Autowired
+    private SyncopeLogic logic;
+
+    @Override
+    public SyncopeTO info() {
+        return logic.info();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/TaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/TaskServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/TaskServiceImpl.java
index 717c15d..fc01f52 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/TaskServiceImpl.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/TaskServiceImpl.java
@@ -33,10 +33,6 @@ import org.apache.syncope.common.lib.to.SyncTaskTO;
 import org.apache.syncope.common.lib.to.TaskExecTO;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
 import org.apache.syncope.common.lib.types.TaskType;
-import org.apache.syncope.common.lib.wrap.JobClass;
-import org.apache.syncope.common.lib.wrap.PushActionClass;
-import org.apache.syncope.common.lib.wrap.SyncActionClass;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
 import org.apache.syncope.common.rest.api.RESTHeaders;
 import org.apache.syncope.common.rest.api.service.TaskService;
 import org.apache.syncope.server.logic.TaskLogic;
@@ -81,21 +77,6 @@ public class TaskServiceImpl extends AbstractServiceImpl implements TaskService
     }
 
     @Override
-    public List<JobClass> getJobClasses() {
-        return CollectionWrapper.wrap(logic.getJobClasses(), JobClass.class);
-    }
-
-    @Override
-    public List<SyncActionClass> getSyncActionsClasses() {
-        return CollectionWrapper.wrap(logic.getSyncActionsClasses(), SyncActionClass.class);
-    }
-
-    @Override
-    public List<PushActionClass> getPushActionsClasses() {
-        return CollectionWrapper.wrap(logic.getPushActionsClasses(), PushActionClass.class);
-    }
-
-    @Override
     public <T extends AbstractTaskTO> PagedResult<T> list(final TaskType taskType) {
         return list(taskType, DEFAULT_PARAM_PAGE_VALUE, DEFAULT_PARAM_SIZE_VALUE, null);
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/workflow-activiti/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/server/workflow-activiti/pom.xml b/syncope620/server/workflow-activiti/pom.xml
index 3d6db04..947ca5a 100644
--- a/syncope620/server/workflow-activiti/pom.xml
+++ b/syncope620/server/workflow-activiti/pom.xml
@@ -57,6 +57,11 @@ under the License.
     </dependency>
     
     <dependency>
+      <groupId>org.codehaus.groovy</groupId>
+      <artifactId>groovy-all</artifactId>
+    </dependency>
+      
+    <dependency>
       <groupId>org.apache.syncope.server</groupId>
       <artifactId>syncope-server-workflow-java</artifactId>
       <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/workflow-activiti/src/main/java/org/apache/syncope/server/workflow/activiti/ActivitiDefinitionLoader.java
----------------------------------------------------------------------
diff --git a/syncope620/server/workflow-activiti/src/main/java/org/apache/syncope/server/workflow/activiti/ActivitiDefinitionLoader.java b/syncope620/server/workflow-activiti/src/main/java/org/apache/syncope/server/workflow/activiti/ActivitiDefinitionLoader.java
new file mode 100644
index 0000000..04ffdb6
--- /dev/null
+++ b/syncope620/server/workflow-activiti/src/main/java/org/apache/syncope/server/workflow/activiti/ActivitiDefinitionLoader.java
@@ -0,0 +1,104 @@
+/*
+ * 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.server.workflow.activiti;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import javax.annotation.Resource;
+import org.activiti.editor.constants.ModelDataJsonConstants;
+import org.activiti.engine.RepositoryService;
+import org.activiti.engine.repository.Model;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.spring.SpringProcessEngineConfiguration;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.server.misc.spring.ResourceWithFallbackLoader;
+import org.apache.syncope.server.workflow.api.WorkflowDefinitionLoader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class ActivitiDefinitionLoader implements WorkflowDefinitionLoader {
+
+    private static final Logger LOG = LoggerFactory.getLogger(ActivitiDefinitionLoader.class);
+
+    @Resource(name = "userWorkflowDef")
+    private ResourceWithFallbackLoader userWorkflowDef;
+
+    @Autowired
+    private RepositoryService repositoryService;
+
+    @Autowired
+    private SpringProcessEngineConfiguration conf;
+
+    @Autowired
+    private ActivitiImportUtils importUtils;
+
+    @Override
+    public String getPrefix() {
+        return "ACT_";
+    }
+
+    @Override
+    public void init() {
+        // jump to the next ID block
+        for (int i = 0; i < conf.getIdBlockSize(); i++) {
+            conf.getIdGenerator().getNextId();
+        }
+    }
+
+    @Override
+    public void load() {
+        List<ProcessDefinition> processes = repositoryService.createProcessDefinitionQuery().processDefinitionKey(
+                ActivitiUserWorkflowAdapter.WF_PROCESS_ID).list();
+        LOG.debug(ActivitiUserWorkflowAdapter.WF_PROCESS_ID + " Activiti processes in repository: {}", processes);
+
+        // Only loads process definition from file if not found in repository
+        if (processes.isEmpty()) {
+            InputStream wfIn = null;
+            try {
+                wfIn = userWorkflowDef.getResource().getInputStream();
+                repositoryService.createDeployment().addInputStream(ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE,
+                        new ByteArrayInputStream(IOUtils.toByteArray(wfIn))).deploy();
+
+                ProcessDefinition procDef = repositoryService.createProcessDefinitionQuery().processDefinitionKey(
+                        ActivitiUserWorkflowAdapter.WF_PROCESS_ID).latestVersion().singleResult();
+
+                Model model = repositoryService.newModel();
+                ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
+                modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, procDef.getName());
+                modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1);
+                modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, procDef.getDescription());
+                model.setMetaInfo(modelObjectNode.toString());
+                model.setName(procDef.getName());
+                model.setDeploymentId(procDef.getDeploymentId());
+                importUtils.fromJSON(procDef, model);
+
+                LOG.debug("Activiti Workflow definition loaded");
+            } catch (IOException e) {
+                LOG.error("While loading " + ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE, e);
+            } finally {
+                IOUtils.closeQuietly(wfIn);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1327b2a4/syncope620/server/workflow-activiti/src/main/java/org/apache/syncope/server/workflow/activiti/ActivitiImportUtils.java
----------------------------------------------------------------------
diff --git a/syncope620/server/workflow-activiti/src/main/java/org/apache/syncope/server/workflow/activiti/ActivitiImportUtils.java b/syncope620/server/workflow-activiti/src/main/java/org/apache/syncope/server/workflow/activiti/ActivitiImportUtils.java
new file mode 100644
index 0000000..d09092e
--- /dev/null
+++ b/syncope620/server/workflow-activiti/src/main/java/org/apache/syncope/server/workflow/activiti/ActivitiImportUtils.java
@@ -0,0 +1,92 @@
+/*
+ * 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.server.workflow.activiti;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import org.activiti.bpmn.converter.BpmnXMLConverter;
+import org.activiti.bpmn.model.BpmnModel;
+import org.activiti.editor.language.json.converter.BpmnJsonConverter;
+import org.activiti.engine.ActivitiException;
+import org.activiti.engine.RepositoryService;
+import org.activiti.engine.repository.Model;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.server.workflow.api.WorkflowException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ActivitiImportUtils {
+
+    @Autowired
+    private RepositoryService repositoryService;
+
+    public void fromXML(final byte[] definition) {
+        try {
+            repositoryService.createDeployment().addInputStream(ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE,
+                    new ByteArrayInputStream(definition)).deploy();
+        } catch (ActivitiException e) {
+            throw new WorkflowException("While updating process " + ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE, e);
+        }
+    }
+
+    public void fromJSON(final byte[] definition, final ProcessDefinition procDef, final Model model) {
+        try {
+            model.setVersion(procDef.getVersion());
+            model.setDeploymentId(procDef.getDeploymentId());
+            repositoryService.saveModel(model);
+
+            repositoryService.addModelEditorSource(model.getId(), definition);
+        } catch (Exception e) {
+            throw new WorkflowException("While updating process " + ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE, e);
+        }
+    }
+
+    public void fromJSON(final ProcessDefinition procDef, final Model model) {
+        InputStream bpmnStream = null;
+        InputStreamReader isr = null;
+        XMLStreamReader xtr = null;
+        try {
+            bpmnStream = repositoryService.getResourceAsStream(
+                    procDef.getDeploymentId(), procDef.getResourceName());
+            isr = new InputStreamReader(bpmnStream);
+            xtr = XMLInputFactory.newInstance().createXMLStreamReader(isr);
+            BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
+
+            fromJSON(new BpmnJsonConverter().convertToJson(bpmnModel).toString().getBytes(), procDef, model);
+        } catch (Exception e) {
+            throw new WorkflowException("While updating process " + ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE, e);
+        } finally {
+            if (xtr != null) {
+                try {
+                    xtr.close();
+                } catch (XMLStreamException e) {
+                    // ignore
+                }
+            }
+            IOUtils.closeQuietly(isr);
+            IOUtils.closeQuietly(bpmnStream);
+        }
+    }
+}


Mime
View raw message