You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Torsten Curdt <tc...@dff.st> on 2001/07/10 17:35:04 UTC

request info action

I need to do a self post of a page that has some
parameters e.g.:

  /cocoon/test.html?param=test

To make it a self post I need the complete
URI plus query parameters to construct the new
form:

 <form action="/cocoon/test.html?param=test">
  or to put hidden fields into the form
  <input type="hidden" name="param" value="test">

In C1 it was possible to get the parameters via

<xsl:param name="test"/>

Which of course works only if you know the exact
amount and names of the parameters in your stylesheet.

This common stuff is still much to complicated!!

What came to my mind was to write an action for this.
So the action would just put the desired information
into the substitution map so I can use e.g.:

  <map:act type="request-info"/>
   <map:transformer>
     <map:parameter name="self-uri" value="{self-uri}"/>
     <map:parameter name="query-parameter" value="{query-parameter}"/>
   </map:transformer>
  </map:act>

But I have been wondering a couple of times...
Shouldn't there be some common standard parameter
available in the substitution map?! Like:

- requested uri
- servlet context or base-uri
- query parameters

Or is an action the better and cleaner way to go?

Comments?
--
Torsten

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


Re: [VOTE] RE: request info action

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 11.Jul.2001 -- 09:40 AM, Torsten Curdt wrote:
> > > But I have been wondering a couple of times...
> > > Shouldn't there be some common standard parameter
> > > available in the substitution map?! Like:
> > >
> > > - requested uri
> > > - servlet context or base-uri
> > > - query parameters
> > >
> > > Or is an action the better and cleaner way to go?
> 
> That's exactly how I feel. The only question is:
> Is it good to have this alway available in the substitution map?
> (as you said: you want it "occasionally") Or will an action do?
> 
> Votes please.

I'd prefer an action because I would support the "occasionally"
argument. It's probably not very expensive to create a couple of
objects in the root map. On the other hand every unecessary object
creation should be avoided.

+1 for action

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


[VOTE] RE: request info action

Posted by Torsten Curdt <tc...@dff.st>.
> > But I have been wondering a couple of times...
> > Shouldn't there be some common standard parameter
> > available in the substitution map?! Like:
> >
> > - requested uri
> > - servlet context or base-uri
> > - query parameters
> >
> > Or is an action the better and cleaner way to go?
> 
> i'm _all_ for being able to access this data via the substitution map.
> occasionally, i want to be able to use a request parameter in the sitemap
> but i can't. the servlet context would be an easy way to allow users to
> issue context-absolute redirects in the sitemap without having to
> hard-code the current context path.

That's exactly how I feel. The only question is:
Is it good to have this alway available in the substitution map?
(as you said: you want it "occasionally") Or will an action do?

Votes please.


I will add this... one or the other way.

I was also wondering if we shouldn't have {0} as parameter as well.
In "awk" e.g. (as well as other regexpr matchers) this means
the whole string. Would be more consitent... anyway

This is what I propose as substitution parameters:

requestURI     - the requested URI (without parameter) (this will of course make {0} obsolete)
requestQuery   - the query parameter (including the "?") like "?test=bla&something=2"
                 so {requestURI}{requestQuery} will give always give the full URI + parameters
context        - the servlet context (usually "/cocoon")
sitemapContext - the context change from a sitemap to a sub-sitemap (e.g. "sub" for the sub sitemap
                 example


Please feel free to add some more and
maybe one of you guys have better/shorter ideas for
the parameters?!
--
Torsten

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


Re: request info action

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 10 Jul 2001, Torsten Curdt wrote:

> But I have been wondering a couple of times...
> Shouldn't there be some common standard parameter
> available in the substitution map?! Like:
>
> - requested uri
> - servlet context or base-uri
> - query parameters
>
> Or is an action the better and cleaner way to go?

i'm _all_ for being able to access this data via the substitution map.
occasionally, i want to be able to use a request parameter in the sitemap
but i can't. the servlet context would be an easy way to allow users to
issue context-absolute redirects in the sitemap without having to
hard-code the current context path.

- donald


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