Index: extensions/jiwigo/trunk/pom.xml
===================================================================
--- extensions/jiwigo/trunk/pom.xml	(revision 6963)
+++ extensions/jiwigo/trunk/pom.xml	(revision 6964)
@@ -3,5 +3,5 @@
   <groupId>Jiwigo</groupId>
   <artifactId>Jiwigo</artifactId>
-  <version>0.0.1-SNAPSHOT</version>
+  <version>0.2</version>
   
 
@@ -50,6 +50,45 @@
 	    <version>1.0</version>
 	</dependency>	
-	 
-	
+	<dependency>
+	    <groupId>junit</groupId>
+	    <artifactId>junit</artifactId>
+	    <version>4.8.1</version>
+	</dependency>	
   </dependencies>
+  
+  <build>
+<!--    <plugins>-->
+<!--      <plugin>-->
+<!--        <groupId>org.apache.maven.plugins</groupId>-->
+<!--        <artifactId>maven-jar-plugin</artifactId>-->
+<!--        <configuration>-->
+<!--          <archive>-->
+<!--            <manifest>-->
+<!--              <addClasspath>true</addClasspath>-->
+<!--              <mainClass>fr.mael.jiwigo.Main</mainClass>-->
+<!--            </manifest>-->
+<!--          </archive>-->
+<!--        </configuration>-->
+<!--      </plugin>-->
+<!--    </plugins>-->
+    <plugins>
+      <plugin>
+        <!-- NOTE: We don't need a groupId specification because the group is
+             org.apache.maven.plugins ...which is assumed by default.
+         -->
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>2.2-beta-5</version>
+        <configuration>
+          <descriptorRefs>
+            <descriptorRef>jar-with-dependencies</descriptorRef>
+          </descriptorRefs>
+          <archive>
+            <manifest>
+              <mainClass>fr.mael.jiwigo.Main</mainClass>
+            </manifest>
+          </archive>
+        </configuration>
+       </plugin>
+      </plugins>
+  </build>
 </project>
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/TagDao.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/TagDao.java	(revision 6964)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/TagDao.java	(revision 6964)
@@ -0,0 +1,105 @@
+package fr.mael.jiwigo.dao;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jdom.Document;
+import org.jdom.Element;
+
+import fr.mael.jiwigo.Main;
+import fr.mael.jiwigo.om.Tag;
+import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
+import fr.mael.jiwigo.transverse.util.Outil;
+
+/**
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   
+ * Dao des catégories
+ * @author mael
+ *
+ */
+public class TagDao {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(Main.class);
+    /**
+     * Instance, afin d'utiliser un singleton
+     */
+    private static TagDao instance;
+
+    /**
+     * Constructeur privé, afin que seule l'instance soit accessible
+     */
+    private TagDao() {
+
+    }
+
+    /**
+     * @return l'instance
+     */
+    public static TagDao getInstance() {
+	if (instance == null) {
+	    instance = new TagDao();
+	}
+	return instance;
+    }
+
+    /**
+     * Lister les tag
+     * @return la liste des tags
+     * @throws IOException 
+     */
+    public List<Tag> lister() throws IOException {
+	Document doc = Main.sessionManager.executerReturnDocument(MethodsEnum.LISTER_TAGS.getLabel());
+	//	System.out.println(Outil.documentToString(doc));
+	Element element = doc.getRootElement().getChild("tags");
+	List<Element> listElement = (List<Element>) element.getChildren("tag");
+	ArrayList<Tag> tags = new ArrayList<Tag>();
+	for (Element t : listElement) {
+	    Tag tag = new Tag(t);
+	    tags.add(tag);
+	}
+	return tags;
+    }
+
+    /**
+     * Création d'un tag
+     * @param tag le tag à créer
+     * @return true si le tag a bien été créé
+     */
+    public boolean creer(Tag tag) {
+	try {
+	    return Outil.checkOk(Main.sessionManager.executerReturnDocument(MethodsEnum.ADD_TAG.getLabel(), "name", tag
+		    .getNom()));
+	} catch (IOException e) {
+	    LOG.error(Outil.getStackTrace(e));
+	}
+	return false;
+    }
+
+}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/om/Tag.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/om/Tag.java	(revision 6964)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/om/Tag.java	(revision 6964)
@@ -0,0 +1,45 @@
+package fr.mael.jiwigo.om;
+
+import org.jdom.Element;
+
+public class Tag {
+    /**
+     * Name of the tag 
+     */
+    String nom;
+
+    /**
+     * Empty constructor
+     */
+    public Tag() {
+    }
+
+    /**
+     * @param element the element in the RPC response
+     */
+    public Tag(Element element) {
+
+    }
+
+    /**
+     * @param nom the name of the tag
+     */
+    public Tag(String nom) {
+	this.nom = nom;
+    }
+
+    /**
+     * @return the nom
+     */
+    public String getNom() {
+	return nom;
+    }
+
+    /**
+     * @param nom the nom to set
+     */
+    public void setNom(String nom) {
+	this.nom = nom;
+    }
+
+}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/TagService.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/TagService.java	(revision 6964)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/TagService.java	(revision 6964)
@@ -0,0 +1,68 @@
+package fr.mael.jiwigo.service;
+
+import java.io.IOException;
+import java.util.List;
+
+import fr.mael.jiwigo.dao.TagDao;
+import fr.mael.jiwigo.om.Tag;
+
+/**
+ * 
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   
+ * @author mael
+ *
+ */
+public class TagService {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(TagService.class);
+
+    private static TagService instance;
+
+    public static TagService getInstance() {
+	if (instance == null) {
+	    instance = new TagService();
+	}
+	return instance;
+    }
+
+    private TagService() {
+
+    }
+
+    public List<Tag> lister() throws IOException {
+	return TagDao.getInstance().lister();
+    }
+
+    public boolean creer(String nom) throws IOException {
+	Tag tag = new Tag(nom);
+	return TagDao.getInstance().creer(tag);
+    }
+
+}
Index: extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java
===================================================================
--- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java	(revision 6963)
+++ extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java	(revision 6964)
@@ -37,5 +37,6 @@
 
     LOGIN("pwg.session.login"), LISTER_CATEGORIES("pwg.categories.getList"), LISTER_IMAGES("pwg.categories.getImages"), GET_INFO(
-	    "pwg.images.getInfo"), AJOUTER_CATEGORIE("pwg.categories.add"), AJOUTER_COMMENTAIRE("pwg.images.addComment");
+	    "pwg.images.getInfo"), AJOUTER_CATEGORIE("pwg.categories.add"), AJOUTER_COMMENTAIRE("pwg.images.addComment"), LISTER_TAGS(
+	    "pwg.tags.getList"), TAGS_ADMIN_LIST("pwg.tags.getAdminList"), ADD_TAG("pwg.tags.add");
 
     protected String label;
Index: extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/TagServiceTest.java
===================================================================
--- extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/TagServiceTest.java	(revision 6964)
+++ extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/TagServiceTest.java	(revision 6964)
@@ -0,0 +1,45 @@
+package fr.mael.jiwigo.service;
+
+import java.io.IOException;
+import java.util.Date;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+import fr.mael.jiwigo.TestBase;
+import fr.mael.jiwigo.dao.TagDao;
+
+public class TagServiceTest extends TestBase {
+
+    public TagServiceTest() {
+	super();
+    }
+
+    /**
+     *  Test of the listing method
+     */
+    @Test
+    public void ListerTest() {
+	try {
+	    TagDao.getInstance().lister();
+	} catch (IOException e) {
+	    e.printStackTrace();
+	}
+    }
+
+    /**
+     * Test of the creation method
+     */
+    @Test
+    public void creerTest() {
+	Date date = new Date();
+	try {
+	    Assert.assertSame(true, TagService.getInstance().creer("Tag" + date.getTime()));
+	} catch (IOException e) {
+	    // TODO Auto-generated catch block
+	    e.printStackTrace();
+	}
+    }
+
+}
