You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2013/06/07 12:19:27 UTC
svn commit: r1490565 - in /syncope/branches/1_1_X/core/src/main:
java/org/apache/syncope/core/report/StaticReportlet.java
resources/report/userReportlet2fo.xsl resources/report/userReportlet2html.xsl
Author: ilgrosso
Date: Fri Jun 7 10:19:27 2013
New Revision: 1490565
URL: http://svn.apache.org/r1490565
Log:
[SYNCOPE-390] Applying provided patch, thanks
Modified:
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/report/StaticReportlet.java
syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2fo.xsl
syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2html.xsl
Modified: syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/report/StaticReportlet.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/report/StaticReportlet.java?rev=1490565&r1=1490564&r2=1490565&view=diff
==============================================================================
--- syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/report/StaticReportlet.java (original)
+++ syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/report/StaticReportlet.java Fri Jun 7 10:19:27 2013
@@ -32,7 +32,7 @@ public class StaticReportlet extends Abs
if (StringUtils.hasText(conf.getStringField())) {
handler.startElement("", "", "string", null);
- handler.characters(conf.getStringField().toCharArray(), 0, conf.getStringField().length() - 1);
+ handler.characters(conf.getStringField().toCharArray(), 0, conf.getStringField().length());
handler.endElement("", "", "string");
}
Modified: syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2fo.xsl
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2fo.xsl?rev=1490565&r1=1490564&r2=1490565&view=diff
==============================================================================
--- syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2fo.xsl (original)
+++ syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2fo.xsl Fri Jun 7 10:19:27 2013
@@ -24,192 +24,225 @@ under the License.
version="1.0">
<xsl:template match="reportlet[@class='org.apache.syncope.core.report.UserReportlet']">
-
- <fo:block font-size="14pt" font-weight="bold" space-after="0.5cm">Reportlet: <xsl:value-of select="@name"/></fo:block>
-
+
+ <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="user">
- <fo:block font-size="12pt" font-weight="bold">User <xsl:value-of select="@username"/></fo:block>
-
- <fo:table table-layout="fixed">
- <fo:table-column/>
- <fo:table-column/>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>Status:</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block><xsl:value-of select="@status"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>Creation Date:</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block><xsl:value-of select="@creationDate"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>Last Login Date:</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block><xsl:value-of select="@lastLoginDate"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>Change Password Date:</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block><xsl:value-of select="@changePwdDate"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>Password History Size:</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block><xsl:value-of select="@passwordHistorySize"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>Number of Failed Login Attempts:</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block><xsl:value-of select="@failedLoginCount"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- </fo:table-body>
+ <fo:block font-size="14pt" font-weight="bold" space-before="15mm" space-after="5mm" background-color="(#8888ff)">User <xsl:value-of select="@username"/></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>Status:</fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block font-style="italic">
+ <xsl:value-of select="@status"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <xsl:if test="string-length(@creationDate) > 0">
+ <fo:table-row background-color="(#ccccff)">
+ <fo:table-cell>
+ <fo:block>Creation Date:</fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block font-style="italic">
+ <xsl:value-of select="@creationDate"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </xsl:if>
+ <xsl:if test="string-length(@lastLoginDate) > 0">
+ <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="@lastLoginDate"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </xsl:if>
+ <xsl:if test="string-length(@changePwdDate) > 0">
+ <fo:table-row background-color="(#ccccff)">
+ <fo:table-cell>
+ <fo:block>Change Password Date:</fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block font-style="italic">
+ <xsl:value-of select="@changePwdDate"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </xsl:if>
+ <xsl:if test="string-length(@passwordHistorySize) > 0">
+ <fo:table-row background-color="(#ccccff)">
+ <fo:table-cell>
+ <fo:block>Password History Size:</fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block font-style="italic">
+ <xsl:value-of select="@passwordHistorySize"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </xsl:if>
+ <xsl:if test="string-length(@failedLoginCount) > 0">
+ <fo:table-row background-color="(#ccccff)">
+ <fo:table-cell>
+ <fo:block>Number of Failed Login Attempts:</fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block font-style="italic">
+ <xsl:value-of select="@failedLoginCount"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </xsl:if>
+ </fo:table-body>
</fo:table>
-
- <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: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:call-template name="attributes">
- <xsl:with-param name="label">Virtual Attributes</xsl:with-param>
- <xsl:with-param name="node" select="virtualAttributes/virtualAttribute"/>
+ <xsl:with-param name="label">Attributes</xsl:with-param>
+ <xsl:with-param name="node" select="attributes/attribute"/>
</xsl:call-template>
-
- <fo:block font-size="11pt" font-weight="bold">Memberships</fo:block>
- <xsl:for-each select="memberships/membership">
- <fo:block font-size="10pt" font-weight="bold">Role: <xsl:value-of select="@roleName"/>(<xsl:value-of select="@roleId"/>)</fo:block>
- </xsl:for-each>
- <fo:block start-indent="1cm" space-after="0.5cm">
- <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: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: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:call-template name="resources">
- <xsl:with-param name="node" select="resources/resource"/>
- </xsl:call-template>
- </fo:block>
-
+ <xsl:choose>
+ <xsl:when test="string-length(derivedAttributes/derivedAttribute) > 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 USER HASN'T ANY DERIVED ATTRIBUTE</fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="string-length(virtualAttributes/virtualAttribute) > 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 USER HASN'T ANY VIRTUAL ATTRIBUTE</fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="string-length(memberships/membership) > 0">
+ <fo:block font-size="11pt" font-weight="bold">Memberships</fo:block>
+ <xsl:for-each select="memberships/membership">
+ <fo:block font-size="10pt" font-weight="bold" space-before="2mm">Role: <xsl:value-of select="@roleName"/>(<xsl:value-of select="@roleId"/>)</fo:block>
+ <fo:block start-indent="1cm" space-before="3mm" space-after="0.5cm">
+ <xsl:choose>
+ <xsl:when test="string-length(attributes/attribute) > 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="8pt" space-after="2mm">THIS ROLE HASN'T ANY ATTRIBUTE</fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="string-length(derivedAttributes/derivedAttribute) > 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="8pt" space-after="2mm">THIS ROLE HASN'T ANY DERIVED ATTRIBUTE</fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="string-length(virtualAttributes/virtualAttribute) > 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="8pt" space-after="2mm">THIS ROLE HASN'T ANY VIRTUAL ATTRIBUTE</fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="resources">
+ <xsl:with-param name="node" select="resources/resource"/>
+ </xsl:call-template>
+ </fo:block>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:block color="red" font-size="9pt" space-after="3mm">THIS USER HASN'T BEEN ASSIGNED TO ANY ROLE</fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:call-template name="resources">
- <xsl:with-param name="node" select="resources/resource"/>
+ <xsl:with-param name="node" select="resources/resource"/>
</xsl:call-template>
-
- <fo:block width="100%">
- <fo:leader leader-pattern="rule" rule-style="solid" leader-length="100%"/>
- </fo:block>
</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"><xsl:value-of select="$label"/></fo:block>
-
- <fo:table table-layout="fixed" space-after="0.5cm">
+ <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>
- <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-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()) > 0">
- <fo:table-row>
- <fo:table-cell>
- <fo:block><xsl:value-of select="@name"/></fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:list-block provisional-label-separation="4mm" provisional-distance-between-starts="2mm">
- <xsl:for-each select="value">
- <fo:list-item>
- <fo:list-item-label end-indent="label-end()">
- <fo:block>•</fo:block>
- </fo:list-item-label>
- <fo:list-item-body start-indent="body-start()">
- <fo:block><xsl:value-of select="text()"/></fo:block>
- </fo:list-item-body>
- </fo:list-item>
- </xsl:for-each>
- </fo:list-block>
- </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>
+ <xsl:for-each select="$node">
+ <xsl:if test="string-length(value/text()) > 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>•</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>
-
<xsl:template name="resources">
<xsl:param name="node"/>
-
- <fo:block font-size="11pt" font-weight="bold">Resources</fo:block>
-
- <fo:list-block provisional-label-separation="4mm" provisional-distance-between-starts="2mm">
- <xsl:for-each select="$node">
- <fo:list-item>
- <fo:list-item-label end-indent="label-end()">
- <fo:block>•</fo:block>
- </fo:list-item-label>
- <fo:list-item-body start-indent="body-start()">
- <fo:block><xsl:value-of select="@name"/></fo:block>
- </fo:list-item-body>
- </fo:list-item>
- </xsl:for-each>
-
- <fo:list-item>
- <fo:list-item-label><fo:block></fo:block></fo:list-item-label>
- <fo:list-item-body><fo:block></fo:block></fo:list-item-body>
- </fo:list-item>
- </fo:list-block>
-
+ <fo:block font-size="11pt" font-weight="bold" space-after="3mm">Resources</fo:block>
+ <xsl:for-each select="$node">
+ <fo:block></fo:block> <!-- <fo:block>•</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
Modified: syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2html.xsl
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2html.xsl?rev=1490565&r1=1490564&r2=1490565&view=diff
==============================================================================
--- syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2html.xsl (original)
+++ syncope/branches/1_1_X/core/src/main/resources/report/userReportlet2html.xsl Fri Jun 7 10:19:27 2013
@@ -28,76 +28,136 @@ under the License.
<h3>User <xsl:value-of select="@username"/></h3>
<table style="border: 1px solid black;">
- <tr>
- <td>Status:</td>
- <td><xsl:value-of select="@status"/></td>
- </tr>
- <tr>
- <td>Creation Date:</td>
- <td><xsl:value-of select="@creationDate"/></td>
- </tr>
- <tr>
- <td>Last Login Date:</td>
- <td><xsl:value-of select="@lastLoginDate"/></td>
- </tr>
- <tr>
- <td>Change Password Date:</td>
- <td><xsl:value-of select="@changePwdDate"/></td>
- </tr>
- <tr>
- <td>Password History Size:</td>
- <td><xsl:value-of select="@passwordHistorySize"/></td>
- </tr>
- <tr>
- <td>Number of Failed Login Attempts:</td>
- <td><xsl:value-of select="@failedLoginCount"/></td>
- </tr>
+ <tr>
+ <td>Status:</td>
+ <td>
+ <xsl:value-of select="@status"/>
+ </td>
+ </tr>
+ <xsl:if test="string-length(@creationDate) > 0">
+ <tr>
+ <td>Creation Date:</td>
+ <td>
+ <xsl:value-of select="@creationDate"/>
+ </td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="string-length(@lastLoginDate) > 0">
+ <tr>
+ <td>Last Login Date:</td>
+ <td>
+ <xsl:value-of select="@lastLoginDate"/>
+ </td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="string-length(@changePwdDate) > 0">
+ <tr>
+ <td>Change Password Date:</td>
+ <td>
+ <xsl:value-of select="@changePwdDate"/>
+ </td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="string-length(@passwordHistorySize) > 0">
+ <tr>
+ <td>Password History Size:</td>
+ <td>
+ <xsl:value-of select="@passwordHistorySize"/>
+ </td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="string-length(@failedLoginCount) > 0">
+ <tr>
+ <td>Number of Failed Login Attempts:</td>
+ <td>
+ <xsl:value-of select="@failedLoginCount"/>
+ </td>
+ </tr>
+ </xsl:if>
</table>
<xsl:call-template name="attributes">
- <xsl:with-param name="label">Attributes</xsl:with-param>
- <xsl:with-param name="node" select="attributes/attribute"/>
+ <xsl:with-param name="label">Attributes</xsl:with-param>
+ <xsl:with-param name="node" select="attributes/attribute"/>
</xsl:call-template>
- <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: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>
-
- <h4>Memberships</h4>
- <xsl:for-each select="memberships/membership">
- <h5>Role: <xsl:value-of select="@roleName"/>(<xsl:value-of select="@roleId"/>)</h5>
- <blockquote>
- <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: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: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:call-template name="resources">
- <xsl:with-param name="node" select="resources/resource"/>
- </xsl:call-template>
- </blockquote>
- </xsl:for-each>
-
+ <!--<xsl:if test="string-length(derivedAttributes/derivedAttribute) > 0">-->
+ <xsl:choose>
+ <xsl:when test="string-length(derivedAttributes/derivedAttribute) > 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 USER HASN'T ANY DERIVED ATTRIBUTE</h5>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!--</xsl:if>-->
+ <xsl:choose>
+ <xsl:when test="string-length(virtualAttributes/virtualAttribute) > 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 USER HASN'T ANY VIRTUAL ATTRIBUTE</h5>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="string-length(memberships/membership) > 0">
+ <h4>Memberships</h4>
+ <xsl:for-each select="memberships/membership">
+ <h5>Role: <xsl:value-of select="@roleName"/>(<xsl:value-of select="@roleId"/>)</h5>
+ <blockquote>
+ <xsl:choose>
+ <xsl:when test="string-length(attributes/attribute) > 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) > 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:choose>
+ <xsl:when test="string-length(virtualAttributes/virtualAttribute) > 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:call-template name="resources">
+ <xsl:with-param name="node" select="resources/resource"/>
+ </xsl:call-template>
+ </blockquote>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <h5>THIS USER ISN'T ASSIGNED TO ANY ROLE</h5>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:call-template name="resources">
- <xsl:with-param name="node" select="resources/resource"/>
+ <xsl:with-param name="node" select="resources/resource"/>
</xsl:call-template>
-
<hr/>
</xsl:for-each>
</xsl:template>
@@ -106,30 +166,36 @@ under the License.
<xsl:param name="label"/>
<xsl:param name="node"/>
- <h4><xsl:value-of select="$label"/></h4>
+ <h4>
+ <xsl:value-of select="$label"/>
+ </h4>
<table>
<thead>
- <tr>
- <th>Schema name</th>
- <th>Value(s)</th>
- </tr>
+ <tr>
+ <th>Schema name</th>
+ <th>Value(s)</th>
+ </tr>
</thead>
<tbody>
- <xsl:for-each select="$node">
- <xsl:if test="string-length(value/text()) > 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>
+ <xsl:for-each select="$node">
+ <xsl:if test="string-length(value/text()) > 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>
@@ -140,7 +206,9 @@ under the License.
<h4>Resources</h4>
<ul>
<xsl:for-each select="$node">
- <li><xsl:value-of select="@name"/></li>
+ <li>
+ <xsl:value-of select="@name"/>
+ </li>
</xsl:for-each>
</ul>
</xsl:template>