r137 - in trunk: . msm-bighashmapV2 msm-fromtoXML msm-fromtoXML/META-INF msm-fromtoXML/META-INF/services msm-fromtoXML/src msm-fromtoXML/src/main msm-fromtoXML/src/main/java msm-fromtoXML/src/main/java/org msm-fromtoXML/src/main/java/org/nuiton msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter msm-fromtoXML/src/site msm-fromtoXML/src/si
Author: dlanglais Date: 2010-02-27 05:20:25 +0100 (Sat, 27 Feb 2010) New Revision: 137 Added: trunk/msm-fromtoXML/ trunk/msm-fromtoXML/LICENSE.txt trunk/msm-fromtoXML/META-INF/ trunk/msm-fromtoXML/META-INF/services/ trunk/msm-fromtoXML/META-INF/services/org.nuiton.mapstoragemanager.plugins.Exporter trunk/msm-fromtoXML/META-INF/services/org.nuiton.mapstoragemanager.plugins.Importer trunk/msm-fromtoXML/README.txt trunk/msm-fromtoXML/changelog.txt trunk/msm-fromtoXML/pom.xml trunk/msm-fromtoXML/src/ trunk/msm-fromtoXML/src/main/ trunk/msm-fromtoXML/src/main/java/ trunk/msm-fromtoXML/src/main/java/org/ trunk/msm-fromtoXML/src/main/java/org/nuiton/ trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/ trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/ trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXML.java trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/importer/ trunk/msm-fromtoXML/src/site/ trunk/msm-fromtoXML/src/site/doc/ trunk/msm-fromtoXML/src/site/doc/xsd/ trunk/msm-fromtoXML/src/site/doc/xsd/example2.dtd trunk/msm-fromtoXML/src/site/doc/xsd/example2.xml trunk/msm-fromtoXML/src/site/todo.rst trunk/msm-fromtoXML/src/test/ trunk/msm-fromtoXML/src/test/java/ trunk/msm-fromtoXML/src/test/java/org/ trunk/msm-fromtoXML/src/test/java/org/nuiton/ trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/ trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/ trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ExporterTest.java trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/importer/ Modified: trunk/msm-bighashmapV2/pom.xml trunk/pom.xml trunk/src/site/doc/analyse/importexport/example1.dtd trunk/src/site/doc/analyse/importexport/example1.xml trunk/src/site/doc/analyse/importexport/example2.dtd trunk/src/site/doc/analyse/importexport/example2.xml Log: Cr?\195?\169ation et ajout d'un module d'import/export dans un format xml. Ce n'est qu'un d?\195?\169but. La classe d'export est bien avanc?\195?\169e selon le second sch?\195?\169ma DTD que j'ai propos?\195?\169. A noter qu'un test concr?\195?\170t du plugin MSM-BigHashMapV2 y est fait (insertion/r?\195?\169cup?\195?\169ration). Je pense avoir d?\195?\169couvert une fonctionnalit?\195?\169 n?\195?\169c?\195?\169ssaire sur une "bigTable" : pouvoir r?\195?\169cup?\195?\169rer les diff?\195?\169rentes versions d'une "cellule" sans les conna?\195?\174tre.. Modified: trunk/msm-bighashmapV2/pom.xml =================================================================== --- trunk/msm-bighashmapV2/pom.xml 2010-02-27 02:23:19 UTC (rev 136) +++ trunk/msm-bighashmapV2/pom.xml 2010-02-27 04:20:25 UTC (rev 137) @@ -23,7 +23,7 @@ </parent> <groupId>org.nuiton</groupId> - <artifactId>msm-bighashmapv2</artifactId> + <artifactId>msm-bighashmapV2</artifactId> <version>0.1-SNAPSHOT</version> <dependencies> Added: trunk/msm-fromtoXML/LICENSE.txt =================================================================== --- trunk/msm-fromtoXML/LICENSE.txt (rev 0) +++ trunk/msm-fromtoXML/LICENSE.txt 2010-02-27 04:20:25 UTC (rev 137) @@ -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-fromtoXML/META-INF/services/org.nuiton.mapstoragemanager.plugins.Exporter =================================================================== --- trunk/msm-fromtoXML/META-INF/services/org.nuiton.mapstoragemanager.plugins.Exporter (rev 0) +++ trunk/msm-fromtoXML/META-INF/services/org.nuiton.mapstoragemanager.plugins.Exporter 2010-02-27 04:20:25 UTC (rev 137) @@ -0,0 +1 @@ +org.nuiton.mapstoragemanager.plugins.exporter.ToXML \ No newline at end of file Added: trunk/msm-fromtoXML/META-INF/services/org.nuiton.mapstoragemanager.plugins.Importer =================================================================== --- trunk/msm-fromtoXML/META-INF/services/org.nuiton.mapstoragemanager.plugins.Importer (rev 0) +++ trunk/msm-fromtoXML/META-INF/services/org.nuiton.mapstoragemanager.plugins.Importer 2010-02-27 04:20:25 UTC (rev 137) @@ -0,0 +1 @@ +org.nuiton.mapstoragemanager.plugins.importer.FromXML \ No newline at end of file Added: trunk/msm-fromtoXML/changelog.txt =================================================================== --- trunk/msm-fromtoXML/changelog.txt (rev 0) +++ trunk/msm-fromtoXML/changelog.txt 2010-02-27 04:20:25 UTC (rev 137) @@ -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-fromtoXML/pom.xml =================================================================== --- trunk/msm-fromtoXML/pom.xml (rev 0) +++ trunk/msm-fromtoXML/pom.xml 2010-02-27 04:20:25 UTC (rev 137) @@ -0,0 +1,220 @@ +<?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-fromtoxml</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> + <scope>test</scope> + </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> + </dependencies> + + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + + <name>MSM-FromToXML</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> + </build> + +</project> + + + + + + + Added: trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXML.java =================================================================== --- trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXML.java (rev 0) +++ trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXML.java 2010-02-27 04:20:25 UTC (rev 137) @@ -0,0 +1,194 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.nuiton.mapstoragemanager.plugins.exporter; + +import java.io.File; +import java.io.FileOutputStream; +import java.util.NoSuchElementException; +import java.util.Set; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jdom.Attribute; +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.output.Format; +import org.jdom.output.XMLOutputter; +import org.nuiton.mapstoragemanager.plugins.Exporter; +import org.nuiton.mapstoragemanager.plugins.NewBigTable; + +/** + * A Class to export in xml files the content of Hbase database. + * @author Dorian Langlais + */ +public class ToXML implements Exporter { + + /** + * Logger. + */ + private static final Log LOG = LogFactory.getLog(ToXML.class); + + // the racine which is the database. + private static Element racine; + + // the jdom document. + private static Document document; + + @Override + public void exportTo(NewBigTable bigTable, File file) { + + racine = new Element("database"); + document = new Document(racine); + + forEachTable(bigTable, racine); +// //On crée un nouvel Element etudiant et on l'ajoute +// //en tant qu'Element de racine +// Element etudiant = new Element("etudiant"); +// racine.addContent(etudiant); + +// for() +// //On crée un nouvel Attribut classe et on l'ajoute à etudiant +// //grâce à la méthode setAttribute +// Attribute classe = new Attribute("classe", "P2"); +// etudiant.setAttribute(classe); +// +// //On crée un nouvel Element nom, on lui assigne du texte +// //et on l'ajoute en tant qu'Element de etudiant +// Element nom = new Element("nom"); +// nom.setText("CynO"); +// etudiant.addContent(nom); + + // the methods to print and to save the database in XML file. + toSreen(); + if(file != null) + save(file); + } + + /** + * For eath table of the database, the document is constructed. + * @param bigTable the bigTable. + * @param database the database Element. + */ + private void forEachTable(NewBigTable bigTable, Element database) { + // the tables name. + Set<String> tablesNames = bigTable.getTablesNames(); + + for (String table : tablesNames) { + // new table Element. + Element tableElement = new Element("table"); + // new attribute which contain the table name. + Attribute tableNameAttribute = new Attribute("tableName", table); + tableElement.setAttribute(tableNameAttribute); + + // we add the table to the database. + database.addContent(tableElement); + + // we search the columns of the table. + forEachColumn(bigTable, tableElement); + } + } + + /** + * For eath column of the table, the document is constructed. + * @param bigTable the bigTable. + * @param table the table Element. + */ + private void forEachColumn(NewBigTable bigTable, Element table) { + // the table name. + String tableName = table.getAttributeValue("tableName"); + + // the columns name. + Set<String> columnNames = bigTable.getColumnsNames(tableName); + + for (String column : columnNames) { + // new column Element. + Element columnElement = new Element("column"); + // new attribute which contain the column name. + Attribute columnNameAttribute = new Attribute("columnName", column); + columnElement.setAttribute(columnNameAttribute); + + // we add the column to the table. + table.addContent(columnElement); + + // we search the columns of the table. + forEachCell(bigTable, columnElement); + } + } + + /** + * For eath cell of the column, the document is constructed. + * @param bigTable the bigTable. + * @param column the column Element. + */ + private void forEachCell(NewBigTable bigTable, Element column) { + System.out.println(column.getParentElement().toString()); + + + // the table name. + String tableName = + column.getParentElement().getAttributeValue("tableName"); + // the column name. + String columnName = column.getAttributeValue("columnName"); + + // the table keys. + Set<String> keys = bigTable.getKeys(tableName); + + String content = ""; + for (String key : keys) { + try{ + content = bigTable.get(tableName, columnName, key); + } + catch (NoSuchElementException e) { +// LOG.error(e, e); + } + if ( ! "".equals(content)) { + + // new cell Element. + Element cellElement = new Element("cell"); + // new attribute which contain the cell key. + Attribute cellKeyAttribute = new Attribute("key", key); + cellElement.setAttribute(cellKeyAttribute); + + // we add the cell to the column. + column.addContent(cellElement); + + // new value Element. + Element valueElement = new Element("value"); +// // new attribute which contain the value version. +// Attribute valueVersionAttribute = new Attribute("version", v); +// valueElement.setAttribute(valueVersionAttribute); + valueElement.setText(content); + + // we add the value to the cell. + cellElement.addContent(valueElement); + } + } + } + + /** + * toSreen(). + * show the XML content on System.out + */ + static void toSreen() { + try { + XMLOutputter output = new XMLOutputter(Format.getPrettyFormat()); + output.output(document, System.out); + } catch (java.io.IOException e) { + LOG.error(e, e); + } + } + + /** + * Method to save the file. + * @param file the file in which we save the database. + */ + private static void save(File file) { + try { + XMLOutputter output = new XMLOutputter(Format.getPrettyFormat()); + output.output(document, new FileOutputStream(file)); + } catch (java.io.IOException e) { + LOG.error(e, e); + } + } +} Added: trunk/msm-fromtoXML/src/site/doc/xsd/example2.dtd =================================================================== --- trunk/msm-fromtoXML/src/site/doc/xsd/example2.dtd (rev 0) +++ trunk/msm-fromtoXML/src/site/doc/xsd/example2.dtd 2010-02-27 04:20:25 UTC (rev 137) @@ -0,0 +1,47 @@ +<?xml version='1.0' encoding='UTF-8'?> + +<!-- + TODO define vocabulary identification + PUBLIC ID: -//vendor//vocabulary//EN + SYSTEM ID: http://server/path/example2.dtd + +--> + +<!-- + An example how to use this DTD from your XML document: + + <?xml version="1.0"?> + + <!DOCTYPE root SYSTEM "example2.dtd"> + + <root> + ... + </root> +--> + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT database (table)*> + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT table (column)*> +<!ATTLIST table + tableName CDATA #IMPLIED + > + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT column (cell)*> +<!ATTLIST column + columnName CDATA #IMPLIED + > + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT cell (value)*> +<!ATTLIST cell + key CDATA #IMPLIED + > + +<!--- Put your DTDDoc comment here. --> +<!ELEMENT value (#PCDATA)> +<!ATTLIST value + version CDATA #IMPLIED + > Added: trunk/msm-fromtoXML/src/site/doc/xsd/example2.xml =================================================================== --- trunk/msm-fromtoXML/src/site/doc/xsd/example2.xml (rev 0) +++ trunk/msm-fromtoXML/src/site/doc/xsd/example2.xml 2010-02-27 04:20:25 UTC (rev 137) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Document : export2.xml.xml + Created on : 26 février 2010, 15:19 + Author : Dorian Langlais + Description: + An other example of format to export hbase content +--> + +<database> + <table tableName="myLittleHBaseTable"> + <column columnName="myLittleFamily"> + <cell key="1"> + <value version="1">bla</value> + <value version="2">blabla</value> + <value version="3">bla</value> + <value version="4">bla</value> + </cell> + <cell key="2"> + <value version="1">blablablablablabla</value> + <value version="2">blabla</value> + </cell> + <cell key="3"> + <value version="1">bla</value> + </cell> + <cell key="4"> + <value version="1">bla</value> + </cell> + </column> + </table> +</database> Added: trunk/msm-fromtoXML/src/site/todo.rst =================================================================== --- trunk/msm-fromtoXML/src/site/todo.rst (rev 0) +++ trunk/msm-fromtoXML/src/site/todo.rst 2010-02-27 04:20:25 UTC (rev 137) @@ -0,0 +1,6 @@ + +Function to implement in toXML +========================================= + + - exportToXml [pending] + - importFromXml [pending] \ No newline at end of file Added: trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ExporterTest.java =================================================================== --- trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ExporterTest.java (rev 0) +++ trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ExporterTest.java 2010-02-27 04:20:25 UTC (rev 137) @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package org.nuiton.mapstoragemanager.plugins.exporter; + +import junit.framework.TestCase; +import org.nuiton.mapstoragemanager.plugins.Exporter; +import org.nuiton.mapstoragemanager.plugins.NewBigTable; +import org.nuiton.mapstoragemanager.plugins.bighashmapv2.BigHashMap; + +/** + * + * @author Dorian Langlais + */ +public class ExporterTest extends TestCase { + + public void testToXML(){ + + } + + public static void main(String[] args) { + NewBigTable nbt = new BigHashMap(); + nbt.createTable("table1"); + nbt.createTable("table2"); + + nbt.createColumn("table1", "column1"); + nbt.createColumn("table1", "column2"); + + nbt.createColumn("table2", "column3"); + nbt.createColumn("table2", "column4"); + nbt.createColumn("table2", "column5"); + + nbt.put("table1", "column1", "1", "content1"); + nbt.put("table1", "column1", "2", "content2"); + nbt.put("table1", "column2", "3", "content3"); + nbt.put("table1", "column2", "4", "content4"); + + nbt.put("table2", "column3", "5", "content5"); + nbt.put("table2", "column3", "6", "content6"); + nbt.put("table2", "column4", "7", "content7"); + nbt.put("table2", "column4", "8", "content8"); + nbt.put("table2", "column5", "9", "content9"); + nbt.put("table2", "column5", "10", "content10"); + + Exporter exporter = new ToXML(); + exporter.exportTo(nbt, null); + } +} Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-02-27 02:23:19 UTC (rev 136) +++ trunk/pom.xml 2010-02-27 04:20:25 UTC (rev 137) @@ -21,6 +21,7 @@ <module>msm-bighashmap</module> <module>msm-bighashmapV2</module> <module>msm-hbase</module> + <module>msm-fromtoXML</module> </modules> <!-- ************************************************************* --> Modified: trunk/src/site/doc/analyse/importexport/example1.dtd =================================================================== --- trunk/src/site/doc/analyse/importexport/example1.dtd 2010-02-27 02:23:19 UTC (rev 136) +++ trunk/src/site/doc/analyse/importexport/example1.dtd 2010-02-27 04:20:25 UTC (rev 137) @@ -20,7 +20,7 @@ --> <!--- Put your DTDDoc comment here. --> -<!ELEMENT root (element)*> +<!ELEMENT database (element)*> <!--- Put your DTDDoc comment here. --> <!ELEMENT element EMPTY> Modified: trunk/src/site/doc/analyse/importexport/example1.xml =================================================================== --- trunk/src/site/doc/analyse/importexport/example1.xml 2010-02-27 02:23:19 UTC (rev 136) +++ trunk/src/site/doc/analyse/importexport/example1.xml 2010-02-27 04:20:25 UTC (rev 137) @@ -8,7 +8,7 @@ An example of format to export hbase content --> -<root> +<database> <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" /> @@ -17,4 +17,4 @@ <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" /> -</root> +</database> Modified: trunk/src/site/doc/analyse/importexport/example2.dtd =================================================================== --- trunk/src/site/doc/analyse/importexport/example2.dtd 2010-02-27 02:23:19 UTC (rev 136) +++ trunk/src/site/doc/analyse/importexport/example2.dtd 2010-02-27 04:20:25 UTC (rev 137) @@ -20,7 +20,7 @@ --> <!--- Put your DTDDoc comment here. --> -<!ELEMENT root (table)*> +<!ELEMENT database (table)*> <!--- Put your DTDDoc comment here. --> <!ELEMENT table (column)*> Modified: trunk/src/site/doc/analyse/importexport/example2.xml =================================================================== --- trunk/src/site/doc/analyse/importexport/example2.xml 2010-02-27 02:23:19 UTC (rev 136) +++ trunk/src/site/doc/analyse/importexport/example2.xml 2010-02-27 04:20:25 UTC (rev 137) @@ -8,7 +8,7 @@ An other example of format to export hbase content --> -<root> +<database> <table tableName="myLittleHBaseTable"> <column columnName="myLittleFamily"> <cell key="1"> @@ -29,4 +29,4 @@ </cell> </column> </table> -</root> +</database>
participants (1)
-
dlanglais@users.nuiton.org