syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [4/5] syncope git commit: [SYNCOPE-620] FIT module is in, now time for importing integration tests
Date Wed, 14 Jan 2015 16:38:20 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/fit/reference/src/main/webapp/cacheStats.jsp
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/webapp/cacheStats.jsp b/syncope620/fit/reference/src/main/webapp/cacheStats.jsp
new file mode 100644
index 0000000..5ff8a6b
--- /dev/null
+++ b/syncope620/fit/reference/src/main/webapp/cacheStats.jsp
@@ -0,0 +1,190 @@
+<%--
+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.
+--%>
+<%@page import="org.apache.syncope.common.lib.SyncopeConstants"%>
+<%@page import="org.apache.syncope.server.misc.spring.ApplicationContextProvider"%>
+<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
+<%@page import="java.text.SimpleDateFormat"%>
+<%@page import="java.util.Date"%>
+<%@page import="org.apache.openjpa.datacache.CacheStatisticsImpl"%>
+<%@page import="javax.persistence.EntityManagerFactory"%>
+<%@page import="org.apache.openjpa.persistence.OpenJPAPersistence"%>
+<%@page import="org.apache.openjpa.persistence.OpenJPAEntityManagerFactory"%>
+<%@page import="org.springframework.context.ConfigurableApplicationContext"%>
+<%@page import="org.apache.openjpa.datacache.QueryKey"%>
+<%@page import="org.apache.openjpa.kernel.QueryStatistics"%>
+<%@page import="org.apache.openjpa.persistence.QueryResultCacheImpl"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Cache Statistics</title>
+    <style type="text/css">
+      .c{
+        text-align: center;
+      }
+      .r{
+        text-align: right;
+      }
+      .l{
+        text-align: left;
+      }
+      .t{
+        vertical-align: top;
+      }
+      .b{
+        vertical-align: bottom;
+      }
+      .odd{
+        background-color: #D4D4D4;
+      }
+      .even{
+        background-color: #EEEEEE;
+      }
+      .bd1{
+        border: solid #888888 1px;
+      }
+      .bg1{
+        background-color: #CCCCCC;
+      }
+      .bg2{
+        background-color: #DDDDDD;
+      }
+    </style>
+  </head>
+  <body>
+    <p/>
+    <%
+        ConfigurableApplicationContext context = ApplicationContextProvider.getApplicationContext();
+
+        EntityManagerFactory emf = context.getBean(EntityManagerFactory.class);
+        OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
+
+        QueryStatistics<QueryKey> queryStatistics =
+                ((QueryResultCacheImpl) oemf.getQueryResultCache()).getDelegate().getStatistics();
+
+        CacheStatisticsImpl statistics = (CacheStatisticsImpl) oemf.getStoreCache().getStatistics();
+
+        String action = request.getParameter("do");
+        StringBuilder info = new StringBuilder(512);
+
+        if ("activate".equals(action) && !statistics.isEnabled()) {
+            statistics.enable();
+            info.append("Statistics enabled\n");
+        } else if ("deactivate".equals(action) && !statistics.isEnabled()) {
+            statistics.disable();
+            info.append("Statistics disabled\n");
+        } else if ("clear".equals(action)) {
+            queryStatistics.reset();
+            statistics.reset();
+            info.append("Statistics cleared\n");
+        }
+
+        SimpleDateFormat sdf = new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN);
+        if (info.length() > 0) {
+    %>
+    <p/><div class="success">
+      <c:out value="${fn:escapeXml(info)}"/>
+    </div>
+    <%                    }%>
+    <p/>
+    <a href="?">Reload</a>
+    <p/>
+    <a href="?do=<%=(statistics.isEnabled() ? "deactivate" : "activate")%>">
+      <%=(statistics.isEnabled() ? "DEACTIVATE" : "ACTIVATE")%></a>
+    <a href="?do=clear">CLEAR</a>
+    <p/>
+    Last update: <%=sdf.format(statistics.since())%><br/>
+    Activation: <%=sdf.format(statistics.start())%><br/>
+    <p/>
+    <table>
+      <tr>
+        <th class="c bd1 bg1">Hits</th>
+        <td><%=statistics.getHitCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Reads</th>
+        <td><%=statistics.getReadCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Writes</th>
+        <td><%=statistics.getWriteCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Query Hits</th>
+        <td><%=queryStatistics.getHitCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Query Executions</th>
+        <td><%=queryStatistics.getExecutionCount()%></td>
+      </tr>
+      <tr>
+        <th class="c bd1 bg1">Query Evictions</th>
+        <td><%=queryStatistics.getEvictionCount()%></td>
+      </tr>
+    </table>
+    <p/>
+    <table width="100%">
+      <tr><th colspan="3" class="c bd1 bg2">Query statistics</th></tr>
+      <tr>
+        <th class="c bd1 bg1">Query</th>
+        <th class="c bd1 bg1">Hits</th>
+        <th class="c bd1 bg1">Executions</th>
+      </tr>
+      <%
+          boolean odd = true;
+          for (QueryKey key : queryStatistics.keys()) {
+      %>
+      <tr class="<%=(odd ? "odd" : "even")%>">
+        <td><%=key%></td>
+        <td><%=queryStatistics.getHitCount(key)%></td>
+        <td><%=queryStatistics.getExecutionCount(key)%></td>
+      </tr>
+      <%
+              odd = !odd;
+          }
+      %>
+    </table>
+    <p/>
+    <table width="100%">
+      <tr><th colspan="4" class="c bd1 bg2">2nd level cache statistics</th></tr>
+      <tr>
+        <th class="c bd1 bg1">Region</th>
+        <th class="c bd1 bg1">Hits</th>
+        <th class="c bd1 bg1">Reads</th>
+        <th class="c bd1 bg1">Writes</th>
+      </tr>
+      <%
+          odd = true;
+          for (String className : statistics.classNames()) {
+      %>
+      <tr class="<%=(odd ? "odd" : "even")%>">
+        <td><%=className%></td>
+        <td><%=statistics.getHitCount(className)%></td>
+        <td><%=statistics.getReadCount(className)%></td>
+        <td><%=statistics.getWriteCount(className)%></td>
+      </tr>
+      <%
+              odd = !odd;
+          }
+      %>
+    </table>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/fit/reference/src/main/webapp/db.jsp
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/webapp/db.jsp b/syncope620/fit/reference/src/main/webapp/db.jsp
new file mode 100644
index 0000000..2a4c6ac
--- /dev/null
+++ b/syncope620/fit/reference/src/main/webapp/db.jsp
@@ -0,0 +1,36 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+--%>
+<%@page import="java.sql.SQLException"%>
+<%@page import="org.h2.tools.Server"%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%
+    Server h2Datastore = (Server) getServletConfig().getServletContext().getAttribute("H2_DATASTORE");
+    if (h2Datastore == null || !h2Datastore.isRunning(true)) {
+        try {
+            h2Datastore = Server.createWebServer("-webPort", "8082");
+            h2Datastore.start();
+
+            getServletConfig().getServletContext().setAttribute("H2_DATASTORE", h2Datastore);
+        } catch (SQLException e) {
+            getServletConfig().getServletContext().log("Could not start H2 web console (datastore)", e);
+        }
+
+        response.sendRedirect("http://localhost:8082");
+    }
+%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/pom.xml b/syncope620/pom.xml
index a2433a8..96b475f 100644
--- a/syncope620/pom.xml
+++ b/syncope620/pom.xml
@@ -325,7 +325,7 @@ under the License.
     <jackson.version>2.5.0</jackson.version>
 
     <spring.version>4.1.4.RELEASE</spring.version>
-    <spring-security.version>4.0.0.RC1</spring-security.version>
+    <spring-security.version>3.2.5.RELEASE</spring-security.version>
 
     <openjpa.version>2.3.0</openjpa.version>
     <commons-dbcp.version>2.0.1</commons-dbcp.version>
@@ -337,8 +337,11 @@ under the License.
 
     <cocoon.version>3.0.0-alpha-3</cocoon.version>
 
+    <groovy.version>2.3.9</groovy.version>
+
     <slf4j.version>1.7.10</slf4j.version>
     <log4j.version>2.1</log4j.version>
+    <disruptor.version>3.3.0</disruptor.version>
 
     <commons-io.version>2.4</commons-io.version>
     <commons-codec.version>1.10</commons-codec.version>
@@ -355,8 +358,31 @@ under the License.
     <log.directory>${project.build.directory}/log</log.directory>
     <activiti-modeler.directory>${project.build.directory}/activiti-modeler</activiti-modeler.directory>
     
-    <testconnectorserver.key>testconnectorserver</testconnectorserver.key>
+    <jquery.version>1.11.1</jquery.version>
+    <jquery-ui.version>1.10.4</jquery-ui.version>
+    <highlightjs.version>8.0</highlightjs.version>
+    <codemirror.version>3.23</codemirror.version>
+    
+    <testds.port>1389</testds.port>
+    <testdb.webport>9082</testdb.webport>
+
+    <testdb.driver>org.h2.Driver</testdb.driver>
+    <testdb.url>jdbc:h2:tcp://localhost:9092/mem:testdb;DB_CLOSE_DELAY=-1</testdb.url>
+    <testdb.username>sa</testdb.username>
+    <testdb.password>sa</testdb.password>
+
     <testconnectorserver.port>4554</testconnectorserver.port>
+    <testconnectorserver.key>testconnectorserver</testconnectorserver.key>
+
+    <test.csvdir.path>${project.build.directory}/test-csvdir</test.csvdir.path>
+
+    <cargo.servlet.port>9080</cargo.servlet.port>
+    <cargo.tomcat.ajp.port>9889</cargo.tomcat.ajp.port>
+    <cargo.rmi.port>9805</cargo.rmi.port>
+    <cargo.log>${log.directory}/cargo.log</cargo.log>
+    <cargo.output>${log.directory}/cargo-output.log</cargo.output>
+
+    <tomcat.version>8.0.15</tomcat.version>
 
     <anonymousUser>anonymous</anonymousUser>
     <!-- static keys, only used for build: generated overlays will override during archetype:generate -->
@@ -397,7 +423,24 @@ under the License.
         <artifactId>geronimo-javamail_1.4_mail</artifactId>
         <version>1.8.4</version>
       </dependency>
-
+      <dependency> 
+        <groupId>javax.servlet</groupId> 
+        <artifactId>javax.servlet-api</artifactId> 
+        <version>3.1.0</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>javax.servlet.jsp</groupId>
+        <artifactId>javax.servlet.jsp-api</artifactId>
+        <version>2.3.1</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>javax.servlet</groupId>
+        <artifactId>jstl</artifactId>
+        <version>1.2</version>
+      </dependency>
+      
       <!-- CXF -->
       <dependency>
         <groupId>org.apache.cxf</groupId>
@@ -506,11 +549,46 @@ under the License.
         <version>${spring.version}</version>
       </dependency>
       <dependency>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring-web</artifactId>
+        <version>${spring.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring-aop</artifactId>
+        <version>${spring.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring-expression</artifactId>
+        <version>${spring.version}</version>
+      </dependency>
+      <dependency>
         <groupId>org.springframework.security</groupId>
         <artifactId>spring-security-core</artifactId>
         <version>${spring-security.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-expression</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
-
+      <dependency>
+        <groupId>org.springframework.security</groupId>
+        <artifactId>spring-security-web</artifactId>
+        <version>${spring-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.springframework.security</groupId>
+        <artifactId>spring-security-config</artifactId>
+        <version>${spring-security.version}</version>
+      </dependency>
+    
       <dependency>
         <groupId>org.aspectj</groupId>
         <artifactId>aspectjweaver</artifactId>
@@ -555,10 +633,22 @@ under the License.
       </dependency>
       
       <dependency>
+        <groupId>org.codehaus.groovy</groupId>
+        <artifactId>groovy-all</artifactId>
+        <version>${groovy.version}</version>
+      </dependency>
+
+      <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
         <version>${h2.version}</version>
       </dependency>
+
+      <dependency>
+        <groupId>org.apache.directory.server</groupId>
+        <artifactId>apacheds-all</artifactId>
+        <version>2.0.0-M19</version>
+      </dependency>
       
       <dependency>
         <groupId>org.jasypt</groupId>
@@ -658,7 +748,7 @@ under the License.
         <artifactId>xercesImpl</artifactId>
         <version>2.11.0</version>
       </dependency>
-
+      
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
@@ -674,6 +764,48 @@ under the License.
         <artifactId>log4j-core</artifactId>
         <version>${log4j.version}</version>
       </dependency>
+      <dependency>
+        <groupId>com.lmax</groupId>
+        <artifactId>disruptor</artifactId>
+        <version>${disruptor.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-slf4j-impl</artifactId>
+        <version>${log4j.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-logging</groupId>
+        <artifactId>commons-logging</artifactId>
+        <version>${commons.logging.version}</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>jcl-over-slf4j</artifactId>
+        <version>${slf4j.version}</version>
+      </dependency>
+      
+      <dependency>
+        <groupId>org.webjars</groupId>
+        <artifactId>jquery</artifactId>
+        <version>${jquery.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.webjars</groupId>
+        <artifactId>jquery-ui</artifactId>
+        <version>${jquery-ui.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.webjars</groupId>
+        <artifactId>highlightjs</artifactId>
+        <version>${highlightjs.version}-3</version>
+      </dependency>
+      <dependency>
+        <groupId>org.webjars</groupId>
+        <artifactId>codemirror</artifactId>
+        <version>${codemirror.version}</version>
+      </dependency>
       
       <!-- TEST -->
       <dependency>
@@ -709,16 +841,6 @@ under the License.
         <enabled>true</enabled>
       </snapshots>
     </repository>
-    
-    <!-- TMP for Spring Security 4.0.0-RC1 -->
-    <repository>
-      <id>spring-milestones</id>
-      <name>Spring Milestones</name>
-      <url>http://repo.spring.io/milestone</url>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
   </repositories>
 
   <pluginRepositories>
@@ -802,6 +924,31 @@ under the License.
         
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-war-plugin</artifactId>
+          <version>2.6</version>
+        </plugin>
+        
+        <plugin>
+          <groupId>org.codehaus.cargo</groupId>
+          <artifactId>cargo-maven2-plugin</artifactId>
+          <version>1.4.11</version>
+          <configuration>
+            <container>
+              <containerId>tomcat8x</containerId>
+              <zipUrlInstaller>
+                <url>http://archive.apache.org/dist/tomcat/tomcat-8/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip</url>
+                <downloadDir>${settings.localRepository}/org/codehaus/cargo/cargo-container-archives</downloadDir>
+                <extractDir>${project.build.directory}/cargo/extract</extractDir>
+              </zipUrlInstaller>
+              <timeout>240000</timeout>
+              <log>${cargo.log}</log>
+              <output>${cargo.output}</output>    
+            </container>
+          </configuration>
+        </plugin>
+        
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
           <version>2.18</version>
           <configuration>
@@ -843,5 +990,6 @@ under the License.
     <module>common</module>
     <module>server</module>
     <module>client</module>
+    <module>fit</module>
   </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/pom.xml b/syncope620/server/logic/pom.xml
index 84cecb0..ad1a791 100644
--- a/syncope620/server/logic/pom.xml
+++ b/syncope620/server/logic/pom.xml
@@ -99,7 +99,7 @@ under the License.
       
     <dependency>
       <groupId>org.apache.syncope.server</groupId>
-      <artifactId>syncope-provisioning-java</artifactId>
+      <artifactId>syncope-server-provisioning-java</artifactId>
       <version>${project.version}</version>
     </dependency>
     
@@ -111,7 +111,7 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.syncope.server</groupId>
-      <artifactId>syncope-workflow-java</artifactId>
+      <artifactId>syncope-server-workflow-java</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
@@ -122,7 +122,7 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.syncope.server</groupId>
-      <artifactId>syncope-persistence-jpa</artifactId>
+      <artifactId>syncope-server-persistence-jpa</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/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 dbf0833..bb369ab 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
@@ -235,10 +235,10 @@ public class ReportLogic extends AbstractTransactionalLogic<ReportTO> {
             // a single ZipEntry in the ZipInputStream (see ReportJob)
             zis.getNextEntry();
 
-            Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
+            Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<>();
             pipeline.addComponent(new XMLGenerator(zis));
 
-            Map<String, Object> parameters = new HashMap<String, Object>();
+            Map<String, Object> parameters = new HashMap<>();
             parameters.put("status", reportExec.getStatus());
             parameters.put("message", reportExec.getMessage());
             parameters.put("startDate", reportExec.getStartDate());

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/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 cba2839..f7f608f 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
@@ -33,6 +33,7 @@ import org.apache.syncope.server.provisioning.api.sync.PushActions;
 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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,7 +48,7 @@ import org.springframework.util.ClassUtils;
  * Cache class names for all implementations of Syncope interfaces found in classpath, for later usage.
  */
 @Component
-public class ImplementationClassNamesLoader {
+public class ImplementationClassNamesLoader implements SyncopeLoader {
 
     public enum Type {
 
@@ -72,10 +73,16 @@ public class ImplementationClassNamesLoader {
 
     private Map<Type, Set<String>> classNames;
 
+    @Override
+    public Integer getPriority() {
+        return 400;
+    }
+
+    @Override
     public void load() {
         CachingMetadataReaderFactory factory = new CachingMetadataReaderFactory();
 
-        classNames = new EnumMap<Type, Set<String>>(Type.class);
+        classNames = new EnumMap<>(Type.class);
         for (Type type : Type.values()) {
             classNames.put(type, new HashSet<String>());
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/JobInstanceLoader.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/JobInstanceLoader.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/JobInstanceLoader.java
index 2d74da0..3f6f753 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/JobInstanceLoader.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/JobInstanceLoader.java
@@ -19,231 +19,23 @@
 package org.apache.syncope.server.logic.init;
 
 import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.common.lib.types.TaskType;
-import org.apache.syncope.server.persistence.api.dao.ConfDAO;
-import org.apache.syncope.server.persistence.api.dao.NotFoundException;
-import org.apache.syncope.server.persistence.api.dao.ReportDAO;
-import org.apache.syncope.server.persistence.api.dao.TaskDAO;
 import org.apache.syncope.server.persistence.api.entity.Report;
-import org.apache.syncope.server.persistence.api.entity.conf.CPlainAttr;
-import org.apache.syncope.server.persistence.api.entity.task.PushTask;
-import org.apache.syncope.server.persistence.api.entity.task.SchedTask;
-import org.apache.syncope.server.persistence.api.entity.task.SyncTask;
 import org.apache.syncope.server.persistence.api.entity.task.Task;
-import org.apache.syncope.server.provisioning.api.job.JobNamer;
-import org.apache.syncope.server.provisioning.api.job.SyncJob;
-import org.apache.syncope.server.provisioning.api.job.TaskJob;
-import org.apache.syncope.server.provisioning.api.sync.SyncActions;
-import org.apache.syncope.server.logic.notification.NotificationJob;
-import org.apache.syncope.server.logic.report.ReportJob;
-import org.apache.syncope.server.misc.spring.ApplicationContextProvider;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobKey;
-import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
-import org.quartz.TriggerKey;
-import org.quartz.impl.JobDetailImpl;
-import org.quartz.impl.triggers.CronTriggerImpl;
-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.scheduling.quartz.SchedulerFactoryBean;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
 
-@Component
-public class JobInstanceLoader {
+public interface JobInstanceLoader {
 
-    private static final Logger LOG = LoggerFactory.getLogger(JobInstanceLoader.class);
+    void registerJob(Task task, String jobClassName, String cronExpression)
+            throws ClassNotFoundException, SchedulerException, ParseException;
 
-    @Autowired
-    private SchedulerFactoryBean scheduler;
+    void registerJob(Report report) throws SchedulerException, ParseException;
 
-    @Autowired
-    private TaskDAO taskDAO;
+    void registerReportJob(Long reportKey) throws SchedulerException, ParseException;
 
-    @Autowired
-    private ReportDAO reportDAO;
+    void registerTaskJob(Long taskKey) throws ClassNotFoundException, SchedulerException, ParseException;
 
-    @Autowired
-    private ConfDAO confDAO;
+    void unregisterJob(Task task);
 
-    private void registerJob(final String jobName, final Job jobInstance, final String cronExpression)
-            throws SchedulerException, ParseException {
+    void unregisterJob(Report report);
 
-        synchronized (scheduler.getScheduler()) {
-            boolean jobAlreadyRunning = false;
-            for (JobExecutionContext jobCtx : scheduler.getScheduler().getCurrentlyExecutingJobs()) {
-                if (jobName.equals(jobCtx.getJobDetail().getKey().getName())
-                        && Scheduler.DEFAULT_GROUP.equals(jobCtx.getJobDetail().getKey().getGroup())) {
-
-                    jobAlreadyRunning = true;
-
-                    LOG.debug("Job {} already running, cancel", jobCtx.getJobDetail().getKey());
-                }
-            }
-
-            if (jobAlreadyRunning) {
-                return;
-            }
-        }
-
-        // 0. unregister job
-        unregisterJob(jobName);
-
-        // 1. Job bean
-        ApplicationContextProvider.getBeanFactory().registerSingleton(jobName, jobInstance);
-
-        // 2. JobDetail bean
-        JobDetailImpl jobDetail = new JobDetailImpl();
-        jobDetail.setName(jobName);
-        jobDetail.setGroup(Scheduler.DEFAULT_GROUP);
-        jobDetail.setJobClass(jobInstance.getClass());
-
-        // 3. Trigger
-        if (cronExpression == null) {
-            // Jobs added with no trigger must be durable
-            jobDetail.setDurability(true);
-            scheduler.getScheduler().addJob(jobDetail, true);
-        } else {
-            CronTriggerImpl cronTrigger = new CronTriggerImpl();
-            cronTrigger.setName(JobNamer.getTriggerName(jobName));
-            cronTrigger.setCronExpression(cronExpression);
-
-            scheduler.getScheduler().scheduleJob(jobDetail, cronTrigger);
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public void registerJob(final Task task, final String jobClassName, final String cronExpression)
-            throws ClassNotFoundException, SchedulerException, ParseException {
-
-        final Class<?> jobClass = Class.forName(jobClassName);
-        Job jobInstance = (Job) ApplicationContextProvider.getBeanFactory().
-                createBean(jobClass, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
-        if (jobInstance instanceof TaskJob) {
-            ((TaskJob) jobInstance).setTaskId(task.getKey());
-        }
-
-        // In case of synchronization job/task retrieve and set synchronization actions:
-        // actions cannot be changed at runtime but connector and synchronization policies (reloaded at execution time).
-        if (jobInstance instanceof SyncJob && task instanceof SyncTask) {
-            final List<SyncActions> actions = new ArrayList<>();
-            for (String className : ((SyncTask) task).getActionsClassNames()) {
-                try {
-                    Class<?> actionsClass = Class.forName(className);
-
-                    final SyncActions syncActions =
-                            (SyncActions) ApplicationContextProvider.getBeanFactory().
-                            createBean(actionsClass, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, true);
-
-                    actions.add(syncActions);
-                } catch (Exception e) {
-                    LOG.info("Class '{}' not found", className, e);
-                }
-            }
-
-            ((SyncJob) jobInstance).setActions(actions);
-        }
-
-        registerJob(JobNamer.getJobName(task), jobInstance, cronExpression);
-    }
-
-    @Transactional(readOnly = true)
-    public void registerTaskJob(final Long taskId)
-            throws ClassNotFoundException, SchedulerException, ParseException {
-
-        SchedTask task = taskDAO.find(taskId);
-        if (task == null) {
-            throw new NotFoundException("Task " + taskId);
-        } else {
-            registerJob(task, task.getJobClassName(), task.getCronExpression());
-        }
-    }
-
-    public void registerJob(final Report report) throws SchedulerException, ParseException {
-        Job jobInstance = (Job) ApplicationContextProvider.getBeanFactory().
-                createBean(ReportJob.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
-        ((ReportJob) jobInstance).setReportKey(report.getKey());
-
-        registerJob(JobNamer.getJobName(report), jobInstance, report.getCronExpression());
-    }
-
-    @Transactional(readOnly = true)
-    public void registerReportJob(final Long reportId) throws SchedulerException, ParseException {
-        Report report = reportDAO.find(reportId);
-        if (report == null) {
-            throw new NotFoundException("Report " + reportId);
-        } else {
-            registerJob(report);
-        }
-    }
-
-    private void unregisterJob(final String jobName) {
-        try {
-            scheduler.getScheduler().unscheduleJob(new TriggerKey(jobName, Scheduler.DEFAULT_GROUP));
-            scheduler.getScheduler().deleteJob(new JobKey(jobName, Scheduler.DEFAULT_GROUP));
-        } catch (SchedulerException e) {
-            LOG.error("Could not remove job " + jobName, e);
-        }
-
-        if (ApplicationContextProvider.getBeanFactory().containsSingleton(jobName)) {
-            ApplicationContextProvider.getBeanFactory().destroySingleton(jobName);
-        }
-    }
-
-    public void unregisterJob(final Task task) {
-        unregisterJob(JobNamer.getJobName(task));
-    }
-
-    public void unregisterJob(final Report report) {
-        unregisterJob(JobNamer.getJobName(report));
-    }
-
-    @Transactional
-    public void load() {
-        // 1. jobs for SchedTasks
-        Set<SchedTask> tasks = new HashSet<>(taskDAO.<SchedTask>findAll(TaskType.SCHEDULED));
-        tasks.addAll(taskDAO.<SyncTask>findAll(TaskType.SYNCHRONIZATION));
-        tasks.addAll(taskDAO.<PushTask>findAll(TaskType.PUSH));
-        for (SchedTask task : tasks) {
-            try {
-                registerJob(task, task.getJobClassName(), task.getCronExpression());
-            } catch (Exception e) {
-                LOG.error("While loading job instance for task " + task.getKey(), e);
-            }
-        }
-
-        // 2. NotificationJob
-        CPlainAttr notificationJobCronExp =
-                confDAO.find("notificationjob.cronExpression", NotificationJob.DEFAULT_CRON_EXP);
-        if (StringUtils.isBlank(notificationJobCronExp.getValuesAsStrings().get(0))) {
-            LOG.debug("Empty value provided for NotificationJob's cron, not registering anything on Quartz");
-        } else {
-            LOG.debug("NotificationJob's cron expression: {} - registering Quartz job and trigger",
-                    notificationJobCronExp);
-
-            try {
-                registerJob(null, NotificationJob.class.getName(), notificationJobCronExp.getValuesAsStrings().get(0));
-            } catch (Exception e) {
-                LOG.error("While loading NotificationJob instance", e);
-            }
-        }
-
-        // 3. ReportJobs
-        for (Report report : reportDAO.findAll()) {
-            try {
-                registerJob(report);
-            } catch (Exception e) {
-                LOG.error("While loading job instance for report " + report.getName(), e);
-            }
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/JobInstanceLoaderImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/JobInstanceLoaderImpl.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/JobInstanceLoaderImpl.java
new file mode 100644
index 0000000..48e7db4
--- /dev/null
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/JobInstanceLoaderImpl.java
@@ -0,0 +1,270 @@
+/*
+ * 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.init;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.types.TaskType;
+import org.apache.syncope.server.persistence.api.dao.ConfDAO;
+import org.apache.syncope.server.persistence.api.dao.NotFoundException;
+import org.apache.syncope.server.persistence.api.dao.ReportDAO;
+import org.apache.syncope.server.persistence.api.dao.TaskDAO;
+import org.apache.syncope.server.persistence.api.entity.Report;
+import org.apache.syncope.server.persistence.api.entity.conf.CPlainAttr;
+import org.apache.syncope.server.persistence.api.entity.task.PushTask;
+import org.apache.syncope.server.persistence.api.entity.task.SchedTask;
+import org.apache.syncope.server.persistence.api.entity.task.SyncTask;
+import org.apache.syncope.server.persistence.api.entity.task.Task;
+import org.apache.syncope.server.provisioning.api.job.JobNamer;
+import org.apache.syncope.server.provisioning.api.job.SyncJob;
+import org.apache.syncope.server.provisioning.api.job.TaskJob;
+import org.apache.syncope.server.provisioning.api.sync.SyncActions;
+import org.apache.syncope.server.logic.notification.NotificationJob;
+import org.apache.syncope.server.logic.report.ReportJob;
+import org.apache.syncope.server.misc.spring.ApplicationContextProvider;
+import org.apache.syncope.server.persistence.api.SyncopeLoader;
+import org.apache.syncope.server.provisioning.api.job.PushJob;
+import org.apache.syncope.server.provisioning.java.sync.PushJobImpl;
+import org.apache.syncope.server.provisioning.java.sync.SyncJobImpl;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobKey;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.TriggerKey;
+import org.quartz.impl.JobDetailImpl;
+import org.quartz.impl.triggers.CronTriggerImpl;
+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.scheduling.quartz.SchedulerFactoryBean;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+@Component
+public class JobInstanceLoaderImpl implements JobInstanceLoader, SyncopeLoader {
+
+    private static final Logger LOG = LoggerFactory.getLogger(JobInstanceLoader.class);
+
+    @Autowired
+    private SchedulerFactoryBean scheduler;
+
+    @Autowired
+    private TaskDAO taskDAO;
+
+    @Autowired
+    private ReportDAO reportDAO;
+
+    @Autowired
+    private ConfDAO confDAO;
+
+    private void registerJob(final String jobName, final Job jobInstance, final String cronExpression)
+            throws SchedulerException, ParseException {
+
+        synchronized (scheduler.getScheduler()) {
+            boolean jobAlreadyRunning = false;
+            for (JobExecutionContext jobCtx : scheduler.getScheduler().getCurrentlyExecutingJobs()) {
+                if (jobName.equals(jobCtx.getJobDetail().getKey().getName())
+                        && Scheduler.DEFAULT_GROUP.equals(jobCtx.getJobDetail().getKey().getGroup())) {
+
+                    jobAlreadyRunning = true;
+
+                    LOG.debug("Job {} already running, cancel", jobCtx.getJobDetail().getKey());
+                }
+            }
+
+            if (jobAlreadyRunning) {
+                return;
+            }
+        }
+
+        // 0. unregister job
+        unregisterJob(jobName);
+
+        // 1. Job bean
+        ApplicationContextProvider.getBeanFactory().registerSingleton(jobName, jobInstance);
+
+        // 2. JobDetail bean
+        JobDetailImpl jobDetail = new JobDetailImpl();
+        jobDetail.setName(jobName);
+        jobDetail.setGroup(Scheduler.DEFAULT_GROUP);
+        jobDetail.setJobClass(jobInstance.getClass());
+
+        // 3. Trigger
+        if (cronExpression == null) {
+            // Jobs added with no trigger must be durable
+            jobDetail.setDurability(true);
+            scheduler.getScheduler().addJob(jobDetail, true);
+        } else {
+            CronTriggerImpl cronTrigger = new CronTriggerImpl();
+            cronTrigger.setName(JobNamer.getTriggerName(jobName));
+            cronTrigger.setCronExpression(cronExpression);
+
+            scheduler.getScheduler().scheduleJob(jobDetail, cronTrigger);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public void registerJob(final Task task, final String jobClassName, final String cronExpression)
+            throws ClassNotFoundException, SchedulerException, ParseException {
+
+        Class<?> jobClass = Class.forName(jobClassName);
+        if (SyncJob.class.equals(jobClass)) {
+            jobClass = SyncJobImpl.class;
+        } else if (PushJob.class.equals(jobClass)) {
+            jobClass = PushJobImpl.class;
+        }
+        Job jobInstance = (Job) ApplicationContextProvider.getBeanFactory().
+                createBean(jobClass, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
+        if (jobInstance instanceof TaskJob) {
+            ((TaskJob) jobInstance).setTaskId(task.getKey());
+        }
+
+        // In case of synchronization job/task retrieve and set synchronization actions:
+        // actions cannot be changed at runtime but connector and synchronization policies (reloaded at execution time).
+        if (jobInstance instanceof SyncJob && task instanceof SyncTask) {
+            final List<SyncActions> actions = new ArrayList<>();
+            for (String className : ((SyncTask) task).getActionsClassNames()) {
+                try {
+                    Class<?> actionsClass = Class.forName(className);
+
+                    final SyncActions syncActions =
+                            (SyncActions) ApplicationContextProvider.getBeanFactory().
+                            createBean(actionsClass, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, true);
+
+                    actions.add(syncActions);
+                } catch (Exception e) {
+                    LOG.info("Class '{}' not found", className, e);
+                }
+            }
+
+            ((SyncJob) jobInstance).setActions(actions);
+        }
+
+        registerJob(JobNamer.getJobName(task), jobInstance, cronExpression);
+    }
+
+    @Transactional(readOnly = true)
+    @Override
+    public void registerTaskJob(final Long taskKey)
+            throws ClassNotFoundException, SchedulerException, ParseException {
+
+        SchedTask task = taskDAO.find(taskKey);
+        if (task == null) {
+            throw new NotFoundException("Task " + taskKey);
+        } else {
+            registerJob(task, task.getJobClassName(), task.getCronExpression());
+        }
+    }
+
+    @Override
+    public void registerJob(final Report report) throws SchedulerException, ParseException {
+        Job jobInstance = (Job) ApplicationContextProvider.getBeanFactory().
+                createBean(ReportJob.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
+        ((ReportJob) jobInstance).setReportKey(report.getKey());
+
+        registerJob(JobNamer.getJobName(report), jobInstance, report.getCronExpression());
+    }
+
+    @Transactional(readOnly = true)
+    @Override
+    public void registerReportJob(final Long reportKey) throws SchedulerException, ParseException {
+        Report report = reportDAO.find(reportKey);
+        if (report == null) {
+            throw new NotFoundException("Report " + reportKey);
+        } else {
+            registerJob(report);
+        }
+    }
+
+    private void unregisterJob(final String jobName) {
+        try {
+            scheduler.getScheduler().unscheduleJob(new TriggerKey(jobName, Scheduler.DEFAULT_GROUP));
+            scheduler.getScheduler().deleteJob(new JobKey(jobName, Scheduler.DEFAULT_GROUP));
+        } catch (SchedulerException e) {
+            LOG.error("Could not remove job " + jobName, e);
+        }
+
+        if (ApplicationContextProvider.getBeanFactory().containsSingleton(jobName)) {
+            ApplicationContextProvider.getBeanFactory().destroySingleton(jobName);
+        }
+    }
+
+    @Override
+    public void unregisterJob(final Task task) {
+        unregisterJob(JobNamer.getJobName(task));
+    }
+
+    @Override
+    public void unregisterJob(final Report report) {
+        unregisterJob(JobNamer.getJobName(report));
+    }
+
+    @Override
+    public Integer getPriority() {
+        return 200;
+    }
+
+    @Transactional
+    @Override
+    public void load() {
+        // 1. jobs for SchedTasks
+        Set<SchedTask> tasks = new HashSet<>(taskDAO.<SchedTask>findAll(TaskType.SCHEDULED));
+        tasks.addAll(taskDAO.<SyncTask>findAll(TaskType.SYNCHRONIZATION));
+        tasks.addAll(taskDAO.<PushTask>findAll(TaskType.PUSH));
+        for (SchedTask task : tasks) {
+            try {
+                registerJob(task, task.getJobClassName(), task.getCronExpression());
+            } catch (Exception e) {
+                LOG.error("While loading job instance for task " + task.getKey(), e);
+            }
+        }
+
+        // 2. NotificationJob
+        CPlainAttr notificationJobCronExp =
+                confDAO.find("notificationjob.cronExpression", NotificationJob.DEFAULT_CRON_EXP);
+        if (StringUtils.isBlank(notificationJobCronExp.getValuesAsStrings().get(0))) {
+            LOG.debug("Empty value provided for NotificationJob's cron, not registering anything on Quartz");
+        } else {
+            LOG.debug("NotificationJob's cron expression: {} - registering Quartz job and trigger",
+                    notificationJobCronExp);
+
+            try {
+                registerJob(null, NotificationJob.class.getName(), notificationJobCronExp.getValuesAsStrings().get(0));
+            } catch (Exception e) {
+                LOG.error("While loading NotificationJob instance", e);
+            }
+        }
+
+        // 3. ReportJobs
+        for (Report report : reportDAO.findAll()) {
+            try {
+                registerJob(report);
+            } catch (Exception e) {
+                LOG.error("While loading job instance for report " + report.getName(), e);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/LoggerLoader.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/LoggerLoader.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/LoggerLoader.java
new file mode 100644
index 0000000..d25a3d6
--- /dev/null
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/LoggerLoader.java
@@ -0,0 +1,98 @@
+/*
+ * 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.init;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.LoggerConfig;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.types.LoggerLevel;
+import org.apache.syncope.common.lib.types.LoggerType;
+import org.apache.syncope.server.persistence.api.SyncopeLoader;
+import org.apache.syncope.server.persistence.api.dao.LoggerDAO;
+import org.apache.syncope.server.persistence.api.entity.EntityFactory;
+import org.apache.syncope.server.persistence.api.entity.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+@Component
+public class LoggerLoader implements SyncopeLoader {
+
+    @Autowired
+    private LoggerDAO loggerDAO;
+
+    @Autowired
+    private EntityFactory entityFactory;
+
+    @Override
+    public Integer getPriority() {
+        return 300;
+    }
+
+    @Transactional
+    @Override
+    public void load() {
+        Map<String, Logger> syncopeLoggers = new HashMap<>();
+        for (Logger syncopeLogger : loggerDAO.findAll(LoggerType.LOG)) {
+            syncopeLoggers.put(syncopeLogger.getKey(), syncopeLogger);
+        }
+
+        for (Logger syncopeLogger : loggerDAO.findAll(LoggerType.AUDIT)) {
+            syncopeLoggers.put(syncopeLogger.getKey(), syncopeLogger);
+        }
+
+        LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+
+        /*
+         * Traverse all defined log4j loggers: if there is a matching SyncopeLogger, set log4j level accordingly,
+         * otherwise create a SyncopeLogger instance with given name and level.
+         */
+        for (LoggerConfig logConf : ctx.getConfiguration().getLoggers().values()) {
+            final String loggerName = LogManager.ROOT_LOGGER_NAME.equals(logConf.getName())
+                    ? SyncopeConstants.ROOT_LOGGER : logConf.getName();
+            if (logConf.getLevel() != null) {
+                if (syncopeLoggers.containsKey(loggerName)) {
+                    logConf.setLevel(syncopeLoggers.get(loggerName).getLevel().getLevel());
+                    syncopeLoggers.remove(loggerName);
+                } else if (!loggerName.equals(LoggerType.AUDIT.getPrefix())) {
+                    Logger syncopeLogger = entityFactory.newEntity(Logger.class);
+                    syncopeLogger.setKey(loggerName);
+                    syncopeLogger.setLevel(LoggerLevel.fromLevel(logConf.getLevel()));
+                    syncopeLogger.setType(loggerName.startsWith(LoggerType.AUDIT.getPrefix())
+                            ? LoggerType.AUDIT
+                            : LoggerType.LOG);
+                    loggerDAO.save(syncopeLogger);
+                }
+            }
+        }
+
+        /*
+         * Foreach SyncopeLogger not found in log4j create a new log4j logger with given name and level.
+         */
+        for (Logger syncopeLogger : syncopeLoggers.values()) {
+            LoggerConfig logConf = ctx.getConfiguration().getLoggerConfig(syncopeLogger.getKey());
+            logConf.setLevel(syncopeLogger.getLevel().getLevel());
+        }
+
+        ctx.updateLoggers();
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/LogicInitializer.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/LogicInitializer.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/LogicInitializer.java
new file mode 100644
index 0000000..7a17121
--- /dev/null
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/LogicInitializer.java
@@ -0,0 +1,73 @@
+/*
+ * 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.init;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.server.persistence.api.SyncopeLoader;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * Take care of all initializations needed by Syncope logic to run up and safe.
+ */
+@Component
+public class LogicInitializer implements InitializingBean, BeanFactoryAware {
+
+    @Autowired
+    private WorkflowAdapterLoader workflowAdapterLoader;
+
+    private DefaultListableBeanFactory beanFactory;
+
+    @Override
+    public void setBeanFactory(final BeanFactory beanFactory) throws BeansException {
+        this.beanFactory = (DefaultListableBeanFactory) beanFactory;
+    }
+
+    @Override
+    public void afterPropertiesSet() throws Exception {
+        Map<String, SyncopeLoader> loaderMap = beanFactory.getBeansOfType(SyncopeLoader.class);
+
+        List<SyncopeLoader> loaders = new ArrayList<>(loaderMap.values());
+        Collections.sort(loaders, new PriorityComparator());
+
+        for (SyncopeLoader loader : loaders) {
+            loader.load();
+        }
+
+        workflowAdapterLoader.init();
+    }
+
+    private static class PriorityComparator implements Comparator<SyncopeLoader> {
+
+        @Override
+        public int compare(final SyncopeLoader o1, final SyncopeLoader o2) {
+            return o1.getPriority().compareTo(o2.getPriority());
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/WorkflowAdapterLoader.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/WorkflowAdapterLoader.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/WorkflowAdapterLoader.java
index 5844277..b89e165 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/WorkflowAdapterLoader.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/init/WorkflowAdapterLoader.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.server.logic.init;
 
+import org.apache.syncope.server.persistence.api.SyncopeLoader;
 import org.apache.syncope.server.workflow.api.RoleWorkflowAdapter;
 import org.apache.syncope.server.workflow.api.UserWorkflowAdapter;
 import org.apache.syncope.server.workflow.api.WorkflowInstanceLoader;
@@ -32,7 +33,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.stereotype.Component;
 
 @Component
-public class WorkflowAdapterLoader implements BeanFactoryAware {
+public class WorkflowAdapterLoader implements BeanFactoryAware, SyncopeLoader {
 
     private static final Logger LOG = LoggerFactory.getLogger(WorkflowAdapterLoader.class);
 
@@ -76,6 +77,12 @@ public class WorkflowAdapterLoader implements BeanFactoryAware {
         }
     }
 
+    @Override
+    public Integer getPriority() {
+        return Integer.MIN_VALUE;
+    }
+
+    @Override
     public void load() {
         lazyInit();
         if (wfLoader == null) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/resources/report/report2csv.xsl
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/resources/report/report2csv.xsl b/syncope620/server/logic/src/main/resources/report/report2csv.xsl
new file mode 100644
index 0000000..b1e2c71
--- /dev/null
+++ b/syncope620/server/logic/src/main/resources/report/report2csv.xsl
@@ -0,0 +1,36 @@
+<?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:import href="userReportlet2csv.xsl"/>
+  <xsl:import href="roleReportlet2csv.xsl"/>
+  <xsl:import href="staticReportlet2csv.xsl"/>
+ 
+  <xsl:param name="status"/>
+  <xsl:param name="message"/>
+  <xsl:param name="startDate"/>
+  <xsl:param name="endDate"/>
+    
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/resources/report/report2fo.xsl
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/resources/report/report2fo.xsl b/syncope620/server/logic/src/main/resources/report/report2fo.xsl
new file mode 100644
index 0000000..7da9cab
--- /dev/null
+++ b/syncope620/server/logic/src/main/resources/report/report2fo.xsl
@@ -0,0 +1,97 @@
+<?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"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+  <xsl:import href="userReportlet2fo.xsl"/>
+  <xsl:import href="roleReportlet2fo.xsl"/>
+  <xsl:import href="staticReportlet2fo.xsl"/>
+ 
+  <xsl:param name="status"/>
+  <xsl:param name="message"/>
+  <xsl:param name="startDate"/>
+  <xsl:param name="endDate"/>
+  
+  <xsl:template match="/">
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Helvetica" font-size="10pt">
+      
+      <!-- defines the layout master -->
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="first" page-height="29.7cm" page-width="21cm" 
+                               margin-top="1cm" margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm">
+          <fo:region-body margin-top="1cm"/>
+          <fo:region-before extent="1cm"/>
+          <fo:region-after extent="1.5cm"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+
+      <!-- starts actual layout -->
+      <fo:page-sequence master-reference="first">
+	
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block font-size="24pt" font-weight="bold" text-align="center" space-after="1cm">
+            Apache Syncope Report - <xsl:value-of select="report/@name"/>
+          </fo:block>
+
+          <fo:table table-layout="fixed" border-width="0.5mm" border-style="solid" width="100%" space-after="1cm">
+            <fo:table-column column-width="proportional-column-width(1)"/>
+            <fo:table-column column-width="proportional-column-width(1)"/>
+            <fo:table-body>
+              <fo:table-row>
+                <fo:table-cell>
+                  <fo:block font-size="18pt" font-weight="bold">Report Name:</fo:block>
+                </fo:table-cell>
+                <fo:table-cell>
+                  <fo:block font-size="18pt" font-weight="bold">
+                    <xsl:value-of select="report/@name"/>
+                  </fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+              <fo:table-row>
+                <fo:table-cell>
+                  <fo:block font-size="18pt" font-weight="bold">Start Date:</fo:block>
+                </fo:table-cell>
+                <fo:table-cell>
+                  <fo:block font-size="18pt" font-weight="bold">
+                    <xsl:value-of select="$startDate"/>
+                  </fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+              <fo:table-row>
+                <fo:table-cell>
+                  <fo:block font-size="18pt" font-weight="bold">End Date:</fo:block>
+                </fo:table-cell>
+                <fo:table-cell>
+                  <fo:block font-size="18pt" font-weight="bold">
+                    <xsl:value-of select="$endDate"/>
+                  </fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+            </fo:table-body>
+          </fo:table>
+
+          <xsl:apply-templates/>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/resources/report/report2html.xsl
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/resources/report/report2html.xsl b/syncope620/server/logic/src/main/resources/report/report2html.xsl
new file mode 100644
index 0000000..c1d6b67
--- /dev/null
+++ b/syncope620/server/logic/src/main/resources/report/report2html.xsl
@@ -0,0 +1,77 @@
+<?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:import href="userReportlet2html.xsl"/>
+  <xsl:import href="roleReportlet2html.xsl"/>
+  <xsl:import href="staticReportlet2html.xsl"/>
+ 
+  <xsl:param name="status"/>
+  <xsl:param name="message"/>
+  <xsl:param name="startDate"/>
+  <xsl:param name="endDate"/>
+  
+  <xsl:template match="/">
+    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+      <head>
+        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+        <title>Apache Syncope Report - <xsl:value-of select="report/@name"/></title>
+      </head>
+      <body>
+        <table style="border: 1px solid black;">
+          <tr>
+            <td>
+              <h1>Report Name:</h1>
+            </td>
+            <td>
+              <h1>
+                <xsl:value-of select="report/@name"/>
+              </h1>
+            </td>
+          </tr>
+          <tr>
+            <td>
+              <h2>Start Date:</h2>
+            </td>
+            <td>
+              <h2>
+                <xsl:value-of select="$startDate"/>
+              </h2>
+            </td>
+          </tr>
+          <tr>
+            <td>
+              <h2>End Date:</h2>
+            </td>
+            <td>
+              <h2>
+                <xsl:value-of select="$endDate"/>
+              </h2>
+            </td>
+          </tr>
+        </table>
+
+        <xsl:apply-templates/>
+      </body>
+    </html>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/resources/report/roleReportlet2csv.xsl
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/resources/report/roleReportlet2csv.xsl b/syncope620/server/logic/src/main/resources/report/roleReportlet2csv.xsl
new file mode 100644
index 0000000..ad092d5
--- /dev/null
+++ b/syncope620/server/logic/src/main/resources/report/roleReportlet2csv.xsl
@@ -0,0 +1,118 @@
+<?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:variable name="delimiter" select="';'"/>
+  
+  <xsl:template match="reportlet[@class='org.apache.syncope.core.report.RoleReportlet']">
+    
+    <xsl:call-template name="header">
+      <xsl:with-param name="node" select="configurations/roleAttributes"/>
+    </xsl:call-template>
+    <xsl:for-each select="role">
+      <xsl:call-template name="roleAttributes">
+        <xsl:with-param name="header" select="../configurations/roleAttributes"/>
+        <xsl:with-param name="attrs" select="."/>
+      </xsl:call-template>
+      <xsl:text>&#10;</xsl:text>
+    </xsl:for-each>
+  </xsl:template>
+  
+  <xsl:template name="header">
+    <xsl:param name="node"/>  
+    <xsl:for-each select="$node/*">
+      <xsl:value-of select="text()"/>   
+      <xsl:if test="position() != last()">
+        <xsl:value-of select="$delimiter"/>
+      </xsl:if>
+    </xsl:for-each>
+    <xsl:text>&#10;</xsl:text>
+  </xsl:template>
+    
+  <xsl:template name="roleAttributes">
+    <xsl:param name="header"/>
+    <xsl:param name="attrs"/>
+    
+    <xsl:for-each select="$header/*">
+      <xsl:variable name="nameAttr" select="text()"/>
+      
+      <xsl:choose> 
+        <xsl:when test="string-length($attrs/@*[name()=$nameAttr]) &gt; 0">
+          <xsl:variable name="roleAttr" select="$attrs/@*[name()=$nameAttr]"/>
+          <xsl:text>"</xsl:text>
+          <xsl:value-of select="$roleAttr/."/>
+          <xsl:text>"</xsl:text>
+        </xsl:when>
+        <xsl:when test="name($attrs/*[name(.)=$nameAttr]/*[name(.)='entitlement']) 
+                        and count($attrs/*[name(.)=$nameAttr]/node()) &gt; 0">
+          <xsl:text>"</xsl:text>       
+          <xsl:for-each select="$attrs/*/entitlement">
+            <xsl:variable name="value" select="@id"/>
+            <xsl:value-of select="$value"/>
+            <xsl:if test="position() != last()">
+              <xsl:value-of select="$delimiter"/>
+            </xsl:if>
+          </xsl:for-each>
+          <xsl:text>"</xsl:text>
+        </xsl:when>
+        <xsl:when test="name($attrs/*[name(.)=$nameAttr]/*[name(.)='resource']) 
+                        and count($attrs/*[name(.)=$nameAttr]/node()) &gt; 0">
+          <xsl:text>"</xsl:text>       
+          <xsl:for-each select="$attrs/*/resource">
+            <xsl:variable name="value" select="@name"/>
+            <xsl:value-of select="$value"/>
+            <xsl:if test="position() != last()">
+              <xsl:value-of select="$delimiter"/>
+            </xsl:if>
+          </xsl:for-each>
+          <xsl:text>"</xsl:text>
+        </xsl:when>
+        <xsl:when test="name($attrs/*[name(.)=$nameAttr]/*[name(.)='user']) 
+                        and count($attrs/*[name(.)=$nameAttr]/node()) &gt; 0">
+          <xsl:text>"</xsl:text>       
+          <xsl:for-each select="$attrs/*/user">
+            <xsl:variable name="value" select="@userUsername"/>
+            <xsl:value-of select="$value"/>
+            <xsl:if test="position() != last()">
+              <xsl:value-of select="$delimiter"/>
+            </xsl:if>
+          </xsl:for-each>
+          <xsl:text>"</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>"</xsl:text>
+          <xsl:if test="string-length($attrs/*/*[@name=$nameAttr]/value/text()) &gt; 0"> 
+            <xsl:variable name="value" select="$attrs/*/*[@name=$nameAttr]/value/text()"/>
+            <xsl:value-of select="$value"/>
+          </xsl:if>
+          <xsl:text>"</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:if test="position() != last()">
+        <xsl:value-of select="$delimiter"/>
+      </xsl:if>
+    
+    </xsl:for-each>
+  </xsl:template>
+  
+</xsl:stylesheet>
+

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/resources/report/roleReportlet2fo.xsl
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/resources/report/roleReportlet2fo.xsl b/syncope620/server/logic/src/main/resources/report/roleReportlet2fo.xsl
new file mode 100644
index 0000000..bb319a4
--- /dev/null
+++ b/syncope620/server/logic/src/main/resources/report/roleReportlet2fo.xsl
@@ -0,0 +1,228 @@
+<?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"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+  <xsl:template match="reportlet[@class='org.apache.syncope.core.report.RoleReportlet']">
+   
+    <fo:block font-size="16pt" font-weight="bold" space-after="0.5cm" space-before="5mm">Reportlet: <xsl:value-of select="@name"/></fo:block>
+        
+    <xsl:for-each select="role">
+      <fo:block font-size="14pt" font-weight="bold" space-before="15mm" space-after="5mm" background-color="(#8888ff)">Role <xsl:value-of select="@name"/></fo:block>
+      <fo:table table-layout="fixed" space-after="7mm">
+        <fo:table-column/>
+        <fo:table-column/>
+        <fo:table-body>
+          <fo:table-row background-color="(#ccccff)">
+            <fo:table-cell>
+              <fo:block>Id:</fo:block>
+            </fo:table-cell>
+            <fo:table-cell>
+              <fo:block font-style="italic">
+                <xsl:value-of select="@id"/>
+              </fo:block>
+            </fo:table-cell>
+          </fo:table-row>
+          <xsl:if test="@roleOwner != 'null'">
+            <fo:table-row background-color="(#ccccff)">
+              <fo:table-cell>
+                <fo:block>Role Owner:</fo:block>
+              </fo:table-cell>
+              <fo:table-cell>
+                <fo:block font-style="italic">
+                  <xsl:value-of select="@roleOwner"/>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </xsl:if>
+          <xsl:if test="@userOwner != 'null'">
+            <fo:table-row background-color="(#ccccff)">
+              <fo:table-cell>
+                <fo:block>Last Login Date:</fo:block>
+              </fo:table-cell>
+              <fo:table-cell>
+                <fo:block font-style="italic">
+                  <xsl:value-of select="@userOwner"/>
+                </fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </xsl:if>
+        </fo:table-body>
+      </fo:table>
+      <xsl:choose>
+        <xsl:when test="string-length(attributes/attribute) &gt; 0">
+          <xsl:call-template name="attributes">
+            <xsl:with-param name="label">Attributes</xsl:with-param>
+            <xsl:with-param name="node" select="attributes/attribute"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block color="red" font-size="9pt" space-after="3mm">THIS ROLE HASN'T ANY ATTRIBUTE</fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+      
+      <xsl:choose>
+        <xsl:when test="string-length(derivedAttributes/derivedAttribute) &gt; 0">
+          <xsl:call-template name="attributes">
+            <xsl:with-param name="label">Derived Attributes</xsl:with-param>
+            <xsl:with-param name="node" select="derivedAttributes/derivedAttribute"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block color="red" font-size="9pt" space-after="3mm">THIS ROLE HASN'T ANY DERIVED ATTRIBUTE</fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:choose>
+        <xsl:when test="string-length(virtualAttributes/virtualAttribute) &gt; 0">
+          <xsl:call-template name="attributes">
+            <xsl:with-param name="label">Virtual Attributes</xsl:with-param>
+            <xsl:with-param name="node" select="virtualAttributes/virtualAttribute"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block color="red" font-size="9pt" space-after="3mm">THIS ROLE HASN'T ANY VIRTUAL ATTRIBUTE</fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+      
+      <!--entitlements-->
+      <xsl:choose>
+        <xsl:when test="entitlements/entitlement">
+          <xsl:call-template name="entitlements">
+            <xsl:with-param name="label">Entitlements</xsl:with-param>
+            <xsl:with-param name="node" select="entitlements/entitlement"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block color="red" font-size="9pt" space-after="3mm">THIS ROLE HASN'T ANY ENTITLEMENT</fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+      
+      <xsl:choose>
+        <xsl:when test="users/user">
+          <fo:block font-size="11pt" font-weight="bold">Users</fo:block>
+          <xsl:for-each select="users/user">
+            <fo:block background-color="(#ccccff)" font-size="9pt" font-weight="bold" space-before="4mm">User: <xsl:value-of select="@userUsername"/> (Id: <xsl:value-of select="@userId"/>)</fo:block>
+                 
+          </xsl:for-each> 
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block color="red" font-size="9pt" space-after="3mm">THIS ROLE HASN'T ANY USER ASSIGNED TO</fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:call-template name="roleResources">
+        <xsl:with-param name="node" select="resources/resource"/>
+      </xsl:call-template>
+    </xsl:for-each>
+
+  </xsl:template>
+  
+  <xsl:template name="attributes">
+    <xsl:param name="label"/>
+    <xsl:param name="node"/>
+    <fo:block font-size="11pt" font-weight="bold" space-after="2mm">
+      <xsl:value-of select="$label"/>
+    </fo:block>
+    <fo:table table-layout="fixed" space-after="7mm">
+      <fo:table-column/>
+      <fo:table-column/>
+      <fo:table-header>
+        <fo:table-row height="7mm" background-color="(#ccccba)">
+          <fo:table-cell>
+            <fo:block font-weight="bold">Schema name</fo:block>
+          </fo:table-cell>
+          <fo:table-cell>
+            <fo:block font-weight="bold">Value(s)</fo:block>
+          </fo:table-cell>
+        </fo:table-row>
+      </fo:table-header>
+      <fo:table-body>
+        <xsl:for-each select="$node">
+          <xsl:if test="string-length(value/text()) &gt; 0">
+            <fo:table-row height="4mm" background-color="(#ccccff)">
+              <fo:table-cell>
+                <fo:block>
+                  <xsl:value-of select="@name"/>
+                </fo:block>
+              </fo:table-cell>
+              <fo:table-cell>
+                <xsl:for-each select="value">
+                  <fo:block></fo:block><!--                        <fo:block>&#x2022;</fo:block>-->
+                  <fo:block font-style="italic">
+                    <xsl:value-of select="text()"/>
+                  </fo:block>
+                </xsl:for-each>
+              </fo:table-cell>
+            </fo:table-row>
+          </xsl:if>
+          <fo:table-row>
+            <fo:table-cell>
+              <fo:block></fo:block>
+            </fo:table-cell>
+            <fo:table-cell>
+              <fo:block></fo:block>
+            </fo:table-cell>
+          </fo:table-row>
+        </xsl:for-each>
+      </fo:table-body>
+    </fo:table>
+  </xsl:template>
+  <!--entitlements template-->
+  <xsl:template name="entitlements">
+    <xsl:param name="label"/>
+    <xsl:param name="node"/>
+    <fo:block font-size="11pt" font-weight="bold" space-after="2mm" space-before="5mm">
+      <xsl:value-of select="$label"/>
+    </fo:block>
+    <fo:table table-layout="fixed" space-after="7mm">
+      <fo:table-column/>
+      <!--<fo:table-column/>-->
+      <fo:table-header>
+        <fo:table-row height="7mm" background-color="(#ccccba)">
+          <fo:table-cell>
+            <fo:block font-weight="bold">Name</fo:block>
+          </fo:table-cell>
+        </fo:table-row>
+      </fo:table-header>
+      <fo:table-body>
+        <xsl:for-each select="$node">
+          <fo:table-row height="4mm" background-color="(#ccccff)">
+            <fo:table-cell>
+              <fo:block>
+                <xsl:value-of select="@id"/>
+              </fo:block>
+            </fo:table-cell>
+          </fo:table-row>
+        </xsl:for-each>
+      </fo:table-body>
+    </fo:table>
+  </xsl:template>
+  
+  <xsl:template name="roleResources">
+    <xsl:param name="node"/>
+    <fo:block font-size="11pt" font-weight="bold" space-after="3mm" space-before="5mm">Role Resources</fo:block>
+    <xsl:for-each select="$node">
+      <fo:block></fo:block> <!--            <fo:block>&#x2022;</fo:block>-->
+      <fo:block background-color="(#ccccff)">
+        <xsl:value-of select="@name"/>
+      </fo:block>
+    </xsl:for-each>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/b015c443/syncope620/server/logic/src/main/resources/report/roleReportlet2html.xsl
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/resources/report/roleReportlet2html.xsl b/syncope620/server/logic/src/main/resources/report/roleReportlet2html.xsl
new file mode 100644
index 0000000..9f5825f
--- /dev/null
+++ b/syncope620/server/logic/src/main/resources/report/roleReportlet2html.xsl
@@ -0,0 +1,196 @@
+<?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="reportlet[@class='org.apache.syncope.core.report.RoleReportlet']">
+    <h2>Reportlet: <xsl:value-of select="@name"/></h2>
+    <xsl:for-each select="role">
+      <h3>Role <xsl:value-of select="@name"/></h3>
+      
+      <table style="border: 1px solid black;">
+        <tr>
+          <td>Id:</td>
+          <td>
+            <xsl:value-of select="@id"/>
+          </td>
+        </tr>
+        <xsl:if test="@roleOwner != 'null'"> <!--!= null test="not(USER/FIRSTNAME)" -->
+          <tr>
+            <td>Role Owner:</td>
+            <td>
+              <xsl:value-of select="@roleOwner"/>
+            </td>
+          </tr>
+        </xsl:if>
+        <xsl:if test="@userOwner != 'null'">
+          <tr>
+            <td>User Owner:</td>
+            <td>
+              <xsl:value-of select="@userOwner"/>
+            </td>
+          </tr>
+        </xsl:if>
+        
+      </table>
+
+      <xsl:choose>
+        <xsl:when test="string-length(attributes/attribute) &gt; 0">
+          <xsl:call-template name="attributes">
+            <xsl:with-param name="label">Attributes</xsl:with-param>
+            <xsl:with-param name="node" select="attributes/attribute"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <h5>THIS ROLE HASN'T ANY ATTRIBUTE</h5>
+        </xsl:otherwise>
+      </xsl:choose>
+
+      <xsl:choose>
+        <xsl:when test="string-length(derivedAttributes/derivedAttribute) &gt; 0">
+          <xsl:call-template name="attributes">
+            <xsl:with-param name="label">Derived Attributes</xsl:with-param>
+            <xsl:with-param name="node" select="derivedAttributes/derivedAttribute"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <h5>THIS ROLE HASN'T ANY DERIVED ATTRIBUTE</h5>
+        </xsl:otherwise>
+      </xsl:choose>
+      <!--</xsl:if>-->
+      <xsl:choose>
+        <xsl:when test="string-length(virtualAttributes/virtualAttribute) &gt; 0">
+          <xsl:call-template name="attributes">
+            <xsl:with-param name="label">Virtual Attributes</xsl:with-param>
+            <xsl:with-param name="node" select="virtualAttributes/virtualAttribute"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <h5>THIS ROLE HASN'T ANY VIRTUAL ATTRIBUTE</h5>
+        </xsl:otherwise>
+      </xsl:choose>
+      
+      <xsl:choose>
+        <xsl:when test="entitlements/entitlement">
+          <xsl:call-template name="entitlements">
+            <xsl:with-param name="label">Entitlements: </xsl:with-param>
+            <xsl:with-param name="node" select="entitlements/entitlement"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <h5>THIS ROLE HASN'T ANY ENTITLEMENT</h5>
+        </xsl:otherwise>
+      </xsl:choose>
+      
+      <xsl:choose>
+        <xsl:when test="users/user">
+          <h4>Users</h4>
+          <xsl:for-each select="users/user">
+            <h5>User: <xsl:value-of select="@userUsername"/> (Id: <xsl:value-of select="@userId"/>)</h5>
+          </xsl:for-each>
+        </xsl:when>
+        <xsl:otherwise>
+          <h5>THIS ROLE HASN'T ANY USER ASSIGNED TO</h5>
+        </xsl:otherwise>
+      </xsl:choose>
+      
+      <xsl:call-template name="roleResources">
+        <xsl:with-param name="node" select="resources/resource"/>
+      </xsl:call-template>
+      <hr/>
+      
+    </xsl:for-each>
+  </xsl:template>
+ 
+  <!--entitlement template-->
+  <xsl:template name="entitlements">
+    <xsl:param name="label"/>
+    <xsl:param name="node"/>
+
+    <h4>
+      <xsl:value-of select="$label"/>
+    </h4>
+    
+    <table>
+      
+      <tbody>
+        <xsl:for-each select="$node">
+          <tr>
+            <td>
+              <xsl:value-of select="@id"/>
+            </td>
+          </tr>
+        </xsl:for-each>
+      </tbody>
+    </table>
+  </xsl:template>
+
+
+  <xsl:template name="attributes">
+    <xsl:param name="label"/>
+    <xsl:param name="node"/>
+
+    <h4>
+      <xsl:value-of select="$label"/>
+    </h4>
+    
+    <table>
+      <thead>
+        <tr>
+          <th>Schema name</th>
+          <th>Value(s)</th>
+        </tr>
+      </thead>
+      <tbody>
+        <xsl:for-each select="$node">
+          <xsl:if test="string-length(value/text()) &gt; 0">
+            <tr>
+              <td>
+                <xsl:value-of select="@name"/>
+              </td>
+              <td>
+                <ul>
+                  <xsl:for-each select="value">
+                    <li>
+                      <xsl:value-of select="text()"/>
+                    </li>
+                  </xsl:for-each>
+                </ul>
+              </td>
+            </tr>
+          </xsl:if>
+        </xsl:for-each>
+      </tbody>
+    </table>
+  </xsl:template>
+
+  <xsl:template name="roleResources">
+    <xsl:param name="node"/>
+    
+    <h4>Role Resources</h4>
+    <ul>
+      <xsl:for-each select="$node">
+        <li>
+          <xsl:value-of select="@name"/>
+        </li>
+      </xsl:for-each>
+    </ul>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file


Mime
View raw message