syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/4] syncope git commit: [SYNCOPE-761] Report templates are now managed entities, not from filesystem anymore
Date Mon, 01 Feb 2016 13:01:04 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/f5682a72/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
index d78f0b0..91d7c86 100644
--- a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
@@ -1213,7 +1213,1102 @@ $$ }

     
   <NotificationTask_recipients notificationtask_id="8" address="recipient@prova.org"/>  
   
-  <Report id="1" name="test" active="1"/>
+  <ReportTemplate name="sample"
+                  htmlTemplate="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;
+&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&#10;
+                version=&quot;1.0&quot;&gt;&#10;
+&#10;
+  &lt;xsl:param name=&quot;status&quot;/&gt;&#10;
+  &lt;xsl:param name=&quot;message&quot;/&gt;&#10;
+  &lt;xsl:param name=&quot;start&quot;/&gt;&#10;
+  &lt;xsl:param name=&quot;end&quot;/&gt;&#10;
+  &#10;
+  &lt;xsl:template match=&quot;/&quot;&gt;&#10;
+    &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;&#10;
+      &lt;head&gt;&#10;
+        &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;&#10;
+        &lt;title&gt;Apache Syncope Report - &lt;xsl:value-of select=&quot;report/@name&quot;/&gt;&lt;/title&gt;&#10;
+      &lt;/head&gt;&#10;
+      &lt;body&gt;&#10;
+        &lt;table style=&quot;border: 1px solid black;&quot;&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;h1&gt;Report Name:&lt;/h1&gt;&#10;
+            &lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;h1&gt;&#10;
+                &lt;xsl:value-of select=&quot;report/@name&quot;/&gt;&#10;
+              &lt;/h1&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;h2&gt;Start Date:&lt;/h2&gt;&#10;
+            &lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;h2&gt;&#10;
+                &lt;xsl:value-of select=&quot;$start&quot;/&gt;&#10;
+              &lt;/h2&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;h2&gt;End Date:&lt;/h2&gt;&#10;
+            &lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;h2&gt;&#10;
+                &lt;xsl:value-of select=&quot;$end&quot;/&gt;&#10;
+              &lt;/h2&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+        &lt;/table&gt;&#10;
+&#10;
+        &lt;xsl:apply-templates/&gt;&#10;
+      &lt;/body&gt;&#10;
+    &lt;/html&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+&#10;
+  &lt;xsl:template match=&quot;reportlet[@class='org.apache.syncope.core.logic.report.StaticReportlet']&quot;&gt;&#10;
+    &lt;h2&gt;Reportlet: &#10;
+      &lt;xsl:value-of select=&quot;@name&quot;/&gt;&#10;
+    &lt;/h2&gt;&#10;
+        &#10;
+    &lt;xsl:if test=&quot;string-length(string/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;p&gt;String value:                 &#10;
+        &lt;xsl:value-of select=&quot;string/text()&quot;/&gt;&#10;
+      &lt;/p&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(long/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;p&gt;Long value: &#10;
+        &lt;xsl:value-of select=&quot;long/text()&quot;/&gt;&#10;
+      &lt;/p&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(double/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;p&gt;Double value: &#10;
+        &lt;xsl:value-of select=&quot;double/text()&quot;/&gt;&#10;
+      &lt;/p&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(date/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;p&gt;Date value: &#10;
+        &lt;xsl:value-of select=&quot;date/text()&quot;/&gt;&#10;
+      &lt;/p&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(enum/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;p&gt;Enum value: &#10;
+        &lt;xsl:value-of select=&quot;enum/text()&quot;/&gt;&#10;
+      &lt;/p&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(list) &amp;gt; 0&quot;&gt;&#10;
+      &lt;p&gt;List values:&lt;/p&gt;&#10;
+            &#10;
+      &lt;ul&gt;&#10;
+        &lt;xsl:for-each select=&quot;list/string&quot;&gt;&#10;
+          &lt;xsl:if test=&quot;string-length(string/text()) &amp;gt; 0&quot;&gt;&#10;
+            &lt;li&gt;&#10;
+              &lt;xsl:value-of select=&quot;text()&quot;/&gt;&#10;
+            &lt;/li&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+        &lt;/xsl:for-each&gt;&#10;
+      &lt;/ul&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template match=&quot;reportlet[@class='org.apache.syncope.core.logic.report.UserReportlet']&quot;&gt;&#10;
+    &#10;
+    &lt;h3&gt;Reportlet: &lt;xsl:value-of select=&quot;@name&quot;/&gt;&lt;/h3&gt;&#10;
+    &#10;
+    &lt;xsl:for-each select=&quot;user&quot;&gt;&#10;
+      &lt;h4&gt;User &lt;xsl:value-of select=&quot;@username&quot;/&gt;&lt;/h4&gt;&#10;
+      &#10;
+      &lt;table style=&quot;border: 1px solid black;&quot;&gt;&#10;
+        &lt;tr&gt;&#10;
+          &lt;td&gt;Status:&lt;/td&gt;&#10;
+          &lt;td&gt;&#10;
+            &lt;xsl:value-of select=&quot;@status&quot;/&gt;&#10;
+          &lt;/td&gt;&#10;
+        &lt;/tr&gt;&#10;
+        &lt;xsl:if test=&quot;string-length(@creationDate) &amp;gt; 0&quot;&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;Creation Date:&lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;xsl:value-of select=&quot;@creationDate&quot;/&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+        &lt;/xsl:if&gt;&#10;
+        &lt;xsl:if test=&quot;string-length(@lastLoginDate) &amp;gt; 0&quot;&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;Last Login Date:&lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;xsl:value-of select=&quot;@lastLoginDate&quot;/&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+        &lt;/xsl:if&gt;&#10;
+        &lt;xsl:if test=&quot;string-length(@changePwdDate) &amp;gt; 0&quot;&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;Change Password Date:&lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;xsl:value-of select=&quot;@changePwdDate&quot;/&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+        &lt;/xsl:if&gt;&#10;
+        &lt;xsl:if test=&quot;string-length(@passwordHistorySize) &amp;gt; 0&quot;&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;Password History Size:&lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;xsl:value-of select=&quot;@passwordHistorySize&quot;/&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+        &lt;/xsl:if&gt;&#10;
+        &lt;xsl:if test=&quot;string-length(@failedLoginCount) &amp;gt; 0&quot;&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;Number of Failed Login Attempts:&lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;xsl:value-of select=&quot;@failedLoginCount&quot;/&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+        &lt;/xsl:if&gt;&#10;
+      &lt;/table&gt;&#10;
+&#10;
+      &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+        &lt;xsl:with-param name=&quot;label&quot;&gt;Attributes&lt;/xsl:with-param&gt;&#10;
+        &lt;xsl:with-param name=&quot;node&quot; select=&quot;attributes/attribute&quot;/&gt;&#10;
+      &lt;/xsl:call-template&gt;&#10;
+&#10;
+      &lt;!--&lt;xsl:if test=&quot;string-length(derivedAttributes/derivedAttribute) &amp;gt; 0&quot;&gt;--&gt;&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(derivedAttributes/derivedAttribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Derived Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;derivedAttributes/derivedAttribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;h5&gt;THIS USER HASN'T DERIVED ATTRIBUTES&lt;/h5&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;!--&lt;/xsl:if&gt;--&gt;&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(virtualAttributes/virtualAttribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Virtual Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;virtualAttributes/virtualAttribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;h5&gt;THIS USER HASN'T VIRTUAL ATTRIBUTES&lt;/h5&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(memberships/membership) &amp;gt; 0&quot;&gt;&#10;
+          &lt;h4&gt;Memberships&lt;/h4&gt;&#10;
+          &lt;xsl:for-each select=&quot;memberships/membership&quot;&gt;&#10;
+            &lt;h5&gt;Group: &lt;xsl:value-of select=&quot;@groupName&quot;/&gt;(&lt;xsl:value-of select=&quot;@groupId&quot;/&gt;)&lt;/h5&gt;&#10;
+            &lt;blockquote&gt;&#10;
+              &lt;xsl:choose&gt;&#10;
+                &lt;xsl:when test=&quot;string-length(attributes/attribute) &amp;gt; 0&quot;&gt;&#10;
+                  &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+                    &lt;xsl:with-param name=&quot;label&quot;&gt;Attributes&lt;/xsl:with-param&gt;&#10;
+                    &lt;xsl:with-param name=&quot;node&quot; select=&quot;attributes/attribute&quot;/&gt;&#10;
+                  &lt;/xsl:call-template&gt;&#10;
+                &lt;/xsl:when&gt;&#10;
+                &lt;xsl:otherwise&gt;&#10;
+                  &lt;h5&gt;THIS GROUP HASN'T ATTRIBUTES&lt;/h5&gt;&#10;
+                &lt;/xsl:otherwise&gt;&#10;
+              &lt;/xsl:choose&gt;&#10;
+              &lt;xsl:choose&gt;&#10;
+                &lt;xsl:when test=&quot;string-length(derivedAttributes/derivedAttribute) &amp;gt; 0&quot;&gt;&#10;
+                  &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+                    &lt;xsl:with-param name=&quot;label&quot;&gt;Derived Attributes&lt;/xsl:with-param&gt;&#10;
+                    &lt;xsl:with-param name=&quot;node&quot; select=&quot;derivedAttributes/derivedAttribute&quot;/&gt;&#10;
+                  &lt;/xsl:call-template&gt;&#10;
+                &lt;/xsl:when&gt;&#10;
+                &lt;xsl:otherwise&gt;&#10;
+                  &lt;h5&gt;THIS GROUP HASN'T DERIVED ATTRIBUTES&lt;/h5&gt;&#10;
+                &lt;/xsl:otherwise&gt;&#10;
+              &lt;/xsl:choose&gt;&#10;
+              &lt;xsl:choose&gt;&#10;
+                &lt;xsl:when test=&quot;string-length(virtualAttributes/virtualAttribute) &amp;gt; 0&quot;&gt;&#10;
+                  &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+                    &lt;xsl:with-param name=&quot;label&quot;&gt;Virtual Attributes&lt;/xsl:with-param&gt;&#10;
+                    &lt;xsl:with-param name=&quot;node&quot; select=&quot;virtualAttributes/virtualAttribute&quot;/&gt;&#10;
+                  &lt;/xsl:call-template&gt;&#10;
+                &lt;/xsl:when&gt;&#10;
+                &lt;xsl:otherwise&gt;&#10;
+                  &lt;h5&gt;THIS GROUP HASN'T VIRTUAL ATTRIBUTES&lt;/h5&gt;&#10;
+                &lt;/xsl:otherwise&gt;&#10;
+              &lt;/xsl:choose&gt;&#10;
+              &lt;xsl:call-template name=&quot;groupResources&quot;&gt;&#10;
+                &lt;xsl:with-param name=&quot;node&quot; select=&quot;resources/resource&quot;/&gt;&#10;
+              &lt;/xsl:call-template&gt;&#10;
+            &lt;/blockquote&gt;&#10;
+          &lt;/xsl:for-each&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;h5&gt;THIS USER ISN'T ASSIGNED TO A GROUP&lt;/h5&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;xsl:if test=&quot;string-length(resources) &amp;gt; 0&quot;&gt;&#10;
+        &lt;xsl:call-template name=&quot;resources&quot;&gt;&#10;
+          &lt;xsl:with-param name=&quot;node&quot; select=&quot;resources/resource&quot;/&gt;&#10;
+        &lt;/xsl:call-template&gt;&#10;
+      &lt;/xsl:if&gt;&#10;
+      &lt;hr/&gt;&#10;
+    &lt;/xsl:for-each&gt;&#10;
+       &#10;
+  &lt;/xsl:template&gt;&#10;
+&#10;
+  &lt;xsl:template match=&quot;reportlet[@class='org.apache.syncope.core.logic.report.GroupReportlet']&quot;&gt;&#10;
+    &lt;h2&gt;Reportlet: &lt;xsl:value-of select=&quot;@name&quot;/&gt;&lt;/h2&gt;&#10;
+    &lt;xsl:for-each select=&quot;group&quot;&gt;&#10;
+      &lt;h3&gt;Group &lt;xsl:value-of select=&quot;@name&quot;/&gt;&lt;/h3&gt;&#10;
+      &#10;
+      &lt;table style=&quot;border: 1px solid black;&quot;&gt;&#10;
+        &lt;tr&gt;&#10;
+          &lt;td&gt;Id:&lt;/td&gt;&#10;
+          &lt;td&gt;&#10;
+            &lt;xsl:value-of select=&quot;@id&quot;/&gt;&#10;
+          &lt;/td&gt;&#10;
+        &lt;/tr&gt;&#10;
+        &lt;xsl:if test=&quot;@groupOwner != 'null'&quot;&gt; &lt;!--!= null test=&quot;not(USER/FIRSTNAME)&quot; --&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;Group Owner:&lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;xsl:value-of select=&quot;@groupOwner&quot;/&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+        &lt;/xsl:if&gt;&#10;
+        &lt;xsl:if test=&quot;@userOwner != 'null'&quot;&gt;&#10;
+          &lt;tr&gt;&#10;
+            &lt;td&gt;User Owner:&lt;/td&gt;&#10;
+            &lt;td&gt;&#10;
+              &lt;xsl:value-of select=&quot;@userOwner&quot;/&gt;&#10;
+            &lt;/td&gt;&#10;
+          &lt;/tr&gt;&#10;
+        &lt;/xsl:if&gt;&#10;
+        &#10;
+      &lt;/table&gt;&#10;
+&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(attributes/attribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;attributes/attribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;h5&gt;THIS GROUP HASN'T ANY ATTRIBUTE&lt;/h5&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(derivedAttributes/derivedAttribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Derived Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;derivedAttributes/derivedAttribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;h5&gt;THIS GROUP HASN'T ANY DERIVED ATTRIBUTE&lt;/h5&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;!--&lt;/xsl:if&gt;--&gt;&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(virtualAttributes/virtualAttribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Virtual Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;virtualAttributes/virtualAttribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;h5&gt;THIS GROUP HASN'T ANY VIRTUAL ATTRIBUTE&lt;/h5&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;users/user&quot;&gt;&#10;
+          &lt;h4&gt;Users&lt;/h4&gt;&#10;
+          &lt;xsl:for-each select=&quot;users/user&quot;&gt;&#10;
+            &lt;h5&gt;User: &lt;xsl:value-of select=&quot;@userUsername&quot;/&gt; (Id: &lt;xsl:value-of select=&quot;@userId&quot;/&gt;)&lt;/h5&gt;&#10;
+          &lt;/xsl:for-each&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;h5&gt;THIS GROUP HASN'T ANY USER ASSIGNED TO&lt;/h5&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &#10;
+      &lt;xsl:call-template name=&quot;groupResources&quot;&gt;&#10;
+        &lt;xsl:with-param name=&quot;node&quot; select=&quot;resources/resource&quot;/&gt;&#10;
+      &lt;/xsl:call-template&gt;&#10;
+      &lt;hr/&gt;&#10;
+      &#10;
+    &lt;/xsl:for-each&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template name=&quot;attributes&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;label&quot;/&gt;&#10;
+    &lt;xsl:param name=&quot;node&quot;/&gt;&#10;
+&#10;
+    &lt;h4&gt;&#10;
+      &lt;xsl:value-of select=&quot;$label&quot;/&gt;&#10;
+    &lt;/h4&gt;&#10;
+    &#10;
+    &lt;table&gt;&#10;
+      &lt;thead&gt;&#10;
+        &lt;tr&gt;&#10;
+          &lt;th&gt;Schema name&lt;/th&gt;&#10;
+          &lt;th&gt;Value(s)&lt;/th&gt;&#10;
+        &lt;/tr&gt;&#10;
+      &lt;/thead&gt;&#10;
+      &lt;tbody&gt;&#10;
+        &lt;xsl:for-each select=&quot;$node&quot;&gt;&#10;
+          &lt;xsl:if test=&quot;string-length(value/text()) &amp;gt; 0&quot;&gt;&#10;
+            &lt;tr&gt;&#10;
+              &lt;td&gt;&#10;
+                &lt;xsl:value-of select=&quot;@name&quot;/&gt;&#10;
+              &lt;/td&gt;&#10;
+              &lt;td&gt;&#10;
+                &lt;ul&gt;&#10;
+                  &lt;xsl:for-each select=&quot;value&quot;&gt;&#10;
+                    &lt;li&gt;&#10;
+                      &lt;xsl:value-of select=&quot;text()&quot;/&gt;&#10;
+                    &lt;/li&gt;&#10;
+                  &lt;/xsl:for-each&gt;&#10;
+                &lt;/ul&gt;&#10;
+              &lt;/td&gt;&#10;
+            &lt;/tr&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+        &lt;/xsl:for-each&gt;&#10;
+      &lt;/tbody&gt;&#10;
+    &lt;/table&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+&#10;
+  &lt;xsl:template name=&quot;resources&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;node&quot;/&gt;&#10;
+    &#10;
+    &lt;h4&gt;Resources&lt;/h4&gt;&#10;
+    &lt;ul&gt;&#10;
+      &lt;xsl:for-each select=&quot;$node&quot;&gt;&#10;
+        &lt;li&gt;&#10;
+          &lt;xsl:value-of select=&quot;@name&quot;/&gt;&#10;
+        &lt;/li&gt;&#10;
+      &lt;/xsl:for-each&gt;&#10;
+    &lt;/ul&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template name=&quot;groupResources&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;node&quot;/&gt;&#10;
+    &#10;
+    &lt;h4&gt;Group Resources&lt;/h4&gt;&#10;
+    &lt;ul&gt;&#10;
+      &lt;xsl:for-each select=&quot;$node&quot;&gt;&#10;
+        &lt;li&gt;&#10;
+          &lt;xsl:value-of select=&quot;@name&quot;/&gt;&#10;
+        &lt;/li&gt;&#10;
+      &lt;/xsl:for-each&gt;&#10;
+    &lt;/ul&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+&lt;/xsl:stylesheet&gt;&#10;"
+                  csvTemplate="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;
+&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&#10;
+                version=&quot;1.0&quot;&gt;&#10;
+ &#10;
+  &lt;xsl:param name=&quot;status&quot;/&gt;&#10;
+  &lt;xsl:param name=&quot;message&quot;/&gt;&#10;
+  &lt;xsl:param name=&quot;start&quot;/&gt;&#10;
+  &lt;xsl:param name=&quot;end&quot;/&gt;&#10;
+    &#10;
+  &lt;xsl:template match=&quot;/&quot;&gt;&#10;
+    &lt;xsl:apply-templates/&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+&#10;
+  &lt;xsl:variable name=&quot;delimiter&quot; select=&quot;';'&quot;/&gt;&#10;
+   &#10;
+  &lt;xsl:template match=&quot;reportlet[@class='org.apache.syncope.core.logic.report.StaticReportlet']&quot;&gt;&#10;
+    &lt;xsl:call-template name=&quot;header&quot;&gt;&#10;
+      &lt;xsl:with-param name=&quot;node&quot; select=&quot;configurations/staticAttributes&quot;/&gt;&#10;
+    &lt;/xsl:call-template&gt;&#10;
+    &#10;
+    &lt;xsl:call-template name=&quot;staticAttributes&quot;&gt;&#10;
+      &lt;xsl:with-param name=&quot;header&quot; select=&quot;configurations/staticAttributes&quot;/&gt;&#10;
+    &lt;/xsl:call-template&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template name=&quot;header&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;node&quot;/&gt;  &#10;
+    &lt;xsl:for-each select=&quot;$node/*&quot;&gt;&#10;
+      &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+      &lt;xsl:value-of select=&quot;text()&quot;/&gt;&#10;
+      &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt; &#10;
+      &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+        &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+      &lt;/xsl:if&gt;&#10;
+    &lt;/xsl:for-each&gt;&#10;
+    &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+    &#10;
+  &lt;xsl:template name=&quot;staticAttributes&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;header&quot;/&gt;&#10;
+    &#10;
+    &lt;xsl:variable name=&quot;attrs&quot; select=&quot;.&quot;/&gt;&#10;
+    &lt;xsl:for-each select=&quot;$header/*&quot;&gt;&#10;
+      &lt;xsl:variable name=&quot;nameAttr&quot; select=&quot;text()&quot;/&gt; &#10;
+      &lt;xsl:if test=&quot;string-length($attrs/*[name(.)=$nameAttr]/text()) &amp;gt; 0 &#10;
+                      and count($attrs/*[name(.)=$nameAttr]/*/node()) = 0&quot;&gt;&#10;
+        &lt;xsl:variable name=&quot;value&quot; select=&quot;$attrs/*[name(.)=$nameAttr]/text()&quot;/&gt;&#10;
+        &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;xsl:value-of select=&quot;$value&quot;/&gt;&#10;
+        &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+      &lt;/xsl:if&gt;&#10;
+      &#10;
+      &lt;xsl:if test=&quot;string-length($attrs/*[name(.)=$nameAttr]/*/text()) &amp;gt; 0 &#10;
+                      and count($attrs/*[name(.)=$nameAttr]/*/node()) &amp;gt; 0&quot;&gt;&#10;
+        &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;xsl:for-each select=&quot;$attrs/*[name(.)=$nameAttr]/*&quot;&gt;&#10;
+          &lt;xsl:variable name=&quot;value&quot; select=&quot;text()&quot;/&gt;&#10;
+          &lt;xsl:text&gt;&lt;/xsl:text&gt;&#10;
+          &lt;xsl:value-of select=&quot;$value&quot;/&gt;&#10;
+          &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+            &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+        &lt;/xsl:for-each&gt;&#10;
+        &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+      &lt;/xsl:if&gt;&#10;
+      &#10;
+      &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+        &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+      &lt;/xsl:if&gt;&#10;
+    &#10;
+    &lt;/xsl:for-each&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template match=&quot;reportlet[@class='org.apache.syncope.core.logic.report.UserReportlet']&quot;&gt;&#10;
+    &#10;
+    &lt;xsl:call-template name=&quot;header&quot;&gt;&#10;
+      &lt;xsl:with-param name=&quot;node&quot; select=&quot;configurations/userAttributes&quot;/&gt;&#10;
+    &lt;/xsl:call-template&gt;&#10;
+    &lt;xsl:for-each select=&quot;user&quot;&gt;&#10;
+      &lt;xsl:call-template name=&quot;userAttributes&quot;&gt;&#10;
+        &lt;xsl:with-param name=&quot;header&quot; select=&quot;../configurations/userAttributes&quot;/&gt;&#10;
+      &lt;/xsl:call-template&gt;&#10;
+      &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;&#10;
+    &lt;/xsl:for-each&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+    &#10;
+  &lt;xsl:template name=&quot;userAttributes&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;header&quot;/&gt;&#10;
+  &#10;
+    &lt;xsl:variable name=&quot;attrs&quot; select=&quot;.&quot;/&gt;&#10;
+    &lt;xsl:for-each select=&quot;$header/*&quot;&gt;&#10;
+      &lt;xsl:variable name=&quot;nameAttr&quot; select=&quot;text()&quot;/&gt;&#10;
+      &lt;xsl:choose&gt;      &#10;
+        &lt;xsl:when test=&quot;count($attrs/@*[name()=$nameAttr]) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:variable name=&quot;userAttr&quot; select=&quot;$attrs/@*[name()=$nameAttr]&quot;/&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+          &lt;xsl:value-of select=&quot;$userAttr/.&quot;/&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:when test=&quot;string-length($attrs/*/*[@name=$nameAttr]/value/text()) &amp;gt; 0 &#10;
+                        and count($attrs/*/*[@name=$nameAttr]/node()) = 0&quot;&gt;&#10;
+          &lt;xsl:variable name=&quot;value&quot; select=&quot;$attrs/*/*[@name=$nameAttr]/value/text()&quot;/&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+          &lt;xsl:value-of select=&quot;$value&quot;/&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:when test=&quot;string-length($attrs/*/*[@name=$nameAttr]/value/text()) &amp;gt; 0 &#10;
+                        and count($attrs/*/*[@name=$nameAttr]/node()) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+          &lt;xsl:for-each select=&quot;$attrs/*/*[@name=$nameAttr]/*&quot;&gt;&#10;
+            &lt;xsl:variable name=&quot;value&quot; select=&quot;$attrs/*/*[@name=$nameAttr]/value/text()&quot;/&gt;&#10;
+            &lt;xsl:value-of select=&quot;$value&quot;/&gt;&#10;
+            &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+              &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+            &lt;/xsl:if&gt;&#10;
+          &lt;/xsl:for-each&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:when test=&quot;name($attrs/*[name(.)=$nameAttr]/*[name(.)='membership']) &#10;
+                        and count($attrs/*[name(.)=$nameAttr]/node()) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;       &#10;
+          &lt;xsl:variable name=&quot;value&quot; select=&quot;@groupName&quot;/&gt;&#10;
+          &lt;xsl:for-each select=&quot;$attrs/*/membership&quot;&gt;&#10;
+            &lt;xsl:variable name=&quot;value&quot; select=&quot;@groupName&quot;/&gt;&#10;
+            &lt;xsl:value-of select=&quot;$value&quot;/&gt;&#10;
+            &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+              &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+            &lt;/xsl:if&gt;&#10;
+          &lt;/xsl:for-each&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:when test=&quot;name($attrs/*[name(.)=$nameAttr]/*[name(.)='resource']) &#10;
+                        and count($attrs/*[name(.)=$nameAttr]/node()) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+          &lt;xsl:variable name=&quot;value&quot; select=&quot;@name&quot;/&gt;&#10;
+          &lt;xsl:for-each select=&quot;$attrs/*/resource&quot;&gt;&#10;
+            &lt;xsl:variable name=&quot;value&quot; select=&quot;@name&quot;/&gt;&#10;
+            &lt;xsl:value-of select=&quot;$value&quot;/&gt;&#10;
+            &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+              &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+            &lt;/xsl:if&gt;&#10;
+          &lt;/xsl:for-each&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;xsl:text&gt;&quot;&quot;&lt;/xsl:text&gt; &#10;
+        &lt;/xsl:otherwise&gt;  &#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+        &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+      &lt;/xsl:if&gt;  &#10;
+    &lt;/xsl:for-each&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template match=&quot;reportlet[@class='org.apache.syncope.core.logic.report.GroupReportlet']&quot;&gt;&#10;
+    &#10;
+    &lt;xsl:call-template name=&quot;header&quot;&gt;&#10;
+      &lt;xsl:with-param name=&quot;node&quot; select=&quot;configurations/groupAttributes&quot;/&gt;&#10;
+    &lt;/xsl:call-template&gt;&#10;
+    &lt;xsl:for-each select=&quot;group&quot;&gt;&#10;
+      &lt;xsl:call-template name=&quot;groupAttributes&quot;&gt;&#10;
+        &lt;xsl:with-param name=&quot;header&quot; select=&quot;../configurations/groupAttributes&quot;/&gt;&#10;
+        &lt;xsl:with-param name=&quot;attrs&quot; select=&quot;.&quot;/&gt;&#10;
+      &lt;/xsl:call-template&gt;&#10;
+      &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;&#10;
+    &lt;/xsl:for-each&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+    &#10;
+  &lt;xsl:template name=&quot;groupAttributes&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;header&quot;/&gt;&#10;
+    &lt;xsl:param name=&quot;attrs&quot;/&gt;&#10;
+    &#10;
+    &lt;xsl:for-each select=&quot;$header/*&quot;&gt;&#10;
+      &lt;xsl:variable name=&quot;nameAttr&quot; select=&quot;text()&quot;/&gt;&#10;
+      &#10;
+      &lt;xsl:choose&gt; &#10;
+        &lt;xsl:when test=&quot;string-length($attrs/@*[name()=$nameAttr]) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:variable name=&quot;groupAttr&quot; select=&quot;$attrs/@*[name()=$nameAttr]&quot;/&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+          &lt;xsl:value-of select=&quot;$groupAttr/.&quot;/&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:when test=&quot;name($attrs/*[name(.)=$nameAttr]/*[name(.)='resource']) &#10;
+                        and count($attrs/*[name(.)=$nameAttr]/node()) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;       &#10;
+          &lt;xsl:for-each select=&quot;$attrs/*/resource&quot;&gt;&#10;
+            &lt;xsl:variable name=&quot;value&quot; select=&quot;@name&quot;/&gt;&#10;
+            &lt;xsl:value-of select=&quot;$value&quot;/&gt;&#10;
+            &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+              &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+            &lt;/xsl:if&gt;&#10;
+          &lt;/xsl:for-each&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:when test=&quot;name($attrs/*[name(.)=$nameAttr]/*[name(.)='user']) &#10;
+                        and count($attrs/*[name(.)=$nameAttr]/node()) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;       &#10;
+          &lt;xsl:for-each select=&quot;$attrs/*/user&quot;&gt;&#10;
+            &lt;xsl:variable name=&quot;value&quot; select=&quot;@userUsername&quot;/&gt;&#10;
+            &lt;xsl:value-of select=&quot;$value&quot;/&gt;&#10;
+            &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+              &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+            &lt;/xsl:if&gt;&#10;
+          &lt;/xsl:for-each&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+          &lt;xsl:if test=&quot;string-length($attrs/*/*[@name=$nameAttr]/value/text()) &amp;gt; 0&quot;&gt; &#10;
+            &lt;xsl:variable name=&quot;value&quot; select=&quot;$attrs/*/*[@name=$nameAttr]/value/text()&quot;/&gt;&#10;
+            &lt;xsl:value-of select=&quot;$value&quot;/&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+          &lt;xsl:text&gt;&quot;&lt;/xsl:text&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;xsl:if test=&quot;position() != last()&quot;&gt;&#10;
+        &lt;xsl:value-of select=&quot;$delimiter&quot;/&gt;&#10;
+      &lt;/xsl:if&gt;&#10;
+    &#10;
+    &lt;/xsl:for-each&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+&lt;/xsl:stylesheet&gt;&#10;"
+                  foTemplate="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;
+&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&#10;
+                xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;&#10;
+                version=&quot;1.0&quot;&gt;&#10;
+&#10;
+  &lt;xsl:param name=&quot;status&quot;/&gt;&#10;
+  &lt;xsl:param name=&quot;message&quot;/&gt;&#10;
+  &lt;xsl:param name=&quot;start&quot;/&gt;&#10;
+  &lt;xsl:param name=&quot;end&quot;/&gt;&#10;
+  &#10;
+  &lt;xsl:template match=&quot;/&quot;&gt;&#10;
+    &lt;fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot; font-family=&quot;Helvetica&quot; font-size=&quot;10pt&quot;&gt;&#10;
+      &#10;
+      &lt;!-- defines the layout master --&gt;&#10;
+      &lt;fo:layout-master-set&gt;&#10;
+        &lt;fo:simple-page-master master-name=&quot;first&quot; page-height=&quot;29.7cm&quot; page-width=&quot;21cm&quot; &#10;
+                               margin-top=&quot;1cm&quot; margin-bottom=&quot;2cm&quot; margin-left=&quot;2.5cm&quot; margin-right=&quot;2.5cm&quot;&gt;&#10;
+          &lt;fo:region-body margin-top=&quot;1cm&quot;/&gt;&#10;
+          &lt;fo:region-before extent=&quot;1cm&quot;/&gt;&#10;
+          &lt;fo:region-after extent=&quot;1.5cm&quot;/&gt;&#10;
+        &lt;/fo:simple-page-master&gt;&#10;
+      &lt;/fo:layout-master-set&gt;&#10;
+&#10;
+      &lt;!-- starts actual layout --&gt;&#10;
+      &lt;fo:page-sequence master-reference=&quot;first&quot;&gt;&#10;
+        &#10;
+        &lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;&#10;
+          &lt;fo:block font-size=&quot;24pt&quot; font-weight=&quot;bold&quot; text-align=&quot;center&quot; space-after=&quot;1cm&quot;&gt;&#10;
+            Apache Syncope Report - &lt;xsl:value-of select=&quot;report/@name&quot;/&gt;&#10;
+          &lt;/fo:block&gt;&#10;
+&#10;
+          &lt;fo:table table-layout=&quot;fixed&quot; border-width=&quot;0.5mm&quot; border-style=&quot;solid&quot; width=&quot;100%&quot; space-after=&quot;1cm&quot;&gt;&#10;
+            &lt;fo:table-column column-width=&quot;proportional-column-width(1)&quot;/&gt;&#10;
+            &lt;fo:table-column column-width=&quot;proportional-column-width(1)&quot;/&gt;&#10;
+            &lt;fo:table-body&gt;&#10;
+              &lt;fo:table-row&gt;&#10;
+                &lt;fo:table-cell&gt;&#10;
+                  &lt;fo:block font-size=&quot;18pt&quot; font-weight=&quot;bold&quot;&gt;Report Name:&lt;/fo:block&gt;&#10;
+                &lt;/fo:table-cell&gt;&#10;
+                &lt;fo:table-cell&gt;&#10;
+                  &lt;fo:block font-size=&quot;18pt&quot; font-weight=&quot;bold&quot;&gt;&#10;
+                    &lt;xsl:value-of select=&quot;report/@name&quot;/&gt;&#10;
+                  &lt;/fo:block&gt;&#10;
+                &lt;/fo:table-cell&gt;&#10;
+              &lt;/fo:table-row&gt;&#10;
+              &lt;fo:table-row&gt;&#10;
+                &lt;fo:table-cell&gt;&#10;
+                  &lt;fo:block font-size=&quot;18pt&quot; font-weight=&quot;bold&quot;&gt;Start Date:&lt;/fo:block&gt;&#10;
+                &lt;/fo:table-cell&gt;&#10;
+                &lt;fo:table-cell&gt;&#10;
+                  &lt;fo:block font-size=&quot;18pt&quot; font-weight=&quot;bold&quot;&gt;&#10;
+                    &lt;xsl:value-of select=&quot;$start&quot;/&gt;&#10;
+                  &lt;/fo:block&gt;&#10;
+                &lt;/fo:table-cell&gt;&#10;
+              &lt;/fo:table-row&gt;&#10;
+              &lt;fo:table-row&gt;&#10;
+                &lt;fo:table-cell&gt;&#10;
+                  &lt;fo:block font-size=&quot;18pt&quot; font-weight=&quot;bold&quot;&gt;End Date:&lt;/fo:block&gt;&#10;
+                &lt;/fo:table-cell&gt;&#10;
+                &lt;fo:table-cell&gt;&#10;
+                  &lt;fo:block font-size=&quot;18pt&quot; font-weight=&quot;bold&quot;&gt;&#10;
+                    &lt;xsl:value-of select=&quot;$end&quot;/&gt;&#10;
+                  &lt;/fo:block&gt;&#10;
+                &lt;/fo:table-cell&gt;&#10;
+              &lt;/fo:table-row&gt;&#10;
+            &lt;/fo:table-body&gt;&#10;
+          &lt;/fo:table&gt;&#10;
+&#10;
+          &lt;xsl:apply-templates/&gt;&#10;
+        &lt;/fo:flow&gt;&#10;
+      &lt;/fo:page-sequence&gt;&#10;
+    &lt;/fo:root&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+&#10;
+  &lt;xsl:template match=&quot;reportlet[@class='org.apache.syncope.core.logic.report.StaticReportlet']&quot;&gt;&#10;
+&#10;
+    &lt;fo:block font-size=&quot;14pt&quot; font-weight=&quot;bold&quot; space-after=&quot;0.5cm&quot;&gt;Reportlet: &#10;
+      &lt;xsl:value-of select=&quot;@name&quot;/&gt;&#10;
+    &lt;/fo:block&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(string/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;fo:block font-size=&quot;11pt&quot;&gt;String value: &#10;
+        &lt;xsl:value-of select=&quot;string/text()&quot;/&gt;&#10;
+      &lt;/fo:block&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(long/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;fo:block font-size=&quot;11pt&quot;&gt;Long value: &#10;
+        &lt;xsl:value-of select=&quot;long/text()&quot;/&gt;&#10;
+      &lt;/fo:block&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(double/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;fo:block font-size=&quot;11pt&quot;&gt;Double value: &#10;
+        &lt;xsl:value-of select=&quot;double/text()&quot;/&gt;&#10;
+      &lt;/fo:block&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(date/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;fo:block font-size=&quot;11pt&quot;&gt;Date value: &#10;
+        &lt;xsl:value-of select=&quot;date/text()&quot;/&gt;&#10;
+      &lt;/fo:block&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(enum/text()) &amp;gt; 0&quot;&gt;&#10;
+      &lt;fo:block font-size=&quot;11pt&quot;&gt;Enum value: &#10;
+        &lt;xsl:value-of select=&quot;enum/text()&quot;/&gt;&#10;
+      &lt;/fo:block&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+&#10;
+    &lt;xsl:if test=&quot;string-length(list) &amp;gt; 0&quot;&gt;&#10;
+      &lt;fo:block font-size=&quot;11pt&quot;&gt;List values:&lt;/fo:block&gt;&#10;
+            &#10;
+      &lt;fo:list-block provisional-label-separation=&quot;4mm&quot; provisional-distance-between-starts=&quot;2mm&quot;&gt;&#10;
+        &lt;xsl:for-each select=&quot;list/string&quot;&gt;&#10;
+          &lt;xsl:if test=&quot;string-length(string/text()) &amp;gt; 0&quot;&gt;&#10;
+            &lt;fo:list-item&gt;&#10;
+              &lt;fo:list-item-label end-indent=&quot;label-end()&quot;&gt;&#10;
+                &lt;fo:block&gt;&#x2022;&lt;/fo:block&gt;&#10;
+              &lt;/fo:list-item-label&gt;&#10;
+              &lt;fo:list-item-body start-indent=&quot;body-start()&quot;&gt;&#10;
+                &lt;fo:block&gt;&#10;
+                  &lt;xsl:value-of select=&quot;text()&quot;/&gt;&#10;
+                &lt;/fo:block&gt;&#10;
+              &lt;/fo:list-item-body&gt;&#10;
+            &lt;/fo:list-item&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+        &lt;/xsl:for-each&gt;&#10;
+      &lt;/fo:list-block&gt;&#10;
+    &lt;/xsl:if&gt;&#10;
+        &#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template match=&quot;reportlet[@class='org.apache.syncope.core.logic.report.UserReportlet']&quot;&gt;&#10;
+   &#10;
+    &lt;fo:block font-size=&quot;16pt&quot; font-weight=&quot;bold&quot; space-after=&quot;0.5cm&quot; space-before=&quot;5mm&quot;&gt;Reportlet: &lt;xsl:value-of select=&quot;@name&quot;/&gt;&lt;/fo:block&gt;&#10;
+        &#10;
+    &lt;xsl:for-each select=&quot;user&quot;&gt;&#10;
+      &lt;fo:block font-size=&quot;14pt&quot; font-weight=&quot;bold&quot; space-before=&quot;15mm&quot; space-after=&quot;5mm&quot; background-color=&quot;(#8888ff)&quot;&gt;User &lt;xsl:value-of select=&quot;@username&quot;/&gt;&lt;/fo:block&gt;&#10;
+      &lt;fo:table table-layout=&quot;fixed&quot; space-after=&quot;7mm&quot;&gt;&#10;
+        &lt;fo:table-column/&gt;&#10;
+        &lt;fo:table-column/&gt;&#10;
+        &lt;fo:table-body&gt;&#10;
+          &lt;fo:table-row background-color=&quot;(#ccccff)&quot;&gt;&#10;
+            &lt;fo:table-cell&gt;&#10;
+              &lt;fo:block&gt;Status:&lt;/fo:block&gt;&#10;
+            &lt;/fo:table-cell&gt;&#10;
+            &lt;fo:table-cell&gt;&#10;
+              &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                &lt;xsl:value-of select=&quot;@status&quot;/&gt;&#10;
+              &lt;/fo:block&gt;&#10;
+            &lt;/fo:table-cell&gt;&#10;
+          &lt;/fo:table-row&gt;&#10;
+          &lt;xsl:if test=&quot;string-length(@creationDate) &amp;gt; 0&quot;&gt;&#10;
+            &lt;fo:table-row background-color=&quot;(#ccccff)&quot;&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block&gt;Creation Date:&lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                  &lt;xsl:value-of select=&quot;@creationDate&quot;/&gt;&#10;
+                &lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+            &lt;/fo:table-row&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+          &lt;xsl:if test=&quot;string-length(@lastLoginDate) &amp;gt; 0&quot;&gt;&#10;
+            &lt;fo:table-row background-color=&quot;(#ccccff)&quot;&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block&gt;Last Login Date:&lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                  &lt;xsl:value-of select=&quot;@lastLoginDate&quot;/&gt;&#10;
+                &lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+            &lt;/fo:table-row&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+          &lt;xsl:if test=&quot;string-length(@changePwdDate) &amp;gt; 0&quot;&gt;&#10;
+            &lt;fo:table-row background-color=&quot;(#ccccff)&quot;&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block&gt;Change Password Date:&lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                  &lt;xsl:value-of select=&quot;@changePwdDate&quot;/&gt;&#10;
+                &lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+            &lt;/fo:table-row&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+          &lt;xsl:if test=&quot;string-length(@passwordHistorySize) &amp;gt; 0&quot;&gt;&#10;
+            &lt;fo:table-row background-color=&quot;(#ccccff)&quot;&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block&gt;Password History Size:&lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                  &lt;xsl:value-of select=&quot;@passwordHistorySize&quot;/&gt;&#10;
+                &lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+            &lt;/fo:table-row&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+          &lt;xsl:if test=&quot;string-length(@failedLoginCount) &amp;gt; 0&quot;&gt;&#10;
+            &lt;fo:table-row background-color=&quot;(#ccccff)&quot;&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block&gt;Number of Failed Login Attempts:&lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                  &lt;xsl:value-of select=&quot;@failedLoginCount&quot;/&gt;&#10;
+                &lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+            &lt;/fo:table-row&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+        &lt;/fo:table-body&gt;&#10;
+      &lt;/fo:table&gt;&#10;
+      &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+        &lt;xsl:with-param name=&quot;label&quot;&gt;Attributes&lt;/xsl:with-param&gt;&#10;
+        &lt;xsl:with-param name=&quot;node&quot; select=&quot;attributes/attribute&quot;/&gt;&#10;
+      &lt;/xsl:call-template&gt;&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(derivedAttributes/derivedAttribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Derived Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;derivedAttributes/derivedAttribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;fo:block color=&quot;red&quot; font-size=&quot;9pt&quot; space-after=&quot;3mm&quot;&gt;THIS USER HASN'T ANY DERIVED ATTRIBUTE&lt;/fo:block&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(virtualAttributes/virtualAttribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Virtual Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;virtualAttributes/virtualAttribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;fo:block color=&quot;red&quot; font-size=&quot;9pt&quot; space-after=&quot;3mm&quot;&gt;THIS USER HASN'T ANY VIRTUAL ATTRIBUTE&lt;/fo:block&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(memberships/membership) &amp;gt; 0&quot;&gt;&#10;
+          &lt;fo:block font-size=&quot;11pt&quot; font-weight=&quot;bold&quot;&gt;Memberships&lt;/fo:block&gt;&#10;
+          &lt;xsl:for-each select=&quot;memberships/membership&quot;&gt;&#10;
+            &lt;fo:block font-size=&quot;10pt&quot; font-weight=&quot;bold&quot; space-before=&quot;2mm&quot;&gt;Group: &lt;xsl:value-of select=&quot;@groupName&quot;/&gt;(&lt;xsl:value-of select=&quot;@groupId&quot;/&gt;)&lt;/fo:block&gt;&#10;
+            &lt;fo:block start-indent=&quot;1cm&quot; space-before=&quot;3mm&quot; space-after=&quot;0.5cm&quot;&gt;&#10;
+              &lt;xsl:choose&gt;&#10;
+                &lt;xsl:when test=&quot;string-length(attributes/attribute) &amp;gt; 0&quot;&gt;&#10;
+                  &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+                    &lt;xsl:with-param name=&quot;label&quot;&gt;Attributes&lt;/xsl:with-param&gt;&#10;
+                    &lt;xsl:with-param name=&quot;node&quot; select=&quot;attributes/attribute&quot;/&gt;&#10;
+                  &lt;/xsl:call-template&gt;&#10;
+                &lt;/xsl:when&gt;&#10;
+                &lt;xsl:otherwise&gt;&#10;
+                  &lt;fo:block color=&quot;red&quot; font-size=&quot;8pt&quot; space-after=&quot;2mm&quot;&gt;THIS GROUP HASN'T ANY ATTRIBUTE&lt;/fo:block&gt;&#10;
+                &lt;/xsl:otherwise&gt;&#10;
+              &lt;/xsl:choose&gt;&#10;
+              &lt;xsl:choose&gt;&#10;
+                &lt;xsl:when test=&quot;string-length(derivedAttributes/derivedAttribute) &amp;gt; 0&quot;&gt;&#10;
+                  &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+                    &lt;xsl:with-param name=&quot;label&quot;&gt;Derived Attributes&lt;/xsl:with-param&gt;&#10;
+                    &lt;xsl:with-param name=&quot;node&quot; select=&quot;derivedAttributes/derivedAttribute&quot;/&gt;&#10;
+                  &lt;/xsl:call-template&gt;&#10;
+                &lt;/xsl:when&gt;&#10;
+                &lt;xsl:otherwise&gt;&#10;
+                  &lt;fo:block color=&quot;red&quot; font-size=&quot;8pt&quot; space-after=&quot;2mm&quot;&gt;THIS GROUP HASN'T ANY DERIVED ATTRIBUTE&lt;/fo:block&gt;&#10;
+                &lt;/xsl:otherwise&gt;&#10;
+              &lt;/xsl:choose&gt;&#10;
+              &lt;xsl:choose&gt;&#10;
+                &lt;xsl:when test=&quot;string-length(virtualAttributes/virtualAttribute) &amp;gt; 0&quot;&gt;&#10;
+                  &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+                    &lt;xsl:with-param name=&quot;label&quot;&gt;Virtual Attributes&lt;/xsl:with-param&gt;&#10;
+                    &lt;xsl:with-param name=&quot;node&quot; select=&quot;virtualAttributes/virtualAttribute&quot;/&gt;&#10;
+                  &lt;/xsl:call-template&gt;&#10;
+                &lt;/xsl:when&gt;&#10;
+                &lt;xsl:otherwise&gt;&#10;
+                  &lt;fo:block color=&quot;red&quot; font-size=&quot;8pt&quot; space-after=&quot;2mm&quot;&gt;THIS GROUP HASN'T ANY VIRTUAL ATTRIBUTE&lt;/fo:block&gt;&#10;
+                &lt;/xsl:otherwise&gt;&#10;
+              &lt;/xsl:choose&gt;&#10;
+              &lt;!-- 'groupResources&quot; is defined in groupReportlet2fo.xsl --&gt;&#10;
+              &lt;xsl:call-template name=&quot;groupResources&quot;&gt;&#10;
+                &lt;xsl:with-param name=&quot;node&quot; select=&quot;resources/resource&quot;/&gt;&#10;
+              &lt;/xsl:call-template&gt;&#10;
+            &lt;/fo:block&gt;&#10;
+          &lt;/xsl:for-each&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;fo:block color=&quot;red&quot; font-size=&quot;9pt&quot; space-after=&quot;3mm&quot;&gt;THIS USER HASN'T BEEN ASSIGNED TO ANY GROUP&lt;/fo:block&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;xsl:call-template name=&quot;resources&quot;&gt;&#10;
+        &lt;xsl:with-param name=&quot;node&quot; select=&quot;resources/resource&quot;/&gt;&#10;
+      &lt;/xsl:call-template&gt;&#10;
+    &lt;/xsl:for-each&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template match=&quot;reportlet[@class='org.apache.syncope.core.logic.report.GroupReportlet']&quot;&gt;&#10;
+   &#10;
+    &lt;fo:block font-size=&quot;16pt&quot; font-weight=&quot;bold&quot; space-after=&quot;0.5cm&quot; space-before=&quot;5mm&quot;&gt;Reportlet: &lt;xsl:value-of select=&quot;@name&quot;/&gt;&lt;/fo:block&gt;&#10;
+        &#10;
+    &lt;xsl:for-each select=&quot;group&quot;&gt;&#10;
+      &lt;fo:block font-size=&quot;14pt&quot; font-weight=&quot;bold&quot; space-before=&quot;15mm&quot; space-after=&quot;5mm&quot; background-color=&quot;(#8888ff)&quot;&gt;Group &lt;xsl:value-of select=&quot;@name&quot;/&gt;&lt;/fo:block&gt;&#10;
+      &lt;fo:table table-layout=&quot;fixed&quot; space-after=&quot;7mm&quot;&gt;&#10;
+        &lt;fo:table-column/&gt;&#10;
+        &lt;fo:table-column/&gt;&#10;
+        &lt;fo:table-body&gt;&#10;
+          &lt;fo:table-row background-color=&quot;(#ccccff)&quot;&gt;&#10;
+            &lt;fo:table-cell&gt;&#10;
+              &lt;fo:block&gt;Id:&lt;/fo:block&gt;&#10;
+            &lt;/fo:table-cell&gt;&#10;
+            &lt;fo:table-cell&gt;&#10;
+              &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                &lt;xsl:value-of select=&quot;@id&quot;/&gt;&#10;
+              &lt;/fo:block&gt;&#10;
+            &lt;/fo:table-cell&gt;&#10;
+          &lt;/fo:table-row&gt;&#10;
+          &lt;xsl:if test=&quot;@groupOwner != 'null'&quot;&gt;&#10;
+            &lt;fo:table-row background-color=&quot;(#ccccff)&quot;&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block&gt;Group Owner:&lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                  &lt;xsl:value-of select=&quot;@groupOwner&quot;/&gt;&#10;
+                &lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+            &lt;/fo:table-row&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+          &lt;xsl:if test=&quot;@userOwner != 'null'&quot;&gt;&#10;
+            &lt;fo:table-row background-color=&quot;(#ccccff)&quot;&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block&gt;Last Login Date:&lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                  &lt;xsl:value-of select=&quot;@userOwner&quot;/&gt;&#10;
+                &lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+            &lt;/fo:table-row&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+        &lt;/fo:table-body&gt;&#10;
+      &lt;/fo:table&gt;&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(attributes/attribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;attributes/attribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;fo:block color=&quot;red&quot; font-size=&quot;9pt&quot; space-after=&quot;3mm&quot;&gt;THIS GROUP HASN'T ANY ATTRIBUTE&lt;/fo:block&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(derivedAttributes/derivedAttribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Derived Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;derivedAttributes/derivedAttribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;fo:block color=&quot;red&quot; font-size=&quot;9pt&quot; space-after=&quot;3mm&quot;&gt;THIS GROUP HASN'T ANY DERIVED ATTRIBUTE&lt;/fo:block&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;string-length(virtualAttributes/virtualAttribute) &amp;gt; 0&quot;&gt;&#10;
+          &lt;xsl:call-template name=&quot;attributes&quot;&gt;&#10;
+            &lt;xsl:with-param name=&quot;label&quot;&gt;Virtual Attributes&lt;/xsl:with-param&gt;&#10;
+            &lt;xsl:with-param name=&quot;node&quot; select=&quot;virtualAttributes/virtualAttribute&quot;/&gt;&#10;
+          &lt;/xsl:call-template&gt;&#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;fo:block color=&quot;red&quot; font-size=&quot;9pt&quot; space-after=&quot;3mm&quot;&gt;THIS GROUP HASN'T ANY VIRTUAL ATTRIBUTE&lt;/fo:block&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &#10;
+      &lt;xsl:choose&gt;&#10;
+        &lt;xsl:when test=&quot;users/user&quot;&gt;&#10;
+          &lt;fo:block font-size=&quot;11pt&quot; font-weight=&quot;bold&quot;&gt;Users&lt;/fo:block&gt;&#10;
+          &lt;xsl:for-each select=&quot;users/user&quot;&gt;&#10;
+            &lt;fo:block background-color=&quot;(#ccccff)&quot; font-size=&quot;9pt&quot; font-weight=&quot;bold&quot; space-before=&quot;4mm&quot;&gt;User: &lt;xsl:value-of select=&quot;@userUsername&quot;/&gt; (Id: &lt;xsl:value-of select=&quot;@userId&quot;/&gt;)&lt;/fo:block&gt;&#10;
+                 &#10;
+          &lt;/xsl:for-each&gt; &#10;
+        &lt;/xsl:when&gt;&#10;
+        &lt;xsl:otherwise&gt;&#10;
+          &lt;fo:block color=&quot;red&quot; font-size=&quot;9pt&quot; space-after=&quot;3mm&quot;&gt;THIS GROUP HASN'T ANY USER ASSIGNED TO&lt;/fo:block&gt;&#10;
+        &lt;/xsl:otherwise&gt;&#10;
+      &lt;/xsl:choose&gt;&#10;
+      &lt;xsl:call-template name=&quot;groupResources&quot;&gt;&#10;
+        &lt;xsl:with-param name=&quot;node&quot; select=&quot;resources/resource&quot;/&gt;&#10;
+      &lt;/xsl:call-template&gt;&#10;
+    &lt;/xsl:for-each&gt;&#10;
+&#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template name=&quot;attributes&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;label&quot;/&gt;&#10;
+    &lt;xsl:param name=&quot;node&quot;/&gt;&#10;
+    &lt;fo:block font-size=&quot;11pt&quot; font-weight=&quot;bold&quot; space-after=&quot;2mm&quot;&gt;&#10;
+      &lt;xsl:value-of select=&quot;$label&quot;/&gt;&#10;
+    &lt;/fo:block&gt;&#10;
+    &lt;fo:table table-layout=&quot;fixed&quot; space-after=&quot;7mm&quot;&gt;&#10;
+      &lt;fo:table-column/&gt;&#10;
+      &lt;fo:table-column/&gt;&#10;
+      &lt;fo:table-header&gt;&#10;
+        &lt;fo:table-row height=&quot;7mm&quot; background-color=&quot;(#ccccba)&quot;&gt;&#10;
+          &lt;fo:table-cell&gt;&#10;
+            &lt;fo:block font-weight=&quot;bold&quot;&gt;Schema name&lt;/fo:block&gt;&#10;
+          &lt;/fo:table-cell&gt;&#10;
+          &lt;fo:table-cell&gt;&#10;
+            &lt;fo:block font-weight=&quot;bold&quot;&gt;Value(s)&lt;/fo:block&gt;&#10;
+          &lt;/fo:table-cell&gt;&#10;
+        &lt;/fo:table-row&gt;&#10;
+      &lt;/fo:table-header&gt;&#10;
+      &lt;fo:table-body&gt;&#10;
+        &lt;xsl:for-each select=&quot;$node&quot;&gt;&#10;
+          &lt;xsl:if test=&quot;string-length(value/text()) &amp;gt; 0&quot;&gt;&#10;
+            &lt;fo:table-row height=&quot;4mm&quot; background-color=&quot;(#ccccff)&quot;&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;fo:block&gt;&#10;
+                  &lt;xsl:value-of select=&quot;@name&quot;/&gt;&#10;
+                &lt;/fo:block&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+              &lt;fo:table-cell&gt;&#10;
+                &lt;xsl:for-each select=&quot;value&quot;&gt;&#10;
+                  &lt;fo:block&gt;&lt;/fo:block&gt;&#10;
+                  &lt;fo:block font-style=&quot;italic&quot;&gt;&#10;
+                    &lt;xsl:value-of select=&quot;text()&quot;/&gt;&#10;
+                  &lt;/fo:block&gt;&#10;
+                &lt;/xsl:for-each&gt;&#10;
+              &lt;/fo:table-cell&gt;&#10;
+            &lt;/fo:table-row&gt;&#10;
+          &lt;/xsl:if&gt;&#10;
+          &lt;fo:table-row&gt;&#10;
+            &lt;fo:table-cell&gt;&#10;
+              &lt;fo:block&gt;&lt;/fo:block&gt;&#10;
+            &lt;/fo:table-cell&gt;&#10;
+            &lt;fo:table-cell&gt;&#10;
+              &lt;fo:block&gt;&lt;/fo:block&gt;&#10;
+            &lt;/fo:table-cell&gt;&#10;
+          &lt;/fo:table-row&gt;&#10;
+        &lt;/xsl:for-each&gt;&#10;
+      &lt;/fo:table-body&gt;&#10;
+    &lt;/fo:table&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+  &#10;
+  &lt;xsl:template name=&quot;resources&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;node&quot;/&gt;&#10;
+    &lt;fo:block font-size=&quot;11pt&quot; font-weight=&quot;bold&quot; space-after=&quot;3mm&quot;&gt;Resources&lt;/fo:block&gt;&#10;
+    &lt;xsl:for-each select=&quot;$node&quot;&gt;&#10;
+      &lt;fo:block&gt;&lt;/fo:block&gt; &lt;!--            &lt;fo:block&gt;&#x2022;&lt;/fo:block&gt;--&gt;&#10;
+      &lt;fo:block background-color=&quot;(#ccccff)&quot;&gt;&#10;
+        &lt;xsl:value-of select=&quot;@name&quot;/&gt;&#10;
+      &lt;/fo:block&gt;&#10;
+    &lt;/xsl:for-each&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+&#10;
+  &lt;xsl:template name=&quot;groupResources&quot;&gt;&#10;
+    &lt;xsl:param name=&quot;node&quot;/&gt;&#10;
+    &lt;fo:block font-size=&quot;11pt&quot; font-weight=&quot;bold&quot; space-after=&quot;3mm&quot; space-before=&quot;5mm&quot;&gt;Group Resources&lt;/fo:block&gt;&#10;
+    &lt;xsl:for-each select=&quot;$node&quot;&gt;&#10;
+      &lt;fo:block&gt;&lt;/fo:block&gt; &lt;!--            &lt;fo:block&gt;&#x2022;&lt;/fo:block&gt;--&gt;&#10;
+      &lt;fo:block background-color=&quot;(#ccccff)&quot;&gt;&#10;
+        &lt;xsl:value-of select=&quot;@name&quot;/&gt;&#10;
+      &lt;/fo:block&gt;&#10;
+    &lt;/xsl:for-each&gt;&#10;
+  &lt;/xsl:template&gt;&#10;
+&#10;
+&lt;/xsl:stylesheet&gt;&#10;"/>
+  
+  <Report id="1" name="test" active="1" template_name="sample"/>
   <ReportletConfInstance id="1" Report_id="1" 
                          serializedInstance='{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","workflowId","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}'/>
   <ReportExec Report_id="1" id="1" status="SUCCESS" start="2012-02-26 15:40:04" end="2012-02-26 15:41:04"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/f5682a72/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java
index 020f280..1c11b36 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java
@@ -22,8 +22,10 @@ import java.util.Map;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.core.provisioning.api.data.NotificationDataBinder;
 import org.apache.syncope.common.lib.to.NotificationTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.core.persistence.api.entity.EntityFactory;
 import org.apache.syncope.core.persistence.api.entity.Notification;
 import org.apache.syncope.core.misc.spring.BeanUtils;
@@ -31,6 +33,7 @@ import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
 import org.apache.syncope.core.persistence.api.dao.MailTemplateDAO;
 import org.apache.syncope.core.persistence.api.entity.AnyAbout;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
+import org.apache.syncope.core.persistence.api.entity.MailTemplate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -55,12 +58,11 @@ public class NotificationDataBinderImpl implements NotificationDataBinder {
     @Override
     public NotificationTO getNotificationTO(final Notification notification) {
         NotificationTO result = new NotificationTO();
-
-        BeanUtils.copyProperties(notification, result, IGNORE_PROPERTIES);
-
         result.setKey(notification.getKey());
         result.setTemplate(notification.getTemplate().getKey());
 
+        BeanUtils.copyProperties(notification, result, IGNORE_PROPERTIES);
+
         for (AnyAbout about : notification.getAbouts()) {
             result.getAbouts().put(about.getAnyType().getKey(), about.get());
         }
@@ -79,6 +81,13 @@ public class NotificationDataBinderImpl implements NotificationDataBinder {
     public void update(final Notification notification, final NotificationTO notificationTO) {
         BeanUtils.copyProperties(notificationTO, notification, IGNORE_PROPERTIES);
 
+        MailTemplate template = mailTemplateDAO.find(notificationTO.getTemplate());
+        if (template == null) {
+            SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.RequiredValuesMissing);
+            sce.getElements().add("template");
+            throw sce;
+        }
+        notification.setTemplate(template);
         notification.setTemplate(mailTemplateDAO.find(notificationTO.getTemplate()));
 
         // 1. add or update all (valid) abouts from TO

http://git-wip-us.apache.org/repos/asf/syncope/blob/f5682a72/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ReportDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ReportDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ReportDataBinderImpl.java
index 7b2ce80..930ece7 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ReportDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ReportDataBinderImpl.java
@@ -19,16 +19,20 @@
 package org.apache.syncope.core.provisioning.java.data;
 
 import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.report.AbstractReportletConf;
 import org.apache.syncope.core.provisioning.api.data.ReportDataBinder;
 import org.apache.syncope.common.lib.report.ReportletConf;
 import org.apache.syncope.common.lib.to.ReportExecTO;
 import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.core.persistence.api.dao.ReportExecDAO;
 import org.apache.syncope.core.persistence.api.entity.Report;
 import org.apache.syncope.core.persistence.api.entity.ReportExec;
 import org.apache.syncope.core.provisioning.api.job.JobNamer;
 import org.apache.syncope.core.misc.spring.BeanUtils;
+import org.apache.syncope.core.persistence.api.dao.ReportTemplateDAO;
+import org.apache.syncope.core.persistence.api.entity.ReportTemplate;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
 import org.quartz.Trigger;
@@ -44,11 +48,14 @@ public class ReportDataBinderImpl implements ReportDataBinder {
 
     private static final Logger LOG = LoggerFactory.getLogger(ReportDataBinder.class);
 
-    private static final String[] IGNORE_REPORT_PROPERTIES = { "key", "reportlets", "executions" };
+    private static final String[] IGNORE_REPORT_PROPERTIES = { "key", "template", "reportlets", "executions" };
 
     private static final String[] IGNORE_REPORT_EXECUTION_PROPERTIES = { "key", "report", "execResult" };
 
     @Autowired
+    private ReportTemplateDAO reportTemplateDAO;
+
+    @Autowired
     private ReportExecDAO reportExecDAO;
 
     @Autowired
@@ -58,6 +65,14 @@ public class ReportDataBinderImpl implements ReportDataBinder {
     public void getReport(final Report report, final ReportTO reportTO) {
         BeanUtils.copyProperties(reportTO, report, IGNORE_REPORT_PROPERTIES);
 
+        ReportTemplate template = reportTemplateDAO.find(reportTO.getTemplate());
+        if (template == null) {
+            SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.RequiredValuesMissing);
+            sce.getElements().add("template");
+            throw sce;
+        }
+        report.setTemplate(template);
+
         report.removeAllReportletConfs();
         for (ReportletConf conf : reportTO.getReportletConfs()) {
             report.add(conf);
@@ -68,6 +83,8 @@ public class ReportDataBinderImpl implements ReportDataBinder {
     public ReportTO getReportTO(final Report report) {
         ReportTO reportTO = new ReportTO();
         reportTO.setKey(report.getKey());
+        reportTO.setTemplate(report.getTemplate().getKey());
+
         BeanUtils.copyProperties(report, reportTO, IGNORE_REPORT_PROPERTIES);
 
         reportTO.getReportletConfs().clear();

http://git-wip-us.apache.org/repos/asf/syncope/blob/f5682a72/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java
index e80c611..44fde36 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java
@@ -73,7 +73,7 @@ public class ReportServiceImpl extends AbstractServiceImpl implements ReportServ
     @Override
     public Response exportExecutionResult(final Long executionKey, final ReportExecExportFormat fmt) {
         final ReportExecExportFormat format = (fmt == null) ? ReportExecExportFormat.XML : fmt;
-        final ReportExec reportExec = logic.getAndCheckReportExec(executionKey);
+        final ReportExec reportExec = logic.getReportExec(executionKey);
         StreamingOutput sout = new StreamingOutput() {
 
             @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/f5682a72/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportTemplateServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportTemplateServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportTemplateServiceImpl.java
new file mode 100644
index 0000000..820b53e
--- /dev/null
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportTemplateServiceImpl.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.core.rest.cxf.service;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URI;
+import java.util.List;
+import javax.ws.rs.InternalServerErrorException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.to.ReportTemplateTO;
+import org.apache.syncope.common.lib.types.ReportTemplateFormat;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.service.ReportTemplateService;
+import org.apache.syncope.core.logic.ReportTemplateLogic;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ReportTemplateServiceImpl extends AbstractServiceImpl implements ReportTemplateService {
+
+    @Autowired
+    private ReportTemplateLogic logic;
+
+    @Override
+    public Response create(final ReportTemplateTO reportTemplateTO) {
+        ReportTemplateTO created = logic.create(reportTemplateTO.getKey());
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(created.getKey())).build();
+        return Response.created(location).
+                header(RESTHeaders.RESOURCE_KEY, created.getKey()).
+                build();
+    }
+
+    @Override
+    public ReportTemplateTO read(final String key) {
+        return logic.read(key);
+    }
+
+    @Override
+    public List<ReportTemplateTO> list() {
+        return logic.list();
+    }
+
+    @Override
+    public void delete(final String key) {
+        logic.delete(key);
+    }
+
+    @Override
+    public Response getFormat(final String key, final ReportTemplateFormat format) {
+        final String template = logic.getFormat(key, format);
+        StreamingOutput sout = new StreamingOutput() {
+
+            @Override
+            public void write(final OutputStream os) throws IOException {
+                os.write(template.getBytes());
+            }
+        };
+        return Response.ok(sout).
+                type(MediaType.APPLICATION_XML).
+                build();
+    }
+
+    @Override
+    public void setFormat(final String key, final ReportTemplateFormat format, final InputStream templateIn) {
+        try {
+            logic.setFormat(key, format, IOUtils.toString(templateIn));
+        } catch (final IOException e) {
+            LOG.error("While setting format {} for report template {}", format, key, e);
+            throw new InternalServerErrorException("Could not read entity", e);
+        }
+    }
+
+    @Override
+    public void removeFormat(final String key, final ReportTemplateFormat format) {
+        logic.setFormat(key, format, null);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/f5682a72/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
index b7af72a..a64bcb8 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
@@ -70,6 +70,7 @@ import org.apache.syncope.common.rest.api.service.GroupService;
 import org.apache.syncope.common.rest.api.service.MailTemplateService;
 import org.apache.syncope.common.rest.api.service.RealmService;
 import org.apache.syncope.common.rest.api.service.RelationshipTypeService;
+import org.apache.syncope.common.rest.api.service.ReportTemplateService;
 import org.apache.syncope.common.rest.api.service.RoleService;
 import org.apache.syncope.common.rest.api.service.SchemaService;
 import org.apache.syncope.common.rest.api.service.SecurityQuestionService;
@@ -188,6 +189,8 @@ public abstract class AbstractITCase {
 
     protected static LoggerService loggerService;
 
+    protected static ReportTemplateService reportTemplateService;
+
     protected static ReportService reportService;
 
     protected static TaskService taskService;
@@ -257,6 +260,7 @@ public abstract class AbstractITCase {
         configurationService = adminClient.getService(ConfigurationService.class);
         connectorService = adminClient.getService(ConnectorService.class);
         loggerService = adminClient.getService(LoggerService.class);
+        reportTemplateService = adminClient.getService(ReportTemplateService.class);
         reportService = adminClient.getService(ReportService.class);
         taskService = adminClient.getService(TaskService.class);
         policyService = adminClient.getService(PolicyService.class);

http://git-wip-us.apache.org/repos/asf/syncope/blob/f5682a72/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
index 98ab976..ff36409 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
@@ -90,6 +90,7 @@ public class ReportITCase extends AbstractITCase {
         report.setName("testReportForCreate" + getUUIDString());
         report.getReportletConfs().add(new UserReportletConf("first"));
         report.getReportletConfs().add(new UserReportletConf("second"));
+        report.setTemplate("sample");
 
         report = createReport(report);
         assertNotNull(report);
@@ -104,9 +105,9 @@ public class ReportITCase extends AbstractITCase {
     public void update() {
         ReportTO report = new ReportTO();
         report.setName("testReportForUpdate" + getUUIDString());
-
         report.getReportletConfs().add(new UserReportletConf("first"));
         report.getReportletConfs().add(new UserReportletConf("second"));
+        report.setTemplate("sample");
 
         report = createReport(report);
         assertNotNull(report);
@@ -126,6 +127,7 @@ public class ReportITCase extends AbstractITCase {
         report.setName("testReportForDelete" + getUUIDString());
         report.getReportletConfs().add(new UserReportletConf("first"));
         report.getReportletConfs().add(new UserReportletConf("second"));
+        report.setTemplate("sample");
 
         report = createReport(report);
         assertNotNull(report);
@@ -203,13 +205,13 @@ public class ReportITCase extends AbstractITCase {
         reportTO.setActive(true);
         reportService.update(reportTO);
 
-        long execId = execute(reportTO.getKey());
+        long execKey = execute(reportTO.getKey());
 
-        checkExport(execId, ReportExecExportFormat.XML);
-        checkExport(execId, ReportExecExportFormat.HTML);
-        checkExport(execId, ReportExecExportFormat.PDF);
-        checkExport(execId, ReportExecExportFormat.RTF);
-        checkExport(execId, ReportExecExportFormat.CSV);
+        checkExport(execKey, ReportExecExportFormat.XML);
+        checkExport(execKey, ReportExecExportFormat.HTML);
+        checkExport(execKey, ReportExecExportFormat.PDF);
+        checkExport(execKey, ReportExecExportFormat.RTF);
+        checkExport(execKey, ReportExecExportFormat.CSV);
     }
 
     @Test
@@ -250,6 +252,7 @@ public class ReportITCase extends AbstractITCase {
         ReportTO reportTO = new ReportTO();
         reportTO.setName("issueSYNCOPE43" + getUUIDString());
         reportTO.setActive(true);
+        reportTO.setTemplate("sample");
         reportTO = createReport(reportTO);
         assertNotNull(reportTO);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/f5682a72/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportTemplateITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportTemplateITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportTemplateITCase.java
new file mode 100644
index 0000000..9b5a7ed
--- /dev/null
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportTemplateITCase.java
@@ -0,0 +1,154 @@
+/*
+ * 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.fit.core;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.ReportTemplateTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.ReportTemplateFormat;
+import org.apache.syncope.fit.AbstractITCase;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class ReportTemplateITCase extends AbstractITCase {
+
+    @Test
+    public void read() {
+        ReportTemplateTO reportTemplateTO = reportTemplateService.read("sample");
+        assertNotNull(reportTemplateTO);
+    }
+
+    @Test
+    public void list() {
+        List<ReportTemplateTO> reportTemplateTOs = reportTemplateService.list();
+        assertNotNull(reportTemplateTOs);
+        assertFalse(reportTemplateTOs.isEmpty());
+        for (ReportTemplateTO instance : reportTemplateTOs) {
+            assertNotNull(instance);
+        }
+    }
+
+    @Test
+    public void crud() throws IOException {
+        final String key = getUUIDString();
+
+        // 1. create (empty) report template
+        ReportTemplateTO reportTemplateTO = new ReportTemplateTO();
+        reportTemplateTO.setKey(key);
+
+        Response response = reportTemplateService.create(reportTemplateTO);
+        assertEquals(201, response.getStatus());
+
+        // 2. attempt to read HTML and CSV -> fail
+        try {
+            reportTemplateService.getFormat(key, ReportTemplateFormat.HTML);
+            fail();
+        } catch (SyncopeClientException e) {
+            assertEquals(ClientExceptionType.NotFound, e.getType());
+        }
+        try {
+            reportTemplateService.getFormat(key, ReportTemplateFormat.CSV);
+            fail();
+        } catch (SyncopeClientException e) {
+            assertEquals(ClientExceptionType.NotFound, e.getType());
+        }
+
+        // 3. set CSV
+        String csvTemplate =
+                "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'></xsl:stylesheet>";
+        reportTemplateService.setFormat(
+                key, ReportTemplateFormat.CSV, IOUtils.toInputStream(csvTemplate));
+
+        response = reportTemplateService.getFormat(key, ReportTemplateFormat.CSV);
+        assertEquals(200, response.getStatus());
+        assertTrue(response.getMediaType().toString().startsWith(MediaType.APPLICATION_XML));
+        assertTrue(response.getEntity() instanceof InputStream);
+        assertEquals(csvTemplate, IOUtils.toString((InputStream) response.getEntity()));
+
+        // 3. set HTML
+        String htmlTemplate =
+                "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'></xsl:stylesheet>";
+        reportTemplateService.setFormat(
+                key, ReportTemplateFormat.HTML, IOUtils.toInputStream(htmlTemplate));
+
+        response = reportTemplateService.getFormat(key, ReportTemplateFormat.HTML);
+        assertEquals(200, response.getStatus());
+        assertTrue(response.getMediaType().toString().startsWith(MediaType.APPLICATION_XML));
+        assertTrue(response.getEntity() instanceof InputStream);
+        assertEquals(htmlTemplate, IOUtils.toString((InputStream) response.getEntity()));
+
+        // 4. remove HTML
+        reportTemplateService.removeFormat(key, ReportTemplateFormat.HTML);
+
+        try {
+            reportTemplateService.getFormat(key, ReportTemplateFormat.HTML);
+            fail();
+        } catch (SyncopeClientException e) {
+            assertEquals(ClientExceptionType.NotFound, e.getType());
+        }
+
+        response = reportTemplateService.getFormat(key, ReportTemplateFormat.CSV);
+        assertEquals(200, response.getStatus());
+        assertTrue(response.getMediaType().toString().startsWith(MediaType.APPLICATION_XML));
+        assertTrue(response.getEntity() instanceof InputStream);
+        assertEquals(csvTemplate, IOUtils.toString((InputStream) response.getEntity()));
+
+        // 5. remove report template
+        reportTemplateService.delete(key);
+
+        try {
+            reportTemplateService.read(key);
+            fail();
+        } catch (SyncopeClientException e) {
+            assertEquals(ClientExceptionType.NotFound, e.getType());
+        }
+        try {
+            reportTemplateService.getFormat(key, ReportTemplateFormat.HTML);
+            fail();
+        } catch (SyncopeClientException e) {
+            assertEquals(ClientExceptionType.NotFound, e.getType());
+        }
+        try {
+            reportTemplateService.getFormat(key, ReportTemplateFormat.CSV);
+            fail();
+        } catch (SyncopeClientException e) {
+            assertEquals(ClientExceptionType.NotFound, e.getType());
+        }
+    }
+}


Mime
View raw message