Difference between revisions of "Data Interchange DSL"
(Created page with "Welcome to the Data Interchange DSL wiki! A general introduction and some high-level concepts for OSBP DSLs can be found in OSBP DSL Documentation. ==Purpose== The Data...") |
|||
Line 9: | Line 9: | ||
You only need to define the ''relationship'' between the file and the bean, not the import / export process themselves. Once defined, these models can be used in e.g. action DSL to define actions which, when triggered, execute the actual import / export process, which are generated automatically by the OSBP based on the model. | You only need to define the ''relationship'' between the file and the bean, not the import / export process themselves. Once defined, these models can be used in e.g. action DSL to define actions which, when triggered, execute the actual import / export process, which are generated automatically by the OSBP based on the model. | ||
− | == | + | ==Overview== |
− | + | The main semantic elements of the Compex Data Interchange DSL are the following: | |
− | |||
− | |||
− | package net.osbee.sample.<applicationname>.datainterchanges title "< | + | |
+ | ==Data Interchange Model File== | ||
+ | |||
+ | Datainterchange DSL model files end with the <code>.data</code> extension. Data Interchange models may be split into several <code>.data</code> files, as long as they have the same package declaration. | ||
+ | |||
+ | <syntaxhighlight lang="java"> | ||
+ | package net.osbee.sample.<applicationname>.datainterchanges title "<titletext>" { | ||
interchange <interchangename> persist file | interchange <interchangename> persist file | ||
<fileformat> "<filepath>" [<further specifications>] | <fileformat> "<filepath>" [<further specifications>] | ||
Line 23: | Line 27: | ||
} | } | ||
} | } | ||
− | </ | + | </syntaxhighlight> |
+ | |||
+ | ===Package=== | ||
+ | |||
+ | Datainterchange DSL model files must start with a package declaration. Packages are the root element of the Entity DSL grammar. All <code>interchange</code> units have to be defined in the package. | ||
+ | |||
+ | |||
where: | where: | ||
* The <code>package</code> specify the datainterchange package, which acts as a namespace. It should have the form <code>net.osbee.sample.<applicationname>.datainterchanges</code> by convention. | * The <code>package</code> specify the datainterchange package, which acts as a namespace. It should have the form <code>net.osbee.sample.<applicationname>.datainterchanges</code> by convention. | ||
− | * | + | * titletext |
::- the name of the datainterchange package. This name will be used for code generation and should thus be unique if there are multiple datainterchange packages. | ::- the name of the datainterchange package. This name will be used for code generation and should thus be unique if there are multiple datainterchange packages. | ||
− | * | + | * interchangename |
Revision as of 12:23, 2 August 2017
Welcome to the Data Interchange DSL wiki!
A general introduction and some high-level concepts for OSBP DSLs can be found in OSBP DSL Documentation.
Purpose
The Data Interchange DSL (datainterchange for short) is made for defining data exchange models that can be used to import data from various formats (CSV, XML, EDI, etc.), map the data to entities, store them into database, or export them back into other formats.
You only need to define the relationship between the file and the bean, not the import / export process themselves. Once defined, these models can be used in e.g. action DSL to define actions which, when triggered, execute the actual import / export process, which are generated automatically by the OSBP based on the model.
Overview
The main semantic elements of the Compex Data Interchange DSL are the following:
Data Interchange Model File
Datainterchange DSL model files end with the .data
extension. Data Interchange models may be split into several .data
files, as long as they have the same package declaration.
package net.osbee.sample.<applicationname>.datainterchanges title "<titletext>" {
interchange <interchangename> persist file
<fileformat> "<filepath>" [<further specifications>]
beans {
<entity relationships>
}
}
Package
Datainterchange DSL model files must start with a package declaration. Packages are the root element of the Entity DSL grammar. All interchange
units have to be defined in the package.
where:
- The
package
specify the datainterchange package, which acts as a namespace. It should have the formnet.osbee.sample.<applicationname>.datainterchanges
by convention. - titletext
- - the name of the datainterchange package. This name will be used for code generation and should thus be unique if there are multiple datainterchange packages.
- interchangename