Author: dlanglais Date: 2010-03-08 07:16:04 +0100 (Mon, 08 Mar 2010) New Revision: 195 Log: Cr?\195?\169ation d'un plugin Import/Export xml utilisant XPP3. Pour le moment seul l'import est impl?\195?\169ment?\195?\169. Added: trunk/msm-fromtoXPP3/ trunk/msm-fromtoXPP3/LICENSE.txt trunk/msm-fromtoXPP3/README.txt trunk/msm-fromtoXPP3/changelog.txt trunk/msm-fromtoXPP3/pom.xml trunk/msm-fromtoXPP3/src/ trunk/msm-fromtoXPP3/src/main/ trunk/msm-fromtoXPP3/src/main/java/ trunk/msm-fromtoXPP3/src/main/java/org/ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXMLXPP3.java trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/package-info.java trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLXPP3.java trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/ParsingState.java trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/package-info.java trunk/msm-fromtoXPP3/src/main/resources/ trunk/msm-fromtoXPP3/src/main/resources/META-INF/ trunk/msm-fromtoXPP3/src/main/resources/META-INF/services/ trunk/msm-fromtoXPP3/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Exporter trunk/msm-fromtoXPP3/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Importer trunk/msm-fromtoXPP3/src/site/ trunk/msm-fromtoXPP3/src/site/doc/ trunk/msm-fromtoXPP3/src/site/doc/xsd/ trunk/msm-fromtoXPP3/src/site/doc/xsd/example1.dtd trunk/msm-fromtoXPP3/src/site/doc/xsd/example1.xml trunk/msm-fromtoXPP3/src/site/todo.rst trunk/msm-fromtoXPP3/src/test/ trunk/msm-fromtoXPP3/src/test/java/ trunk/msm-fromtoXPP3/src/test/java/org/ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/fromto/ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/getFile.java trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLTest.java trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLXPP3Main.java trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/tofrom/ trunk/msm-fromtoXPP3/src/test/resources/ trunk/msm-fromtoXPP3/src/test/resources/fiveColumns.xml trunk/msm-fromtoXPP3/src/test/resources/fiveTables.xml trunk/msm-fromtoXPP3/src/test/resources/importTest.xml trunk/msm-fromtoXPP3/src/test/resources/sixCells.xml Modified: trunk/pom.xml Added: trunk/msm-fromtoXPP3/LICENSE.txt =================================================================== --- trunk/msm-fromtoXPP3/LICENSE.txt (rev 0) +++ trunk/msm-fromtoXPP3/LICENSE.txt 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,166 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + Added: trunk/msm-fromtoXPP3/changelog.txt =================================================================== --- trunk/msm-fromtoXPP3/changelog.txt (rev 0) +++ trunk/msm-fromtoXPP3/changelog.txt 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,2 @@ +Changelog is not any longer maintained, please refer to the release note : + http://maven-site.nuiton.org/mapstoragemanager/changes-report.html Added: trunk/msm-fromtoXPP3/pom.xml =================================================================== --- trunk/msm-fromtoXPP3/pom.xml (rev 0) +++ trunk/msm-fromtoXPP3/pom.xml 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,278 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <!-- repository containing the parent pom. --> + <repositories> + <repository> + <id>org.nuiton</id> + <url>http://maven.nuiton.org/release</url> + </repository> + </repositories> + + <modelVersion>4.0.0</modelVersion> + + <!-- ************************************************************* --> + <!-- *** POM Relationships *************************************** --> + <!-- ************************************************************* --> + <parent> + <groupId>org.nuiton</groupId> + <artifactId>mapstoragemanager</artifactId> + <version>0.1-SNAPSHOT</version> + </parent> + + <groupId>org.nuiton</groupId> + <artifactId>msm-fromtoxpp3</artifactId> + <version>0.1-SNAPSHOT</version> + + <dependencies> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>msm</artifactId> + <version>0.1-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>msm-bighashmapV2</artifactId> + <version>0.1-SNAPSHOT</version> + <type>jar</type> + </dependency> + + <!--<dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-utils</artifactId> + <version>${lutinutil.version}</version> + </dependency>--> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1.1</version> + </dependency> + + <!-- JUnit for tests --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.7</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>xpp3</groupId> + <artifactId>xpp3</artifactId> + <version>1.1.4c</version> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.6.1</version> + </dependency> + </dependencies> + + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + + <name>MSM-FromToXPP3</name> + + <description>Plugin for MapStorageManager to work with actuals HBase</description> + <inceptionYear>2010</inceptionYear> + + <developers> + <developer> + <id>tchemit</id> + <name>Tony Chemit</name> + <email>chemit@codelutin.com</email> + <organization>CodeLutin</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>fdesbois</id> + <name>Florian Desbois</name> + <email>fdesbois@codelutin.com</email> + <organization>CodeLutin</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>fgilet</id> + <name>Florent Gilet</name> + <email>florent.gilet@etu.univ-nantes.fr</email> + <organization>Université de nantes</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>gcrieloue</id> + <name>Gilles Crieloue</name> + <email>gilles.crieloue@etu.univ-nantes.fr</email> + <organization>Université de nantes</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>afages</id> + <name>Amaury Fages</name> + <email>amaury.fages@etu.univ-nantes.fr</email> + <organization>Université de nantes</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>dlanglais</id> + <name>Dorian langlais</name> + <email>dorain.langlais@etu.univ-nantes.fr</email> + <organization>Université de nantes</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + </developers> + + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> + <packaging>jar</packaging> + + <build> + + <!--<plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-deps</id> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <silent>true</silent> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots>false</overWriteSnapshots> + <overWriteIfNewer>true</overWriteIfNewer> + <outputDirectory>${project.build.directory}/lib</outputDirectory> + </configuration> + </execution> + </executions> + + </plugin> + + </plugins>--> + + <pluginManagement> + <plugins> + + <!--<plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <configuration> + <copyToMETA_INF>true</copyToMETA_INF> + </configuration> + </plugin>--> + + <!--<plugin> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <classpathPrefix>./lib/</classpathPrefix> + </manifest> + </archive> + </configuration> + </plugin>--> + + <!-- plugin site --> + <!--<plugin> + <artifactId>maven-site-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>doxia-module-jrst</artifactId> + <version>${jrst.version}</version> + </dependency> + </dependencies> + </plugin>--> + + </plugins> + </pluginManagement> + <plugins> + + <!--<plugin> + <artifactId>maven-assembly-plugin</artifactId> + <version></version> + <configuration> + <descriptorRefs> + <descriptorRef>jar-with-dependencies</descriptorRef> + </descriptorRefs> + </configuration> + <executions> + <execution> + <id>make-assembly</id> this is used for inheritance merges + <phase>package</phase> append to the packaging phase. + <goals> + <goal>attached</goal> goals == mojos + </goals> + </execution> + </executions> + </plugin>--> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + <encoding>${project.build.sourceEncoding}</encoding> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.2</version> + <configuration> + <encoding>${project.build.sourceEncoding}</encoding> + </configuration> + </plugin> + + </plugins> + </build> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +</project> + + + + + + + + + + + Added: trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXMLXPP3.java =================================================================== --- trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXMLXPP3.java (rev 0) +++ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXMLXPP3.java 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,63 @@ +package org.nuiton.mapstoragemanager.plugins.exporter; + +import org.nuiton.mapstoragemanager.plugins.importer.*; +import java.io.File; +import javax.swing.filechooser.FileFilter; +import javax.swing.filechooser.FileNameExtensionFilter; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.mapstoragemanager.plugins.BigTable; +import org.nuiton.mapstoragemanager.plugins.Exporter; +/** + * A XML Parser - using pullparsing - to import database from xml files. + * @author Dorian Langlais + */ +public class ToXMLXPP3 implements Exporter { + + /** + * Logger. + */ + private static final Log LOG = LogFactory.getLog(ToXMLXPP3.class); + + /** + * Parsing State. + */ + private ParsingState state; + /** + * Current Table, needed when create the database to know in which table + * we are to add a new column. + */ + private String currentTable; + /** + * the fileFilter. + */ + private static FileFilter fileFilter; + + /** + * Constructor. + */ + { + fileFilter = new FileNameExtensionFilter("Fichiers XML", "xml"); + } + + /** + * {@inheritDoc} + */ + public void exportTo(BigTable bigTable, File file) { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * {@inheritDoc} + */ + public FileFilter getFileFilter() { + return fileFilter; + } + + /** + * {@inheritDoc} + */ + public String getPluginName() { + return this.getClass().getSimpleName(); + } +} Added: trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/package-info.java =================================================================== --- trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/package-info.java (rev 0) +++ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/package-info.java 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,5 @@ +package org.nuiton.mapstoragemanager.plugins.exporter; +/** + * @package exporter. + * Export bigtable database in xml files. + */ Added: trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLXPP3.java =================================================================== --- trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLXPP3.java (rev 0) +++ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLXPP3.java 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,184 @@ +package org.nuiton.mapstoragemanager.plugins.importer; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import javax.swing.filechooser.FileFilter; +import javax.swing.filechooser.FileNameExtensionFilter; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.mapstoragemanager.plugins.BigTable; +import org.nuiton.mapstoragemanager.plugins.Importer; +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; +import org.xmlpull.v1.XmlPullParserFactory; + +/** + * A XML Parser - using pullparsing - to import database from xml files. + * @author Dorian Langlais + */ +public class FromXMLXPP3 implements Importer { + + /** + * Logger. + */ + private static final Log LOG = LogFactory.getLog(FromXMLXPP3.class); + + /** + * Parsing State. + */ + private ParsingState state; + /** + * Current Table, needed when create the database to know in which table + * we are to add a new column. + */ + private String currentTable; + /** + * the fileFilter. + */ + private static FileFilter fileFilter; + + /** + * Constructor. + */ + { + fileFilter = new FileNameExtensionFilter("Fichiers XML", "xml"); + } + + + /** + * {@inheritDoc} + */ + public void importFrom(BigTable bigTable, File file) { + + try { + XmlPullParserFactory factory = XmlPullParserFactory.newInstance(System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null); + //factory.setNamespaceAware(true); + factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); + XmlPullParser xpp = factory.newPullParser(); + FromXMLXPP3 app = new FromXMLXPP3(); + + /** + * Start Parsing. + */ + xpp.setInput(new FileReader(file)); + app.processDocument(bigTable, xpp); + + } catch (FileNotFoundException ex) { + LOG.fatal(ex, ex); + } catch (IOException ex) { + LOG.fatal(ex, ex); + } catch (XmlPullParserException ex) { + LOG.fatal(ex, ex); + } + } + + /** + * Process Document. + * @param bigTable the bigTable. + * @param xpp XmlPullParser. + * @throws XmlPullParserException + * @throws IOException + */ + public void processDocument(BigTable bigTable, XmlPullParser xpp) + throws XmlPullParserException, IOException { + int eventType = xpp.getEventType(); + + do { + if(eventType == XmlPullParser.START_DOCUMENT) { + System.out.println("Start document"); + state = ParsingState.START; + } else if(eventType == XmlPullParser.END_DOCUMENT) { + System.out.println("End document"); + } else if(eventType == XmlPullParser.START_TAG) { + processStartElement(bigTable, xpp); +// } else if(eventType == XmlPullParser.END_TAG) { +// processEndElement(xpp); +// } else if(eventType == XmlPullParser.TEXT) { +// processText(xpp); + } + eventType = xpp.next(); + } while (eventType != XmlPullParser.END_DOCUMENT); + } + + /** + * Process an element when we start reading it. + * @param bigTable the bigTable. + * @param xpp XmlPullParser. + */ + public void processStartElement (BigTable bigTable, XmlPullParser xpp) { + final String elementName = xpp.getName(); + final int nbAttribute = xpp.getAttributeCount(); + + final Map<String, String> attributes = new HashMap<String, String>(); + for (int i = 0 ; i < nbAttribute ; i++ ) { + attributes.put(xpp.getAttributeName(i), xpp.getAttributeValue(i)); + } + + if(elementName.equals("describe")) { + LOG.trace("Start Describe Database"); + state = ParsingState.START_DESCRIBE_DATABASE; + } else if (elementName.equals("table")) { + LOG.trace("Start Describe Table"); + state = ParsingState.START_DESCRIBE_TABLE; + } else if (elementName.equals("column")) { + LOG.trace("Start Describe Column"); + state = ParsingState.START_DESCRIBE_COLUMN; + } else if (elementName.equals("insert")) { + LOG.trace("Start Insert"); + state = ParsingState.START_INSERT_DATA; + } else if (elementName.equals("element")) { + LOG.trace("Start Insert new Element"); + state = ParsingState.INSERT_DATA; + } + + System.out.println("Start element : <" + elementName + ">"); + System.out.println("Attributes : " + attributes.toString()); + + switch (state) { + case START_DESCRIBE_TABLE : + final String tableName = attributes.get("tableName"); + LOG.info("Create Table : " + tableName); + bigTable.createTable(tableName); + currentTable = tableName; + break; + case START_DESCRIBE_COLUMN : + final String columnName = attributes.get("columnName"); + LOG.info("Create Column : " + columnName); + bigTable.createColumn(currentTable, columnName); + break; + case INSERT_DATA : +// if(attributes.keySet().contains("version")) { +// bigTable.put( +// attributes.get("table"), +// attributes.get("column"), +// attributes.get("key"), +// attributes.get("version"), +// attributes.get("value")); +// } else { + bigTable.put( + attributes.get("table"), + attributes.get("column"), + attributes.get("key"), + attributes.get("value")); +// } + } + } + + /** + * {@inheritDoc} + */ + public FileFilter getFileFilter() { + return fileFilter; + } + + /** + * {@inheritDoc} + */ + public String getPluginName() { + return this.getClass().getSimpleName(); + } +} Added: trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/ParsingState.java =================================================================== --- trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/ParsingState.java (rev 0) +++ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/ParsingState.java 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,40 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package org.nuiton.mapstoragemanager.plugins.importer; + +/** + * + * @author Dorian Langlais + */ +public enum ParsingState { + START, + START_DESCRIBE_DATABASE, + END_DESCRIBE_DATABASE, + START_DESCRIBE_TABLE, + END_DESCRIBE_TABLE, + START_DESCRIBE_COLUMN, + END_DESCRIBE_COLUMN, + START_INSERT_DATA, + END_INSERT_DATA, + INSERT_DATA, + END + +// { +// System.out.println("ParsingState : " + +// "START : " + START + +// "START_DESCRIBE_DATABASE : " + START_DESCRIBE_DATABASE + +// "END_DESCRIBE_DATABASE : " + END_DESCRIBE_DATABASE + +// "START_DESCRIBE_TABLE : " + START_DESCRIBE_TABLE + +// "END_DESCRIBE_TABLE : " + END_DESCRIBE_TABLE + +// "START_DESCRIBE_COLUMN : " + START_DESCRIBE_COLUMN + +// "END_DESCRIBE_COLUMN : " + END_DESCRIBE_COLUMN + +// "START_INSERT_DATA : " + START_INSERT_DATA + +// "END_INSERT_DATA : " + END_INSERT_DATA + +// "INSERT_DATA : " + INSERT_DATA + +// "END : " + END +// ); +// } +} Added: trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/package-info.java =================================================================== --- trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/package-info.java (rev 0) +++ trunk/msm-fromtoXPP3/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/package-info.java 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,5 @@ +package org.nuiton.mapstoragemanager.plugins.importer; +/** + * @package importer. + * Import bigtable database from xml files. + */ Added: trunk/msm-fromtoXPP3/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Exporter =================================================================== --- trunk/msm-fromtoXPP3/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Exporter (rev 0) +++ trunk/msm-fromtoXPP3/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Exporter 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1 @@ +org.nuiton.mapstoragemanager.plugins.exporter.ToXMLXPP3 \ No newline at end of file Added: trunk/msm-fromtoXPP3/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Importer =================================================================== --- trunk/msm-fromtoXPP3/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Importer (rev 0) +++ trunk/msm-fromtoXPP3/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Importer 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1 @@ +org.nuiton.mapstoragemanager.plugins.importer.FromXMLXPP3 \ No newline at end of file Added: trunk/msm-fromtoXPP3/src/site/doc/xsd/example1.dtd =================================================================== --- trunk/msm-fromtoXPP3/src/site/doc/xsd/example1.dtd (rev 0) +++ trunk/msm-fromtoXPP3/src/site/doc/xsd/example1.dtd 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,51 @@ +<?xml version='1.0' encoding='UTF-8'?> + +<!-- + TODO define vocabulary identification + PUBLIC ID: -//vendor//vocabulary//EN + SYSTEM ID: http://server/path/example1.dtd + +--> + +<!-- + An example how to use this DTD from your XML document: + + <?xml version="1.0"?> + + <!DOCTYPE database SYSTEM "example1.dtd"> + + <database> + ... + </database> +--> + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT database (describe, insert)> + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT describe (table)*> + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT table (column)*> +<!ATTLIST table + tableName CDATA #IMPLIED + > + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT column EMPTY> +<!ATTLIST column + columnName CDATA #IMPLIED + > + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT insert (element)*> + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT element EMPTY> +<!ATTLIST element + value CDATA #IMPLIED + version CDATA #IMPLIED + key CDATA #IMPLIED + column CDATA #IMPLIED + table CDATA #IMPLIED + > Added: trunk/msm-fromtoXPP3/src/site/doc/xsd/example1.xml =================================================================== --- trunk/msm-fromtoXPP3/src/site/doc/xsd/example1.xml (rev 0) +++ trunk/msm-fromtoXPP3/src/site/doc/xsd/example1.xml 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Document : export.xml + Created on : 26 février 2010, 15:10 + Author : Dorian Langlais + Description: + An example of format to export hbase content +--> + +<database> + <describe> + <table tableName="myLittleHBaseTable"> + <column columnName="myLittleFamily"/> + </table> + </describe> + + <insert> + <element table="myLittleHBaseTable" column="myLittleFamily" key="1" version="1" value="bla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="1" version="2" value="blabla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="1" version="3" value="bla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="1" version="4" value="bla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="2" version="1" value="blablablablablabla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="2" version="2" value="blabla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="3" version="1" value="bla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="4" version="1" value="bla" /> + </insert> +</database> Added: trunk/msm-fromtoXPP3/src/site/todo.rst =================================================================== --- trunk/msm-fromtoXPP3/src/site/todo.rst (rev 0) +++ trunk/msm-fromtoXPP3/src/site/todo.rst 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,6 @@ + +Function to implement in toXML +========================================= + + - exportToXml [pending] + - importFromXml [pending] \ No newline at end of file Added: trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/getFile.java =================================================================== --- trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/getFile.java (rev 0) +++ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/getFile.java 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.nuiton.mapstoragemanager.plugins; + +import java.io.File; + +/** + * + * @author Dorian Langlais + */ +public class getFile { + + private static String basedir; + + public static File getTestFile(String path) { + return new File(getBasedir(), path); + } + + public static File getTestFile(String basedir, String path) { + File basedirFile = new File(basedir); + + if (!basedirFile.isAbsolute()) { + basedirFile = getTestFile(basedir); + } + + return new File(basedirFile, path); + } + + public static String getTestPath(String path) { + return getTestFile(path).getAbsolutePath(); + } + + public static String getTestPath(String basedir, String path) { + return getTestFile(basedir, path).getAbsolutePath(); + } + + public static String getBasedir() { + if (basedir != null) { + return basedir; + } + + basedir = System.getProperty("basedir"); + + if (basedir == null) { + basedir = new File("").getAbsolutePath(); + } + + return basedir; + } +} Added: trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLTest.java =================================================================== --- trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLTest.java (rev 0) +++ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLTest.java 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,308 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.nuiton.mapstoragemanager.plugins.importer; + +import java.io.File; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import javax.swing.filechooser.FileNameExtensionFilter; +import junit.framework.Assert; +import junit.framework.TestCase; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.mapstoragemanager.plugins.Importer; +import org.nuiton.mapstoragemanager.plugins.BigTable; +import org.nuiton.mapstoragemanager.plugins.Plugin; +import org.nuiton.mapstoragemanager.plugins.bighashmapv2.BigHashMapV2; +import org.nuiton.mapstoragemanager.plugins.getFile; + +/** + * + * @author Dorian Langlais + */ +public class FromXMLTest extends TestCase { + + /** + * Logger. + */ + private static final Log LOG = LogFactory.getLog(FromXMLTest.class); + +// public void testImportFrom() { +// Assert.fail(); +// } + + /** + * Import the database from the file fiveTables. + * Verify the content. + */ + public void testImportFromFiveTables() { + + File fiveTables = + getFile.getTestFile("/src/test/resources/fiveTables.xml"); + + // import fiveTables. + Importer importer = new FromXMLXPP3(); + BigTable bigTable = new BigHashMapV2(); + + importer.importFrom(bigTable, fiveTables); + + /************************ + * Test Tables * + ************************/ + Set<String> tableNamesExpected; + { + /** + * Init tableNames. + */ + tableNamesExpected = new HashSet<String>(); + tableNamesExpected.add("table1"); + tableNamesExpected.add("table2"); + tableNamesExpected.add("table3"); + tableNamesExpected.add("table4"); + tableNamesExpected.add("table5"); + } + Set<String> tableNamesActual = bigTable.getTablesNames(); + assertEquals(tableNamesExpected, tableNamesActual); + + + for (String tableName : tableNamesActual) { + Set<String> columnNamesExpected = new HashSet<String>(); + assertEquals(columnNamesExpected, + bigTable.getColumnsNames(tableName)); + } + } + + /** + * Import the database from the file fiveColumns. + * Verify the content. + */ + public void testImportFromFiveColumns() { + + File twoTablesFiveColumns = + getFile.getTestFile("/src/test/resources/fiveColumns.xml"); + + // import fiveTables. + Importer importer = new FromXMLXPP3(); + BigTable bigTable = new BigHashMapV2(); + + importer.importFrom(bigTable, twoTablesFiveColumns); + + /************************ + * Test Tables * + ************************/ + Set<String> tableNamesExpected; + { + /** + * Init tableNames. + */ + tableNamesExpected = new HashSet<String>(); + tableNamesExpected.add("table1"); + tableNamesExpected.add("table2"); + } + Set<String> tableNamesActual = bigTable.getTablesNames(); + assertEquals(tableNamesExpected, tableNamesActual); + + /************************ + * Test Columns * + ************************/ + Map<String, Set<String>> columnNamesExpected; + { + /** + * Init columnNames. + */ + columnNamesExpected = new HashMap<String, Set<String>>(); + Set<String> table1ColumnNames = new HashSet<String>(); + table1ColumnNames.add("column1"); + table1ColumnNames.add("column2"); + Set<String> table2ColumnNames = new HashSet<String>(); + table2ColumnNames.add("column3"); + table2ColumnNames.add("column4"); + table2ColumnNames.add("column5"); + columnNamesExpected.put("table1", table1ColumnNames); + columnNamesExpected.put("table2", table2ColumnNames); + } + + Set<String> columnNamesActual; + for (String tableName : tableNamesActual) { + columnNamesActual = bigTable.getColumnsNames(tableName); + assertEquals(columnNamesExpected.get(tableName), columnNamesActual); + } + } + + /** + * Import the database from the file tenCells. + * Verify the content. + */ + public void testImportFromThreeTenCells() { + + File twoTablesFiveColumns = + getFile.getTestFile("/src/test/resources/sixCells.xml"); + + // import fiveTables. + Importer importer = new FromXMLXPP3(); + BigTable bigTable = new BigHashMapV2(); + + importer.importFrom(bigTable, twoTablesFiveColumns); + + /************************ + * Test Tables * + ************************/ + Set<String> tableNamesExpected; + { + /** + * Init tableNames. + */ + tableNamesExpected = new HashSet<String>(); + tableNamesExpected.add("table1"); + tableNamesExpected.add("table2"); + } + Set<String> tableNamesActual = bigTable.getTablesNames(); + assertEquals(tableNamesExpected, tableNamesActual); + + /************************ + * Test Columns * + ************************/ + Map<String, Set<String>> columnNamesExpected; + { + /** + * Init columnNames. + */ + columnNamesExpected = new HashMap<String, Set<String>>(); + Set<String> table1ColumnNames = new HashSet<String>(); + table1ColumnNames.add("column1"); + Set<String> table2ColumnNames = new HashSet<String>(); + table2ColumnNames.add("column2"); + table2ColumnNames.add("column3"); + columnNamesExpected.put("table1", table1ColumnNames); + columnNamesExpected.put("table2", table2ColumnNames); + } + + Set<String> columnNamesActual; + for (String tableName : tableNamesActual) { + columnNamesActual = bigTable.getColumnsNames(tableName); + assertEquals(columnNamesExpected.get(tableName), columnNamesActual); + } + + /************************ + * Test Cells * + ************************/ + Map<String, Map<String, Map<String, String>>> CellContentExpected; + { + /** + * Init cellContent. + */ + CellContentExpected = new HashMap<String, + Map<String, Map<String, String>>>(); + // table 1. + Map<String, Map<String, String>> table1 = + new HashMap<String, Map<String, String>>(); + // column 1. + Map<String,String> column1 = new HashMap<String, String>(); + column1.put("111", "111"); + table1.put("column1", column1); + // table 2. + Map<String, Map<String, String>> table2 = + new HashMap<String, Map<String, String>>(); + // column 2. + Map<String,String> column2 = new HashMap<String, String>(); + column2.put("221", "221"); + column2.put("222", "222"); + table2.put("column2", column2); + // column 3. + Map<String,String> column3 = new HashMap<String, String>(); + column3.put("231", "231"); + column3.put("232", "232"); + column3.put("233", "233"); + table2.put("column3", column3); + + CellContentExpected.put("table1", table1); + CellContentExpected.put("table2", table2); + LOG.info(CellContentExpected); + } + + Set<String> tableKeys; + String cellContentActual; + String cellContentExpected = null; + for (String tableName : tableNamesActual) { + columnNamesActual = bigTable.getColumnsNames(tableName); + tableKeys = bigTable.getKeys(tableName); + for (String columnName : columnNamesActual) { + for (String cellKey : tableKeys) { + + try { + try{ + cellContentExpected = + CellContentExpected + .get(tableName) + .get(columnName) + .get(cellKey); + } catch (NullPointerException ex) { + LOG.trace(ex); + } + + LOG.info(tableName + ' ' + + columnName + ' ' + + cellKey + ' ' + + cellContentExpected); + + cellContentActual = + bigTable.get(tableName, columnName, cellKey); + assertEquals(cellContentExpected, cellContentActual); + } catch (NoSuchElementException ex) { + if(cellContentExpected != null) { + LOG.error(ex, ex); + Assert.fail(); + } else { + LOG.trace(ex); + } + } + } + } + } + } + + /** + * Test of getPluginName(). + */ + public void testGetPluginName() { + Plugin fromXML = new FromXMLXPP3(); + String expectedPluginName = fromXML.getClass().getSimpleName(); + String actualPluginName = fromXML.getPluginName(); + LOG.info("pluginName : {expected,'" + expectedPluginName + + "'} - {actual,'" + actualPluginName + "'}"); + assertEquals(expectedPluginName, actualPluginName); + } + + /** + * Test of getFileFilter. + */ + public void testGetFileFilter(){ + + Importer fromXML = new FromXMLXPP3(); + + FileNameExtensionFilter fileFilterExpected + = new FileNameExtensionFilter("Fichiers XML", "xml"); + FileNameExtensionFilter fileFilterActual = + (FileNameExtensionFilter) fromXML.getFileFilter(); + + /** Same Description */ + assertEquals(fileFilterExpected.getDescription(), + fileFilterActual.getDescription()); + + /** get extension Set and assertEquals */ + Set<String> acceptedExtensionExpected = new HashSet<String>(); + Set<String> acceptedExtensionActual = new HashSet<String>(); + for (String extension : fileFilterExpected.getExtensions()) { + acceptedExtensionExpected.add(extension); + } + for (String extension : fileFilterActual.getExtensions()) { + acceptedExtensionActual.add(extension); + } + assertEquals(acceptedExtensionExpected, acceptedExtensionActual); + } +} Added: trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLXPP3Main.java =================================================================== --- trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLXPP3Main.java (rev 0) +++ trunk/msm-fromtoXPP3/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/FromXMLXPP3Main.java 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package org.nuiton.mapstoragemanager.plugins.importer; + +import java.io.File; +import org.nuiton.mapstoragemanager.plugins.BigTable; +import org.nuiton.mapstoragemanager.plugins.bighashmapv2.BigHashMapV2; +import org.nuiton.mapstoragemanager.plugins.getFile; + +/** + * + * @author Dorian Langlais + */ +public class FromXMLXPP3Main { + + public static void main (String args[]) { + + BigTable bigTable = new BigHashMapV2(); + + if(bigTable==null) { + System.out.println("oups"); + } else { + System.out.println("Noups"); + } + + FromXMLXPP3 myXmlPullApp = new FromXMLXPP3(); + File importTest = + getFile.getTestFile("/src/test/resources/importTest.xml"); + myXmlPullApp.importFrom(bigTable, importTest); + + } +} Added: trunk/msm-fromtoXPP3/src/test/resources/fiveColumns.xml =================================================================== --- trunk/msm-fromtoXPP3/src/test/resources/fiveColumns.xml (rev 0) +++ trunk/msm-fromtoXPP3/src/test/resources/fiveColumns.xml 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<database> + <describe> + <table tableName="table1"> + <column columnName="column1" /> + <column columnName="column2" /> + </table> + <table tableName="table2"> + <column columnName="column3" /> + <column columnName="column4" /> + <column columnName="column5" /> + </table></describe> +</database> + Added: trunk/msm-fromtoXPP3/src/test/resources/fiveTables.xml =================================================================== --- trunk/msm-fromtoXPP3/src/test/resources/fiveTables.xml (rev 0) +++ trunk/msm-fromtoXPP3/src/test/resources/fiveTables.xml 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<database> + <describe> + <table tableName="table1" /> + <table tableName="table2" /> + <table tableName="table3" /> + <table tableName="table4" /> + <table tableName="table5" /> + </describe> +</database> + Added: trunk/msm-fromtoXPP3/src/test/resources/importTest.xml =================================================================== --- trunk/msm-fromtoXPP3/src/test/resources/importTest.xml (rev 0) +++ trunk/msm-fromtoXPP3/src/test/resources/importTest.xml 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Document : export.xml + Created on : 26 février 2010, 15:10 + Author : Dorian Langlais + Description: + An example of format to export hbase content +--> + +<database> + <describe> + <table tableName="myLittleHBaseTable"> + <column columnName="myLittleFamily"/> + </table> + </describe> + + <insert> + <element table="myLittleHBaseTable" column="myLittleFamily" key="1" version="1" value="bla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="1" version="2" value="blabla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="1" version="3" value="bla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="1" version="4" value="bla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="2" version="1" value="blablablablablabla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="2" version="2" value="blabla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="3" version="1" value="bla" /> + <element table="myLittleHBaseTable" column="myLittleFamily" key="4" version="1" value="bla" /> + </insert> +</database> Added: trunk/msm-fromtoXPP3/src/test/resources/sixCells.xml =================================================================== --- trunk/msm-fromtoXPP3/src/test/resources/sixCells.xml (rev 0) +++ trunk/msm-fromtoXPP3/src/test/resources/sixCells.xml 2010-03-08 06:16:04 UTC (rev 195) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<database> + <describe> + <table tableName="table1"> + <column columnName="column1"/> + </table> + <table tableName="table2"> + <column columnName="column2"/> + <column columnName="column3"/> + </table> + </describe> + <insert> + <element table="table1" column="column1" key="111" version="1" value="111" /> + <element table="table2" column="column2" key="221" version="1" value="221" /> + <element table="table2" column="column2" key="222" version="1" value="222" /> + <element table="table2" column="column3" key="231" version="1" value="231" /> + <element table="table2" column="column3" key="232" version="1" value="232" /> + <element table="table2" column="column3" key="233" version="1" value="233" /> + </insert> +</database> + Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-03-07 01:31:28 UTC (rev 194) +++ trunk/pom.xml 2010-03-08 06:16:04 UTC (rev 195) @@ -22,6 +22,7 @@ <module>msm-bighashmapV2</module> <module>msm-hbase</module> <module>msm-fromtoXML</module> + <module>msm-fromtoXPP3</module> </modules> <!-- ************************************************************* -->