cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject Generating user-specific content (was: Re: How can I patch cocoon?)
Date Sun, 04 Mar 2001 00:41:14 GMT
On Sat, Mar 03, 2001 at 04:40:07PM +0100, Marco Spinetti wrote:
> Hi all
> my problem is as make a modification to Cocoon. In start phase Cocoon  reads
> from the Cocoon.properties the list of the Browers: this way it is possible
> using the attribute "media" to associate a Sheet style. 

> I want to make Cocoon read, in start phase, another list in which I take back
> the possible users who have done request to a certain Xsp page.
>
> I would like to be able to use an attribute "User " as "media".

So in your XSP page, you want to be able to determine which "user" is
requesting your page, and customise output for that user?

You could do it with standard servlet2.2 session tracking.. Eg, have users log
on, assign them a certain "role", and in the XSP page have:

<xsp:logic>
if (request.isUserInRole("blah")) {
	<html><h1>Special content for users in group blah</h1></html>
} else {
	<html>normal content</html>
}
</xsp:logic>


But that's not very pretty. In C2, I'm sure you can either do it currently with
the sitemap, or the sitemap could be generalised to select on user "role". Eg,
in your sitemap you could have:

<map:select>
  <map:when user="bob">
    <map:generate src="bobsxsp.xml"/>
  </map:when>
  <map:otherwise>
    <map:generate src="normalxsp.xml"/>
  </map:otherwise>
</map:select>

I've never used C2, so judge the above snippet accordingly ;P

--Jeff


> How can I do this? 
> Is it possible?
> Which files can I have to modify?
> Thanks
> 
> Marco
> m.spinetti@pisa.iol.it
>  

-- 

Mime
View raw message