You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Donald Ball <ba...@webslingerZ.com> on 2001/06/13 04:19:53 UTC

[c2.1] xsp question and a sitemap question

1. it's quite simple. i want to pass parameters to my xsp page from my
sitemap. the typical modus operandi is to do this:

<map:generate src="content/product.xml" type="serverpages">
  <map:parameter name="foo" value="bar"/>
</map:generate>

but how do i access the parameter from my xsp page? actions are given a
Parameters object, but xsp pages are not, and i don't know how to access
the Parameters from the objectModel.

2. i want to add a couple of http response headers to a sitemap resource
pipeline:

   <map:match pattern="header">
    <map:generate src="content/header.xml" type="serverpages"/>
    <map:transform src="style/header2svg.xsl"/>
    <map:serialize type="svg2jpeg"/>
   </map:match>

i want to give it a Pragma: No-cache HTTP header so that the client will
refetch the resource every time. are there parameters i can pass to the
serializer so that it will add HTTP headers (assuming it subclasses
AbstractSerializer or whatever)? If not, would anyone oppose that
addition?

- donald


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

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


Re: [c2.1] xsp question and a sitemap question

Posted by giacomo <gi...@apache.org>.
On Tue, 12 Jun 2001, Donald Ball wrote:

> 1. it's quite simple. i want to pass parameters to my xsp page from my
> sitemap. the typical modus operandi is to do this:
>
> <map:generate src="content/product.xml" type="serverpages">
>   <map:parameter name="foo" value="bar"/>
> </map:generate>
>
> but how do i access the parameter from my xsp page? actions are given a
> Parameters object, but xsp pages are not, and i don't know how to access
> the Parameters from the objectModel.

In your xsp pages parameters are available in the
parameters variable which is a Parameters object.

The usual objectModel content are in convenient variables called
request, response and context respectively.

> 2. i want to add a couple of http response headers to a sitemap resource
> pipeline:
>
>    <map:match pattern="header">
>     <map:generate src="content/header.xml" type="serverpages"/>
>     <map:transform src="style/header2svg.xsl"/>
>     <map:serialize type="svg2jpeg"/>
>    </map:match>
>
> i want to give it a Pragma: No-cache HTTP header so that the client will
> refetch the resource every time. are there parameters i can pass to the
> serializer so that it will add HTTP headers (assuming it subclasses
> AbstractSerializer or whatever)? If not, would anyone oppose that
> addition?

If I haven't missed any commit to the serializers they don't have (and
shouldn't have) access to the environment objects like request response
etc. The only purpose of them are to serialize a SAX stream to an
OutputStream. The only solution I can see so far is

a) enhance the <map:serializer> element to accept headers the sitemap
   engine should set.

b) use an action that can set headers.

My preference is more on b)

Giacomo


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

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