You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Thorsten Scherler <th...@apache.org> on 2006/08/06 00:43:58 UTC

Contacting input modules from jx

Hi all,

I am looking for a comfortable way to contact input modules from within
my jx:templates. Something like 
http://cocoon.apache.org/2.1/userdocs/concepts/modules.html#Step+2b:+Use
+it+on+an+XSP
...
<p> Parameter name=<input:get-attribute module="request-param"
                       as="string" name="module" default="John Doe"/>; </p>

Does somebody knows how to do it in jx?

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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


Re: Contacting input modules from jx

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Thorsten Scherler wrote:
> Hi all,
> 
> I am looking for a comfortable way to contact input modules from within
> my jx:templates. Something like 
> http://cocoon.apache.org/2.1/userdocs/concepts/modules.html#Step+2b:+Use
> +it+on+an+XSP
> ...
> <p> Parameter name=<input:get-attribute module="request-param"
>                        as="string" name="module" default="John Doe"/>; </p>
> 
> Does somebody knows how to do it in jx?

Currently there is no support for input modules in jxtemplate.

-- 
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

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


Re: Contacting input modules from jx

Posted by Toby <to...@linux.it>.
Thorsten Scherler wrote:
> <input:get-attribute module="request-param" as="string" 
>                      name="module" default="John Doe"/>
> 
> Does somebody knows how to do it in jx?

${request.getParameter('module')} ?

Don't know about the default="John Doe" part though.  I suppose it could
be done with some kind of jx expression, but I'm having trouble with them.  
You might have more luck with a <jx:choose> tag.


Toby

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


Re: Contacting input modules from jx

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Aug 8, 2006, at 11:52 PM, Dennis Dam wrote:

> I consider it best practice to state all the input values to 
> processing components specifically in the sitemap.

+1 :-)

(cf. the recent thread about <use-request-parameters> in 
TraxTransfomer... summary: me and Ard think it's pure dag nasty evil 
:-)

cheers,
—ml—


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


Re: Contacting input modules from jx

Posted by Dennis Dam <d....@hippo.nl>.
Why not pass the values from the sitemap?

i.e.:

<map:generate src="someFile.xml" type="jx">
  <map:parameter name="someValue" value="{request-param:someValue}"/>
</map:generate>

I consider it best practice to state all the input values to processing 
components specifically in the sitemap. It provides a nice overview of 
all the values that could change the outcome of a JXTemplate.

Or do you have a specific reason not to pass them from the sitemap?

Dennis

Thorsten Scherler wrote:
> El lun, 07-08-2006 a las 08:20 -0700, Mark Lundquist escribió:
>   
>> On Aug 5, 2006, at 3:43 PM, Thorsten Scherler wrote:
>>
>>     
>>> I am looking for a comfortable way to contact input modules from within
>>> my jx:templates. Something like
>>> http://cocoon.apache.org/2.1/userdocs/concepts/modules.html#Step+2b: 
>>> +Use
>>> +it+on+an+XSP
>>> ...
>>> <p> Parameter name=<input:get-attribute module="request-param"
>>>                        as="string" name="module" default="John Doe"/>;  
>>> </p>
>>>
>>> Does somebody knows how to do it in jx?
>>>       
>> You could always pass the InputModule into the JXTemplate, then call  
>> getAttribute() on it using the JExL syntax:
>>
>> 	${someInputModule.getAttribute ( 'foo')}
>>
>> I assume you're invoking the JXTG pipeline from flow, e.g. calling  
>> cocoon.sendPage() from flowscript?  Then you can inject the InputModule  
>> directly from flowscript by including it in the context bean passed to  
>> sendPage()... see the other current thread with topic "Accessing XML  
>> File input module inside a flowscript" for an explanation of how to  
>> obtain the InputModule within flowscript.
>>     
>
> Actually I am using standalone jx-template without flow. Meaning I
> cannot pass the inputModule into the template.
>
>   
>> Though I'm curious why you want your JX Template to  know about an  
>> InputModule... I prefer JX Templates to be as "dumb" as possible,  
>> getting all their data from the flow context bean :-)
>>
>>     
>
> jeje, like said above I do not have flow. 
>
> Thanks for your response.
>
> salu
>
>   
>> peace,
>> —ml—
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>     


-- 

Hippo
Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466
-------------------------------------------------------------
d.dam@hippo.nl / http://www.hippo.nl
-------------------------------------------------------------- 


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


Re: Contacting input modules from jx

Posted by Thorsten Scherler <th...@wyona.com>.
El lun, 07-08-2006 a las 08:20 -0700, Mark Lundquist escribió:
> On Aug 5, 2006, at 3:43 PM, Thorsten Scherler wrote:
> 
> > I am looking for a comfortable way to contact input modules from within
> > my jx:templates. Something like
> > http://cocoon.apache.org/2.1/userdocs/concepts/modules.html#Step+2b: 
> > +Use
> > +it+on+an+XSP
> > ...
> > <p> Parameter name=<input:get-attribute module="request-param"
> >                        as="string" name="module" default="John Doe"/>;  
> > </p>
> >
> > Does somebody knows how to do it in jx?
> 
> You could always pass the InputModule into the JXTemplate, then call  
> getAttribute() on it using the JExL syntax:
> 
> 	${someInputModule.getAttribute ( 'foo')}
> 
> I assume you're invoking the JXTG pipeline from flow, e.g. calling  
> cocoon.sendPage() from flowscript?  Then you can inject the InputModule  
> directly from flowscript by including it in the context bean passed to  
> sendPage()... see the other current thread with topic "Accessing XML  
> File input module inside a flowscript" for an explanation of how to  
> obtain the InputModule within flowscript.

Actually I am using standalone jx-template without flow. Meaning I
cannot pass the inputModule into the template.

> 
> Though I'm curious why you want your JX Template to  know about an  
> InputModule... I prefer JX Templates to be as "dumb" as possible,  
> getting all their data from the flow context bean :-)
> 

jeje, like said above I do not have flow. 

Thanks for your response.

salu

> peace,
> —ml—
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)
-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


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


Re: Contacting input modules from jx

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Aug 5, 2006, at 3:43 PM, Thorsten Scherler wrote:

> I am looking for a comfortable way to contact input modules from within
> my jx:templates. Something like
> http://cocoon.apache.org/2.1/userdocs/concepts/modules.html#Step+2b: 
> +Use
> +it+on+an+XSP
> ...
> <p> Parameter name=<input:get-attribute module="request-param"
>                        as="string" name="module" default="John Doe"/>;  
> </p>
>
> Does somebody knows how to do it in jx?

You could always pass the InputModule into the JXTemplate, then call  
getAttribute() on it using the JExL syntax:

	${someInputModule.getAttribute ( 'foo')}

I assume you're invoking the JXTG pipeline from flow, e.g. calling  
cocoon.sendPage() from flowscript?  Then you can inject the InputModule  
directly from flowscript by including it in the context bean passed to  
sendPage()... see the other current thread with topic "Accessing XML  
File input module inside a flowscript" for an explanation of how to  
obtain the InputModule within flowscript.

Though I'm curious why you want your JX Template to  know about an  
InputModule... I prefer JX Templates to be as "dumb" as possible,  
getting all their data from the flow context bean :-)

peace,
—ml—


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