I tried to test the edifact-to-xml file with smooks 2 (.m2\repository\org\smooks\cartridges\edi\edifact-schemas\2.0.0-M2-SNAPSHOT)
My first question is, would it be possible to read EDI file using unedifact:reader, bind selected data to beans and use template to create flatfile.
Is it possible to use ejc on unedifact model ?
so far, I understand that we can only populate output file using java. Is it right ?
--
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 on the web visit https://groups.google.com/d/msgid/smooks-user/5973965d-23e8-4f6e-b159-f3e46df07fafo%40googlegroups.com.
Welcome to the forum Jean-Francois! We're still preparing the docs for Smooks 2 but the unpublished docs for 2.0.0-M1 can be found at https://github.com/smooks/smooks.github.io/blob/v2.0.0-M1/docs.markdown.I tried to test the edifact-to-xml file with smooks 2 (.m2\repository\org\smooks\cartridges\edi\edifact-schemas\2.0.0-M2-SNAPSHOT)In general, snapshots are unstable so you should test with 2.0.0-M1: https://github.com/smooks/smooks-examples/tree/v1.0.0/edifact-to-xml.
My first question is, would it be possible to read EDI file using unedifact:reader, bind selected data to beans and use template to create flatfile.I can't see why not. You can skip the Java binding and leverage the DomModelCreator to transparently bind fragments to DOM nodes and then go on to read the nodes directly from the FreeMarker visitor. An example is shown in the docs. Give this a try and let me know if the same error pops out.
Is it possible to use ejc on unedifact model ?
It's possible but you shouldn't need to for Smooks 1.7. The Java bindings were generated beforehand and published to Maven Central. Check out the docs.so far, I understand that we can only populate output file using java. Is it right ?Smooks is a Java framework so it's a given that Java must be used to populate to a file from within Smooks. However, as mentioned above, visitors like FreeMarker can read data from Java objects other than Java beans. Another example is the DFDL visitor introduced in Smooks 2 which can be used to write flat files directly from XML.
Claude
To unsubscribe from this group and stop receiving emails from it, send an email to smook...@googlegroups.com.
I just tried with 2.0.0-M1 but got the same error.I guess the reason is I'm on Windows and there is an invalid transcoding of the file EDIFACT-Interchange.dfdl.xsd.mustache when resolving version in temp.
I saw the documentation but purhaps I miss somethings. In the example there is no mappingModel as the source file is xml.
Which variables can I use in my template to populate the destination file with data from the edifact source message?
Which selector can be used to access message and message items ?
Thanks for your quick answer ClaudeI tried to follow your recommandations but still need your help.
Le vendredi 30 octobre 2020 18:22:37 UTC+1, Claude a écrit :Welcome to the forum Jean-Francois! We're still preparing the docs for Smooks 2 but the unpublished docs for 2.0.0-M1 can be found at https://github.com/smooks/smooks.github.io/blob/v2.0.0-M1/docs.markdown.I tried to test the edifact-to-xml file with smooks 2 (.m2\repository\org\smooks\cartridges\edi\edifact-schemas\2.0.0-M2-SNAPSHOT)In general, snapshots are unstable so you should test with 2.0.0-M1: https://github.com/smooks/smooks-examples/tree/v1.0.0/edifact-to-xml.I just tried with 2.0.0-M1 but got the same error.I guess the reason is I'm on Windows and there is an invalid transcoding of the file EDIFACT-Interchange.dfdl.xsd.mustache when resolving version in temp.
My first question is, would it be possible to read EDI file using unedifact:reader, bind selected data to beans and use template to create flatfile.
I can't see why not. You can skip the Java binding and leverage the DomModelCreator to transparently bind fragments to DOM nodes and then go on to read the nodes directly from the FreeMarker visitor. An example is shown in the doI saw the documentation but purhaps I miss somethings. In the example there is no mappingModel as the source file is xml.cs. Give this a try and let me know if the same error pops out.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/aa9d331b-a5e9-4ed1-a036-ba8ab6706649o%40googlegroups.com.
unEdifactInterchange:<org.milyn.smooks.edi.unedifact.model.r41.UNEdifactInterchange41> |
<interchangeHeader> |
<syntaxIdentifier> |
<id>UNOC</id> |
<versionNum>3</versionNum> |
</syntaxIdentifier> |
<sender> |
<id>3011743300100</id> |
<codeQualifier>14</codeQualifier> |
</sender> |
<recipient> |
<id>3016611910017</id> |
<codeQualifier>14</codeQualifier> |
</recipient> |
<date> |
<date>200918</date> |
<time>1422</time> |
</date> |
<controlRef>2654</controlRef> |
</interchangeHeader> |
<interchangeTrailer> |
<controlCount>1</controlCount> |
<controlRef>2654</controlRef> |
</interchangeTrailer> |
<messages> |
<org.milyn.smooks.edi.unedifact.model.r41.UNEdifactMessage41> |
<interchangeHeader reference="../../../interchangeHeader"/> |
<messageHeader> |
<messageRefNum>1</messageRefNum> |
<messageIdentifier> |
<id>DESADV</id> |
<versionNum>D</versionNum> |
<releaseNum>96A</releaseNum> |
<controllingAgencyCode>UN</controllingAgencyCode> |
<associationAssignedCode>EAN005</associationAssignedCode> |
</messageIdentifier> |
</messageHeader> |
<messageTrailer> |
<segmentCount>179</segmentCount> |
<messageRefNum>1</messageRefNum> |
</messageTrailer> |
<message class="org.milyn.edi.unedifact.d96a.DESADV.Desadv"> |
<bGMBeginningOfMessage> |
<c002DocumentMessageName> |
<e1001DocumentMessageNameCoded>351</e1001DocumentMessageNameCoded> |
</c002DocumentMessageName> |
<e1004DocumentMessageNumber>80975091</e1004DocumentMessageNumber> |
<e1225MessageFunctionCoded>9</e1225MessageFunctionCoded> |
</bGMBeginningOfMessage> |
<dTMDateTimePeriod>I just tried with 2.0.0-M1 but got the same error.I guess the reason is I'm on Windows and there is an invalid transcoding of the file EDIFACT-Interchange.dfdl.xsd.mustache when resolving version in temp.Can you open a ticket? We'll investigate it before releasing M2.I saw the documentation but purhaps I miss somethings. In the example there is no mappingModel as the source file is xml.The example is a general one: you need to add the reader.Which variables can I use in my template to populate the destination file with data from the edifact source message?With DomModelCreator, the variables are the nodes captured from the XML stream.Which selector can be used to access message and message items ?I'm not too familiar with the EDIFACT mapping but you can easily find out which selector/s to use by looking at the generated XML stream via HtmlReportGenerator.Claude
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/aa9d331b-a5e9-4ed1-a036-ba8ab6706649o%40googlegroups.com.
I opened a ticket.
Another point is that it only works if I use UNH or UNT selector, not with i.e. BGM
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/2fd0e022-ba53-435c-bd66-0de1f83928f0o%40googlegroups.com.
ClaudeI opened a ticket.Thanks for creating an issue. The fix will be rolled out in 2.0.0-M2 but, as a workaround in 2.0.0-M1, set the JVM "file.encoding" property to UTF-8.Another point is that it only works if I use UNH or UNT selector, not with i.e. BGMI'd have to see the whole mapped XML doc but keep in mind that the FreeMarker visitor won't have access to all the targeted element's descendants unless you use DomModelCreator.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/2fd0e022-ba53-435c-bd66-0de1f83928f0o%40googlegroups.com.
I understand that we need to use DomModelCreator, but I would need an example of how to use it with unedifact:reader.
Currrently, I'm using UNEdifactInterchange41, UNEdifactMessage41 to solve this, but will it be available with DFDL schemas ?
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/abe723df-185a-40f7-becb-c5372f7c702bo%40googlegroups.com.