You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jeff Turner <je...@socialchange.net.au> on 2001/03/04 01:41:14 UTC

Generating user-specific content (was: Re: How can I patch cocoon?)

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
>  

-- 

Re: Inserting raw HTML/XML

Posted by simone cecchini <si...@kiosco.org>.
hello Olivier,

Monday, March 05, 2001, 15:11:42, you wrote:

OR> We are storing into a database an HTML fragment that should be extracted
OR> later. The fact is that with Cocoon, when we insert the fragment into a
OR> node, Cocoon escapes the HTML tags. And Cocoon does not disable output
OR> escaping with <xsl:value-of> so that we are stuck.

you should use <xsl:copy-of  to insert xml fragment, since <xsl:value-of always returns a string value.

OR> We are storing the HTML in order to keep the presentation. We are ready to
OR> change the way we store information, and ready to store XML. But is there an
OR> easy way to store an XML fragment and load it on demand so that it can be
OR> inserted in a node?

OR> Has anyone run into the same problem and found a workaround.

OR> Thanks in advance.

OR> Olivier.

OR> _____________________________________
OR> Olivier Richaud
OR> E-FB2
OR> WWW : http://www.efb2.com
OR> Tel : O4 93 22 13 07 / 06 21 01 55 35



OR> _________________________________________________________

OR> Do You Yahoo!?

OR> Get your free @yahoo.com address at http://mail.yahoo.com




OR> ---------------------------------------------------------------------
OR> Please check that your question has not already been answered in the
OR> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

OR> To unsubscribe, e-mail: <co...@xml.apache.org>
OR> For additional commands, e-mail: <co...@xml.apache.org>



-- 
Best regards,
 simone                            mailto:simone@kiosco.org



Re: Inserting raw HTML/XML

Posted by Tagunov Anthony <at...@nnt.ru>.
On Mon, 5 Mar 2001 15:11:42 +0100, Olivier Richaud wrote:

>But is there an
>easy way to store an XML fragment and load it on demand so that it can be
>inserted in a node?

Haven't tested it personally, but the esql.xsl taglib has got a tag
<esql:get-xml column=".."/>

(just the same as <esql:get-string/>)

Does serve your needs?

Best regards, Tagunov Anthony



Inserting raw HTML/XML

Posted by Olivier Richaud <ol...@yahoo.com>.
We are storing into a database an HTML fragment that should be extracted
later. The fact is that with Cocoon, when we insert the fragment into a
node, Cocoon escapes the HTML tags. And Cocoon does not disable output
escaping with <xsl:value-of> so that we are stuck.

We are storing the HTML in order to keep the presentation. We are ready to
change the way we store information, and ready to store XML. But is there an
easy way to store an XML fragment and load it on demand so that it can be
inserted in a node?

Has anyone run into the same problem and found a workaround.

Thanks in advance.

Olivier.

_____________________________________
Olivier Richaud
E-FB2
WWW : http://www.efb2.com
Tel : O4 93 22 13 07 / 06 21 01 55 35


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com