-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Process an XML from Vodafone to create a database using HyperJaxb3
- Loading branch information
Showing
27 changed files
with
81,719 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
asciidoctor (0.1.4) | ||
awestruct (0.5.5) | ||
asciidoctor | ||
bootstrap-sass (~> 3.1.1.0) | ||
colorize (~> 0.7.1) | ||
compass (~> 0.12.4) | ||
compass-960-plugin (~> 0.10.4) | ||
git (~> 1.2.6) | ||
guard-livereload (~> 2.1.2) | ||
haml (~> 4.0.5) | ||
listen (~> 2.7.1) | ||
mime-types (~> 2.1) | ||
nokogiri (~> 1.5.10) | ||
rack (~> 1.5.2) | ||
rest-client (~> 1.6.7) | ||
ruby-s3cmd (~> 0.1.5) | ||
tilt (~> 2.0.1) | ||
zurb-foundation (~> 4.3.2) | ||
bootstrap-sass (3.1.1.1) | ||
sass (~> 3.2) | ||
celluloid (0.15.2) | ||
timers (~> 1.1.0) | ||
celluloid-io (0.15.0) | ||
celluloid (>= 0.15.0) | ||
nio4r (>= 0.5.0) | ||
chunky_png (1.3.1) | ||
coderay (1.1.0) | ||
coffee-script (2.2.0) | ||
coffee-script-source | ||
execjs | ||
coffee-script-source (1.7.0) | ||
colorize (0.7.2) | ||
compass (0.12.6) | ||
chunky_png (~> 1.2) | ||
fssm (>= 0.2.7) | ||
sass (~> 3.2.19) | ||
compass-960-plugin (0.10.4) | ||
compass (>= 0.10.0) | ||
em-websocket (0.5.1) | ||
eventmachine (>= 0.12.9) | ||
http_parser.rb (~> 0.6.0) | ||
eventmachine (1.0.3-java) | ||
execjs (2.0.2) | ||
ffi (1.9.3-java) | ||
formatador (0.2.4) | ||
fssm (0.2.10) | ||
git (1.2.6) | ||
guard (2.6.1) | ||
formatador (>= 0.2.4) | ||
listen (~> 2.7) | ||
lumberjack (~> 1.0) | ||
pry (>= 0.9.12) | ||
thor (>= 0.18.1) | ||
guard-livereload (2.1.2) | ||
em-websocket (~> 0.5) | ||
guard (~> 2.0) | ||
multi_json (~> 1.8) | ||
haml (4.0.5) | ||
tilt | ||
htmlcompressor (0.1.1) | ||
http_parser.rb (0.6.0-java) | ||
json (1.8.1-java) | ||
kramdown (1.3.3) | ||
listen (2.7.4) | ||
celluloid (>= 0.15.2) | ||
celluloid-io (>= 0.15.0) | ||
rb-fsevent (>= 0.9.3) | ||
rb-inotify (>= 0.9) | ||
lumberjack (1.0.5) | ||
method_source (0.8.2) | ||
mime-types (2.2) | ||
multi_json (1.10.0) | ||
nio4r (1.0.0-java) | ||
nokogiri (1.5.11-java) | ||
pry (0.9.12.6-java) | ||
coderay (~> 1.0) | ||
method_source (~> 0.8) | ||
slop (~> 3.4) | ||
spoon (~> 0.0) | ||
rack (1.5.2) | ||
rb-fsevent (0.9.4) | ||
rb-inotify (0.9.4) | ||
ffi (>= 0.5.0) | ||
rest-client (1.6.7) | ||
mime-types (>= 1.16) | ||
ruby-s3cmd (0.1.5) | ||
sass (3.2.19) | ||
slop (3.5.0) | ||
spoon (0.0.4) | ||
ffi | ||
thor (0.19.1) | ||
tilt (2.0.1) | ||
timers (1.1.0) | ||
uglifier (2.5.0) | ||
execjs (>= 0.3.0) | ||
json (>= 1.8.0) | ||
webrick (1.3.1) | ||
zurb-foundation (4.3.2) | ||
sass (>= 3.2.0) | ||
|
||
PLATFORMS | ||
java | ||
|
||
DEPENDENCIES | ||
asciidoctor (>= 0.1.1) | ||
awestruct (~> 0.5.3) | ||
coffee-script (>= 2.2.0) | ||
htmlcompressor (>= 0.0.3) | ||
kramdown (>= 0.14.2) | ||
uglifier (>= 1.3.0) | ||
webrick (~> 1.3.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>es.tena.vodafone</groupId> | ||
<artifactId>facturasXML</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<name>Process Bill</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.hibernate.javax.persistence</groupId> | ||
<artifactId>hibernate-jpa-2.0-api</artifactId> | ||
<version>1.0.0.Final</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<!--dependency> | ||
<groupId>com.sun.xml.bind</groupId> | ||
<artifactId>jaxb-impl</artifactId> | ||
<version>2.2.4-1</version> | ||
<version>2.2-promoted-b65</version> | ||
<version>2.2.10-b140310.1920</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.sun.xml.bind</groupId> | ||
<artifactId>jaxb-core</artifactId> | ||
<version>2.2.8-b01</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.sun.xml.bind</groupId> | ||
<artifactId>jaxb-impl</artifactId> | ||
<version>2.2.8-b01</version> | ||
<scope>compile</scope> | ||
</dependency--> | ||
<dependency> | ||
<groupId>org.glassfish.jaxb</groupId> | ||
<artifactId>jaxb-runtime</artifactId> | ||
<version>2.2.11-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jvnet.hyperjaxb3</groupId> | ||
<artifactId>hyperjaxb3-ejb-runtime</artifactId> | ||
<version>0.5.6</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
|
||
<!-- Test dependencies --> | ||
<!--dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.8.1</version> | ||
</dependency--> | ||
|
||
<!-- Roundtrip --> | ||
<dependency> | ||
<groupId>org.jvnet.hyperjaxb3</groupId> | ||
<artifactId>hyperjaxb3-ejb-roundtrip</artifactId> | ||
<version>0.5.6</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
|
||
<!-- Hibernate Dependencies --> | ||
<dependency> | ||
<groupId>org.hibernate</groupId> | ||
<artifactId>hibernate-entitymanager</artifactId> | ||
<version>3.6.5.Final</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<!-- Database --> | ||
<dependency> | ||
<groupId>hsqldb</groupId> | ||
<artifactId>hsqldb</artifactId> | ||
<version>1.8.0.7</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<!--dependency> | ||
<groupId>mysql</groupId> | ||
<artifactId>mysql-connector-java</artifactId> | ||
<version>5.1.30</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>net.sourceforge.jtds</groupId> | ||
<artifactId>jtds</artifactId> | ||
<version>1.3.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.microsoft.sqlserver</groupId> | ||
<artifactId>sqljdbc4</artifactId> | ||
<version>4.0</version> | ||
</dependency--> | ||
</dependencies> | ||
<repositories> | ||
<repository> | ||
<id>maven2-repository.jboss.com</id> | ||
<url>http://repository.jboss.com/maven2</url> | ||
</repository> | ||
</repositories> | ||
<build> | ||
<defaultGoal>install</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jvnet.hyperjaxb3</groupId> | ||
<artifactId>maven-hyperjaxb3-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
<configuration> | ||
<variant>jpa2</variant> | ||
<!-- allows superclass to be defined for the classes generated from xsd: --> | ||
<extension>true</extension> | ||
<removeOldOutput>true</removeOldOutput> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<extension>true</extension> | ||
<roundtripTestClassName>FacturaTest</roundtripTestClassName> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<inherited>true</inherited> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.5</source> | ||
<target>1.5</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Empty file.
33 changes: 33 additions & 0 deletions
33
xml/java/facturasVodafone/src/main/java/es/tena/vodafone/facturas/GenSchema.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package es.tena.vodafone.facturas; | ||
|
||
import es.tena.vodafone.factura.INVOICEType; | ||
import java.io.IOException; | ||
import javax.xml.bind.JAXBContext; | ||
import javax.xml.bind.SchemaOutputResolver; | ||
import javax.xml.transform.Result; | ||
import javax.xml.transform.stream.StreamResult; | ||
|
||
|
||
/** | ||
* Generates database schema | ||
* @author Francisco Tena <francisco.tena@gmail.com> | ||
*/ | ||
public class GenSchema { | ||
|
||
public static void main(String[] args) throws Exception { | ||
JAXBContext jc = JAXBContext.newInstance(INVOICEType.class); | ||
|
||
jc.generateSchema(new SchemaOutputResolver() { | ||
|
||
@Override | ||
public Result createOutput(String namespaceURI, String suggestedFileName) | ||
throws IOException { | ||
StreamResult result = new StreamResult(System.out); | ||
result.setSystemId(suggestedFileName); | ||
return result; | ||
} | ||
|
||
}); | ||
} | ||
|
||
} |
Oops, something went wrong.