You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tony Edwards <te...@civica.com.au> on 2005/06/16 03:19:17 UTC

Obtaining sitemap globals in flow

Hi folks,
Is there a simple way of obtaining a variable set up in the sitemap 
<global-variables> section?
At the moment I'm passing the value through every time a flow function 
is called which can't be good:
        <map:match pattern="*.do">
            <map:call function="main">
                <map:parameter name="page" value="{1}" />
                 <map:parameter name="webdav-source" 
value="{global:webdav-source}"/>
            </map:call>
        </map:match>
    </map:pipeline>  

and referencing this in my flow thusly:

    print("Global thing: " + cocoon.parameters["webdav-source"]);

Is there a "cocoon.sitemap.globals("webdav-source")" type method lurking 
anywhere????

thanks

Tony

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


Re: Obtaining sitemap globals in flow

Posted by Geert Josten <Ge...@daidalos.nl>.
Oh, yeah. I probably did an importPackage first, I guess..

:-P

Tony Edwards wrote:

> Geert,
> Thanks for that. That actual method call is 
> "Packages.org.apache.cocoon.components.modules.input.InputModule.ROLE" 
> but you  got me off and running in the right direction!!!
> 
> 
> Thansk agian,
> Tony
> 
> Geert Josten wrote:
> 
>> Hi,
>>
>> Not yet? ;-)
>>
>> But you can do something like:
>>
>> var global = cocoon.getComponent(InputModule.ROLE + 
>> "Selector").select("global");
>> var webdavSource = global.getAttribute("webdav-source",null,null);
>>
>> Cheers,
>> Geert
>>
>> Tony Edwards wrote:
>>
>>> Hi folks,
>>> Is there a simple way of obtaining a variable set up in the sitemap 
>>> <global-variables> section?
>>> At the moment I'm passing the value through every time a flow 
>>> function is called which can't be good:
>>>        <map:match pattern="*.do">
>>>            <map:call function="main">
>>>                <map:parameter name="page" value="{1}" />
>>>                 <map:parameter name="webdav-source" 
>>> value="{global:webdav-source}"/>
>>>            </map:call>
>>>        </map:match>
>>>    </map:pipeline> and referencing this in my flow thusly:
>>>
>>>    print("Global thing: " + cocoon.parameters["webdav-source"]);
>>>
>>> Is there a "cocoon.sitemap.globals("webdav-source")" type method 
>>> lurking anywhere????
>>>
>>> thanks
>>>
>>> Tony
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

-- 
=====================================
NB: het Daidalos kantoor is sinds 22 april
jl. gevestigd op een nieuw adres:

Daidalos BV
Hoekeindsehof 1 - 4
2665 JZ Bleiswijk
tel: +31 (0)10 850 12 00
fax: +31 (0)10 850 11 99

Bovenstaand adres is tevens het postadres.
======================
Geert.Josten@Daidalos.nl
IT-consultant at Daidalos BV

http://www.daidalos.nl/

GPG: 1024D/12DEBB50

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


Re: Obtaining sitemap globals in flow

Posted by Tony Edwards <te...@civica.com.au>.
Geert,
Thanks for that. That actual method call is 
"Packages.org.apache.cocoon.components.modules.input.InputModule.ROLE" 
but you  got me off and running in the right direction!!!


Thansk agian,
Tony

Geert Josten wrote:

> Hi,
>
> Not yet? ;-)
>
> But you can do something like:
>
> var global = cocoon.getComponent(InputModule.ROLE + 
> "Selector").select("global");
> var webdavSource = global.getAttribute("webdav-source",null,null);
>
> Cheers,
> Geert
>
> Tony Edwards wrote:
>
>> Hi folks,
>> Is there a simple way of obtaining a variable set up in the sitemap 
>> <global-variables> section?
>> At the moment I'm passing the value through every time a flow 
>> function is called which can't be good:
>>        <map:match pattern="*.do">
>>            <map:call function="main">
>>                <map:parameter name="page" value="{1}" />
>>                 <map:parameter name="webdav-source" 
>> value="{global:webdav-source}"/>
>>            </map:call>
>>        </map:match>
>>    </map:pipeline> and referencing this in my flow thusly:
>>
>>    print("Global thing: " + cocoon.parameters["webdav-source"]);
>>
>> Is there a "cocoon.sitemap.globals("webdav-source")" type method 
>> lurking anywhere????
>>
>> thanks
>>
>> Tony
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>

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


Re: Obtaining sitemap globals in flow

Posted by Geert Josten <Ge...@daidalos.nl>.
Hi,

Not yet? ;-)

But you can do something like:

var global = cocoon.getComponent(InputModule.ROLE + "Selector").select("global");
var webdavSource = global.getAttribute("webdav-source",null,null);

Cheers,
Geert

Tony Edwards wrote:

> Hi folks,
> Is there a simple way of obtaining a variable set up in the sitemap 
> <global-variables> section?
> At the moment I'm passing the value through every time a flow function 
> is called which can't be good:
>        <map:match pattern="*.do">
>            <map:call function="main">
>                <map:parameter name="page" value="{1}" />
>                 <map:parameter name="webdav-source" 
> value="{global:webdav-source}"/>
>            </map:call>
>        </map:match>
>    </map:pipeline> 
> and referencing this in my flow thusly:
> 
>    print("Global thing: " + cocoon.parameters["webdav-source"]);
> 
> Is there a "cocoon.sitemap.globals("webdav-source")" type method lurking 
> anywhere????
> 
> thanks
> 
> Tony
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

-- 
=====================================
NB: het Daidalos kantoor is sinds 22 april
jl. gevestigd op een nieuw adres:

Daidalos BV
Hoekeindsehof 1 - 4
2665 JZ Bleiswijk
tel: +31 (0)10 850 12 00
fax: +31 (0)10 850 11 99

Bovenstaand adres is tevens het postadres.
======================
Geert.Josten@Daidalos.nl
IT-consultant at Daidalos BV

http://www.daidalos.nl/

GPG: 1024D/12DEBB50

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