Commit 620068d9 authored by rwm's avatar rwm

manual generation of XSD via scripts after build

parent 5555db1e
README
======
Schema/XSD for import descriptions
----------------------------------
If you want an XSD file for the import description XML,
you can run `target/classes/schemagen.bat` or `target/classes/schemagen.sh`
after a successful build. The resulting schema will be stored in
`target/generated-sources/schemagen/`.
Parsing of columns
------------------
Columns are parsed as follows:
......@@ -6,3 +17,4 @@ Columns are parsed as follows:
3. Regular expression substitution is performed if present via @regex-replace (may change the value)
4. Map rules are executed if present via map/case and map/otherwise elements. These rules may change the value (and concept code)
5. If the @na attribute is present and equals the calculated value, the value is removed completely
......@@ -13,16 +13,21 @@
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<!-- TODO: Fix schemagen invokation (some annotations wrong?)
<resources>
<resource>
<directory>src/main/scripts</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins><!--
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.1</version>
<version>2.2</version>
<executions>
<execution>
<id>schemagen</id>
......@@ -32,12 +37,12 @@
</execution>
</executions>
<configuration>
<sources>
<source>src/main/java/de/sekmi/histream/etl/config</source>
<source>src/main/java/de/sekmi/histream/etl/config/DataSource.java</source>
</sources>
</configuration>
</plugin>
-->
</plugin> -->
</plugins>
</build>
......
......@@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlSeeAlso;
* @author Raphael
*
*/
@XmlRootElement
@XmlRootElement(name="datasource")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlSeeAlso({Column.class, StringColumn.class})
public class DataSource {
......
package de.sekmi.histream.etl.config;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import de.sekmi.histream.etl.RowSupplier;
@XmlType(name="sql-query")
public class SQLSource extends TableSource {
@XmlElement
String jdbcDriver;
@XmlElement
String connectString;
@XmlElement
String sql;
String sqlSelect;
private SQLSource() {
}
......@@ -21,7 +23,6 @@ public class SQLSource extends TableSource {
}
@Override
public RowSupplier rows(Meta meta) {
// TODO Auto-generated method stub
return null;
throw new UnsupportedOperationException("Not implemented yet");
}
}
@ECHO OFF
mkdir target/generated-sources/schemagen
"%JAVA_HOME%/bin/schemagen.exe" -d "target/generated-sources/schemagen" -cp "target/histream-import-${project.version}.jar;../histream-core/target/histream-core-${project.version}.jar" de.sekmi.histream.etl.config.DataSource
#!/bin/bash
mkdir -p target/generated-sources/schemagen
"$JAVA_HOME/bin/schemagen.exe" -d "target/generated-sources/schemagen" -cp "target/histream-import-${project.version}.jar;../histream-core/target/histream-core-${project.version}.jar" de.sekmi.histream.etl.config.DataSource
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment