edifact-to-* examples are very poor because limited to obtaing only a Interchange object and that does not allow to really undestand how mapping to POJO works.
--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/196970cc-48ef-4121-9945-33f6d60608dfn%40googlegroups.com.
Welcome to the Smooks community.
edifact-to-* examples are very poor because limited to obtaing only a Interchange object and that does not allow to really undestand how mapping to POJO works.The edifact-to-java example illustrates Java binding without any mapping. As you hinted, the edi-to-java example illustrates mapping and binding with the JavaBean cartridge but, in this example, you can definitely substitute EDI with EDIFACT, or any other data format for that matter. I can understand the confusion: we should document these two different approaches for binding EDIFACT documents to Java POJOs. Your use case suggests that the edi-to-java example is a good starting point for your project.
--You are more than welcome to edit the agenda and join the community call this Thursday. We can discuss and offer guidance. Like most flexible frameworks, there's more than one way to skin a cat in Smooks.
ClaudeHi Dear,Anyone who could point me in the right direction?Thanks.--Il giorno giovedì 12 dicembre 2024 alle 15:14:36 UTC+1 giova....@gmail.com ha scritto:Hi Dears,
this is my first experince relative to EDIFACT and Smooks framework.
I need to make a simple gateway to import/export EDIFACT messages (ORDERS & INVOICE release D.96A) to our ERP software.
Reading docs and example seems that is possible to import and EDI file and mapping segment and fields (through available cartridge ) to JAVA object and Bean allowing to perform task to this objects.
edifact-to-* examples are very poor because limited to obtaing only a Interchange object and that does not allow to really undestand how mapping to POJO works.
I'm seeking for a sample that import EDIFACT file for example ORDERS and get OrderList segment mapping them to java object to allow to easily get order item and relative field like item code, quantity price and so on.
Viceversa, starting from a java object (for example orderList) to populate edifact segments.
Some examples like edi-to-* seems to implement something similar and are less "low-level" rather other examples.
I'm very confused and I need some less low-level examples that can help me understand the functioning and potential of the framework.
Thanks for you help.
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/196970cc-48ef-4121-9945-33f6d60608dfn%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/CADvAAugSdN7ZvA3EZuu3aPLmAnq4cSqRGPR2ReNVxTmoBqi8bw%40mail.gmail.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/CADvAAugSdN7ZvA3EZuu3aPLmAnq4cSqRGPR2ReNVxTmoBqi8bw%40mail.gmail.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/CAF1itZ9kMO3%3DUPO2zVDVC3ACOtv9i2HbL8StYb6DWYW-rSnD6A%40mail.gmail.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/CADvAAugwHEkaP%3DoCY%3DZxfQJsG-Qgs6TKKPXU4U420xDouRz19Q%40mail.gmail.com.
In your opinion, to create a simple transformation gateway from CSV->EDIFACT and from EDICAT->CSV (that does not require any data enrichment) is it better to create an intermediate JavaBean or is the optimal way to use the PIPELINE and REWRITE constructs?
<?xml version="1.0"?>
<smooks-resource-list
xmlns="https://www.smooks.org/xsd/smooks-2.0.xsd"
xmlns:csv="https://www.smooks.org/xsd/smooks/csv-1.7.xsd"
xmlns:edifact="https://www.smooks.org/xsd/smooks/edifact-2.0.xsd"
xmlns:core="https://www.smooks.org/xsd/smooks/smooks-core-1.6.xsd">
<csv:reader fields="..." rootElementName="MyRoot" recordElementName="..."/>
<core:smooks filterSourceOn="/MyRoot">
<core:action>
<core:inline>
<core:replace/>
</core:inline>
</core:action>
<core:config>
<smooks-resource-list>
<core:rewrite>
<core:rewrite>
<ftl:freemarker applyOnElement="#document">
<ftl:template>my-edifact-message.xml.ftl</ftl:template>
</ftl:freemarker>
</core:rewrite>
</core:rewrite>
<edifact:unparser schemaUri="/d96a/EDIFACT-Messages.dfdl.xsd" unparseOnNode="*">
<edifact:messageTypes>
<edifact:messageType>...</edifact:messageType>
</edifact:messageTypes>
</edifact:unparser>
</smooks-resource-list>
</core:config>
</core:smooks>
</smooks-resource-list>
I have already tried some examples and I noted that DFDL compilation time, especially in EDIFACT, is very high.
How does the cache engine work? The "Cache on disk" attribute is sufficient or have I to check schema hit/miss on cache via code?
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/CAF1itZ9rnyD___fz_o93RDaL_NaHi76OBzyfTGuzg7kxDUXT%2BQ%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "Smooks Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/smooks-user/EW4EkYhUzpY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to smooks-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/CADvAAuiYfuWBnBMNGOr65gDjy%3DYWPuSRyM2p8WMpPPeLd0xR%2BA%40mail.gmail.com.
the file must be written using freemarker and if it is necessary pass through JavaBean.
<smooks-resource-list xmlns="https://www.smooks.org/xsd/smooks-2.0.xsd"
xmlns:core="https://www.smooks.org/xsd/smooks/smooks-core-1.6.xsd"
xmlns:edifact="https://www.smooks.org/xsd/smooks/edifact-2.0.xsd"
xmlns:dfdl="https://www.smooks.org/xsd/smooks/dfdl-1.0.xsd">
<edifact:parser schemaUri="/d03b/EDIFACT-Messages.dfdl.xsd">
<edifact:messageTypes>
<edifact:messageType>PAXLST</edifact:messageType>
</edifact:messageTypes>
</edifact:parser>
<core:smooks filterSourceOn="#document">
<core:action>
<core:inline>
<core:replace/>
</core:inline>
</core:action>
<core:config>
<smooks-resource-list>
<dfdl:unparser schemaUri="/csv.dfdl.xsd" unparseOnNode="*"/>
</smooks-resource-list>
</core:config>
</core:smooks>
</smooks-resource-list>
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/CAF1itZ_NY0zLRStz9_BacSUdEwbtJZt6SgA%3DLGzMn42n5gPkSg%40mail.gmail.com.
Yeah, currently the guidance is to write CSV using {https://www.smooks.org/xsd/smooks/freemarker-2.1.xsd}:freemarker or {https://www.smooks.org/xsd/smooks/dfdl-1.0.xsd}:unparser. Far from ideal since CSV is a common format but hopefully someone from the community can contribute a CSV writer. We should propose it in the dev mailing list. Another option is to implement you own visitor that writes out the CSV.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/CADvAAuiHsqhfxDbEBTFZqqXgm8KS_tpG7Z9dkQW4BCQpc1sPiw%40mail.gmail.com.