cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: RoleFilterTransformer - is it broken or is it me?
Date Sat, 05 Jun 2004 01:09:38 GMT
On 04.06.2004 17:54, Simeon Walker wrote:

> Hi,
> 
> Whilst look for something to access request.isUserInRole I found the 
> RoleFilterTransformer. It does not seem to be mentioned anywhere other 
> than the Cocoon java api docs.

Yeah, some features are treated really stepmotherly.

> I have setup the transform acting on the output of SQL Transformer which 
> produces a list of all possible role in our system. Here's a bit of the 
> sitemap:
> 
> <map:match pattern="roles.xml">
>  <map:generate src="cocoon://database/auth/ldap-roles.xml"/>
>  <map:transform src="roles.xsl"/>
>  <map:transform type="role-filter">
>    <map:parameter name="element-name" value="dummy"/>
>    <map:parameter name="count" value="100"/>
>  </map:transform>
>  <map:serialize type="xml"/>
> </map:match>
> 
> The roles.xsl filter does the following to an SQL Tranformer rowset:
> 
> <xsl:template match="sql:rowset">
>  <table>
>    <xsl:for-each select="sql:row">
>      <row roles:read-only="{sql:role_name}">
>        <entry><xsl:value-of select="sql:role_name"/></entry>
>      </row>
>    </xsl:for-each>
>  </table>
> </xsl:template>

How does the XML output of the cocoon://database/auth/ldap-roles.xml 
pipeline look like?

> But this gives and odd result. The rows for the rows I possess have an 
> attribute roles:read-only="" and rows for the roles I don't possess are 
> passed through untouched! Surely this is not what's meant to happen?

Can you be a bit more clear on this section?

> If I try to use roles:restricted in the xsl above then I get a
> java.util.EmptyStackException

Just by switching from roles:read-only to roles:restricted? Sounds crazy 
and such crazy things point often to the endorsed libs problem:
http://wiki.cocoondev.org/Wiki.jsp?page=EndorsedLibsProblem
Make sure you are using the version of Xalan you expect as described at 
http://xml.apache.org/xalan-j/faq.html#environmentcheck.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message