-
1. Re: Smooks JavaBinding
tfennelly Mar 27, 2009 9:22 AM (in response to ama1)I don't think you can do this directly, but it wouldn't be hard to get it to work with the help of a little Groovy scripting to manually wire the address records into the address Map.
Also, you can probably abreviate the binding config for mapping the csv-record set data into the Map.
Here's what it would look like (untested)...<jb:bindings beanId="addresses" class="java.util.HashMap" createOnElement="csv-set" /> <jb:bindings beanId="addressRecord" class="java.util.HashMap" createOnElement="csv-record"> <!-- Omit the property + use a wildcard selector => Smooks will use the element name as the Map key --> <jb:value data="csv-record/*" /> </jb:bindings> <g:groovy executeOnElement="csv-record"> <g:script> <!-- // Manually wire each addressRecord into the address Map... Map addresses = BeanRepository.getInstance(executionContext).getBean("addresses"); Map addressRecord = BeanRepository.getInstance(executionContext).getBean("addressRecord"); addresses.put(addressRecord.ADDR_ID, addressRecord); --> </g:script> </g:groovy>
-
2. Re: Smooks JavaBinding
ama1 Mar 27, 2009 10:48 AM (in response to ama1)Hi,
thanks for the reply. Yes that would work I guess, if this bug would not occur http://jira.codehaus.org/browse/MILYN-252
I think I have to wait for a fix here and use in the meantime a unperfomant iteration over all elements and compare the IDs with freemarker if statements :-/ -
3. Re: Smooks JavaBinding
tfennelly Mar 27, 2009 12:14 PM (in response to ama1)That's actually fixed in Smooks trunk. You can safely use the fix with Smooks v1.1.x. You can get the latest SNAPSHOT from here.
-
4. Re: Smooks JavaBinding
ama1 Apr 1, 2009 8:55 AM (in response to ama1)Ok thanks a lot, I ll use the snapshot. Is there already a release planing for 1.2?
-
5. Re: Smooks JavaBinding
tfennelly Apr 1, 2009 9:45 AM (in response to ama1)We made a v1.1.2 patch release at the weekend, so you can use that too since it has this fix... http://www.smooks.org/downloads
-