You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by SAXESS - Hussayn Dabbous <da...@saxess.com> on 2003/02/10 15:20:01 UTC

"global sitemap parameters" and programatic cocoon configuration

Hy, all

I just fall over a configuration issue:

1.) assume you like to use a "global parameter" ${myserver}
     within several places in your sitemap AND all subsitemaps.
     Is the following (or something equivalent) possible
     to do:

     <map:sitemap>
       <map:parameter name="myserver" value="http://myserver" />

       ...

       <map:match pattern="*/canvas/collection">
         <map:read src="html:${/myserver}/index.xml"/>
       </map:match>

       ...

2.) Is it possible to also add such parameters programatically
     to the rootsitemap and use them all over in cocoon?

     I.e. i want the variable ${myserver} be preset from an
     external configuration, which happens to be separate from
     sitemap.xmap.
     background: I would like to keep the customisation at one
     place and keep my customers away from sitemap.xmap if possible.

     is something like this possible with cocoon:

     1.) on-startup of cocoon process an additional java-class-instance
         (a servlet, or better an initilisation-component
          specified in cocoon.xconf)
     2.) the initialisation-class reads a customisationfile and
         adds a set of global variables to the rootsitemap.
     3.) After cocoon came up the global sitemap parameters are
         available within any sitemap.xmap ....

     Does anyone know, if this could be achieved and if yes, could you
     point me to an example or a document about this ?

     thanks you
     Hussayn

-- 
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
50935 Köln
Telefon: +49-221-56011-0
Fax:     +49-221-56011-20
E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


AW: AW: "global sitemap parameters" and programatic cocoon configuration

Posted by Marco Rolappe <m_...@web.de>.
hi hussayn,

I see the classes available and modules declared in cocoon.xconf in 2.0.4,
so; 1. they seem to be released stuff and 2. you should be able to use them
in 2.0.4.

> -----Ursprüngliche Nachricht-----
> Von: cocoon-users-return-46409-m_rolappe=web.de@xml.apache.org
> [mailto:cocoon-users-return-46409-m_rolappe=web.de@xml.apache.org]Im
> Auftrag von SAXESS - Hussayn Dabbous
> Gesendet: Montag, 10. Februar 2003 21:15
> An: cocoon-users@xml.apache.org
> Betreff: Re: AW: "global sitemap parameters" and programatic cocoon
> configuration
>
>
> Hy, Jeremy;
>
> Thank you for this hint. That's great, because this comes
> in fact very close to what i want. The only thing
> i would have to change in my current setup is switching
> from property-notation to XML-notation in my customisation
> files. I planned this move anyway.
>
> Only one last question, before i dive into it. Does this
> also work on cocoon-2.0.4, or do i have to wait until 2.1
> is released ?
>
> regards, Hussayn
>


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: AW: "global sitemap parameters" and programatic cocoon configuration

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On Monday, February 10, 2003, at 08:15 PM, SAXESS - Hussayn Dabbous 
wrote:

> Only one last question, before i dive into it. Does this
> also work on cocoon-2.0.4, or do i have to wait until 2.1
> is released ?
>

Sorry, I do not know about 2.0.4, I just use 2.1 ;)

regards Jeremy


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: AW: "global sitemap parameters" and programatic cocoon configuration

Posted by SAXESS - Hussayn Dabbous <da...@saxess.com>.
Hy, Jeremy;

Thank you for this hint. That's great, because this comes
in fact very close to what i want. The only thing
i would have to change in my current setup is switching
from property-notation to XML-notation in my customisation
files. I planned this move anyway.

Only one last question, before i dive into it. Does this
also work on cocoon-2.0.4, or do i have to wait until 2.1
is released ?

regards, Hussayn

Jeremy Quinn wrote:
> 
> On Monday, February 10, 2003, at 06:44 PM, SAXESS - Hussayn Dabbous wrote:
> 
>>
>> I also learned, that input modules is something not yet released,
>> and under discussion...
>>
>> I'll start experimenting with DefaultsMetaModule and add some
>> stuff into cocoon.xconf and look into this in more depth. I would
>> appreciate, if anyone could add a little more light to this ...
>>
> 
> Here's an example from my config in Cocoon 2.1:
> 
> WEB-INF/cocoon.xconf:
> ....
> <component-instance
>   class="org.apache.cocoon.components.modules.input.XMLFileModule"
>   logger="core.modules.xml" name="my-org-conf">
>  <file src="WEB-INF/my-org.xconf"/>
> </component-instance>
> 
> <component-instance
>   class="org.apache.cocoon.components.modules.input.ChainMetaModule"
>   logger="core.modules.input" name="my-org">
>  <input-module name="request-param"/>
>  <input-module name="simple-map">
>    <prefix>/vars/</prefix>
>    <input-module name="my-org-conf"/>
>  </input-module>
> </component-instance>
> ....
> 
> WEB-INF/my-org.xconf:
> <vars>
>   <start>0</start>
>   <count>25</count>
>   <xslt>parts/xsl</xslt>
>   ....
> </vars>
> 
> my-org.xmap (a sub site-map)
> ....
> <map:transform src="{my-org:xslt}/process-sql.xsl">
>   <map:parameter name="count" value="{my-org:count}"/>
>   <map:parameter name="start" value="{my-org:start}"/>
> </map:transform>
> ....
> 
> Values from the xml file can be used as values in the sitemap.
> In this example, any of the 'vars' can be overridden by a request 
> parameter.
> 
> Hope this helps
> 
> regards Jeremy
> 
> 
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 

-- 
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
50935 Köln
Telefon: +49-221-56011-0
Fax:     +49-221-56011-20
E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: AW: "global sitemap parameters" and programatic cocoon configuration

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On Monday, February 10, 2003, at 06:44 PM, SAXESS - Hussayn Dabbous 
wrote:

>
> I also learned, that input modules is something not yet released,
> and under discussion...
>
> I'll start experimenting with DefaultsMetaModule and add some
> stuff into cocoon.xconf and look into this in more depth. I would
> appreciate, if anyone could add a little more light to this ...
>

Here's an example from my config in Cocoon 2.1:

WEB-INF/cocoon.xconf:
....
<component-instance
   class="org.apache.cocoon.components.modules.input.XMLFileModule"
   logger="core.modules.xml" name="my-org-conf">
  <file src="WEB-INF/my-org.xconf"/>
</component-instance>

<component-instance
   class="org.apache.cocoon.components.modules.input.ChainMetaModule"
   logger="core.modules.input" name="my-org">
  <input-module name="request-param"/>
  <input-module name="simple-map">
    <prefix>/vars/</prefix>
    <input-module name="my-org-conf"/>
  </input-module>
</component-instance>
....

WEB-INF/my-org.xconf:
<vars>
   <start>0</start>
   <count>25</count>
   <xslt>parts/xsl</xslt>
   ....
</vars>

my-org.xmap (a sub site-map)
....
<map:transform src="{my-org:xslt}/process-sql.xsl">
   <map:parameter name="count" value="{my-org:count}"/>
   <map:parameter name="start" value="{my-org:start}"/>
</map:transform>
....

Values from the xml file can be used as values in the sitemap.
In this example, any of the 'vars' can be overridden by a request 
parameter.

Hope this helps

regards Jeremy


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: AW: "global sitemap parameters" and programatic cocoon configuration

Posted by SAXESS - Hussayn Dabbous <da...@saxess.com>.
Hy, Marco;

Thank you for your infos so far. The keyword DefaultsMetaModule
brought me to a thread within the users archive:

http://www.mail-archive.com/cocoon-users@xml.apache.org/msg18831.html

 From the thread i learned, that DefaultsMetaModule would NOT
pass parameters to subsitemaps when mounted. But there seems
to be the concept of "global parameters" around in cocoon, although
some problems are reported (i.e. "/myserver" would not work either).

hmm... i didn't find the docs about "global parameters" yet...

I also learned, that input modules is something not yet released,
and under discussion...

I'll start experimenting with DefaultsMetaModule and add some
stuff into cocoon.xconf and look into this in more depth. I would
appreciate, if anyone could add a little more light to this ...

regards, Hussayn


Marco Rolappe wrote:
> hi hussayn,
> 
> 
>>-----Ursprüngliche Nachricht-----
>>Von: cocoon-users-return-46387-m_rolappe=web.de@xml.apache.org
>>[mailto:cocoon-users-return-46387-m_rolappe=web.de@xml.apache.org]Im
>>Auftrag von SAXESS - Hussayn Dabbous
>>Gesendet: Montag, 10. Februar 2003 15:20
>>An: cocoon-users@xml.apache.org
>>Betreff: "global sitemap parameters" and programatic cocoon
>>configuration
>>
>>
>>Hy, all
>>
>>I just fall over a configuration issue:
>>
>>1.) assume you like to use a "global parameter" ${myserver}
>>     within several places in your sitemap AND all subsitemaps.
>>     Is the following (or something equivalent) possible
>>     to do:
>>
>>     <map:sitemap>
>>       <map:parameter name="myserver" value="http://myserver" />
>>
>>       ...
>>
>>       <map:match pattern="*/canvas/collection">
>>         <map:read src="html:${/myserver}/index.xml"/>
>>       </map:match>
>>
>>       ...
> 
> 
> I think there's an input module available for stuff like that which IIRC
> makes those variables also available to subsitemaps.
> 
> 
>>2.) Is it possible to also add such parameters programatically
>>     to the rootsitemap and use them all over in cocoon?
>>
>>     I.e. i want the variable ${myserver} be preset from an
>>     external configuration, which happens to be separate from
>>     sitemap.xmap.
>>     background: I would like to keep the customisation at one
>>     place and keep my customers away from sitemap.xmap if possible.
>>
>>     is something like this possible with cocoon:
>>
>>     1.) on-startup of cocoon process an additional java-class-instance
>>         (a servlet, or better an initilisation-component
>>          specified in cocoon.xconf)
> 
> 
> you can of course have another servlet declared in the web.xml and have it
> automatically loaded/started via <load-on-startup> (see servlet spec).
> 
> the other alternative you pointed out also works and is probably the better
> way to go (also thought about this, needing to have something like an
> application core running which could be accessible as a Component). I think
> for this to work you have to make your 'instance' an avalon component (i.e.
> implements Component interface) with a defined role (you can specify your
> own roles in a separate file which you can reference from the cocoon.xconf,
> /cocoon/@user-roles IIRC).
> 
> 
>>     2.) the initialisation-class reads a customisationfile and
>>         adds a set of global variables to the rootsitemap.
> 
> 
> it might be possible to get hold of the above mentioned input module via a
> ComponentManager (within your Component) and add those variables
> programmatically.
> 
> 
>>     3.) After cocoon came up the global sitemap parameters are
>>         available within any sitemap.xmap ....
>>
> 
> 
> as I said, I think the variables should be visible in sub-sitemaps also, but
> I might be wrong. But from the fact that the modules declared in the root
> sitemap are available in sub-sitemaps I assume that the global variable
> module's scope is not limited to the root sitemap.
> 
> 
>>     Does anyone know, if this could be achieved and if yes, could you
>>     point me to an example or a document about this ?
>>
> 
> 
> Just had a quick look and I think the DefaultsMetaModule is what I had in
> mind.
> 
> 
>>     thanks you
>>     Hussayn
>>
> 
> 
> HTH
> 
> 
>>--
>>Dr. Hussayn Dabbous
>>SAXESS Software Design GmbH
>>Neuenhöfer Allee 125
>>50935 Köln
>>Telefon: +49-221-56011-0
>>Fax:     +49-221-56011-20
>>E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
>>For additional commands, e-mail:   <co...@xml.apache.org>
>>
> 
> 
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 

-- 
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
50935 Köln
Telefon: +49-221-56011-0
Fax:     +49-221-56011-20
E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


AW: "global sitemap parameters" and programatic cocoon configuration

Posted by Marco Rolappe <m_...@web.de>.
hi hussayn,

> -----Ursprüngliche Nachricht-----
> Von: cocoon-users-return-46387-m_rolappe=web.de@xml.apache.org
> [mailto:cocoon-users-return-46387-m_rolappe=web.de@xml.apache.org]Im
> Auftrag von SAXESS - Hussayn Dabbous
> Gesendet: Montag, 10. Februar 2003 15:20
> An: cocoon-users@xml.apache.org
> Betreff: "global sitemap parameters" and programatic cocoon
> configuration
>
>
> Hy, all
>
> I just fall over a configuration issue:
>
> 1.) assume you like to use a "global parameter" ${myserver}
>      within several places in your sitemap AND all subsitemaps.
>      Is the following (or something equivalent) possible
>      to do:
>
>      <map:sitemap>
>        <map:parameter name="myserver" value="http://myserver" />
>
>        ...
>
>        <map:match pattern="*/canvas/collection">
>          <map:read src="html:${/myserver}/index.xml"/>
>        </map:match>
>
>        ...

I think there's an input module available for stuff like that which IIRC
makes those variables also available to subsitemaps.

>
> 2.) Is it possible to also add such parameters programatically
>      to the rootsitemap and use them all over in cocoon?
>
>      I.e. i want the variable ${myserver} be preset from an
>      external configuration, which happens to be separate from
>      sitemap.xmap.
>      background: I would like to keep the customisation at one
>      place and keep my customers away from sitemap.xmap if possible.
>
>      is something like this possible with cocoon:
>
>      1.) on-startup of cocoon process an additional java-class-instance
>          (a servlet, or better an initilisation-component
>           specified in cocoon.xconf)

you can of course have another servlet declared in the web.xml and have it
automatically loaded/started via <load-on-startup> (see servlet spec).

the other alternative you pointed out also works and is probably the better
way to go (also thought about this, needing to have something like an
application core running which could be accessible as a Component). I think
for this to work you have to make your 'instance' an avalon component (i.e.
implements Component interface) with a defined role (you can specify your
own roles in a separate file which you can reference from the cocoon.xconf,
/cocoon/@user-roles IIRC).

>      2.) the initialisation-class reads a customisationfile and
>          adds a set of global variables to the rootsitemap.

it might be possible to get hold of the above mentioned input module via a
ComponentManager (within your Component) and add those variables
programmatically.

>      3.) After cocoon came up the global sitemap parameters are
>          available within any sitemap.xmap ....
>

as I said, I think the variables should be visible in sub-sitemaps also, but
I might be wrong. But from the fact that the modules declared in the root
sitemap are available in sub-sitemaps I assume that the global variable
module's scope is not limited to the root sitemap.

>      Does anyone know, if this could be achieved and if yes, could you
>      point me to an example or a document about this ?
>

Just had a quick look and I think the DefaultsMetaModule is what I had in
mind.

>      thanks you
>      Hussayn
>

HTH

> --
> Dr. Hussayn Dabbous
> SAXESS Software Design GmbH
> Neuenhöfer Allee 125
> 50935 Köln
> Telefon: +49-221-56011-0
> Fax:     +49-221-56011-20
> E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>