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 2003/01/19 14:59:13 UTC

environment input module

I was wondering... is there already an input module for quering the 
current environment?

   ..
   <map:match pattern="my/**">
      <map:mount uri-prefix="my" src="my/"/>
   </map:match>
   ...

And inside the sub sitemap something like:

   ...
   <map:parameter name="my-prefix" value="{env:uri-prefix}"/>
   ...

cheers
--
Torsten


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


Re: environment input module

Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Torsten Curdt" <tc...@dff.st>

> >> sure - will do...
> >
> > What's the need for an environment input module besides getting the
> > current uri prefix ?
>
> I couldn't really think of anything else yet..
>
> > Remember that environment is an internal object used by the pipeline
> > system (sitemap + pipeline implementations) that isn't visible from
> > other classes.
> >
> > I also recently needed to get the uri-prefix, and was thinking of adding
> > a new getSitemapPath() to Request, that would complement
> > getContextPath() with the current uri prefix.
> >
> > Thoughts ?
>
> Something like that was also my first thought... just hesitated to
> propose a change/addition of the Request interface ...since I only need
> it inside the sitemap - so I came up with the idea of the environment
> module.
>
> Shall we add it to the Request?

+1

This will at last allow to get correct paths for JSPEngine in mounted
subsitemaps.

Konstantin

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


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


Re: Request interface change (was: Re: environment input module)

Posted by Torsten Curdt <tc...@dff.st>.
<snip/>

> Thinking further about this, we have to define carefully how this 
> relates to the "cocoon:" protocol, because in such a case we have _two_ 
> request paths :
> - the protocol-level path, accessible using getRequestURI(),
> - the sitemap-level path, accessible using getSitemapURI() (different 
> from the above in the case of a mount or "cocoon:")

Hm... you are right

> We also have to consider that, through getSitemapURI(), the 
> "getSitemapXxx" names are tied to the current sitemap request (i.e. the 
> "cocoon:" one).
> 
> IMO, the use case is more related to the protocol-level URI :

I aggree

<snip/>

> But this is only my view of the problem. Any other use case ?

I have the same use case - and same view :)

...but I am really wondering if there aren't any use cases not only 
related to the protocol level. Anyone?

> We also have to consider how to handle the interface change :
> - on 2.1, no problem : we're not even alpha ;-)
> - on 2.0, there can be some backwards compatibility for people having 
> implemented their own Request without extending one of the provided 
> classes. Are there many of them ? I would say no, but if there are, 
> please stand up !

Hm... changing an core interface in 2.0? I guess I am -0 on that...
...maybe we should ask on cocoon-users?
--
Torsten


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


Request interface change (was: Re: environment input module)

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Christian Haul wrote:

>On 21.Jan.2003 -- 05:35 PM, Torsten Curdt wrote:
>  
>
>>>>sure - will do...
>>>>        
>>>>
>>>What's the need for an environment input module besides getting the 
>>>current uri prefix ?
>>>      
>>>
>>I couldn't really think of anything else yet..
>>
>>    
>>
>>>Remember that environment is an internal object used by the pipeline 
>>>system (sitemap + pipeline implementations) that isn't visible from 
>>>other classes.
>>>
>>>I also recently needed to get the uri-prefix, and was thinking of adding 
>>>a new getSitemapPath() to Request, that would complement 
>>>getContextPath() with the current uri prefix.
>>>
>>>Thoughts ?
>>>      
>>>
>>Something like that was also my first thought... just hesitated to 
>>propose a change/addition of the Request interface ...since I only need 
>>it inside the sitemap - so I came up with the idea of the environment 
>>module.
>>
>>Shall we add it to the Request?
>>    
>>
>
>Sounds even better.
>

Thinking further about this, we have to define carefully how this 
relates to the "cocoon:" protocol, because in such a case we have _two_ 
request paths :
- the protocol-level path, accessible using getRequestURI(),
- the sitemap-level path, accessible using getSitemapURI() (different 
from the above in the case of a mount or "cocoon:")

We also have to consider that, through getSitemapURI(), the 
"getSitemapXxx" names are tied to the current sitemap request (i.e. the 
"cocoon:" one).

IMO, the use case is more related to the protocol-level URI : I had the 
need for this when building links to images located at the root of the 
current sitemap from an abitrarily nested URI (see [1] and search for 
"{request:contextPath}/mount/cvssource").

But this is only my view of the problem. Any other use case ?



We also have to consider how to handle the interface change :
- on 2.1, no problem : we're not even alpha ;-)
- on 2.0, there can be some backwards compatibility for people having 
implemented their own Request without extending one of the provided 
classes. Are there many of them ? I would say no, but if there are, 
please stand up !

Sylvain

[1] 
http://cvs.cocoondev.org/cgi-bin/viewcvs.cgi/cvssource/src/samples/cvssource/sitemap.xmap?rev=1.1&cvsroot=cvssource&content-type=text/vnd.viewcvs-markup

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }




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


Re: environment input module

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 21.Jan.2003 -- 05:35 PM, Torsten Curdt wrote:
> >>sure - will do...
> >
> >What's the need for an environment input module besides getting the 
> >current uri prefix ?
> 
> I couldn't really think of anything else yet..
> 
> >Remember that environment is an internal object used by the pipeline 
> >system (sitemap + pipeline implementations) that isn't visible from 
> >other classes.
> >
> >I also recently needed to get the uri-prefix, and was thinking of adding 
> >a new getSitemapPath() to Request, that would complement 
> >getContextPath() with the current uri prefix.
> >
> >Thoughts ?
> 
> Something like that was also my first thought... just hesitated to 
> propose a change/addition of the Request interface ...since I only need 
> it inside the sitemap - so I came up with the idea of the environment 
> module.
> 
> Shall we add it to the Request?

Sounds even better.

	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


Re: environment input module

Posted by Torsten Curdt <tc...@dff.st>.
>> sure - will do...
> 
> What's the need for an environment input module besides getting the 
> current uri prefix ?

I couldn't really think of anything else yet..

> Remember that environment is an internal object used by the pipeline 
> system (sitemap + pipeline implementations) that isn't visible from 
> other classes.
> 
> I also recently needed to get the uri-prefix, and was thinking of adding 
> a new getSitemapPath() to Request, that would complement 
> getContextPath() with the current uri prefix.
> 
> Thoughts ?

Something like that was also my first thought... just hesitated to 
propose a change/addition of the Request interface ...since I only need 
it inside the sitemap - so I came up with the idea of the environment 
module.

Shall we add it to the Request?
--
Torsten


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


Re: environment input module

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Torsten Curdt wrote:

>>> I was wondering... is there already an input module for quering the 
>>> current environment?
>>
>> AFAIK not. Would be quite helpful, though. If you write such a cutie,
>> consider wrapping the environment so that things like the component
>> manager are not accessible this way...
>
>
> sure - will do...


What's the need for an environment input module besides getting the 
current uri prefix ?

Remember that environment is an internal object used by the pipeline 
system (sitemap + pipeline implementations) that isn't visible from 
other classes.

I also recently needed to get the uri-prefix, and was thinking of adding 
a new getSitemapPath() to Request, that would complement 
getContextPath() with the current uri prefix.

Thoughts ?

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



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


Re: environment input module

Posted by Torsten Curdt <tc...@dff.st>.
>>I was wondering... is there already an input module for quering the 
>>current environment?
> 
> 
> AFAIK not. Would be quite helpful, though. If you write such a cutie,
> consider wrapping the environment so that things like the component
> manager are not accessible this way...

sure - will do...
--
Torsten


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


Re: environment input module

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 19.Jan.2003 -- 02:59 PM, Torsten Curdt wrote:
> I was wondering... is there already an input module for quering the 
> current environment?

AFAIK not. Would be quite helpful, though. If you write such a cutie,
consider wrapping the environment so that things like the component
manager are not accessible this way...

	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