cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simeon Walker <sim...@sbs.bangor.ac.uk>
Subject RoleFilterTransformer - is it broken or is it me?
Date Fri, 04 Jun 2004 15:54:27 GMT
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.

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>

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?

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

Does anyone use this transformer? How did you get it to work?

Regards,
Simeon




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


Mime
View raw message