Mapstoragemanager-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 329 discussions
r139 - trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter
by dlanglais@users.nuiton.org 27 Feb '10
by dlanglais@users.nuiton.org 27 Feb '10
27 Feb '10
Author: dlanglais
Date: 2010-02-27 17:28:06 +0100 (Sat, 27 Feb 2010)
New Revision: 139
Modified:
trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ExporterTest.java
Log:
Rectification :
- classe de test : OK
- classe ToXML : Nok.
Modified: 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 2010-02-27 16:24:45 UTC (rev 138)
+++ trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ExporterTest.java 2010-02-27 16:28:06 UTC (rev 139)
@@ -7,8 +7,6 @@
import java.io.IOException;
import java.lang.reflect.Field;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import junit.framework.TestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -113,77 +111,77 @@
value2.setText("content2");
cell2.addContent(value2);
-// nbt.put("table1", "column2", "3", "content3");
-// Element cell3 = new Element("cell");
-// Attribute cell3key = new Attribute("key", "3");
-// cell3.setAttribute(cell3key);
-// column2.addContent(cell3);
-// Element value3 = new Element("value");
-// value3.setText("content3");
-// cell3.addContent(value3);
+ nbt.put("table1", "column2", "3", "content3");
+ Element cell3 = new Element("cell");
+ Attribute cell3key = new Attribute("key", "3");
+ cell3.setAttribute(cell3key);
+ column2.addContent(cell3);
+ Element value3 = new Element("value");
+ value3.setText("content3");
+ cell3.addContent(value3);
-// nbt.put("table1", "column2", "4", "content4");
-// Element cell4 = new Element("cell");
-// Attribute cell4key = new Attribute("key", "4");
-// cell4.setAttribute(cell4key);
-// column2.addContent(cell4);
-// Element value4 = new Element("value");
-// value4.setText("content4");
-// cell4.addContent(value4);
+ nbt.put("table1", "column2", "4", "content4");
+ Element cell4 = new Element("cell");
+ Attribute cell4key = new Attribute("key", "4");
+ cell4.setAttribute(cell4key);
+ column2.addContent(cell4);
+ Element value4 = new Element("value");
+ value4.setText("content4");
+ cell4.addContent(value4);
-// nbt.put("table2", "column3", "5", "content5");
-// Element cell5 = new Element("cell");
-// Attribute cell5key = new Attribute("key", "5");
-// cell5.setAttribute(cell5key);
-// column3.addContent(cell5);
-// Element value5 = new Element("value");
-// value5.setText("content5");
-// cell5.addContent(value5);
+ nbt.put("table2", "column3", "5", "content5");
+ Element cell5 = new Element("cell");
+ Attribute cell5key = new Attribute("key", "5");
+ cell5.setAttribute(cell5key);
+ column3.addContent(cell5);
+ Element value5 = new Element("value");
+ value5.setText("content5");
+ cell5.addContent(value5);
-// nbt.put("table2", "column3", "6", "content6");
-// Element cell6 = new Element("cell");
-// Attribute cell6key = new Attribute("key", "6");
-// cell6.setAttribute(cell6key);
-// column3.addContent(cell6);
-// Element value6 = new Element("value");
-// value6.setText("content6");
-// cell6.addContent(value6);
+ nbt.put("table2", "column3", "6", "content6");
+ Element cell6 = new Element("cell");
+ Attribute cell6key = new Attribute("key", "6");
+ cell6.setAttribute(cell6key);
+ column3.addContent(cell6);
+ Element value6 = new Element("value");
+ value6.setText("content6");
+ cell6.addContent(value6);
-// nbt.put("table2", "column4", "7", "content7");
-// Element cell7 = new Element("cell");
-// Attribute cell7key = new Attribute("key", "7");
-// cell7.setAttribute(cell7key);
-// column4.addContent(cell7);
-// Element value7 = new Element("value");
-// value7.setText("content7");
-// cell7.addContent(value7);
+ nbt.put("table2", "column4", "7", "content7");
+ Element cell7 = new Element("cell");
+ Attribute cell7key = new Attribute("key", "7");
+ cell7.setAttribute(cell7key);
+ column4.addContent(cell7);
+ Element value7 = new Element("value");
+ value7.setText("content7");
+ cell7.addContent(value7);
-// nbt.put("table2", "column4", "8", "content8");
-// Element cell8 = new Element("cell");
-// Attribute cell8key = new Attribute("key", "8");
-// cell8.setAttribute(cell8key);
-// column4.addContent(cell8);
-// Element value8 = new Element("value");
-// value8.setText("content8");
-// cell8.addContent(value8);
+ nbt.put("table2", "column4", "8", "content8");
+ Element cell8 = new Element("cell");
+ Attribute cell8key = new Attribute("key", "8");
+ cell8.setAttribute(cell8key);
+ column4.addContent(cell8);
+ Element value8 = new Element("value");
+ value8.setText("content8");
+ cell8.addContent(value8);
-// nbt.put("table2", "column5", "9", "content9");
-// Element cell9 = new Element("cell");
-// Attribute cell9key = new Attribute("key", "9");
-// cell9.setAttribute(cell9key);
-// column5.addContent(cell9);
-// Element value9 = new Element("value");
-// value9.setText("content9");
-// cell9.addContent(value9);
+ nbt.put("table2", "column5", "9", "content9");
+ Element cell9 = new Element("cell");
+ Attribute cell9key = new Attribute("key", "9");
+ cell9.setAttribute(cell9key);
+ column5.addContent(cell9);
+ Element value9 = new Element("value");
+ value9.setText("content9");
+ cell9.addContent(value9);
-// nbt.put("table2", "column5", "10", "content10");
-// Element cell10 = new Element("cell");
-// Attribute cell10key = new Attribute("key", "10");
-// cell10.setAttribute(cell10key);
-// column5.addContent(cell10);
-// Element value10 = new Element("value");
-// value10.setText("content10");
-// cell10.addContent(value10);
+ nbt.put("table2", "column5", "10", "content10");
+ Element cell10 = new Element("cell");
+ Attribute cell10key = new Attribute("key", "10");
+ cell10.setAttribute(cell10key);
+ column5.addContent(cell10);
+ Element value10 = new Element("value");
+ value10.setText("content10");
+ cell10.addContent(value10);
Exporter exporter = new ToXML();
exporter.exportTo(nbt, null);
@@ -209,7 +207,7 @@
try {
XMLOutputter output = new XMLOutputter(Format.getPrettyFormat());
output.output(expected, System.out);
- output.output(actual, System.out);
+// output.output(actual, System.out);
} catch (IOException ex) {
LOG.error(ex, ex);
}
1
0
r138 - in trunk/msm-fromtoXML/src: main/java/org/nuiton/mapstoragemanager/plugins/exporter test/java/org/nuiton/mapstoragemanager/plugins/exporter
by dlanglais@users.nuiton.org 27 Feb '10
by dlanglais@users.nuiton.org 27 Feb '10
27 Feb '10
Author: dlanglais
Date: 2010-02-27 17:24:45 +0100 (Sat, 27 Feb 2010)
New Revision: 138
Modified:
trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXML.java
trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ExporterTest.java
Log:
commencement de classe de test pour ToXML (ne marche pas pour le moment).
Modified: 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 2010-02-27 04:20:25 UTC (rev 137)
+++ trunk/msm-fromtoXML/src/main/java/org/nuiton/mapstoragemanager/plugins/exporter/ToXML.java 2010-02-27 16:24:45 UTC (rev 138)
@@ -41,28 +41,14 @@
racine = new Element("database");
document = new Document(racine);
+ // Construction of the document.
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)
+ //toSreen();
+ if (file != null) {
save(file);
+ }
}
/**
@@ -122,9 +108,6 @@
* @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");
@@ -140,7 +123,7 @@
content = bigTable.get(tableName, columnName, key);
}
catch (NoSuchElementException e) {
-// LOG.error(e, e);
+// LOG.warn(e, e);
}
if ( ! "".equals(content)) {
Modified: 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 2010-02-27 04:20:25 UTC (rev 137)
+++ trunk/msm-fromtoXML/src/test/java/org/nuiton/mapstoragemanager/plugins/exporter/ExporterTest.java 2010-02-27 16:24:45 UTC (rev 138)
@@ -5,7 +5,18 @@
package org.nuiton.mapstoragemanager.plugins.exporter;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import junit.framework.TestCase;
+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;
import org.nuiton.mapstoragemanager.plugins.bighashmapv2.BigHashMap;
@@ -16,8 +27,197 @@
*/
public class ExporterTest extends TestCase {
- public void testToXML(){
+ /**
+ * Logger.
+ */
+ private static final Log LOG = LogFactory.getLog(ExporterTest.class);
+// private static final Log LOGXML = LogFactory.getLog(ToXML.class);
+ public void testToXML() {
+
+ Document actual = null;
+ Document expected = new Document();
+
+ /********************************
+ * Creation of the database. *
+ ********************************/
+ NewBigTable nbt = new BigHashMap();
+ Element database = new Element("database");
+ expected.addContent(database);
+
+ /********************************
+ * Creation of the tables. *
+ ********************************/
+ nbt.createTable("table1");
+ Element table1 = new Element("table");
+ Attribute table1name = new Attribute("tableName", "table1");
+ table1.setAttribute(table1name);
+ database.addContent(table1);
+ nbt.createTable("table2");
+ Element table2 = new Element("table");
+ Attribute table2name = new Attribute("tableName", "table2");
+ table2.setAttribute(table2name);
+ database.addContent(table2);
+
+ /********************************
+ * Creation of the columns. *
+ ********************************/
+ nbt.createColumn("table1", "column1");
+ Element column1 = new Element("column");
+ Attribute column1name = new Attribute("columnName", "column1");
+ column1.setAttribute(column1name);
+ table1.addContent(column1);
+ nbt.createColumn("table1", "column2");
+ Element column2 = new Element("column");
+ Attribute column2name = new Attribute("columnName", "column2");
+ column2.setAttribute(column2name);
+ table1.addContent(column2);
+
+ nbt.createColumn("table2", "column3");
+ Element column3 = new Element("column");
+ Attribute column3name = new Attribute("columnName", "column3");
+ column3.setAttribute(column3name);
+ table2.addContent(column3);
+
+ nbt.createColumn("table2", "column4");
+ Element column4 = new Element("column");
+ Attribute column4name = new Attribute("columnName", "column4");
+ column4.setAttribute(column4name);
+ table2.addContent(column4);
+
+ nbt.createColumn("table2", "column5");
+ Element column5 = new Element("column");
+ Attribute column5name = new Attribute("columnName", "column5");
+ column5.setAttribute(column5name);
+ table2.addContent(column5);
+
+
+ /********************************
+ * Put elements in the columns. *
+ ********************************/
+ nbt.put("table1", "column1", "1", "content1");
+ Element cell1 = new Element("cell");
+ Attribute cell1key = new Attribute("key", "1");
+ cell1.setAttribute(cell1key);
+ column1.addContent(cell1);
+ Element value1 = new Element("value");
+ value1.setText("content1");
+ cell1.addContent(value1);
+
+ nbt.put("table1", "column1", "2", "content2");
+ Element cell2 = new Element("cell");
+ Attribute cell2key = new Attribute("key", "2");
+ cell2.setAttribute(cell2key);
+ column1.addContent(cell2);
+ Element value2 = new Element("value");
+ value2.setText("content2");
+ cell2.addContent(value2);
+
+// nbt.put("table1", "column2", "3", "content3");
+// Element cell3 = new Element("cell");
+// Attribute cell3key = new Attribute("key", "3");
+// cell3.setAttribute(cell3key);
+// column2.addContent(cell3);
+// Element value3 = new Element("value");
+// value3.setText("content3");
+// cell3.addContent(value3);
+
+// nbt.put("table1", "column2", "4", "content4");
+// Element cell4 = new Element("cell");
+// Attribute cell4key = new Attribute("key", "4");
+// cell4.setAttribute(cell4key);
+// column2.addContent(cell4);
+// Element value4 = new Element("value");
+// value4.setText("content4");
+// cell4.addContent(value4);
+
+// nbt.put("table2", "column3", "5", "content5");
+// Element cell5 = new Element("cell");
+// Attribute cell5key = new Attribute("key", "5");
+// cell5.setAttribute(cell5key);
+// column3.addContent(cell5);
+// Element value5 = new Element("value");
+// value5.setText("content5");
+// cell5.addContent(value5);
+
+// nbt.put("table2", "column3", "6", "content6");
+// Element cell6 = new Element("cell");
+// Attribute cell6key = new Attribute("key", "6");
+// cell6.setAttribute(cell6key);
+// column3.addContent(cell6);
+// Element value6 = new Element("value");
+// value6.setText("content6");
+// cell6.addContent(value6);
+
+// nbt.put("table2", "column4", "7", "content7");
+// Element cell7 = new Element("cell");
+// Attribute cell7key = new Attribute("key", "7");
+// cell7.setAttribute(cell7key);
+// column4.addContent(cell7);
+// Element value7 = new Element("value");
+// value7.setText("content7");
+// cell7.addContent(value7);
+
+// nbt.put("table2", "column4", "8", "content8");
+// Element cell8 = new Element("cell");
+// Attribute cell8key = new Attribute("key", "8");
+// cell8.setAttribute(cell8key);
+// column4.addContent(cell8);
+// Element value8 = new Element("value");
+// value8.setText("content8");
+// cell8.addContent(value8);
+
+// nbt.put("table2", "column5", "9", "content9");
+// Element cell9 = new Element("cell");
+// Attribute cell9key = new Attribute("key", "9");
+// cell9.setAttribute(cell9key);
+// column5.addContent(cell9);
+// Element value9 = new Element("value");
+// value9.setText("content9");
+// cell9.addContent(value9);
+
+// nbt.put("table2", "column5", "10", "content10");
+// Element cell10 = new Element("cell");
+// Attribute cell10key = new Attribute("key", "10");
+// cell10.setAttribute(cell10key);
+// column5.addContent(cell10);
+// Element value10 = new Element("value");
+// value10.setText("content10");
+// cell10.addContent(value10);
+
+ Exporter exporter = new ToXML();
+ exporter.exportTo(nbt, null);
+
+
+// expected.toString();
+
+ Field fdocument;
+ try {
+ fdocument = exporter.getClass().getDeclaredField("document");
+ fdocument.setAccessible(true);
+ actual = (Document) fdocument.get(exporter);
+ } catch (IllegalArgumentException ex) {
+ LOG.error(ex, ex);
+ } catch (IllegalAccessException ex) {
+ LOG.error(ex, ex);
+ } catch (NoSuchFieldException ex) {
+ LOG.error(ex, ex);
+ } catch (SecurityException ex) {
+ LOG.error(ex, ex);
+ }
+
+ try {
+ XMLOutputter output = new XMLOutputter(Format.getPrettyFormat());
+ output.output(expected, System.out);
+ output.output(actual, System.out);
+ } catch (IOException ex) {
+ LOG.error(ex, ex);
+ }
+
+// System.out.println(expected);
+// System.out.println(actual);
+// assertEquals(expected.toString(),actual.toString());
+// assertEquals(expected, actual);
}
public static void main(String[] args) {
@@ -46,5 +246,8 @@
Exporter exporter = new ToXML();
exporter.exportTo(nbt, null);
+
+ Document a = new Document();
+ Document b = new Document();
}
}
1
0
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(a)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(a)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(a)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(a)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(a)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(a)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>
1
0
Author: dlanglais
Date: 2010-02-27 03:23:19 +0100 (Sat, 27 Feb 2010)
New Revision: 136
Modified:
trunk/msm/src/main/resources/i18n/msm-en_GB.properties
trunk/msm/src/main/resources/i18n/msm-fr_FR.properties
Log:
Oubli de commit des modifs sur les fichiers i18n
Modified: trunk/msm/src/main/resources/i18n/msm-en_GB.properties
===================================================================
--- trunk/msm/src/main/resources/i18n/msm-en_GB.properties 2010-02-27 02:15:31 UTC (rev 135)
+++ trunk/msm/src/main/resources/i18n/msm-en_GB.properties 2010-02-27 02:23:19 UTC (rev 136)
@@ -4,6 +4,7 @@
connectionError=The connection attempt to failed, please retry \!
jaxxdemo.message.goto.site=Visit site
jaxxdemo.tree.component=
+keys=
login\ \:=Login
mapstoragemanager.action.aboutUs=About us
mapstoragemanager.action.aboutUs.tip=About Code Lutin
Modified: trunk/msm/src/main/resources/i18n/msm-fr_FR.properties
===================================================================
--- trunk/msm/src/main/resources/i18n/msm-fr_FR.properties 2010-02-27 02:15:31 UTC (rev 135)
+++ trunk/msm/src/main/resources/i18n/msm-fr_FR.properties 2010-02-27 02:23:19 UTC (rev 136)
@@ -4,6 +4,7 @@
connectionError=La connexion \u00E0 \u00E9chou\u00E9e, r\u00E9essayez s'il vous pla\u00EEt \!
jaxxdemo.message.goto.site=Visitez le site
jaxxdemo.tree.component=
+keys=
login\ \:=Identifiant
mapstoragemanager.action.aboutUs=A propos
mapstoragemanager.action.aboutUs.tip=A propos de Code Lutin
1
0
r135 - trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins
by dlanglais@users.nuiton.org 27 Feb '10
by dlanglais@users.nuiton.org 27 Feb '10
27 Feb '10
Author: dlanglais
Date: 2010-02-27 03:15:31 +0100 (Sat, 27 Feb 2010)
New Revision: 135
Modified:
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java
Log:
modif mineure sur OutHashMap2.java (condition "combinable").
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java 2010-02-27 02:13:12 UTC (rev 134)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java 2010-02-27 02:15:31 UTC (rev 135)
@@ -65,11 +65,10 @@
@Override
public void put(String table, String column, String key, String content) {
- if(mapTable.containsKey(table)){
- if(mapColumn.containsKey(column)){
- mapColumn.get(column).add(key);
- mapData.put(key, content);
- }
+ // If the table and the column exist.
+ if(mapTable.containsKey(table) && mapColumn.containsKey(column)) {
+ mapColumn.get(column).add(key);
+ mapData.put(key, content);
}
}
1
0
r134 - trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui
by dlanglais@users.nuiton.org 27 Feb '10
by dlanglais@users.nuiton.org 27 Feb '10
27 Feb '10
Author: dlanglais
Date: 2010-02-27 03:13:12 +0100 (Sat, 27 Feb 2010)
New Revision: 134
Modified:
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java
Log:
Tentative traduction Keys/Cl?\195?\169s dans le tableau affichant le contenu d'une table.
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java 2010-02-27 02:06:19 UTC (rev 133)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java 2010-02-27 02:13:12 UTC (rev 134)
@@ -199,7 +199,7 @@
* Show help.
*/
public void showHelp() {
- String message=n_("No help today, sorry !");
+ String message = n_("No help today, sorry !");
JOptionPane.showMessageDialog(null, message);
}
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java 2010-02-27 02:06:19 UTC (rev 133)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java 2010-02-27 02:13:12 UTC (rev 134)
@@ -11,6 +11,8 @@
import javax.swing.tree.DefaultMutableTreeNode;
import org.nuiton.mapstoragemanager.plugins.OurHashMap2;
+import static org.nuiton.i18n.I18n.n_;
+
/**
* Model of a table content
* @author E045231P
@@ -49,7 +51,7 @@
data = new String[columnsNames.size()+1][tableKeys.size()];
// a column which shows keys.
- titles[colIndex++] = "keys";
+ titles[colIndex++] = n_("keys");
while(i.hasNext()){
String titreTemp = i.next();
1
0
r133 - in trunk/msm/src/main/java/org/nuiton/mapstoragemanager: plugins ui/gui
by dlanglais@users.nuiton.org 27 Feb '10
by dlanglais@users.nuiton.org 27 Feb '10
27 Feb '10
Author: dlanglais
Date: 2010-02-27 03:06:19 +0100 (Sat, 27 Feb 2010)
New Revision: 133
Modified:
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java
Log:
Am?\195?\169lioration code OurHashMap2 (plus compr?\195?\169hensible de mon point de vue, mais c'est subjectif).
Ajout d'une colonne keys dans le tableau d'une table.
-> modification des objets stock?\195?\169s pour "mieux s'y retrouver -> les doublons peuvent faire croire que tout marche...).
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java 2010-02-27 00:45:14 UTC (rev 132)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java 2010-02-27 02:06:19 UTC (rev 133)
@@ -41,18 +41,18 @@
@Override
public void createColumn(String table, String column) {
- if(mapTable.containsKey(table)){
+ // if the table exist and only if the column doesn't exist.
+ if (mapTable.containsKey(table) && !mapColumn.containsKey(column)) {
mapColumn.put(column, new ArrayList<String>());
- ArrayList<String> list;
- list = mapTable.get(table);
- list.add(column);
- mapTable.put(table,list);
+ mapTable.get(table).add(column);
}
}
@Override
public void deleteColumn(String table, String column) {
- if(mapTable.containsKey(table)){
+ // if the table exist and only if the column exist.
+ if (mapTable.containsKey(table) &&
+ mapTable.get(table).contains(column)) {
mapTable.get(table).remove(column);
}
}
@@ -67,10 +67,7 @@
public void put(String table, String column, String key, String content) {
if(mapTable.containsKey(table)){
if(mapColumn.containsKey(column)){
- ArrayList<String> list;
- list = mapColumn.get(column);
- list.add(key);
- mapColumn.put(column,list);
+ mapColumn.get(column).add(key);
mapData.put(key, content);
}
}
@@ -104,17 +101,16 @@
@Override
public Set<String> getKeys(String table) {
- Set<String> keys = new HashSet();
- Set<String> column = new HashSet(mapTable.get(table));
- Iterator i = column.iterator();
+ Set<String> tableKeys = new HashSet();
+ Set<String> tableColumns = new HashSet(mapTable.get(table));
+ Iterator<String> i = tableColumns.iterator();
+ // we get and add all the keys of the column to the keys of the table
while(i.hasNext()){
- String columnName = (String)i.next();
- ArrayList<String> al = mapColumn.get(columnName);
- for(int j=0;j<al.size();j++){
- keys.add(al.get(j));
- }
+ String columnName = i.next();
+ ArrayList<String> columnKeys = mapColumn.get(columnName);
+ tableKeys.addAll(columnKeys);
}
- return keys;
+ return tableKeys;
}
public Set<String> getKeys(String table, String column) {
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java 2010-02-27 00:45:14 UTC (rev 132)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java 2010-02-27 02:06:19 UTC (rev 133)
@@ -74,12 +74,12 @@
ohm.put("table1", "column2", "3", "content3");
ohm.put("table1", "column2", "4", "content4");
- ohm.put("table2", "column3", "5", "content1");
- ohm.put("table2", "column3", "6", "content2");
- ohm.put("table2", "column4", "7", "content3");
- ohm.put("table2", "column4", "8", "content4");
- ohm.put("table2", "column5", "9", "content3");
- ohm.put("table2", "column5", "10", "content4");
+ ohm.put("table2", "column3", "5", "content5");
+ ohm.put("table2", "column3", "6", "content6");
+ ohm.put("table2", "column4", "7", "content7");
+ ohm.put("table2", "column4", "8", "content8");
+ ohm.put("table2", "column5", "9", "content9");
+ ohm.put("table2", "column5", "10", "content10");
}
/**
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java 2010-02-27 00:45:14 UTC (rev 132)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java 2010-02-27 02:06:19 UTC (rev 133)
@@ -21,7 +21,7 @@
/**
* columnNames.
*/
- String[] titres;
+ String[] titles;
/**
* data.
@@ -34,38 +34,59 @@
public TableModel(DefaultMutableTreeNode node) {
String table = node.toString();
ApplicationEngine engine = ApplicationEngine.getInstance();
- OurHashMap2 testHashmap2 = engine.getOurHashMap();
- Set<String> set = testHashmap2.getColumnsNames(table);
- titres = new String[set.size()];
+ OurHashMap2 hashmap = engine.getOurHashMap();
+ Set<String> columnsNames = hashmap.getColumnsNames(table);
+ titles = new String[columnsNames.size()+1];
+
//content
- Set<String> keySetTable = testHashmap2.getKeys(table);
- Iterator i = set.iterator();
- int j=0;
- int k=0;
- System.out.println("set.size() : "+set.size()+" | keySet.size() : "+keySetTable.size());
- data = new String[set.size()][keySetTable.size()];
+ Set<String> tableKeys = hashmap.getKeys(table);
+ Iterator<String> i = columnsNames.iterator();
+ int colIndex = 0;
+ int rowIndex = 0;
+ System.out.println("set.size() : " + columnsNames.size()
+ + " | keySet.size() : " + tableKeys.size());
+ data = new String[columnsNames.size()+1][tableKeys.size()];
+
+ // a column which shows keys.
+ titles[colIndex++] = "keys";
+
while(i.hasNext()){
- String titreTemp = (String)i.next();
- titres[j]=titreTemp;
+ String titreTemp = i.next();
+ titles[colIndex] = titreTemp;
- Set<String> keySet = testHashmap2.getKeys(table,titres[j]);
- Iterator i2 = keySet.iterator();
+ Set<String> columnKeys =
+ hashmap.getKeys(table, titles[colIndex]);
+ Iterator<String> i2 = columnKeys.iterator();
while(i2.hasNext()){
- System.out.println("table = "+table);
- System.out.println("titreTemp = "+titreTemp);
- String str = testHashmap2.get(table,titreTemp,(String)i2.next());
- data[j][k]=str;
- System.out.println("data["+j+"]["+k+"] = "+data[j][k]);
- k++;
+ String key = i2.next();
+ System.out.println("table = " + table);
+ System.out.println("titreTemp = " + titreTemp);
+ String str = hashmap.get(table, titreTemp, key);
+ //data[j][k]=str;
+ // the key
+ this.setValueAt(rowIndex, 0, key);
+ this.setValueAt(rowIndex, colIndex, str);
+ System.out.println("data[" + colIndex + "][" + rowIndex + "] = "
+ + data[colIndex][rowIndex]);
+ rowIndex++;
}
- j++;
+ colIndex++;
}
}
+ /**
+ * put data into the table.
+ * @param rowIndex the rox index
+ * @param colIndex the column index
+ * @param value to put in the table.
+ */
+ public void setValueAt(int rowIndex, int colIndex, String value) {
+ data[colIndex][rowIndex] = value;
+ }
/**
- * Add data into the table.
+ * get data from the table.
* @param rowIndex the rox index
* @param colIndex the column index
*/
@@ -80,7 +101,7 @@
*/
@Override
public int getColumnCount() {
- return titres.length;
+ return titles.length;
}
/**
@@ -99,7 +120,7 @@
*/
@Override
public String getColumnName(int col){
- return titres[col];
+ return titles[col];
}
1
0
r132 - in trunk/msm/src/main: java/org/nuiton/mapstoragemanager java/org/nuiton/mapstoragemanager/plugins java/org/nuiton/mapstoragemanager/ui java/org/nuiton/mapstoragemanager/ui/gui resources resources/i18n resources/icons
by fgilet@users.nuiton.org 27 Feb '10
by fgilet@users.nuiton.org 27 Feb '10
27 Feb '10
Author: fgilet
Date: 2010-02-27 01:45:14 +0100 (Sat, 27 Feb 2010)
New Revision: 132
Added:
trunk/msm/src/main/resources/icons/action-connect.png
trunk/msm/src/main/resources/icons/action-disconnect.png
Modified:
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/Main.java
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/MsmConfig.java
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/MainUI.css
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/MainUI.jaxx
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/MSMNavigationListener.java
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java
trunk/msm/src/main/resources/i18n/msm-en_GB.properties
trunk/msm/src/main/resources/i18n/msm-fr_FR.properties
trunk/msm/src/main/resources/msm.properties
Log:
Ajout d'images dans le menu.
menu "aide", "visitez site" et "?\195?\160 propos" fait partiellement.
menu connect et disconnect mis ?\195?\160 jour.
contenu d'une table mis ?\195?\160 jour dans un jscrollpane. (donc vu des colonnes)
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/Main.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/Main.java 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/Main.java 2010-02-27 00:45:14 UTC (rev 132)
@@ -80,10 +80,10 @@
private void init() {
MainUI ui = MainUI.getInstance();
- Locale locale = Main.locale;
- if (locale.equals(Locale.FRANCE)){
+ Locale localeTemp = Main.locale;
+ if (localeTemp.equals(Locale.FRANCE)){
ui.getMenuFileLanguageFR().setEnabled(false);
- } else if (locale.equals(Locale.UK)){
+ } else if (localeTemp.equals(Locale.UK)){
ui.getMenuFileLanguageUK().setEnabled(false);
}
String message = n_("messageEntry");
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/MsmConfig.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/MsmConfig.java 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/MsmConfig.java 2010-02-27 00:45:14 UTC (rev 132)
@@ -22,6 +22,7 @@
* to use log facility, just put in your code: log.info(\"...\");
*/
static private Log log = LogFactory.getLog(MsmConfig.class);
+
/**
* le fichier de configuration de l'application avec les informations sur
* le projet (version, license,...) et la configuration des ui (icons, ...)
@@ -30,6 +31,8 @@
public MsmConfig() {
+ //setConfigFileName(APPLICATION_PROPERTIES);
+
// chargement de la configuration interne
InputStream stream = getClass().getResourceAsStream(
APPLICATION_PROPERTIES);
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java 2010-02-27 00:45:14 UTC (rev 132)
@@ -41,8 +41,8 @@
@Override
public void createColumn(String table, String column) {
- mapColumn.put(column, new ArrayList<String>());
if(mapTable.containsKey(table)){
+ mapColumn.put(column, new ArrayList<String>());
ArrayList<String> list;
list = mapTable.get(table);
list.add(column);
@@ -53,9 +53,6 @@
@Override
public void deleteColumn(String table, String column) {
if(mapTable.containsKey(table)){
- /*ArrayList<String> list = mapTable.get(table);
- list.remove(column);
- mapTable.put(table,list);*/
mapTable.get(table).remove(column);
}
}
@@ -70,11 +67,10 @@
public void put(String table, String column, String key, String content) {
if(mapTable.containsKey(table)){
if(mapColumn.containsKey(column)){
- /*ArrayList<String> list;
+ ArrayList<String> list;
list = mapColumn.get(column);
list.add(key);
- mapColumn.put(column,list);*/
- mapColumn.get(column).add(key);
+ mapColumn.put(column,list);
mapData.put(key, content);
}
}
@@ -108,16 +104,14 @@
@Override
public Set<String> getKeys(String table) {
- Set<String> keys = null;
+ Set<String> keys = new HashSet();
Set<String> column = new HashSet(mapTable.get(table));
Iterator i = column.iterator();
while(i.hasNext()){
String columnName = (String)i.next();
- System.out.println("columnName : "+columnName);
ArrayList<String> al = mapColumn.get(columnName);
- for(String str : al){
- System.out.println("str : "+str);
- keys.add(str);
+ for(int j=0;j<al.size();j++){
+ keys.add(al.get(j));
}
}
return keys;
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/MainUI.css
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/MainUI.css 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/MainUI.css 2010-02-27 00:45:14 UTC (rev 132)
@@ -38,12 +38,14 @@
#menuConnect {
text:"mapstoragemanager.action.connect";
toolTipText:"mapstoragemanager.action.connect.tip";
+ actionIcon:"connect";
mnemonic:C;
}
#menuDisconnect {
text:"mapstoragemanager.action.disconnect";
toolTipText:"mapstoragemanager.action.disconnect.tip";
+ actionIcon:"disconnect";
mnemonic:D;
}
@@ -114,6 +116,11 @@
title:"Map Storage Manager";
}
+#toolBar {
+ visible:false;
+}
+
+
JLabel.boldUnderline {
font-weight: bold;
}
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/MainUI.jaxx
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/MainUI.jaxx 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/MainUI.jaxx 2010-02-27 00:45:14 UTC (rev 132)
@@ -8,6 +8,7 @@
import javax.swing.tree.*;
import static org.nuiton.i18n.I18n.n_;
import javax.swing.JLabel;
+ import org.nuiton.mapstoragemanager.MsmConfig;
ApplicationEngine engine = ApplicationEngine.getInstance();
@@ -36,6 +37,14 @@
}
/**
+ * Access to the config.
+ * @return instance of the class
+ */
+ public MsmConfig getConfig() {
+ return getContextValue(MsmConfig.class);
+ }
+
+ /**
* Dispose UI.
*/
public void dispose(){
@@ -51,17 +60,18 @@
*/
public void displayMessage(String message, int code){
this.getMessagesPanel().removeAll();
- JLabel label = new JLabel(message);
+
/*
if (code==0){
- ImageIcon = new ImageIcon("ok_16.png");
+ ImageIcon icon = new ImageIcon(getClass().getResource("ok_16.png"));
}else if (code==1){
- ImageIcon = new ImageIcon("warning_16.png");
+ ImageIcon icon = new ImageIcon(getClass().getResource("warning_16.png"));
}else if (code==2){
- ImageIcon = new ImageIcon("cancel_16.png");
+ ImageIcon icon = new ImageIcon(getClass().getResource("cancel_16.png"));
}
*/
- //label.setIcon(icon);
+ //JLabel label = new JLabel(message, icon, SwingConstants.CENTER);
+ JLabel label = new JLabel(message);
this.getMessagesPanel().add(label);
}
@@ -77,9 +87,9 @@
<JMenuBar>
<JMenu id='menuFile'>
<JMenuItem id='menuConnect'
- onActionPerformed='engine.doSomething()'/>
- <JMenuItem id='menuDisconnect'
- onActionPerformed='engine.doSomething()'/>
+ onActionPerformed='engine.showToolBar()'/>
+ <JMenuItem id='menuDisconnect' enabled='false'
+ onActionPerformed='engine.disposeToolBar()'/>
<JSeparator/>
<JMenuItem id='menuExit'
onActionPerformed='engine.close()'/>
@@ -100,47 +110,46 @@
<JMenu id='menuHelp'>
<JMenuItem id='menuHelpHelp'
- onActionPerformed='engine.doSomething()'/>
+ onActionPerformed='engine.showHelp()'/>
<JMenuItem id='menuHelpSite'
- onActionPerformed='engine.doSomething()'/>
+ onActionPerformed='engine.gotoSite()'/>
<JMenuItem id='menuHelpAbout'
- onActionPerformed='engine.doSomething()'/>
+ onActionPerformed='engine.showAbout()'/>
</JMenu>
-
</JMenuBar>
<JPanel layout='{new BorderLayout()}' constraints='BorderLayout.CENTER'>
- <JPanel layout='{new BorderLayout()}' id='mainPanel'>
- <JToolBar constraints='BorderLayout.NORTH' opaque='true'>
- <JLabel text="name base :" actionIcon='database_16' styleClass='boldUnderline' />
- <JAXXComboBox id='nameBase' onActionPerformed='engine.doSomething()' >
- <item value='OurHashMap' selected='true'/>
- <item value='HBase'/>
- <item value='Cassandra'/>
- <item value='Other'/>
- </JAXXComboBox>
- <JLabel text="login :" actionIcon='login_16' styleClass='boldUnderline'/>
- <JTextField id='login'/>
- <JLabel text="password :" actionIcon='password_16' styleClass='boldUnderline'/>
- <JPasswordField id='password'/>
- <JButton text="ok" actionIcon='ok_16' onActionPerformed='engine.connection()'/>
- </JToolBar>
+ <JPanel layout='{new BorderLayout()}' id='mainPanel'>
+ <JToolBar id='toolBar' constraints='BorderLayout.NORTH' opaque='true' >
+ <JLabel text="name base :" actionIcon='database_16' styleClass='boldUnderline' />
+ <JAXXComboBox id='nameBase' onActionPerformed='engine.doSomething()' >
+ <item value='OurHashMap' selected='true'/>
+ <item value='HBase'/>
+ <item value='Cassandra'/>
+ <item value='Other'/>
+ </JAXXComboBox>
+ <JLabel text="login :" actionIcon='login_16' styleClass='boldUnderline'/>
+ <JTextField id='login'/>
+ <JLabel text="password :" actionIcon='password_16' styleClass='boldUnderline'/>
+ <JPasswordField id='password'/>
+ <JButton text="ok" actionIcon='ok_16' onActionPerformed='engine.connection()'/>
+ </JToolBar>
- <JSplitPane constraints='BorderLayout.CENTER' dividerLocation='200' >
- <JScrollPane>
- <JTree id='navigation'
- model='{new DefaultTreeModel(new DefaultMutableTreeNode("Empty"))}' />
- </JScrollPane>
- <JScrollPane >
- <JPanel layout='{new BorderLayout()}'>
- <JPanel id='tableName' constraints='BorderLayout.NORTH'/>
- <JPanel id='tableContent' constraints='BorderLayout.CENTER'/>
- <JPanel id='tableTips' constraints='BorderLayout.SOUTH'/>
- </JPanel>
- </JScrollPane>
- </JSplitPane>
+ <JSplitPane constraints='BorderLayout.CENTER' dividerLocation='200' >
+ <JScrollPane>
+ <JTree id='navigation'
+ model='{new DefaultTreeModel(new DefaultMutableTreeNode(n_("Empty")))}' />
+ </JScrollPane>
+ <JScrollPane>
+ <JPanel layout='{new BorderLayout()}'>
+ <JPanel id='tableName' constraints='BorderLayout.NORTH'/>
+ <JPanel id='tableContent' constraints='BorderLayout.CENTER'/>
+ <JPanel id='tableTips' constraints='BorderLayout.SOUTH'/>
+ </JPanel>
+ </JScrollPane>
+ </JSplitPane>
+ </JPanel>
+ <JPanel id='messagesPanel' constraints='BorderLayout.SOUTH'/>
</JPanel>
- <JPanel id='messagesPanel' constraints='BorderLayout.SOUTH'/>
- </JPanel>
</Application>
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java 2010-02-27 00:45:14 UTC (rev 132)
@@ -1,5 +1,7 @@
package org.nuiton.mapstoragemanager.ui.gui;
+import java.awt.Desktop;
+import java.net.URL;
import java.util.Iterator;
import java.util.Locale;
import java.util.Properties;
@@ -10,12 +12,15 @@
import javax.swing.JOptionPane;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
+import jaxx.runtime.swing.ErrorDialogUI;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.mapstoragemanager.Main;
+import org.nuiton.mapstoragemanager.MsmConfig;
import org.nuiton.mapstoragemanager.plugins.OurHashMap2;
import org.nuiton.mapstoragemanager.ui.MainUI;
import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n._;
/**
* Engine Class with methods for application user interface.
@@ -26,7 +31,7 @@
/**
* Logger.
*/
- private static final Log LOG = LogFactory.getLog(ApplicationEngine.class);
+ private static final Log log = LogFactory.getLog(ApplicationEngine.class);
/**
* current Locale.
@@ -48,8 +53,6 @@
*/
private static ApplicationEngine instance = null;
- //public ImageIcon imgOk = new ImageIcon(getClass().getResource("ok.png"));
-
/**
* Constructor.
*/
@@ -68,7 +71,7 @@
ohm.put("table1", "column1", "1", "content1");
ohm.put("table1", "column1", "2", "content2");
- ohm.put("table1", "column2", "1", "content3");
+ ohm.put("table1", "column2", "3", "content3");
ohm.put("table1", "column2", "4", "content4");
ohm.put("table2", "column3", "5", "content1");
@@ -80,13 +83,6 @@
}
/**
- * Show the developers.
- */
- public final void showGreeting() {
- JOptionPane.showMessageDialog(null, "CODE LUTIN");
- }
-
- /**
* Method to close the application.
*/
public final void close() {
@@ -112,11 +108,42 @@
this.application = application;
}*/
+ /**
+ * Show toolBar in order to connect.
+ */
+ public void showToolBar(){
+ MainUI ui = MainUI.getInstance();
+ ui.getToolBar().setVisible(true);
+ }
+
+ /**
+ * Hide toolBar in order to disconnect.
+ */
+ public void disposeToolBar(){
+ MainUI ui = MainUI.getInstance();
+ ui.getToolBar().setVisible(false);
+ clean(ui);
+ }
+
+ /**
+ * Clean the application.
+ */
+ public void clean(MainUI ui){
+ ui.getNavigation().setVisible(false);
+ ui.getTableContent().setVisible(false);
+ ui.getTableName().setVisible(false);
+ ui.getTableTips().setVisible(false);
+ }
+
/**
* Try to connect the user to a database.
*/
public void connection(){
MainUI ui = MainUI.getInstance();
+
+ //update menu
+ ui.getMenuDisconnect().setEnabled(true);
+
String nameBase = ui.getNameBase().getSelectedJaxxItem().getValue().toString();
String login = ui.getLogin().getText();
char[] password = ui.getPassword().getPassword();
@@ -145,7 +172,7 @@
ui.getNavigation().revalidate();
}else{
//display error
- JOptionPane.showMessageDialog(null, n_("jaxxdemo.tree.component"));
+ JOptionPane.showMessageDialog(null, n_("connectionError"));
}
}
@@ -168,13 +195,66 @@
instance = null;
}
+ /**
+ * Show help.
+ */
+ public void showHelp() {
+ String message=n_("No help today, sorry !");
+ JOptionPane.showMessageDialog(null, message);
+ }
+ /**
+ * Redirection to site.
+ */
+ public void gotoSite() {
+ MainUI ui = MainUI.getInstance();
+ MsmConfig config = ui.getConfig();
+
+ URL siteURL = config.getOptionAsURL("application.site.url");
+
+ log.info(_("jaxxdemo.message.goto.site", siteURL));
+
+ if (log.isDebugEnabled()) {
+ log.debug("goto " + siteURL);
+ }
+ if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
+ try {
+ Desktop.getDesktop().browse(siteURL.toURI());
+ } catch (Exception ex) {
+ log.error(ex.getMessage(), ex);
+ ErrorDialogUI.showError(ex);
+ }
+ }
+ }
+
+ /**
+ * Informations about team.
+ */
+ public void showAbout() {
+ String message="Developers :"+"\n";
+ message+=" Gilles Crieloue"+"\n";
+ message+=" Amaury Fages"+"\n";
+ message+=" Florent Gilet"+"\n";
+ message+=" Langlais Dorian"+"\n";
+ message+="Version 1.0 Codelutin @ 2009-2010";
+ JOptionPane.showMessageDialog(null, message);
+ }
+
+
//GETTERS AND SETTERS
+ /**
+ *
+ * @return
+ */
public OurHashMap2 getOurHashMap(){
return ohm;
}
+ /**
+ *
+ * @param ohm
+ */
public void setOurHashMap(OurHashMap2 ohm){
this.ohm = ohm;
}
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/MSMNavigationListener.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/MSMNavigationListener.java 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/MSMNavigationListener.java 2010-02-27 00:45:14 UTC (rev 132)
@@ -5,9 +5,14 @@
package org.nuiton.mapstoragemanager.ui.gui;
+import java.awt.BorderLayout;
import java.awt.Color;
+import java.awt.Dimension;
import javax.swing.JLabel;
+import javax.swing.JScrollPane;
import javax.swing.JTable;
+import javax.swing.ScrollPaneLayout;
+import javax.swing.SwingUtilities;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.table.TableColumn;
@@ -22,9 +27,11 @@
@Override
public void valueChanged(TreeSelectionEvent e) {
- DefaultMutableTreeNode node = (DefaultMutableTreeNode)MainUI.getInstance().getNavigation().getLastSelectedPathComponent();
- MainUI.getInstance().getTableContent().removeAll();
- MainUI.getInstance().getTableName().removeAll();
+ MainUI ui = MainUI.getInstance();
+
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode)ui.getNavigation().getLastSelectedPathComponent();
+ ui.getTableContent().removeAll();
+ ui.getTableName().removeAll();
/* if nothing is selected */
if (node == null || node.isRoot()) {
@@ -34,16 +41,19 @@
TableModel model = new TableModel(node);
JTable jTable = new JTable(model);
+ JScrollPane scrollPane = new JScrollPane(jTable);
+ jTable.setFillsViewportHeight(true);
+
//we check attributes and values of the select table
//and display the result into the JPanel named 'tableContent'
- MainUI.getInstance().getTableContent().add(jTable);
+ ui.getTableContent().add(scrollPane);
}
- MainUI.getInstance().getTableName().add(new JLabel("<html><b><u>"+node.toString()+"</b></u></html>"));
- MainUI.getInstance().getTableContent().repaint();
- MainUI.getInstance().getTableContent().revalidate();
+ ui.getTableName().add(new JLabel("<html><b><u>"+node.toString()+"</b></u></html>"));
+ ui.getTableContent().repaint();
+ ui.getTableContent().revalidate();
}
Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/TableModel.java 2010-02-27 00:45:14 UTC (rev 132)
@@ -39,33 +39,28 @@
titres = new String[set.size()];
//content
+ Set<String> keySetTable = testHashmap2.getKeys(table);
Iterator i = set.iterator();
int j=0;
int k=0;
+ System.out.println("set.size() : "+set.size()+" | keySet.size() : "+keySetTable.size());
+ data = new String[set.size()][keySetTable.size()];
while(i.hasNext()){
String titreTemp = (String)i.next();
titres[j]=titreTemp;
- //content of data
- Set<String> keySet = testHashmap2.getKeys(table,titres[j]);
+ Set<String> keySet = testHashmap2.getKeys(table,titres[j]);
Iterator i2 = keySet.iterator();
-
- System.out.println(set.size()+" | "+keySet.size());
- if(j==0){
- data = new String[set.size()][keySet.size()];
- }
while(i2.hasNext()){
+ System.out.println("table = "+table);
+ System.out.println("titreTemp = "+titreTemp);
String str = testHashmap2.get(table,titreTemp,(String)i2.next());
data[j][k]=str;
System.out.println("data["+j+"]["+k+"] = "+data[j][k]);
k++;
- };
+ }
j++;
- k=0;
}
-
-
-
}
Modified: trunk/msm/src/main/resources/i18n/msm-en_GB.properties
===================================================================
--- trunk/msm/src/main/resources/i18n/msm-en_GB.properties 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/resources/i18n/msm-en_GB.properties 2010-02-27 00:45:14 UTC (rev 132)
@@ -1,9 +1,10 @@
+Empty=
Map\ Storage\ Manager=Map Storage Manager
-TABLE\ NAME\ \:\ TODO=
+No\ help\ today,\ sorry\ \!=No help today, sorry \!
connectionError=The connection attempt to failed, please retry \!
+jaxxdemo.message.goto.site=Visit site
jaxxdemo.tree.component=
login\ \:=Login
-map\ Storage\ Manager=
mapstoragemanager.action.aboutUs=About us
mapstoragemanager.action.aboutUs.tip=About Code Lutin
mapstoragemanager.action.connect=Connect
Modified: trunk/msm/src/main/resources/i18n/msm-fr_FR.properties
===================================================================
--- trunk/msm/src/main/resources/i18n/msm-fr_FR.properties 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/resources/i18n/msm-fr_FR.properties 2010-02-27 00:45:14 UTC (rev 132)
@@ -1,9 +1,10 @@
+Empty=Vide
Map\ Storage\ Manager=Map Storage Manager
-TABLE\ NAME\ \:\ TODO=
+No\ help\ today,\ sorry\ \!=Pas d'aide pour l'instant, d\u00E9sol\u00E9 \!
connectionError=La connexion \u00E0 \u00E9chou\u00E9e, r\u00E9essayez s'il vous pla\u00EEt \!
+jaxxdemo.message.goto.site=Visitez le site
jaxxdemo.tree.component=
login\ \:=Identifiant
-map\ Storage\ Manager=
mapstoragemanager.action.aboutUs=A propos
mapstoragemanager.action.aboutUs.tip=A propos de Code Lutin
mapstoragemanager.action.connect=Connexion
Added: trunk/msm/src/main/resources/icons/action-connect.png
===================================================================
(Binary files differ)
Property changes on: trunk/msm/src/main/resources/icons/action-connect.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/msm/src/main/resources/icons/action-disconnect.png
===================================================================
(Binary files differ)
Property changes on: trunk/msm/src/main/resources/icons/action-disconnect.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/msm/src/main/resources/msm.properties
===================================================================
--- trunk/msm/src/main/resources/msm.properties 2010-02-26 14:37:51 UTC (rev 131)
+++ trunk/msm/src/main/resources/msm.properties 2010-02-27 00:45:14 UTC (rev 132)
@@ -11,4 +11,7 @@
icon.action.exit=action-exit.png
icon.action.config=action-config.png
icon.action.i18n-fr=action-i18n-fr.png
-icon.action.i18n-uk=action-i18n-uk.png
\ No newline at end of file
+icon.action.i18n-uk=action-i18n-uk.png
+icon.action.connect=action-connect.png
+icon.action.disconnect=action-disconnect.png
+application.site.url=http\://www.nuiton.org/projects/show/mapstoragemanager
\ No newline at end of file
1
0
26 Feb '10
Author: dlanglais
Date: 2010-02-26 15:37:51 +0100 (Fri, 26 Feb 2010)
New Revision: 131
Added:
trunk/src/site/doc/analyse/importexport/
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:
Ajout de deux exemples de format d'import/export de contenu de bases. Tr?\195?\168s basique.
Pr?\195?\169f?\195?\169rence pour example2.
Added: trunk/src/site/doc/analyse/importexport/example1.dtd
===================================================================
--- trunk/src/site/doc/analyse/importexport/example1.dtd (rev 0)
+++ trunk/src/site/doc/analyse/importexport/example1.dtd 2010-02-26 14:37:51 UTC (rev 131)
@@ -0,0 +1,33 @@
+<?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 root SYSTEM "example1.dtd">
+
+ <root>
+ ...
+ </root>
+-->
+
+<!--- Put your DTDDoc comment here. -->
+<!ELEMENT root (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/src/site/doc/analyse/importexport/example1.xml
===================================================================
--- trunk/src/site/doc/analyse/importexport/example1.xml (rev 0)
+++ trunk/src/site/doc/analyse/importexport/example1.xml 2010-02-26 14:37:51 UTC (rev 131)
@@ -0,0 +1,20 @@
+<?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
+-->
+
+<root>
+ <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" />
+</root>
Added: trunk/src/site/doc/analyse/importexport/example2.dtd
===================================================================
--- trunk/src/site/doc/analyse/importexport/example2.dtd (rev 0)
+++ trunk/src/site/doc/analyse/importexport/example2.dtd 2010-02-26 14:37:51 UTC (rev 131)
@@ -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 root (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/src/site/doc/analyse/importexport/example2.xml
===================================================================
--- trunk/src/site/doc/analyse/importexport/example2.xml (rev 0)
+++ trunk/src/site/doc/analyse/importexport/example2.xml 2010-02-26 14:37:51 UTC (rev 131)
@@ -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
+-->
+
+<root>
+ <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>
+</root>
1
0
r130 - in trunk: msm msm/src/main/java/org/nuiton/mapstoragemanager/plugins msm-bighashmap msm-bighashmapV2 msm-hbase
by dlanglais@users.nuiton.org 26 Feb '10
by dlanglais@users.nuiton.org 26 Feb '10
26 Feb '10
Author: dlanglais
Date: 2010-02-26 05:49:19 +0100 (Fri, 26 Feb 2010)
New Revision: 130
Added:
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Exporter.java
trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Importer.java
Modified:
trunk/msm-bighashmap/pom.xml
trunk/msm-bighashmapV2/pom.xml
trunk/msm-hbase/pom.xml
trunk/msm/pom.xml
Log:
Modifications mineures des pom (ajout groupId nuiton.org ?\195?\160 ceux qui ne l'avait pas).
Ajout de deux interfaces pour des plugins d'import/export :
-> permettra l'import/export en suivant des "sch?\195?\169mas" diff?\195?\169rents.
Modified: trunk/msm/pom.xml
===================================================================
--- trunk/msm/pom.xml 2010-02-25 16:28:09 UTC (rev 129)
+++ trunk/msm/pom.xml 2010-02-26 04:49:19 UTC (rev 130)
@@ -14,9 +14,9 @@
<version>0.1-SNAPSHOT</version>
</parent>
- <!--version>0.1-SNAPSHOT</version-->
<groupId>org.nuiton</groupId>
<artifactId>msm</artifactId>
+ <version>0.1-SNAPSHOT</version>
<dependencies>
Added: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Exporter.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Exporter.java (rev 0)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Exporter.java 2010-02-26 04:49:19 UTC (rev 130)
@@ -0,0 +1,17 @@
+package org.nuiton.mapstoragemanager.plugins;
+
+import java.io.File;
+
+/**
+ * The interface for the exporter implementations.
+ * @author Dorian Langlais
+ */
+public interface Exporter {
+
+ /**
+ * Export the content of a "bigTable" in a file.
+ * @param bigTable the bigTable plugin.
+ * @param file the file in which export the content of the base.
+ */
+ void exportTo (final NewBigTable bigTable, final File file);
+}
\ No newline at end of file
Added: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Importer.java
===================================================================
--- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Importer.java (rev 0)
+++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Importer.java 2010-02-26 04:49:19 UTC (rev 130)
@@ -0,0 +1,17 @@
+package org.nuiton.mapstoragemanager.plugins;
+
+import java.io.File;
+
+/**
+ * The interface for the importer implementations.
+ * @author Dorian Langlais
+ */
+public interface Importer {
+
+ /**
+ * Import the content of a file in a "bigTable".
+ * @param bigTable the bigTable plugin.
+ * @param file the file in which export the content of the base.
+ */
+ void importFrom (final NewBigTable bigTable, final File file);
+}
\ No newline at end of file
Modified: trunk/msm-bighashmap/pom.xml
===================================================================
--- trunk/msm-bighashmap/pom.xml 2010-02-25 16:28:09 UTC (rev 129)
+++ trunk/msm-bighashmap/pom.xml 2010-02-26 04:49:19 UTC (rev 130)
@@ -22,8 +22,9 @@
<version>0.1-SNAPSHOT</version>
</parent>
+ <groupId>org.nuiton</groupId>
+ <artifactId>msm-bighashmap</artifactId>
<version>0.1-SNAPSHOT</version>
- <artifactId>msm-bighashmap</artifactId>
<dependencies>
Modified: trunk/msm-bighashmapV2/pom.xml
===================================================================
--- trunk/msm-bighashmapV2/pom.xml 2010-02-25 16:28:09 UTC (rev 129)
+++ trunk/msm-bighashmapV2/pom.xml 2010-02-26 04:49:19 UTC (rev 130)
@@ -22,8 +22,9 @@
<version>0.1-SNAPSHOT</version>
</parent>
+ <groupId>org.nuiton</groupId>
+ <artifactId>msm-bighashmapv2</artifactId>
<version>0.1-SNAPSHOT</version>
- <artifactId>msm-bighashmapv2</artifactId>
<dependencies>
Modified: trunk/msm-hbase/pom.xml
===================================================================
--- trunk/msm-hbase/pom.xml 2010-02-25 16:28:09 UTC (rev 129)
+++ trunk/msm-hbase/pom.xml 2010-02-26 04:49:19 UTC (rev 130)
@@ -35,8 +35,9 @@
<version>0.1-SNAPSHOT</version>
</parent>
+ <groupId>org.nuiton</groupId>
+ <artifactId>msm-hbase</artifactId>
<version>0.1-SNAPSHOT</version>
- <artifactId>msm-hbase</artifactId>
<dependencies>
1
0