delightful-edifact

delightful-edifact is an EDIFACT data-binding library and code generator for Scala

License

License

GroupId

GroupId

org.sweet-delights
ArtifactId

ArtifactId

delightful-edifact_2.12
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

delightful-edifact
delightful-edifact is an EDIFACT data-binding library and code generator for Scala
Project URL

Project URL

https://github.com/sweet-delights/delightful-edifact
Project Organization

Project Organization

org.sweet-delights
Source Code Management

Source Code Management

https://github.com/sweet-delights/delightful-edifact

Download delightful-edifact_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/org.sweet-delights/delightful-edifact_2.12/ -->
<dependency>
    <groupId>org.sweet-delights</groupId>
    <artifactId>delightful-edifact_2.12</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.sweet-delights/delightful-edifact_2.12/
implementation 'org.sweet-delights:delightful-edifact_2.12:0.0.1'
// https://jarcasting.com/artifacts/org.sweet-delights/delightful-edifact_2.12/
implementation ("org.sweet-delights:delightful-edifact_2.12:0.0.1")
'org.sweet-delights:delightful-edifact_2.12:jar:0.0.1'
<dependency org="org.sweet-delights" name="delightful-edifact_2.12" rev="0.0.1">
  <artifact name="delightful-edifact_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.sweet-delights', module='delightful-edifact_2.12', version='0.0.1')
)
libraryDependencies += "org.sweet-delights" % "delightful-edifact_2.12" % "0.0.1"
[org.sweet-delights/delightful-edifact_2.12 "0.0.1"]

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.12
com.github.julien-truffaut : monocle-core_2.12 jar 2.0.3
com.github.julien-truffaut : monocle-macro_2.12 jar 2.0.3
org.scala-lang.modules : scala-xml_2.12 jar 1.3.0
org.scala-lang.modules : scala-parser-combinators_2.12 jar 1.1.2
org.slf4j : slf4j-api jar 1.7.25

test (3)

Group / Artifact Type Version
org.slf4j : slf4j-log4j12 jar 1.7.25
io.spray : spray-json_2.12 jar 1.3.5
org.specs2 : specs2-core_2.12 jar 4.5.1

Project Modules

There are no modules declared in this project.

Build Status Maven Central

delightful-edifact is a data-binding code generator and library for EDIFACT messages, written in Scala . It is inspired by the excellent scalaxb tool. The parsing itself is implemented with scala-parser-combinators.

delightful-edifact is built for Scala 2.12.12 and 2.13.3. The plugin is tested against SBT 1.3.13.

Quick Start

SBT

Step 1 - in build.sbt, add:

libraryDependencies += "org.sweet-delights" %% "delightful-edifact" % "0.0.1"

Step 2 - in project/plugins.sbt, add:

addSbtPlugin("org.sweet-delights" % "sbt-delightful-edifact" % "0.0.1")

Step 3 - in src/main/resources/edifact/, add EDIFACT grammar files

The SBT plugin generates the code in target/scala-${scalaVersion}/src_managed/main/sbt-delightful-edifact/

Maven

<dependency>
  <groupId>org.sweet-delights</groupId>
  <artifactId>delightful-edifact_2.12</artifactId>
  <version>0.0.1</version>
</dependency>

License

All files in delightful-edifact are under the GNU Lesser General Public License version 3. Please read files COPYING and COPYING.LESSER for details.

Presentation

What is EDIFACT ?

EDIFACT is an electronic data interchange (EDI) format developed for the United Nations and approved and published by the UNECE. For more information, please check the UNECE site or wikipedia page.

What is EDIFACT data-binding ?

EDIFACT data-binding is the process of mapping and filling objects representing the structure of an EDIFACT message. In the special case of delightful-edifact, the objects are Scala case classes and objects.

What does delightful-edifact ?

Firstly, delightful-edifact defines a XML Schema Definition (XSD) for describing EDIFACT grammars. Once such a grammar is available, delightful-edifact is able to generate the data-binding case classes and parsers to read EDIFACT messages. The parsers are based on scala-parser-combinators.

As of now, delightful-edifact does not write data-binding case classes back to EDIFACT. But contributions are welcome to add this feature!

How to use delightful-edifact ?

Suppose we want to parse the following EDIFACT message (taken from wikipedia):

UNB+IATB:1+6XPPC:ZZ+LHPPC:ZZ+940101:0950+1'
UNH+1+PAORES:93:1:IA'
MSG+1:45'
IFT+3+XYZCOMPANY AVAILABILITY'
ERC+A7V:1:AMD'
IFT+3+NO MORE FLIGHTS'
ODI'
TVL+240493:1000::1220+FRA+JFK+DL+400+C'
PDI++C:3+Y::3+F::1'
APD+74C:0:::6++++++6X'
TVL+240493:1740::2030+JFK+MIA+DL+081+C'
PDI++C:4'
APD+EM2:0:1630::6+++++++DA'
UNT+13+1'
UNZ+1+1'

The structure of this message (aka "the grammar") is described in a XML file. Example: PAORES_IA_93_1.xml. The XSD for this file is available here.

delightful-edifact takes care of generating the case classes and parser combinators from the grammar file.

Contributing

This project follows the Typelevel Code of Conduct, available here.

To contribute, please feel free to open an issue and submit pull requests.

Acknowledgements

org.sweet-delights

sweet-delights

A collection of libraries & tools.

Versions

Version
0.0.1