ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vjapa...@apache.org
Subject svn commit: r1551254 [16/26] - in /ctakes/branches/ytex: ctakes-ytex-res/ ctakes-ytex-res/.settings/ ctakes-ytex-res/src/ ctakes-ytex-res/src/main/ ctakes-ytex-res/src/main/resources/ ctakes-ytex-res/src/main/resources/org/ ctakes-ytex-res/src/main/res...
Date Mon, 16 Dec 2013 16:30:40 GMT
Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/umls/v_snomed_fword_lookup.xml
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/umls/v_snomed_fword_lookup.xml?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/umls/v_snomed_fword_lookup.xml (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/umls/v_snomed_fword_lookup.xml Mon Dec 16 16:30:30 2013
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<load xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://jdl-prj.googlecode.com/files/xdl.xsd">
+	<csv table="@db.schema@.v_snomed_fword_lookup" commit="10000" delimiter="&#009;">
+		<column name="cui" />
+		<column name="tui" />
+		<column name="fword" />
+		<column name="fstem" />
+		<column name="tok_str" />
+		<column name="stem_str" />
+	</csv>
+</load>

Added: ctakes/branches/ytex/ctakes-ytex/src/assemble/dist.xml
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/assemble/dist.xml?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/assemble/dist.xml (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/assemble/dist.xml Mon Dec 16 16:30:30 2013
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly
+	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd">
+	<id>dist</id>
+	<formats>
+		<format>dir</format>
+	</formats>
+	<includeBaseDirectory>false</includeBaseDirectory>
+	<dependencySets>
+		<dependencySet>
+			<outputFileNameMapping>${build.finalName}.${artifact.extension}</outputFileNameMapping>
+			<includes>
+				<include>${project.groupId}:${project.artifactId}</include>
+			</includes>
+		</dependencySet>
+		<dependencySet>
+			<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+			<!-- <outputDirectory>lib</outputDirectory> -->
+			<excludes>
+				<exclude>${project.groupId}:${artifactId}</exclude>
+			</excludes>
+		</dependencySet>
+	</dependencySets>
+</assembly>

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/META-INF/MANIFEST.MF?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/META-INF/MANIFEST.MF (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/META-INF/MANIFEST.MF Mon Dec 16 16:30:30 2013
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/App.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/App.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/App.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/App.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,13 @@
+package org.apache.ctakes.jdl;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/AppJdl.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/AppJdl.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/AppJdl.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/AppJdl.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,100 @@
+package org.apache.ctakes.jdl;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.net.URL;
+import java.sql.SQLException;
+
+import javax.xml.bind.JAXBException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ctakes.jdl.data.base.JdlConnection;
+import org.apache.ctakes.jdl.data.loader.CsvLoader;
+import org.apache.ctakes.jdl.data.loader.XmlLoader;
+import org.apache.ctakes.jdl.data.xml.DomUtil;
+import org.apache.ctakes.jdl.data.xml.SchemaUtil;
+import org.apache.ctakes.jdl.data.xml.Validation;
+import org.apache.ctakes.jdl.data.xml.jaxb.ObjectFactoryUtil;
+import org.apache.ctakes.jdl.schema.xdl.CsvLoadType;
+import org.apache.ctakes.jdl.schema.xdl.JdbcType;
+import org.apache.ctakes.jdl.schema.xdl.LoadType;
+import org.apache.ctakes.jdl.schema.xdl.XmlLoadType;
+
+/**
+ * Java data loader Application.
+ * 
+ * @author mas
+ */
+public class AppJdl {
+	private static final Log log = LogFactory.getLog(AppJdl.class);
+	private String srcConn;
+	private String srcData;
+	private String srcLoad;
+	public static final URL XSD = AppJdl.class
+			.getResource("/org/apache/ctakes/jdl/xdl.xsd");
+
+	/**
+	 * @param srcConn
+	 *            the conn file
+	 * @param srcData
+	 *            the data file
+	 * @param srcLoad
+	 *            the load file
+	 */
+	public AppJdl(String srcConn, String srcData, String srcLoad) {
+		this.srcConn = srcConn;
+		this.srcData = srcData;
+		this.srcLoad = srcLoad;
+	}
+
+	/**
+	 * Execute the loader of the data into the database.
+	 */
+	public void execute() {
+		Validation validation = new Validation(SchemaUtil.urlToSchema(XSD),
+				srcConn);
+		if (validation.succeed()) {
+			validation.setDocument(srcLoad);
+			if (validation.succeed()) {
+				JdlConnection jdlConnection = null;
+				try {
+					JdbcType jdbc = ObjectFactoryUtil
+							.getJdbcTypeBySrcXml(srcConn);
+					LoadType load = ObjectFactoryUtil
+							.getLoadTypeBySrcXml(srcLoad);
+					jdlConnection = new JdlConnection(jdbc);
+					CsvLoadType csv = load.getCsv();
+					if (csv != null) {
+						try {
+							CsvLoader csvLoader = new CsvLoader(csv, new File(
+									srcData));
+							csvLoader.dataInsert(jdlConnection);
+						} catch (FileNotFoundException e) {
+							throw new RuntimeException(e);
+						}
+					}
+					XmlLoadType xml = load.getXml();
+					if (xml != null) {
+						XmlLoader xPathParsing = new XmlLoader(xml,
+								DomUtil.srcToDocument(srcData));
+						xPathParsing.dataInsert(jdlConnection);
+					}
+				} catch (JAXBException e) {
+					e.printStackTrace();
+				} finally {
+					try {
+						if (jdlConnection != null)
+							jdlConnection.closeConnection();
+					} catch (SQLException e) {
+						log.error("closing connection", e);
+					}
+				}
+			} else {
+				System.err.println(validation.getError());
+			}
+		} else {
+			System.err.println(validation.getError());
+		}
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/AppMain.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/AppMain.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/AppMain.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/AppMain.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,75 @@
+package org.apache.ctakes.jdl;
+
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
+
+/**
+ * Java data loader Main.
+ * 
+ * @author mas
+ */
+public final class AppMain {
+	private static final String OPT_XDL_CONN_LONG = "conn";
+	private static final String OPT_XDL_DATA_LONG = "data";
+	private static final String OPT_XDL_LOAD_LONG = "load";
+	private static final String OPT_XDL_CONN_DESCR = "conn file";
+	private static final String OPT_XDL_DATA_DESCR = "data file";
+	private static final String OPT_XDL_LOAD_DESCR = "load file";
+	public static final String OPT_XDL_CONN = "c";
+	public static final String OPT_XDL_DATA = "d";
+	public static final String OPT_XDL_LOAD = "l";
+
+	private AppMain() {
+	}
+
+	/**
+	 * @return the options of the commandLine
+	 */
+	public static Options getOprions() {
+		Option optXdlConn = new Option(OPT_XDL_CONN, OPT_XDL_CONN_LONG, true, OPT_XDL_CONN_DESCR);
+		optXdlConn.setRequired(true);
+		Option optXdlData = new Option(OPT_XDL_DATA, OPT_XDL_DATA_LONG, true, OPT_XDL_DATA_DESCR);
+		optXdlData.setRequired(true);
+		Options options = new Options();
+		options.addOption(optXdlConn);
+		options.addOption(optXdlData);
+		options.addOption(OPT_XDL_LOAD, OPT_XDL_LOAD_LONG, true, OPT_XDL_LOAD_DESCR);
+		return options;
+	}
+
+	/**
+	 * @param arguments
+	 *            the arguments to parse
+	 * @return the commandLine
+	 * @throws ParseException
+	 *             exception
+	 */
+	public static CommandLine parsingCLI(String[] arguments) throws ParseException {
+		Options options = getOprions();
+		PosixParser posix = new PosixParser();
+		return posix.parse(options, arguments);
+	}
+
+	/**
+	 * @param args
+	 *            input string
+	 */
+	public static void main(String[] args) {
+		String cmdLineSyntax = "java [-options] -jar jarfile";
+		String header = "Java Data Loader";
+		try {
+			CommandLine cl = parsingCLI(args);
+			String srcConn = cl.getOptionValue(OPT_XDL_CONN);
+			String srcData = cl.getOptionValue(OPT_XDL_DATA);
+			String srcLoad = cl.getOptionValue(OPT_XDL_LOAD);
+			new AppJdl(srcConn, srcData, srcLoad).execute();
+		} catch (ParseException e) {
+			new HelpFormatter().printHelp(cmdLineSyntax, header, getOprions(), null, true);
+		}
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/FileUtil.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/FileUtil.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/FileUtil.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/FileUtil.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,79 @@
+package org.apache.ctakes.jdl.common;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.lang.SystemUtils;
+
+/**
+ * Utility to get a file.
+ * 
+ * @author mas
+ */
+public final class FileUtil {
+	private FileUtil() {
+	}
+
+	/**
+	 * @return the javaClassPaths
+	 */
+	public static String[] getJavaClassPaths() {
+		return SystemUtils.JAVA_CLASS_PATH.split(SystemUtils.PATH_SEPARATOR);
+	}
+
+	/**
+	 * @param fileName
+	 *            the name of the file
+	 * @return the file if exist in one of all the javaClassPaths otherwise null
+	 */
+	public static File getFile(final String fileName) {
+		File file = new File(fileName);
+		if (file.exists()) {
+			return file;
+		}
+		for (String token : getJavaClassPaths()) {
+			file = new File(token + SystemUtils.FILE_SEPARATOR + fileName);
+			if (file.exists()) {
+				return file;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * @param file
+	 *            the file to get
+	 * @param defaultString
+	 *            the defaultString to return if the file is null
+	 * @return the canonical pathname string
+	 */
+	public static String getCanonical(File file, String defaultString) {
+		try {
+			return (file == null) ? defaultString : file.getCanonicalPath();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return defaultString;
+	}
+
+	/**
+	 * @param file
+	 *            the file to get
+	 * @return the canonical pathname string or USER_DIR if the file is null
+	 */
+	public static String getCanonical(File file) {
+		return getCanonical(file, SystemUtils.USER_DIR);
+	}
+
+	/**
+	 * @param filePath
+	 *            the filePath of the file
+	 * @param fileName
+	 *            the fileName of the file
+	 * @return the canonical pathname string
+	 */
+	public static String fullPath(File filePath, String fileName) {
+		return getCanonical(filePath) + SystemUtils.FILE_SEPARATOR + fileName;
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/PropFile.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/PropFile.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/PropFile.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/PropFile.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,54 @@
+package org.apache.ctakes.jdl.common;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * Access to a properties file.
+ * 
+ * @author mas
+ */
+public class PropFile {
+	/**
+	 * @param srcFile
+	 *            the srcFile to load
+	 * @param internal
+	 *            where get the file
+	 * @return the properties
+	 */
+	public static final Properties getProperties(final String srcFile, final boolean internal) {
+		Properties properties = new Properties();
+		try {
+			if (internal) {
+				properties.load(PropFile.class.getResourceAsStream(srcFile));
+			} else {
+				properties.load(new FileInputStream(srcFile));
+			}
+			return properties;
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (NullPointerException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * @param properties
+	 *            the properties to set
+	 * @param property
+	 *            the property to get
+	 * @return the property
+	 */
+	public static final String getProperty(final Properties properties, final String property) {
+		try {
+			return properties.getProperty(property).trim();
+		} catch (NullPointerException e) {
+			// TODO Auto-generated catch block
+			return null;
+		}
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/PropertiesFile.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/PropertiesFile.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/PropertiesFile.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/PropertiesFile.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,67 @@
+package org.apache.ctakes.jdl.common;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * Access to a properties file.
+ * 
+ * @author mas
+ */
+public class PropertiesFile {
+	private Properties properties;
+
+	/**
+	 * External.
+	 * 
+	 * @param srcFile
+	 *            the srcFile to load
+	 * @throws IOException
+	 *             exception
+	 */
+	public final void loadInputStream(final String srcFile) throws IOException {
+		properties = new Properties();
+		properties.load(new FileInputStream(srcFile));
+	}
+
+	/**
+	 * Internal.
+	 * 
+	 * @param srcFile
+	 *            the srcFile to load
+	 * @throws IOException
+	 *             exception
+	 */
+	public final void loadResourceAsStream(final String srcFile) throws IOException {
+		properties = new Properties();
+		properties.load(PropertiesFile.class.getResourceAsStream(srcFile));
+	}
+
+	/**
+	 * @param properties
+	 *            the properties to set
+	 */
+	public final void setProperties(final Properties properties) {
+		this.properties = properties;
+	}
+
+	/**
+	 * @param property
+	 *            the property to get
+	 * @return the property
+	 */
+	public final String getProperty(final String property) {
+		if (properties != null) {
+			return properties.getProperty(property);
+		}
+		return null;
+	}
+
+	/**
+	 * Clears this hashtable.
+	 */
+	public final void clear() {
+		this.properties.clear();
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/Singleton.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/Singleton.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/Singleton.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/Singleton.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,23 @@
+package org.apache.ctakes.jdl.common;
+
+/**
+ * Singleton example.
+ * 
+ * @author mas
+ */
+public final class Singleton {
+	private static Singleton istance;
+
+	private Singleton() {
+	}
+
+	/**
+	 * @return the instance
+	 */
+	public static Singleton getIstance() {
+		if (istance == null) {
+			istance = new Singleton();
+		}
+		return istance;
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/package-info.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/package-info.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/package-info.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/common/package-info.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,5 @@
+/**
+ * Common utility.
+ */
+package org.apache.ctakes.jdl.common;
+

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/base/JdlConnection.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/base/JdlConnection.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/base/JdlConnection.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/base/JdlConnection.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,138 @@
+package org.apache.ctakes.jdl.data.base;
+
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.ctakes.jdl.schema.xdl.JdbcType;
+
+/**
+ * Connection with db.
+ * 
+ * @author mas
+ */
+public class JdlConnection {
+	private String driver;
+	private String url;
+	private String user;
+	private String password;
+	private Connection connection;
+
+	/**
+	 * @param jdbc
+	 *            the jdbc
+	 */
+	public JdlConnection(final JdbcType jdbc) {
+		driver = StringUtils.defaultIfEmpty(jdbc.getDriver(), driver);
+		url = StringUtils.defaultIfEmpty(jdbc.getUrl(), url);
+		user = StringUtils.defaultIfEmpty(jdbc.getUsername(), user);
+		password = StringUtils.defaultIfEmpty(jdbc.getPassword(), password);
+	}
+
+	/**
+	 * @return the connected
+	 * @throws SQLException
+	 *             exception
+	 */
+	public final boolean isConnected() throws SQLException {
+		return (connection != null && !connection.isClosed());
+	}
+
+	/**
+	 * Attempts to establish a connection.
+	 * 
+	 * @throws InstantiationException
+	 *             exception
+	 * @throws IllegalAccessException
+	 *             exception
+	 * @throws ClassNotFoundException
+	 *             exception
+	 * @throws SQLException
+	 *             exception
+	 */
+	private void openConnection() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
+		// Class.forName(driver);
+		DriverManager.registerDriver((Driver) Class.forName(driver).newInstance());
+		connection = DriverManager.getConnection(url, user, password);
+	}
+
+	/**
+	 * @return the openConnection
+	 * @throws InstantiationException
+	 *             exception
+	 * @throws IllegalAccessException
+	 *             exception
+	 * @throws ClassNotFoundException
+	 *             exception
+	 * @throws SQLException
+	 *             exception
+	 */
+	public final Connection getOpenConnection() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
+		if (!isConnected()) {
+			openConnection();
+		}
+		return connection;
+	}
+
+	/**
+	 * Makes all changes made since the previous commit/rollback permanent and
+	 * releases any database locks currently held by this Connection object.
+	 * 
+	 * @throws SQLException
+	 *             exception
+	 */
+	public final void commitConnection() throws SQLException {
+		if (isConnected() && !connection.getAutoCommit()) {
+			connection.commit();
+		}
+	}
+
+	/**
+	 * Undoes all changes made in the current transaction and releases any
+	 * database locks currently held by this Connection object.
+	 * 
+	 * @throws SQLException
+	 *             exception
+	 */
+	public final void rollbackConnection() throws SQLException {
+		if (isConnected() && !connection.getAutoCommit()) {
+			connection.rollback();
+		}
+	}
+
+	/**
+	 * Releases this Connection object's database.
+	 * 
+	 * @throws SQLException
+	 *             exception
+	 */
+	public final void closeConnection() throws SQLException {
+		if (isConnected()) {
+			connection.close();
+		}
+	}
+
+	/**
+	 * @return the autoCommit
+	 * @throws SQLException
+	 *             exception
+	 */
+	public final boolean isAutoCommit() throws SQLException {
+		return (isConnected()) ? connection.getAutoCommit() : false;
+	}
+
+	/**
+	 * @param autoCommit
+	 *            the autoCommit to set
+	 * @throws SQLException
+	 *             exception
+	 */
+	public final void setAutoCommit(final boolean autoCommit) throws SQLException {
+		if (isConnected()) {
+			connection.setAutoCommit(autoCommit);
+		}
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/base/package-info.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/base/package-info.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/base/package-info.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/base/package-info.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,5 @@
+/**
+ * Database.
+ */
+package org.apache.ctakes.jdl.data.base;
+

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/CsvLoader.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/CsvLoader.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/CsvLoader.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/CsvLoader.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,240 @@
+package org.apache.ctakes.jdl.data.loader;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.lang.reflect.Constructor;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.text.Format;
+import java.util.HashMap;
+import java.util.Map;
+
+
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.csv.CSVStrategy;
+import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.lang.CharUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ctakes.jdl.data.base.JdlConnection;
+import org.apache.ctakes.jdl.schema.xdl.CsvLoadType;
+import org.apache.ctakes.jdl.schema.xdl.CsvLoadType.Column;
+
+/**
+ * Loader of CSV file.
+ * 
+ * @author mas
+ */
+public class CsvLoader extends Loader {
+	private CSVParser parser;
+	private CsvLoadType loader;
+	/**
+	 * copied from CSVStrategy
+	 */
+	static final char DISABLED = '\ufffe';
+
+	static final Log log = LogFactory.getLog(CsvLoader.class);
+	private Map<String, Format> formatMap;
+
+	/**
+	 * @param loader
+	 *            the loader
+	 * @param file
+	 *            the file
+	 * @throws FileNotFoundException
+	 *             exception
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public CsvLoader(final CsvLoadType loader, final File file)
+			throws FileNotFoundException {
+		InputStream inputStrem = new FileInputStream(file);
+		Reader reader = new InputStreamReader(inputStrem);
+		CSVStrategy strategy = CSVStrategy.DEFAULT_STRATEGY;
+		strategy.setDelimiter(CharUtils.toChar(loader.getDelimiter()));
+		if (loader.getEncapsulator() == null
+				|| loader.getEncapsulator().length() == 0)
+			strategy.setEncapsulator(DISABLED);
+		else
+			strategy.setEncapsulator(CharUtils.toChar(loader.getEncapsulator()));
+		parser = new CSVParser(reader, strategy);
+		this.loader = loader;
+		formatMap = new HashMap<String, Format>();
+		try {
+			for (Column col : loader.getColumn()) {
+				if (col.getFormat() != null && col.getFormat().length() > 0) {
+					Class cf = Class.forName(col.getFormat());
+					Constructor ccf = cf.getConstructor(String.class);
+					this.formatMap.put(col.getName(),
+							(Format) ccf.newInstance(col.getPattern()));
+				}
+			}
+		} catch (Exception e) {
+			throw new RuntimeException("oops", e);
+		}
+
+	}
+
+	/**
+	 * @param loader
+	 *            the loader to manage
+	 * @return the sql string
+	 */
+	public final String getSqlInsert(final CsvLoadType loader) {
+		String query = "insert into " + loader.getTable() + " (";
+		String values = ") values (";
+		for (Column column : loader.getColumn()) {
+			if (BooleanUtils.isNotTrue(column.isSkip())) {
+				query += column.getName() + ",";
+				values += "?,";
+			}
+		}
+		return StringUtils.removeEnd(query, ",")
+				+ StringUtils.removeEnd(values, ",") + ")";
+	}
+
+	/**
+	 * @param jdlConnection
+	 *            the jdlConnection to manage
+	 */
+	@Override
+	public final void dataInsert(final JdlConnection jdlConnection) {
+		String sql = getSqlInsert(loader);
+		if(log.isInfoEnabled())
+			log.info(sql);
+		Number ncommit = loader.getCommit();
+		int rs = (loader.getSkip() == null) ? 0 : loader.getSkip().intValue();
+		PreparedStatement preparedStatement = null;
+		try {
+			jdlConnection.setAutoCommit(false);
+			// String[][] values = parser.getAllValues();
+			preparedStatement = jdlConnection.getOpenConnection()
+					.prepareStatement(sql);
+			boolean leftoversToCommit = false;
+			// for (int r = rs; r < values.length; r++) {
+			String[] row = null;
+			int r = 0;
+			do {
+				row = parser.getLine();
+				if (row == null)
+					break;
+				if (r < rs) {
+					r++;
+					continue;
+				}
+				r++;
+				try {
+					int cs = 0; // columns to skip
+					int ce = 0; // columns from external
+					int c = 0;
+					// PreparedStatement preparedStatement = jdlConnection
+					// .getOpenConnection().prepareStatement(sql);
+					// if (ncommit == null) {
+					// jdlConnection.setAutoCommit(true);
+					// } else {
+					// jdlConnection.setAutoCommit(false);
+					// }
+					for (Column column : loader.getColumn()) {
+						if (BooleanUtils.isTrue(column.isSkip())) {
+							cs++;
+						} else {
+							c++;
+							Object value = column.getConstant();
+							ce++;
+							if (value == null) {
+								if (column.getSeq() != null) {
+									value = r + column.getSeq().intValue();
+								} else {
+									// value = values[r][c + cs - ce];
+									value = row[c + cs - ce];
+									ce--;
+								}
+							}
+							if (value == null
+									|| (value instanceof String && ((String) value)
+											.length() == 0))
+								preparedStatement.setObject(c, null);
+							else {
+								// if there is a formatter, parse the string
+								if (this.formatMap
+										.containsKey(column.getName())) {
+									try {
+										preparedStatement
+												.setObject(
+														c,
+														this.formatMap
+																.get(column
+																		.getName())
+																.parseObject(
+																		(String) value));
+									} catch (Exception e) {
+										System.err.println("Could not format '"
+												+ value + "' for column "
+												+ column.getName()
+												+ " on line " + r);
+										e.printStackTrace(System.err);
+										throw new RuntimeException(e);
+									}
+								} else {
+									preparedStatement.setObject(c, value);
+								}
+							}
+						}
+					}
+					preparedStatement.addBatch();
+					leftoversToCommit = true;
+					// preparedStatement.executeBatch();
+					// executeBatch(preparedStatement);
+					// if (!jdlConnection.isAutoCommit()
+					// && (r % ncommit.intValue() == 0)) {
+					if (r % ncommit.intValue() == 0) {
+						preparedStatement.executeBatch();
+						jdlConnection.commitConnection();
+						leftoversToCommit = false;
+						log.info("inserted " + ncommit.intValue() + " rows");
+					}
+				} catch (SQLException e) {
+					// e.printStackTrace();
+					throw new RuntimeException(e);
+				}
+			} while (row != null);
+			if (leftoversToCommit) {
+				preparedStatement.executeBatch();
+				jdlConnection.commitConnection();
+				leftoversToCommit = false;
+			}
+			log.info("inserted " + (r - rs) + " rows total");
+		} catch (InstantiationException e) {
+			log.error("", e);
+		} catch (IllegalAccessException e) {
+			log.error("", e);
+		} catch (ClassNotFoundException e) {
+			log.error("", e);
+		} catch (IOException e) {
+			log.error("", e);
+		} catch (SQLException e) {
+			throw new RuntimeException(e);
+		} finally {
+			if (preparedStatement != null) {
+				try {
+					preparedStatement.close();
+				} catch (Exception e) {
+				}
+			}
+		}
+		// try {
+		// if (!jdlConnection.isAutoCommit()) {
+		// jdlConnection.commitConnection();
+		// }
+		// jdlConnection.closeConnection();
+		// } catch (SQLException e) {
+		// // TODO Auto-generated catch block
+		// e.printStackTrace();
+		// }
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/Loader.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/Loader.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/Loader.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/Loader.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,36 @@
+package org.apache.ctakes.jdl.data.loader;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+import org.apache.ctakes.jdl.data.base.JdlConnection;
+
+
+/**
+ * Abstract Loader.
+ * 
+ * @author mas
+ */
+public abstract class Loader {
+	/**
+	 * @param preparedStatement
+	 *            the PreparedStatement to execute
+	 */
+	public static void executeBatch(final PreparedStatement preparedStatement) {
+		try {
+			preparedStatement.addBatch();
+			preparedStatement.executeBatch();
+		} catch (SQLException e) {
+			// TODO Auto-generated catch block
+			//vng change - fail on error
+			//			e.printStackTrace();
+			throw new RuntimeException(e);
+		}
+	}
+
+	/**
+	 * @param jdlConnection
+	 *            the jdlConnection to manage
+	 */
+	public abstract void dataInsert(JdlConnection jdlConnection);
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/XmlLoader.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/XmlLoader.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/XmlLoader.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/XmlLoader.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,119 @@
+package org.apache.ctakes.jdl.data.loader;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.Iterator;
+
+
+import org.apache.commons.jxpath.JXPathContext;
+import org.apache.commons.jxpath.ri.model.NodePointer;
+import org.apache.commons.lang.StringUtils;
+import org.apache.ctakes.jdl.data.base.JdlConnection;
+import org.apache.ctakes.jdl.data.xml.DomUtil;
+import org.apache.ctakes.jdl.schema.xdl.XmlLoadType;
+import org.apache.ctakes.jdl.schema.xdl.XmlLoadType.Column;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * Loader of XML file.
+ * 
+ * @author mas
+ */
+public class XmlLoader extends Loader {
+	private JXPathContext context;
+	private XmlLoadType loader;
+
+	/**
+	 * @param loader
+	 *            the loader
+	 * @param document
+	 *            the document
+	 */
+	public XmlLoader(final XmlLoadType loader, final Document document) {
+		context = JXPathContext.newContext(document);
+		this.loader = loader;
+	}
+
+	/**
+	 * @param loader
+	 *            the xml to manage
+	 * @return the sql string
+	 */
+	public final String getSqlInsert(final XmlLoadType loader) {
+		String query = "insert into " + loader.getTable() + " (";
+		String values = ") values (";
+		for (Column column : loader.getColumn()) {
+			query += column.getName() + ",";
+			values += "?,";
+		}
+		return StringUtils.removeEnd(query, ",") + StringUtils.removeEnd(values, ",") + ")";
+	}
+
+	/**
+	 * @param jdlConnection
+	 *            the jdlConnection to manage
+	 */
+	@Override
+	public final void dataInsert(final JdlConnection jdlConnection) {
+		String sql = getSqlInsert(loader);
+		Number ncommit = loader.getCommit();
+		int r = 0;
+		try {
+			Iterator<?> iterator = context.iteratePointers(loader.getXroot());
+			while (iterator.hasNext()) {
+				r++;
+				NodePointer pointer = (NodePointer) iterator.next();
+				Node node = (Node) pointer.getNode();
+				JXPathContext context = JXPathContext.newContext(DomUtil.nodeToDocument(node));
+				try {
+					int c = 0;
+					PreparedStatement preparedStatement = jdlConnection.getOpenConnection().prepareStatement(sql);
+					if (ncommit == null) {
+						jdlConnection.setAutoCommit(true);
+					} else {
+						jdlConnection.setAutoCommit(false);
+					}
+					for (Column column : loader.getColumn()) {
+						c++;
+						Object value = column.getConstant();
+						if (value == null) {
+							if (column.getSeq() != null) {
+								value = r + column.getSeq().intValue();
+							} else if (column.getXpath() != null) {
+								value = this.context.getValue(column.getXpath());
+							} else {
+								value = context.getPointer(column.getXleaf()).getValue();
+							}
+						}
+						preparedStatement.setObject(c, value);
+					}
+					executeBatch(preparedStatement);
+					if (!jdlConnection.isAutoCommit() && (r % ncommit.intValue() == 0)) {
+						jdlConnection.commitConnection();
+					}
+				} catch (SQLException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+		} catch (InstantiationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IllegalAccessException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (ClassNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		try {
+			if (!jdlConnection.isAutoCommit()) {
+				jdlConnection.commitConnection();
+			}
+		} catch (SQLException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/package-info.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/package-info.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/package-info.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/loader/package-info.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,5 @@
+/**
+ * Loader of data.
+ */
+package org.apache.ctakes.jdl.data.loader;
+

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/DomParser.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/DomParser.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/DomParser.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/DomParser.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,74 @@
+package org.apache.ctakes.jdl.data.xml;
+
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+/**
+ * To parse DOM.
+ * 
+ * @author mas
+ */
+public class DomParser {
+	private String srcXml;
+	private Document dom;
+
+	/**
+	 * @param srcXml
+	 *            the srcXml
+	 */
+	public DomParser(final String srcXml) {
+		setSrcXml(srcXml);
+	}
+
+	/**
+	 * DOM parser.
+	 */
+	private final void parse() {
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		factory.setNamespaceAware(true);
+		// factory.setValidating(true);
+		try {
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			dom = builder.parse(srcXml);
+		} catch (ParserConfigurationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (SAXException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * @return the srcXml
+	 */
+	public final String getSrcXml() {
+		return srcXml;
+	}
+
+	/**
+	 * @param srcXml
+	 *            the srcXml to set
+	 */
+	public final void setSrcXml(final String srcXml) {
+		this.srcXml = srcXml;
+		parse();
+	}
+
+	/**
+	 * @return the root
+	 */
+	public final Element getRoot() {
+		return dom.getDocumentElement();
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/DomUtil.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/DomUtil.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/DomUtil.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/DomUtil.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,136 @@
+package org.apache.ctakes.jdl.data.xml;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Utility to manage DOM.
+ * 
+ * @author mas
+ */
+public final class DomUtil {
+	private DomUtil() {
+	}
+
+	/**
+	 * @return the emptyDocument
+	 * @throws ParserConfigurationException
+	 *             exception
+	 */
+	public static Document getEmptyDocument() throws ParserConfigurationException {
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		factory.setNamespaceAware(true);
+		// factory.setValidating(true);
+		DocumentBuilder builder = factory.newDocumentBuilder();
+		return builder.newDocument();
+	}
+
+	/**
+	 * @param node
+	 *            the node to convert
+	 * @return the document
+	 */
+	public static Document nodeToDocument(final Node node) {
+		try {
+			Document document = getEmptyDocument();
+			document.appendChild(document.importNode(node, true));
+			return document;
+		} catch (ParserConfigurationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * @param strXml
+	 *            the strXml to convert
+	 * @return the documnet
+	 */
+	public static Document strToDocument(final String strXml) {
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		factory.setNamespaceAware(true);
+		// factory.setValidating(true);
+		try {
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			return builder.parse(new InputSource(new StringReader(strXml)));
+		} catch (SAXException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (ParserConfigurationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * @param srcXml
+	 *            the srcXml to convert
+	 * @return the document
+	 */
+	public static Document srcToDocument(final String srcXml) {
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		factory.setNamespaceAware(true);
+		// factory.setValidating(true);
+		try {
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			// return builder.parse(new InputSource(srcXml));
+			return builder.parse(srcXml);
+		} catch (ParserConfigurationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (SAXException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * @param node
+	 *            the node to convert
+	 * @return the node
+	 */
+	public static String nodeToStr(final Node node) {
+		final String YES = "yes";
+		StringWriter sw = new StringWriter();
+		try {
+			Transformer transformer = TransformerFactory.newInstance().newTransformer();
+			transformer.setOutputProperty(OutputKeys.INDENT, YES);
+			transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, YES);
+			transformer.transform(new DOMSource(node), new StreamResult(sw));
+			return sw.toString();
+		} catch (TransformerFactoryConfigurationError e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (TransformerException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/SaxParser.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/SaxParser.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/SaxParser.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/SaxParser.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,132 @@
+package org.apache.ctakes.jdl.data.xml;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * To parse SAX.
+ * 
+ * @author mas
+ */
+public class SaxParser extends DefaultHandler {
+	private String srcXml;
+
+	/**
+	 * @param srcXml
+	 *            the srcXml
+	 */
+	public SaxParser(final String srcXml) {
+		setSrcXml(srcXml);
+	}
+
+	/**
+	 * SAX Parser.
+	 */
+	public final void parse() {
+		SAXParserFactory factory = SAXParserFactory.newInstance();
+		factory.setNamespaceAware(true);
+		factory.setValidating(true);
+		SAXParser parser;
+		try {
+			parser = factory.newSAXParser();
+			parser.parse(srcXml, this);
+		} catch (ParserConfigurationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (SAXException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * @return the srcXml
+	 */
+	public final String getSrcXml() {
+		return srcXml;
+	}
+
+	/**
+	 * @param srcXml
+	 *            the srcXml to set
+	 */
+	public final void setSrcXml(final String srcXml) {
+		this.srcXml = srcXml;
+		parse();
+	}
+
+	/**
+	 * @throws ParserConfigurationException
+	 *             exception
+	 * @throws SAXException
+	 *             exception
+	 * @throws MalformedURLException
+	 *             exception
+	 */
+	public final void parse(String srcXsd) throws ParserConfigurationException, SAXException, MalformedURLException {
+		SAXParserFactory saxfactory = SAXParserFactory.newInstance();
+		saxfactory.setNamespaceAware(true);
+		// saxfactory.setValidating(true);
+
+		SAXParser parser = saxfactory.newSAXParser();
+		XMLReader reader = parser.getXMLReader();
+
+		reader.setFeature(NAMESPACES_FEATURE_ID, false);
+		reader.setFeature(NAMESPACE_PREFIXES_FEATURE_ID, false);
+		reader.setFeature(VALIDATION_FEATURE_ID, true);
+		reader.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true);
+		reader.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, false);
+		reader.setFeature(DYNAMIC_VALIDATION_FEATURE_ID, false);
+		// reader.setContentHandler(handler);
+		// reader.setErrorHandler(handler);
+		reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", new File(srcXsd).toURI().toURL().toString());
+		// reader.parse(inp);
+	}
+
+	/** Namespaces feature id (http://xml.org/sax/features/namespaces). */
+	protected static final String NAMESPACES_FEATURE_ID = "http://xml.org/sax/features/namespaces";
+
+	/**
+	 * Namespace prefixes feature id
+	 * (http://xml.org/sax/features/namespace-prefixes).
+	 */
+	protected static final String NAMESPACE_PREFIXES_FEATURE_ID = "http://xml.org/sax/features/namespace-prefixes";
+
+	/** Validation feature id (http://xml.org/sax/features/validation). */
+	protected static final String VALIDATION_FEATURE_ID = "http://xml.org/sax/features/validation";
+
+	/**
+	 * Schema validation feature id
+	 * (http://apache.org/xml/features/validation/schema).
+	 */
+	protected static final String SCHEMA_VALIDATION_FEATURE_ID = "http://apache.org/xml/features/validation/schema";
+
+	/**
+	 * Schema full checking feature id
+	 * (http://apache.org/xml/features/valid...full-checking).
+	 */
+	protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking";
+
+	/**
+	 * Dynamic validation feature id
+	 * (http://apache.org/xml/features/validation/dynamic).
+	 */
+	protected static final String DYNAMIC_VALIDATION_FEATURE_ID = "http://apache.org/xml/features/validation/dynamic";
+
+	/**
+	 * Schema nons location id.
+	 */
+	protected static final String SCHEMA_NONS_LOCATION_ID = "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation";
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/SchemaUtil.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/SchemaUtil.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/SchemaUtil.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/SchemaUtil.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,70 @@
+package org.apache.ctakes.jdl.data.xml;
+
+import java.io.File;
+import java.io.StringReader;
+import java.net.URL;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.xml.sax.SAXException;
+
+/**
+ * Utility to manage Schema.
+ * 
+ * @author mas
+ */
+public final class SchemaUtil {
+	private SchemaUtil() {
+	}
+
+	/**
+	 * @param srcXsd
+	 *            the srcXsd to convert
+	 * @return the schema
+	 */
+	public static Schema srcToSchema(final String srcXsd) {
+		SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+		try {
+			return factory.newSchema(new File(srcXsd));
+		} catch (SAXException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * @param url
+	 *            the url to convert
+	 * @return the schema
+	 */
+	public static Schema urlToSchema(final URL url) {
+		SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+		try {
+			return factory.newSchema(url);
+		} catch (SAXException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * @param strXsd
+	 *            the strXsd to convert
+	 * @return the schema
+	 */
+	public static Schema strToSchema(final String strXsd) {
+		SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+		try {
+			return factory.newSchema(new StreamSource(new StringReader(strXsd)));
+		} catch (SAXException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/Validation.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/Validation.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/Validation.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/Validation.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,145 @@
+package org.apache.ctakes.jdl.data.xml;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.Validator;
+
+
+import org.apache.ctakes.jdl.common.FileUtil;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Validation between Schema and XML.
+ * 
+ * @author mas
+ */
+public class Validation {
+	private Document document;
+	private String srcXml;
+	private Validator validator;
+	private String error;
+
+	/**
+	 * @param schema
+	 *            the schema
+	 */
+	public Validation(final Schema schema) {
+		setSchema(schema);
+	}
+
+	/**
+	 * @param srcXsd
+	 *            the srcXsd
+	 */
+	public Validation(final String srcXsd) {
+		setSchema(srcXsd);
+	}
+
+	/**
+	 * @param schema
+	 *            the schema
+	 * @param document
+	 *            the document
+	 */
+	public Validation(final Schema schema, final Document document) {
+		setSchema(schema);
+		setDocument(document);
+	}
+
+	/**
+	 * @param schema
+	 *            the schema
+	 * @param srcXml
+	 *            the srcXsd
+	 */
+	public Validation(final Schema schema, final String srcXml) {
+		setSchema(schema);
+		setDocument(srcXml);
+	}
+
+	/**
+	 * @param schema
+	 *            the schema to set
+	 */
+	public final void setSchema(final Schema schema) {
+		validator = schema.newValidator();
+		error = null;
+	}
+
+	/**
+	 * @param srcXsd
+	 *            the srcXsd to set
+	 */
+	public final void setSchema(final String srcXsd) {
+		setSchema(SchemaUtil.srcToSchema(srcXsd));
+	}
+
+	/**
+	 * @param document
+	 *            the document to set
+	 */
+	public final void setDocument(final Document document) {
+		this.document = document;
+		error = null;
+		srcXml = null;
+	}
+
+	/**
+	 * @param srcXml
+	 *            the srcXml to set
+	 */
+	public final void setDocument(final String srcXml) {
+		DomUtil.srcToDocument(FileUtil.getFile(srcXml).toString());
+		this.srcXml = srcXml;
+		error = null;
+		document = null;
+	}
+
+	/**
+	 * @return the error
+	 */
+	public final String getError() {
+		return error;
+	}
+
+	private boolean succeed(final Source source) {
+		try {
+			validator.validate(source);
+			error = null;
+			return true;
+		} catch (SAXException e) {
+			error = e.getMessage();
+		} catch (IOException e) {
+			error = e.getMessage();
+		}
+		return false;
+	}
+
+	private boolean domSucceed() {
+		return succeed(new DOMSource(document));
+	}
+
+	private boolean saxSucceed() {
+		try {
+			return succeed(new SAXSource(new InputSource(new FileInputStream(srcXml))));
+		} catch (FileNotFoundException e) {
+			error = e.getMessage();
+		}
+		return false;
+	}
+
+	/**
+	 * @return result of validation
+	 */
+	public final boolean succeed() {
+		return (document == null) ? saxSucceed() : domSucceed();
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/ObjectFactoryBind.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/ObjectFactoryBind.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/ObjectFactoryBind.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/ObjectFactoryBind.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,58 @@
+package org.apache.ctakes.jdl.data.xml.jaxb;
+
+import java.io.File;
+import java.io.StringReader;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.ctakes.jdl.schema.xdl.ObjectFactory;
+
+
+/**
+ * Bind JAXB factory.
+ * 
+ * @author mas
+ */
+public class ObjectFactoryBind {
+	private Unmarshaller unmarshaller;
+
+	/**
+	 * @throws JAXBException
+	 *             exception
+	 */
+	public ObjectFactoryBind() throws JAXBException {
+		unmarshaller = JAXBContext.newInstance(ObjectFactory.class.getPackage().getName()).createUnmarshaller();
+	}
+
+	/**
+	 * @param srcXml
+	 *            the srcXml to unmarshal
+	 * @return the object unmarshalled
+	 * @throws JAXBException
+	 *             exception
+	 */
+	public final Object unmarshalSrcXml(final String srcXml) throws JAXBException {
+		try {
+			return unmarshaller.unmarshal(new File(srcXml));
+		} catch (JAXBException e) {
+			throw e;
+		}
+	}
+
+	/**
+	 * @param strXml
+	 *            the strXml to unmarshal
+	 * @return the object unmarshalled
+	 * @throws JAXBException
+	 *             exception
+	 */
+	public final Object unmarshalStrXml(final String strXml) throws JAXBException {
+		try {
+			return unmarshaller.unmarshal(new StringReader(strXml));
+		} catch (JAXBException e) {
+			throw e;
+		}
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/ObjectFactoryUtil.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/ObjectFactoryUtil.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/ObjectFactoryUtil.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/ObjectFactoryUtil.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,103 @@
+package org.apache.ctakes.jdl.data.xml.jaxb;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+
+import org.apache.ctakes.jdl.schema.xdl.ConnType;
+import org.apache.ctakes.jdl.schema.xdl.JdbcType;
+import org.apache.ctakes.jdl.schema.xdl.LoadType;
+
+
+/**
+ * Utility to mange JAXB factory.
+ * 
+ * @author mas
+ */
+public final class ObjectFactoryUtil {
+	private static ObjectFactoryBind objectFactoryMapping;
+
+	private ObjectFactoryUtil() {
+	}
+
+	private static ObjectFactoryBind getObjectFactoryMapping() throws JAXBException {
+		return (objectFactoryMapping == null) ? new ObjectFactoryBind() : objectFactoryMapping;
+	}
+
+	private static Object getJAXBElement(final Object obj) {
+		return (obj == null) ? obj : ((JAXBElement<?>) obj).getValue();
+	}
+
+	private static Object getJAXBElementBySrcXml(final String srcXml) throws JAXBException {
+		return getJAXBElement(getObjectFactoryMapping().unmarshalSrcXml(srcXml));
+	}
+
+	private static Object getJAXBElementByStrXml(final String strXml) throws JAXBException {
+		return getJAXBElement(getObjectFactoryMapping().unmarshalStrXml(strXml));
+	}
+
+	/**
+	 * @param srcXml
+	 *            the srcXml to manage
+	 * @return the jdbcType
+	 * @throws JAXBException
+	 *             exception
+	 */
+	public static JdbcType getJdbcTypeBySrcXml(final String srcXml) throws JAXBException {
+		return getConnTypeBySrcXml(srcXml).getJdbc();
+	}
+
+	/**
+	 * @param strXml
+	 *            the strXml to manage
+	 * @return the jdbcType
+	 * @throws JAXBException
+	 *             exception
+	 */
+	public static JdbcType getJdbcTypeByStrXml(final String strXml) throws JAXBException {
+		return getConnTypeByStrXml(strXml).getJdbc();
+	}
+
+	/**
+	 * @param srcXml
+	 *            the srcXml to manage
+	 * @return the connType
+	 * @throws JAXBException
+	 *             exception
+	 */
+	public static ConnType getConnTypeBySrcXml(final String srcXml) throws JAXBException {
+		return (ConnType) getJAXBElementBySrcXml(srcXml);
+	}
+
+	/**
+	 * @param strXml
+	 *            the strXml to manage
+	 * @return the connType
+	 * @throws JAXBException
+	 *             exception
+	 */
+	public static ConnType getConnTypeByStrXml(final String strXml) throws JAXBException {
+		return (ConnType) getJAXBElementByStrXml(strXml);
+	}
+
+	/**
+	 * @param srcXml
+	 *            the srcXml to manage
+	 * @return the loadType
+	 * @throws JAXBException
+	 *             exception
+	 */
+	public static LoadType getLoadTypeBySrcXml(final String srcXml) throws JAXBException {
+		return (LoadType) getJAXBElementBySrcXml(srcXml);
+	}
+
+	/**
+	 * @param strXml
+	 *            the strXml to manage
+	 * @return the loadType
+	 * @throws JAXBException
+	 *             exception
+	 */
+	public static LoadType getLoadTypeByStrXml(final String strXml) throws JAXBException {
+		return (LoadType) getJAXBElementByStrXml(strXml);
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/package-info.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/package-info.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/package-info.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/jaxb/package-info.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,5 @@
+/**
+ * JAXB utility.
+ */
+package org.apache.ctakes.jdl.data.xml.jaxb;
+

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/package-info.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/package-info.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/package-info.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/data/xml/package-info.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,5 @@
+/**
+ * XML data.
+ */
+package org.apache.ctakes.jdl.data.xml;
+

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/package-info.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/package-info.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/package-info.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/jdl/package-info.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,10 @@
+/**
+ * Copied from https://code.google.com/p/jdl-prj/ 
+ * Following modifications:
+ * <li> fixed batch insert
+ * <li> support specification of tab as delimiter
+ * <li> disable text encapsulators by defalt in CsvLoader
+ * <li> change package names
+ */
+package org.apache.ctakes.jdl;
+

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/KernelLauncher.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/KernelLauncher.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/KernelLauncher.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/KernelLauncher.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,210 @@
+package org.apache.ctakes.ytex;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.GnuParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.cli.OptionGroup;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.ctakes.ytex.kernel.tree.InstanceTreeBuilder;
+import org.apache.ctakes.ytex.kernel.tree.TreeMappingInfo;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.access.ContextSingletonBeanFactoryLocator;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+
+public class KernelLauncher {
+	private static Options initOptions() {
+		Option oStoreInstanceMap = OptionBuilder
+				.withArgName("instanceMap.obj")
+				.hasArg()
+				.withDescription(
+						"store the instanceMap.  Use prior to running the kernel evaluations in parallel.")
+				.create("storeInstanceMap");
+		Option oEvaluateKernel = OptionBuilder
+				.withDescription(
+						"evaluate kernel specified in application context on the instances. If instanceMap is specified, load instance from file system, else from db.")
+				.create("evalKernel");
+		Option exportBagOfWords = OptionBuilder
+				.withDescription(
+						"exportBagOfWords.  Must specify property file")
+				.hasArg().create("exportBagOfWords");
+		Option exportType = OptionBuilder
+				.withDescription("exportType.  either libsvm or weka").hasArg()
+				.create("exportType");
+		Option oLoadInstanceMap = OptionBuilder
+				.withArgName("instanceMap.obj")
+				.hasArg()
+				.withDescription(
+						"load instanceMap from file system instead of from db.  Use after storing instance map.")
+				.create("loadInstanceMap");
+		Option oEvalMod = OptionBuilder
+				.withDescription(
+						"for parallelization, split the instances into mod slices")
+				.hasArg().create("mod");
+		Option oEvalSlice = OptionBuilder
+				.withDescription(
+						"for parallelization, parameter that determines which slice we work on.  If this is not specified, nMod threads will be started to evaluate all slices in parallel.")
+				.hasArg().create("slice");
+		Option oBeanref = OptionBuilder
+				.withArgName("classpath*:simSvcBeanRefContext.xml")
+				.hasArg()
+				.withDescription(
+						"use specified beanRefContext.xml, default classpath*:simSvcBeanRefContext.xml")
+				.create("beanref");
+		Option oAppctx = OptionBuilder
+				.withArgName("kernelApplicationContext")
+				.hasArg()
+				.withDescription(
+						"use specified applicationContext, default kernelApplicationContext")
+				.create("appctx");
+		Option oBeans = OptionBuilder
+				.withArgName("beans-corpus.xml")
+				.hasArg()
+				.withDescription(
+						"use specified beans.xml, no default.  This file is typically required.")
+				.create("beans");
+
+		Option oHelp = new Option("help", "print this message");
+		Options options = new Options();
+		OptionGroup og = new OptionGroup();
+		og.addOption(oStoreInstanceMap);
+		og.addOption(oEvaluateKernel);
+		og.addOption(exportBagOfWords);
+		options.addOptionGroup(og);
+		// options.addOption(oStoreInstanceMap);
+		options.addOption(oEvaluateKernel);
+		// options.addOption(exportBagOfWords);
+		options.addOption(exportType);
+		options.addOption(oLoadInstanceMap);
+		options.addOption(oEvalMod);
+		options.addOption(oEvalSlice);
+		options.addOption(oBeanref);
+		options.addOption(oAppctx);
+		options.addOption(oBeans);
+		options.addOption(oHelp);
+
+		return options;
+	}
+
+	private static void printHelp(Options options) {
+		HelpFormatter formatter = new HelpFormatter();
+		formatter
+				.printHelp(
+						"java org.apache.ctakes.ytex.kernel.evaluator.CorpusKernelEvaluatorImpl\n Main Options: -storeInstanceMap or -evalKernel",
+						options);
+	}
+
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) throws Exception {
+		Options options = initOptions();
+
+		if (args.length == 0) {
+			printHelp(options);
+		} else {
+			CommandLineParser parser = new GnuParser();
+			try {
+				// parse the command line arguments
+				CommandLine line = parser.parse(options, args);
+				String storeInstanceMap = line
+						.getOptionValue("storeInstanceMap");
+				boolean evalKernel = line.hasOption("evalKernel");
+				String exportBagOfWords = line
+						.getOptionValue("exportBagOfWords");
+				if (!evalKernel && storeInstanceMap == null
+						&& exportBagOfWords == null) {
+					System.out
+							.println("specify either -evalKernel, -storeInstanceMap, or -exportBagOfWords");
+					printHelp(options);
+				} else {
+
+					// parse the command line arguments
+					// by default use the kernelBeanRefContext
+					// when evaluating kernel, by default use the
+					// simSvcBeanRefContext.xml
+					// don't want to load that for other tasks as the simSvc
+					// loads the UMLS object graph which needs lots of memory
+					String beanRefContext = line.getOptionValue("beanref",
+							evalKernel ? "classpath*:org/apache/ctakes/ytex/simSvcBeanRefContext.xml"
+									: "classpath*:org/apache/ctakes/ytex/kernelBeanRefContext.xml");
+					String contextName = line.getOptionValue("appctx",
+							"kernelApplicationContext");
+					String beans = line.getOptionValue("beans");
+					ApplicationContext appCtx = (ApplicationContext) ContextSingletonBeanFactoryLocator
+							.getInstance(beanRefContext)
+							.useBeanFactory(contextName).getFactory();
+					ApplicationContext appCtxSource = appCtx;
+					if (beans != null) {
+						appCtxSource = new FileSystemXmlApplicationContext(
+								new String[] { beans }, appCtx);
+					}
+					if (storeInstanceMap != null) {
+						storeInstanceMap(appCtxSource, storeInstanceMap, line);
+//					} else if (evalKernel) {
+//						evalKernel(appCtxSource, line);
+//					} else if (exportBagOfWords != null) {
+//						exportBagOfWords(appCtxSource, exportBagOfWords, line);
+					}
+				}
+			} catch (ParseException e) {
+				printHelp(options);
+				throw e;
+			}
+		}
+	}
+
+//	private static void exportBagOfWords(ApplicationContext appCtxSource,
+//			String exportBagOfWords, CommandLine line) throws IOException {
+//		String beanName = "wekaBagOfWordsExporter";
+//		if ("libsvm".equals(line.getOptionValue("exportType"))) {
+//			beanName = "libsvmBagOfWordsExporter";
+//		}
+//		BagOfWordsExporter exporter = (BagOfWordsExporter) appCtxSource
+//				.getBean(beanName);
+//		exporter.exportBagOfWords(exportBagOfWords);
+//	}
+
+//	private static void evalKernel(ApplicationContext appCtxSource,
+//			CommandLine line) throws Exception {
+//		InstanceTreeBuilder builder = appCtxSource.getBean(
+//				"instanceTreeBuilder", InstanceTreeBuilder.class);
+//		CorpusKernelEvaluator corpusEvaluator = appCtxSource.getBean(
+//				"corpusKernelEvaluator", CorpusKernelEvaluator.class);
+//		String loadInstanceMap = line.getOptionValue("loadInstanceMap");
+//		String strMod = line.getOptionValue("mod");
+//		String strSlice = line.getOptionValue("slice");
+//		int nMod = strMod != null ? Integer.parseInt(strMod) : 0;
+//		Integer nSlice = null;
+//		if (nMod == 0) {
+//			nSlice = 0;
+//		} else if (strSlice != null) {
+//			nSlice = Integer.parseInt(strSlice);
+//		}
+//		Map<Integer, Node> instanceMap = null;
+//		if (loadInstanceMap != null) {
+//			instanceMap = builder.loadInstanceTrees(loadInstanceMap);
+//		} else {
+//			instanceMap = builder.loadInstanceTrees(appCtxSource.getBean(
+//					"treeMappingInfo", TreeMappingInfo.class));
+//		}
+//		if (nSlice != null) {
+//			corpusEvaluator.evaluateKernelOnCorpus(instanceMap, nMod, nSlice, false);
+//		} else {
+//			corpusEvaluator.evaluateKernelOnCorpus(instanceMap, nMod, false);
+//		}
+//	}
+
+	private static void storeInstanceMap(ApplicationContext appCtxSource,
+			String storeInstanceMap, CommandLine line) throws Exception {
+		InstanceTreeBuilder builder = appCtxSource.getBean(
+				"instanceTreeBuilder", InstanceTreeBuilder.class);
+		builder.serializeInstanceTrees(
+				appCtxSource.getBean("treeMappingInfo", TreeMappingInfo.class),
+				storeInstanceMap);
+	}
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/R/RGramMatrixExporter.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/R/RGramMatrixExporter.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/R/RGramMatrixExporter.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/R/RGramMatrixExporter.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,10 @@
+package org.apache.ctakes.ytex.R;
+
+import java.io.IOException;
+import java.util.Properties;
+
+public interface RGramMatrixExporter {
+
+	public abstract void exportGramMatrix(Properties props) throws IOException;
+
+}
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/R/RGramMatrixExporterImpl.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/R/RGramMatrixExporterImpl.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/R/RGramMatrixExporterImpl.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/R/RGramMatrixExporterImpl.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,330 @@
+package org.apache.ctakes.ytex.R;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.SortedSet;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.GnuParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ctakes.ytex.kernel.FileUtil;
+import org.apache.ctakes.ytex.kernel.InstanceData;
+import org.apache.ctakes.ytex.kernel.KernelContextHolder;
+import org.apache.ctakes.ytex.kernel.KernelUtil;
+import org.apache.ctakes.ytex.kernel.dao.KernelEvaluationDao;
+import org.apache.ctakes.ytex.sparsematrix.InstanceDataExporter;
+
+
+public class RGramMatrixExporterImpl implements RGramMatrixExporter {
+	private static final Log log = LogFactory.getLog(RGramMatrixExporter.class);
+
+	@SuppressWarnings("static-access")
+	public static void main(String args[]) throws IOException {
+		Options options = new Options();
+		options.addOption(OptionBuilder
+				.withArgName("prop")
+				.hasArg()
+				.isRequired()
+				.withDescription(
+						"property file with queries and other kernel parameters")
+				.create("prop"));
+		try {
+			CommandLineParser parser = new GnuParser();
+			CommandLine line = parser.parse(options, args);
+			RGramMatrixExporter exporter = (RGramMatrixExporter) KernelContextHolder
+					.getApplicationContext().getBean(RGramMatrixExporter.class);
+			exporter.exportGramMatrix(FileUtil.loadProperties(
+					line.getOptionValue("prop"), true));
+		} catch (ParseException pe) {
+			HelpFormatter formatter = new HelpFormatter();
+			formatter.printHelp("java " + RGramMatrixExporterImpl.class.getName()
+					+ " export gram matrix for use in R/Matlab", options);
+		}
+	}
+
+	private InstanceDataExporter instanceDataExporter;
+	private KernelEvaluationDao kernelEvaluationDao;
+
+	private KernelUtil kernelUtil;
+
+	private void exportGramMatrices(String name, String experiment,
+			double param1, String param2, String splitName, String scope,
+			String outdir, InstanceData instanceData) throws IOException {
+		if (scope == null || scope.length() == 0) {
+			exportGramMatrix(name, experiment, param1, param2, splitName,
+					outdir, instanceData, null, 0, 0);
+		} else {
+			for (String label : instanceData.getLabelToInstanceMap().keySet()) {
+				if ("label".equals(scope)) {
+					exportGramMatrix(name, experiment, param1, param2,
+							splitName, outdir, instanceData, label, 0, 0);
+				} else if ("fold".equals(scope)) {
+					for (int run : instanceData.getLabelToInstanceMap()
+							.get(label).keySet()) {
+						for (int fold : instanceData.getLabelToInstanceMap()
+								.get(label).get(run).keySet()) {
+							exportGramMatrix(name, experiment, param1, param2,
+									splitName, outdir, instanceData, label,
+									run, fold);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	private void exportGramMatrix(String name, String experiment,
+			double param1, String param2, String splitName, String outdir,
+			InstanceData instanceData, String label, int run, int fold)
+			throws IOException {
+		SortedSet<Long> instanceIds = instanceData.getAllInstanceIds(label,
+				run, fold);
+		String filePrefix = FileUtil.getDataFilePrefix(outdir, label, run,
+				fold, null);
+		double[][] gramMatrix = kernelUtil.loadGramMatrix(instanceIds, name,
+				splitName, experiment, label, run, fold, param1, param2);
+		if (gramMatrix != null)
+			outputGramMatrix(gramMatrix, instanceIds, filePrefix);
+	}
+
+	// private KernelEvaluation getKernelEval(String name, String splitName,
+	// String experiment, String label, int run, int fold, double param1,
+	// String param2) {
+	// int foldId = 0;
+	// if (run != 0 && fold != 0) {
+	// CrossValidationFold f = this.classifierEvaluationDao
+	// .getCrossValidationFold(name, splitName, label, run, fold);
+	// if (f != null)
+	// foldId = f.getCrossValidationFoldId();
+	// }
+	// KernelEvaluation kEval = this.kernelEvaluationDao.getKernelEval(name,
+	// experiment, label, foldId, param1, param2);
+	// if (kEval == null) {
+	// log.warn("could not find kernelEvaluation.  name=" + name
+	// + ", experiment=" + experiment + ", label=" + label
+	// + ", fold=" + fold + ", run=" + run);
+	// }
+	// return kEval;
+	// }
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.ctakes.ytex.R.RGramMatrixExporter#exportGramMatrix(java.util.Properties)
+	 */
+	@Override
+	public void exportGramMatrix(Properties props) throws IOException {
+		String name = props.getProperty("org.apache.ctakes.ytex.corpusName");
+		String splitName = props.getProperty("org.apache.ctakes.ytex.splitName");
+		String experiment = props.getProperty("org.apache.ctakes.ytex.experiment");
+		String param2 = props.getProperty("org.apache.ctakes.ytex.param2");
+		double param1 = Double.parseDouble(props
+				.getProperty("org.apache.ctakes.ytex.param1", "0"));
+		String scope = props.getProperty("scope");
+		String outdir = props.getProperty("outdir");
+		InstanceData instanceData = this.getKernelUtil().loadInstances(
+				props.getProperty("instanceClassQuery"));
+		exportGramMatrices(name, experiment, param1, param2, splitName, scope,
+				outdir, instanceData);
+		instanceDataExporter.outputInstanceData(instanceData,
+				FileUtil.addFilenameToDir(outdir, "instance.txt"));
+	}
+
+	//
+	// private void exportGramMatrix(String name, String experiment,
+	// double param1, String param2, String outdir,
+	// InstanceData instanceData, String label, int foldId)
+	// throws IOException {
+	// SortedSet<Integer> instanceIds = getAllInstanceIdsForLabel(
+	// instanceData, label);
+	// double[][] gramMatrix = new double[instanceIds.size()][instanceIds
+	// .size()];
+	// KernelEvaluation kernelEval = this.kernelEvaluationDao.getKernelEval(
+	// name, experiment, label, 0, param1, param2);
+	// if (kernelEval != null) {
+	// kernelUtil.fillGramMatrix(kernelEval, instanceIds, gramMatrix,
+	// null, null);
+	// outputInstanceData(instanceData, label, outdir);
+	// outputGramMatrix(kernelEval, gramMatrix, instanceIds,
+	// FileUtil.getDataFilePrefix(outdir, label, 0, 0, null));
+	// } else {
+	// log.info("no kernel eval for label=" + label);
+	// }
+	//
+	// }
+
+	// /**
+	// * get all instance ids for the specified label
+	// *
+	// * @param instanceData
+	// * @param label
+	// * @return
+	// */
+	// private SortedSet<Integer> getAllInstanceIdsForLabel(
+	// InstanceData instanceData, String label) {
+	// SortedSet<Integer> instanceIds = new TreeSet<Integer>();
+	// for (int run : instanceData.getLabelToInstanceMap().get(label).keySet())
+	// {
+	// for (int fold : instanceData.getLabelToInstanceMap().get(label)
+	// .get(run).keySet()) {
+	// for (SortedMap<Integer, String> instanceLabelMap : instanceData
+	// .getLabelToInstanceMap().get(label).get(run).get(fold)
+	// .values()) {
+	// instanceIds.addAll(instanceLabelMap.keySet());
+	// }
+	// }
+	// }
+	// return instanceIds;
+	// }
+
+	public InstanceDataExporter getInstanceDataExporter() {
+		return instanceDataExporter;
+	}
+
+	public KernelEvaluationDao getKernelEvaluationDao() {
+		return kernelEvaluationDao;
+	}
+
+	public KernelUtil getKernelUtil() {
+		return kernelUtil;
+	}
+
+	private void outputGramMatrix(double[][] gramMatrix,
+			SortedSet<Long> instanceIds, String dataFilePrefix)
+			throws IOException {
+		BufferedWriter w = null;
+		BufferedWriter wId = null;
+		try {
+			w = new BufferedWriter(new FileWriter(dataFilePrefix + "data.txt"));
+			wId = new BufferedWriter(new FileWriter(dataFilePrefix
+					+ "instance_id.txt"));
+			Long instanceIdArray[] = instanceIds.toArray(new Long[] {});
+			// write instance id corresponding to row
+			for (int h = 0; h < instanceIdArray.length; h++) {
+				wId.write(Long.toString(instanceIdArray[h]));
+				wId.write("\n");
+			}
+			for (int i = 0; i < instanceIdArray.length; i++) {
+				// write line from gram matrix
+				for (int j = 0; j < instanceIdArray.length; j++) {
+					w.write(Double.toString(gramMatrix[i][j]));
+					if (j < instanceIdArray.length - 1)
+						w.write(" ");
+				}
+				w.write("\n");
+			}
+		} finally {
+			if (w != null) {
+				w.close();
+			}
+			if (wId != null) {
+				wId.close();
+			}
+		}
+	}
+
+	public void setInstanceDataExporter(
+			InstanceDataExporter instanceDataExporter) {
+		this.instanceDataExporter = instanceDataExporter;
+	}
+
+	public void setKernelEvaluationDao(KernelEvaluationDao kernelEvaluationDao) {
+		this.kernelEvaluationDao = kernelEvaluationDao;
+	}
+
+	public void setKernelUtil(KernelUtil kernelUtil) {
+		this.kernelUtil = kernelUtil;
+	}
+
+	// private void exportGramMatrices(String name, String experiment,
+	// String outdir, String instanceQuery) throws IOException {
+	// SortedMap<Integer, SortedMap<Boolean, SortedMap<Integer, Integer>>>
+	// instanceFolds = new TreeMap<Integer, SortedMap<Boolean,
+	// SortedMap<Integer, Integer>>>();
+	// SortedMap<String, SortedMap<Integer, String>> instanceLabels = new
+	// TreeMap<String, SortedMap<Integer, String>>();
+	//
+	// }
+	//
+	// private void exportLabel(String name, String experiment, String outdir) {
+	// }
+	//
+	// private static class InstanceFoldData {
+	// SortedMap<Boolean, SortedMap<Integer, Integer>> folds;
+	//
+	// public void addEntry(boolean train, int fold, int run) {
+	// SortedMap<Integer, Integer> foldToRun = folds.get(train);
+	// if (foldToRun == null) {
+	// if (fold != 0) {
+	// foldToRun = new TreeMap<Integer, Integer>();
+	// foldToRun.put(fold, run);
+	// }
+	// }
+	// folds.put(train, foldToRun);
+	// }
+	// }
+	//
+	// private void loadInstanceData(
+	// String strQuery,
+	// final SortedMap<Integer, SortedMap<Boolean, SortedMap<Integer, Integer>>>
+	// instanceFolds,
+	// final SortedMap<String, SortedMap<Integer, String>> instanceLabels) {
+	// jdbcTemplate.query(strQuery, new RowCallbackHandler() {
+	//
+	// @Override
+	// public void processRow(ResultSet rs) throws SQLException {
+	// String label = "";
+	// int run = 0;
+	// int fold = 0;
+	// Boolean train = null;
+	// int instanceId = rs.getInt(1);
+	// String className = rs.getString(2);
+	// if (rs.getMetaData().getColumnCount() >= 3)
+	// train = rs.getBoolean(3);
+	// if (rs.getMetaData().getColumnCount() >= 4)
+	// label = rs.getString(4);
+	// if (rs.getMetaData().getColumnCount() >= 5)
+	// fold = rs.getInt(5);
+	// if (rs.getMetaData().getColumnCount() >= 6)
+	// run = rs.getInt(6);
+	// // set instance className for label
+	// SortedMap<Integer, String> instClassName = instanceLabels
+	// .get(label);
+	// if (instClassName == null) {
+	// instClassName = new TreeMap<Integer, String>();
+	// instClassName.put(instanceId, labels);
+	// }
+	// labels.put(label, className);
+	// // set fold data
+	// if (train != null) {
+	// // we split into train/test - save this in the instanceFolds
+	// SortedMap<Boolean, SortedMap<Integer, Integer>> folds = instanceFolds
+	// .get(instanceId);
+	// if (folds == null) {
+	// folds = new TreeMap<Boolean, SortedMap<Integer, Integer>>();
+	// instanceFolds.put(instanceId, folds);
+	// }
+	// // we split into folds / runs
+	// SortedMap<Integer, Integer> foldToRun = folds.get(train);
+	// if (foldToRun == null) {
+	// if (fold != 0) {
+	// foldToRun = new TreeMap<Integer, Integer>();
+	// foldToRun.put(fold, run);
+	// }
+	// }
+	// // add train/test flag
+	// // foldToRun is null if we don't have any folds
+	// folds.put(train, foldToRun);
+	// }
+	// }
+	// });
+	// }
+}

Added: ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/dao/DBUtil.java
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/dao/DBUtil.java?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/dao/DBUtil.java (added)
+++ ctakes/branches/ytex/ctakes-ytex/src/main/java/org/apache/ctakes/ytex/dao/DBUtil.java Mon Dec 16 16:30:30 2013
@@ -0,0 +1,98 @@
+package org.apache.ctakes.ytex.dao;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Oracle differs from sql server & mysql in handling of empty string. In
+ * oracle, empty string is null, in other platforms, empty string is non-null.
+ * We need a stand-in for the empty string in oracle; we use the string with one
+ * blank in its place.
+ * 
+ * @author vijay
+ * 
+ */
+public class DBUtil {
+
+	private static final Log log = LogFactory.getLog(DBUtil.class);
+	private static Properties ytexProperties;
+	private static boolean oracle;
+	private static boolean mysql;
+	private static boolean mssql;
+	private static String escapeBegin;
+	private static String escapeEnd;
+
+	static {
+		InputStream ytexPropsIn = null;
+		try {
+			ytexPropsIn = DBUtil.class.getResourceAsStream("/org/apache/ctakes/ytex/ytex.properties");
+			ytexProperties = new Properties();
+			ytexProperties.load(ytexPropsIn);
+			oracle = "orcl".equals(ytexProperties.getProperty("db.type"));
+			mysql = "mysql".equals(ytexProperties.getProperty("db.type"));
+			mssql = "mssql".equals(ytexProperties.getProperty("db.type"));
+			if (mssql) {
+				escapeBegin = "[";
+				escapeEnd = "]";
+			} else if (mysql) {
+				escapeBegin = "`";
+				escapeEnd = "`";
+			} else if (oracle) {
+				escapeBegin = "";
+				escapeEnd = "";
+			}
+		} catch (Exception e) {
+			log.error("initalizer", e);
+		} finally {
+			if (ytexPropsIn != null) {
+				try {
+					ytexPropsIn.close();
+				} catch (IOException e) {
+				}
+			}
+		}
+	}
+
+	public static String getYTEXTablePrefix() {
+		if (mssql)
+			return ytexProperties.getProperty("db.schema", "dbo") + ".";
+		else
+			return "";
+	}
+
+	public static String getEmptyString() {
+		if (oracle)
+			return " ";
+		else
+			return "";
+	}
+
+	public static String getEscapeBegin() {
+		return escapeBegin;
+	}
+
+	public static String getEscapeEnd() {
+		return escapeEnd;
+	}
+
+	public static String nullToEmptyString(String param) {
+		if (param == null)
+			return getEmptyString();
+		else
+			return param;
+	}
+
+	public static String formatFieldName(String fieldName) {
+		return getEscapeBegin() + fieldName + getEscapeEnd();
+	}
+
+	public static String formatTableName(String tableName) {
+		return getEscapeBegin()
+				+ tableName.replaceAll("\\.", getEscapeEnd() + '.'
+						+ getEscapeBegin()) + getEscapeEnd();
+	}
+}



Mime
View raw message