Permalink
Browse files

Cleaned up, provided zip file for release 3 and added adequate user i…

…nformation.
  • Loading branch information...
1 parent e6f729e commit 7a79300fb04fd1c8faded468ae989422574446d6 @wardblonde wardblonde committed Jun 10, 2015
View
@@ -2,7 +2,8 @@
# of the properties after the = signs according to your needs.
# The path to the file with log4j properties for logging errors, warnings, info, etc.
-log4j-properties-file=src/main/resources/log4j.xml
+# log4j-properties-file=src/main/resources/log4j.xml
+log4j-properties-file=log4j.xml
# The property below specifies the maximum length that a clinical data entry may have.
# Longer strings will be cut off in order to assure that the length of the string does
Binary file not shown.
@@ -127,8 +127,8 @@ Maven
-----
We use [Maven](http://maven.apache.org/) as our build tool. This makes it easier to use certain tools (like Checkstyle
-and FindBugs) and to manage the third-party libraries (dependencies) we use. The pom.xml file for the trait_odm_to_i2b2
-conversion tool is stored in the root directory.
+and FindBugs) and to manage the third-party libraries (dependencies) we use. The pom.xml file that Maven needs
+is stored in the root directory: trait_odm_to_i2b2. All the maven commands need to be executed in this root directory.
Some commonly used Maven commands are
(see [Introduction to the Build Lifecycle](http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)
@@ -167,6 +167,28 @@ for an explanation of the build lifecycle and the build phases):
\# Check for CPD issues (report in target\cpd.xml):<br/>
**`mvn compile pmd:cpd-check`**
+\# Create the jar file in the trait_odm_to_i2b2\target directory
+**`mvn clean compile assembly:single`**
+
+Auto-generating the java files from the ODM-specification
+---------------------------------------------------------
+Java classes are generated for handling ODM files using the JAXB (Java Architecture for XML Binding) related xjc binding
+compiler. The source code of these ODM reader classes are created by the xjc tool with xsd files that describe the ODM
+standard as input. See for example https://jaxb.java.net/2.2.11/docs/ch04.html#tools-xjc or
+https://en.wikipedia.org/wiki/Java_Architecture_for_XML_Binding for more information on xjc and JAXB.
+
+The main schema file (ODM1-3-1.xsd) depends on several other schema files: ODM1-3-1-foundation.xsd, xml.xsd, and
+xmldsig-core-schema.xsd. The bindings file (bindings.xml) modifies the default package names that are used. The Java
+classes are put in two packages: org.cdisk.odm.jaxb (ODM1-3-1.xsd) and org.w3.xmldsig.jaxb (xmldsig-core-schema.xsd).
+
+The call to xjc looks something like this:<br/>
+**`xjc [schema file] -b [bindings file] -d [destination directory]`**
+
+For example, on the Windows platform (with xjc.bat in the jaxb-ri\bin directory at your install location) using ODM 1.3.1,
+you could generate the ODM reader classes like this:<br/>
+**`mkdir java-generated`**<br/>
+**`xjc.bat xsd\cdisc-odm-1.3.1\ODM1-3-1.xsd -b xsd\cdisc-odm-1.3.1\bindings.xml -d java-generated`**
+
Checkstyle
----------
@@ -3,19 +3,14 @@ Users information
This page is meant for users who want to install and use ODM-to-i2b2 in order to convert an ODM file to
three tabular files.
-Windows:
```sh
-$ cd C:\path\to\workspace
-$ mkdir ODM-to-i2b2
-$ cd ODM-to-i2b2
-$ mkdir input-ODMs
-$ mkdir output-tabular-files
-$ git clone https://github.com/CTMM-TraIT/trait_odm_to_i2b2.git
-$ cd trait_odm_to_i2b2
-$ git checkout tags/v3.0
-$ copy odm\examples\odm130.XML ..\input-ODMs\test.xml
-$ mvn test
-$ mvn exec:java -Dexec.mainClass="com.recomdata.i2b2.I2B2ODMStudyHandlerCMLClient" -Dexec.args="C:\path\to\workspace\ODM-to-i2b2\input-ODMs\test.xml C:\path\to\workspace\ODM-to-i2b2\output-tabular-files"
-$ cd ..\output-tabular-files
-$ dir
+Download odm-to-i2b2-3.0.zip from the [release directory](https://github.com/CTMM-TraIT/trait_odm_to_i2b2/blob/master/releases/release-3.0) and unzip it.
+Save your ODM file in odm-to-i2b2-3.0\input-ODMs (e.g. odm130.XML)
+Start the command line terminal (e.g. cmd.exe)
+$ cd C:\path\to\odm-to-i2b2-3.0
+$ java -jar odm-to-i2b2-3.0.jar input-ODMs\odm130.XML output-tabular-files
+$ cd output-tabular-files
+$ ls -l
```
+
+![Image cmd execution](https://github.com/CTMM-TraIT/trait_odm_to_i2b2/blob/master/src/documentation/cmd_execution.png)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -91,9 +91,9 @@ public static void main(String[] args) {
try {
logger.info("ODM-to-i2b2 version v3.0 (2015-05-28) started running.");
if (args.length >= 1) {
- String propertiesFilePath = "ODM-to-i2b2.properties";
+ final String propertiesFilePath = "ODM-to-i2b2.properties";
final Configuration configuration = new Configuration(propertiesFilePath);
- DOMConfigurator.configure(configuration.getLog4jPath());
+ DOMConfigurator.configure(I2B2ODMStudyHandlerCMLClient.class.getResource(configuration.getLog4jPath()));
if (EXPORT_TO_DATABASE) {
logger.info("Initializing database connection...");
File renamed without changes.
File renamed without changes.
Binary file not shown.

0 comments on commit 7a79300

Please sign in to comment.