cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Balthazar" <...@emakina.com>
Subject dynamic src for <map:generate>
Date Tue, 09 Jul 2002 16:13:22 GMT
hello everybody,

i'm a newbie with cocoon, and i would like to quickly test some feature
to eventually use it on a real project.

here is the situation : 

1. the end user click on an hyperlink
(href="http://localhost:8080/cocoon/tba/preview.html")

2. in the sitemap.xmap, the '<map:match pattern="tba/*">' "catches the
click".

3. then the "<map:generate src="docs/samples/tba/tba.xml"/>" file
is processed by "<map:transform src="docs/samples/tba/tba.xsl"/>"
then serialized with "<map:serialize type="html"/>"

ok, this is "easy", the page is displayed and it works fine for me.


now, what i would like to do is to select the "<map:generate src="xxx">"
dynamicly, depending on the link the user clicked on.


what i want to have is :

i generate links for the end user that looks like this :
href="http://localhost:8080/cocoon/tba/preview.html?page=/content/_MY_XM
L_PAGE_1.xml"
href="http://localhost:8080/cocoon/tba/preview.html?page=/content/_MY_XM
L_PAGE_2.xml"
...

if the user clicks on the first link, i would like to have something
like that 
<map:match pattern="tba/*">
	<map:generate src="/content/_MY_XML_PAGE_1.xml"/>
	<map:transform src="docs/samples/tba/redirect.xsl"/>
	<map:serialize type="html"/>
</map:match>

if the user clicks on the second link, i would like to have something
like that 
<map:match pattern="tba/*">
	<map:generate src="/content/_MY_XML_PAGE_2.xml"/>
	<map:transform src="docs/samples/tba/redirect.xsl"/>
	<map:serialize type="html"/>
</map:match>

and so on ...


what i have done is :

1. i generate a link for the end user that looks like this :
href="http://localhost:8080/cocoon/tba/preview.html?page=/content/_MY_XM
L_PAGE_1.xml"

2. in the sitemap.xmap, the '<map:match pattern="tba/*">' "catches the
click".

3. with "<map:generate type="serverpages"
src="docs/samples/tba/redirect.xsp"/>"
i can get the "page" parameter with the "<xsp-request:get-parameter
name="page"/> tag.

4. i can display this parameter for debug with "<map:transform
src="docs/samples/tba/redirect.xsl"/>"
and "<map:serialize type="html"/>"

so what can/must i do with this parameter?
do i have to do something like a "redirect" in the pipeline?
do i have to do it with an "action"?

i hope i was clear ;o)
can you please help me?
thanks in advance.

--
Thomas Balthazar
tba@emakina.com





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

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


Mime
View raw message