you need a <group mapToObject="PressArticle" attribute in order for the
mapping to work.  There is also a mapToProperty attribute of <field>,
but that is optional.  If all your classes that will be used within
intake come from the same package the top level tag has a basePackage
attribute that you can use: <input-data
basePackage="com.mycompany.media.">.  Otherwise you will need to specify
the full classname within mapToObject.

john mcnally

Stefan Riß wrote:
> 
> Hello.
> 
> I'm trying to use the intake service in my application.
> so far i  only used it as a "form checker". but now i discovered the "mapTo"
> properties and possibilities.
> 
> but:
> I can't get it to work or do not understand the following:
> 
> In my template I do the following:
> #set ( $articleGroup = $intake.PressArticle.mapTo( $pressArticle ) )
> 
> PressArticle is an object that has an entry ExhibitorCompany, so that
> $pressArticle.ExhibitorCompany
> evaluates to the the correct value of my object lets say "fooCompany".
> 
> my intake group in the intake.xml looks as follows:
> <group name="PressArticle" key="pressarticle">
>         <field name="ExhibitorCompany" key="exhibitor_company" type="String">
>                 <rule name="required" 
>value="true">PRESS_ARTICLE_COMPANY_REQUIRED</rule>
>         </field>
> </group>
> 
> Now if I use
> $articleGroup.ExhibitorCompany
> I get an empty String instead of "fooCompany". Why?
> 
> What am I doing wrong?
> Do I have to use the mapTo property of the <group> element?
> If so, do I have to put the complete classname there including packages?
> 
> Additional Info:
> - I'm using tdk 2.1 but also tried it with the turbine-2.2-dev.jar -> same
> result.
> - pressArticle is an torque-generated entity so it should fullfill the bean
> requirement.
> 
> Any help and hints appreciated.
> Thanx.
> 
> Stefan Riß ___  /\    __/\  /\___/\  __
> Entwicklung   \/  \  /    \/       \/
>                    \/
> mediawave internet solutions GmbH
> Tel.: +49 +89 350 190 92
> Fax.: +49 +89 350 190 79
> [EMAIL PROTECTED]
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to