[jboss-dev-forums] [JBoss ESB Development] - Smooks-Is it possible to add dynamic date to the file name under file:fileNamePattern element?
Daniel Bevenius
do-not-reply at jboss.com
Mon Aug 2 02:15:41 EDT 2010
Daniel Bevenius [http://community.jboss.org/people/beve] replied to the discussion
"Smooks-Is it possible to add dynamic date to the file name under file:fileNamePattern element?"
To view the discussion, visit: http://community.jboss.org/message/555344#555344
--------------------------------------------------------------
Hi,
you could create a new Date instance in your smooks configuration and then referens it in the fileNamePattern element.
For example:
<smooks-resource-list>
<jb:bean beanId="myDate" createOnElement="order-item"/>
...
<file:outputStream resourceName="orderItemSplitStream" openOnElement="order-item">
<file:fileNamePattern>order-${order.orderItem.itemId}-${myDate?date}.xml</file:fileNamePattern>
...
</smooks-resource-list>
The format that Freemarker uses, above specified as '?date', can be configured. You can find more information about the formatting http://freemarker.sourceforge.net/docs/ref_builtins_date.html#ref_builtin_date_datetype here
Regards,
/Daniel
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/555344#555344]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2032]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20100802/e350609b/attachment.html
More information about the jboss-dev-forums
mailing list