You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by oceatoon <t....@systheo.com> on 2005/05/06 16:16:47 UTC

Flow Input Modules and sitemap global variable ??

Hi devers

I posted this in Users, but with no luck I'm trying the devers.
Is it possible to call an input module from flow to retreive a value like
realpath?
I know I could pass it from the sitemap but it's a bit complicated, because
this particular variable concerns all my pipelines.

My other question is how can I put the result of a input module into a
sitemap global variable, because the sitemap takes my {inputmodule:bla} as
it is, I would like it to evaluate it and set my global var with the
result.
Thanks.
Regards
Tibor


Re: Flow Input Modules and sitemap global variable ??

Posted by oceatoon <t....@systheo.com>.
Thanks a lot Leszek,

Very intersting LinkRewriterTransformer :), this is something we did in our
own system through xsl, I realise everything allready existed within cocoon
for uri rewriting according to context (Those little Cocoon pleasures ;).
I'll have to add this to the migrating Containers docs, it was definitly
missing somewhere out there.

This is great for all my urls all over our website since it replaces any
attributes context, but in Flow there is no attribute  and since all my
logics are in there, I have quite a few context relative paths. I'm afraid
it won't be able to use this in FLow. 

Which brings me to my next question, the sitemap global variables, by
placing the result of my input module ({realpath}) into a globalvar I can
easely use it from everywhere even from Flow.
Please tell me why this would be a bad idea ?

Could you please give me a bit more detail on how to use the
InputModuleHelper, sorry I don't quite get it? The name sounds great but
how could this help me ?

Thanks for the help
Regards
Tibor

> oceatoon wrote:
>> Hi devers
>> 
>> I posted this in Users, but with no luck I'm trying the devers.
>> Is it possible to call an input module from flow to retreive a value like
>> realpath?
>> I know I could pass it from the sitemap but it's a bit complicated,
>> because this particular variable concerns all my pipelines.
> cocoon-core.xconf states:
> 
> | InputModules are a replacement to reading values directly
> | e.g. from request parameters. By using this abstraction and
> | indirection, other components can be more generic and changes
> | to the application logic are easier.
> |
> | A number of components already use InputModules: the sitemap processor,
> | flow, some matchers, the linkrewriting transformer, database actions
> | and more.
> 
> this will lead you to
>
src/blocks/linkrewriter/java/org/apache/cocoon/transformation/LinkRewriterTransformer.java
> 
> which in turn reveal that there is a
> src/java/org/apache/cocoon/components/modules/input/InputModuleHelper.java
> 
>> 
>> My other question is how can I put the result of a input module into a
>> sitemap global variable, because the sitemap takes my {inputmodule:bla}
>> as it is, I would like it to evaluate it and set my global var with the
>> result.
> this does not seem like a good idea. What are you trying to achieve?
> 



Re: Flow Input Modules and sitemap global variable ??

Posted by Leszek Gawron <lg...@mobilebox.pl>.
oceatoon wrote:
> Hi devers
> 
> I posted this in Users, but with no luck I'm trying the devers.
> Is it possible to call an input module from flow to retreive a value like
> realpath?
> I know I could pass it from the sitemap but it's a bit complicated, because
> this particular variable concerns all my pipelines.
cocoon-core.xconf states:

| InputModules are a replacement to reading values directly
| e.g. from request parameters. By using this abstraction and
| indirection, other components can be more generic and changes
| to the application logic are easier.
|
| A number of components already use InputModules: the sitemap processor,
| flow, some matchers, the linkrewriting transformer, database actions
| and more.

this will lead you to 
src/blocks/linkrewriter/java/org/apache/cocoon/transformation/LinkRewriterTransformer.java

which in turn reveal that there is a 
src/java/org/apache/cocoon/components/modules/input/InputModuleHelper.java

> 
> My other question is how can I put the result of a input module into a
> sitemap global variable, because the sitemap takes my {inputmodule:bla} as
> it is, I would like it to evaluate it and set my global var with the
> result.
this does not seem like a good idea. What are you trying to achieve?

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65