2006/unicorn/src/org/w3c/unicorn/tasklist RDFUnmarshallerJena.java,1.1.2.7,1.1.2.8 TaskListUnmarshallerBeans.java,1.1.2.5,1.1.2.6 RDFUnmarshaller.java,1.1.2.2,1.1.2.3 TasksListUnmarshaller.java,1.1.2.2,1.1.2.3 Tasklist.java,1.1.2.1,1.1.2.2

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/tasklist
In directory hutz:/tmp/cvs-serv22746/src/org/w3c/unicorn/tasklist

Modified Files:
      Tag: dev2
	RDFUnmarshallerJena.java TaskListUnmarshallerBeans.java 
	RDFUnmarshaller.java TasksListUnmarshaller.java Tasklist.java 
Log Message:
translation of values in RDF file was broken + some cleaning

Index: RDFUnmarshallerJena.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/tasklist/Attic/RDFUnmarshallerJena.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -d -r1.1.2.7 -r1.1.2.8
--- RDFUnmarshallerJena.java	20 Aug 2009 14:06:22 -0000	1.1.2.7
+++ RDFUnmarshallerJena.java	20 Aug 2009 14:42:11 -0000	1.1.2.8
@@ -6,14 +6,13 @@
 
 import java.io.IOException;
 import java.net.URL;
-import java.util.Map;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.w3c.unicorn.Framework;
-import org.w3c.unicorn.contract.Observer;
-import org.w3c.unicorn.tasklist.parameters.Mapping;
 import org.w3c.unicorn.tasklist.parameters.Parameter;
 import org.w3c.unicorn.tasklist.parameters.Value;
+
 import com.hp.hpl.jena.rdf.model.Literal;
 import com.hp.hpl.jena.rdf.model.Model;
 import com.hp.hpl.jena.rdf.model.ModelFactory;
@@ -40,16 +39,12 @@
 
 	private static Property PROPERTY_DESCRIPTION = null;
 
-	private static Property PROPERTY_HASMAPPING = null;
-
 	private static Property PROPERTY_HASPARAMETER = null;
 
 	private static Property PROPERTY_HASVALUE = null;
 
 	private static Property PROPERTY_LONGNAME = null;
 
-	private static Property PROPERTY_OBSERVER = null;
-
 	private static Property PROPERTY_PARAMETER = null;
 
 	private static Property PROPERTY_REFERENCE = null;
@@ -60,9 +55,7 @@
 	
 	private static Property PROPERTY_DEFAULT = null;
 
-	private Map<String, Observer> mapOfObserver = null;
-
-	private Tasklist<String, Task> mapOfTask = null;
+	private Tasklist mapOfTask = null;
 
 	private Model aModel = null;
 
@@ -150,36 +143,6 @@
 	}
 
 	/**
-	 * Adds a mapping to the given value.
-	 * 
-	 * @param value
-	 *            The value to map.
-	 * @param aMapping
-	 *            The mapping for the value.
-	 */
-	private void addMapping(final Value aValue, final Resource aMapping) {
-		RDFUnmarshallerJena.logger.trace("addMapping");
-		if (RDFUnmarshallerJena.logger.isDebugEnabled()) {
-			RDFUnmarshallerJena.logger.debug("Value : " + aValue.getName()
-					+ ".");
-			RDFUnmarshallerJena.logger.debug("Mapping : "
-					+ aMapping.getLocalName() + ".");
-		}
-		// TODO verifier ce brol
-		final String sObserver = aMapping.getProperty(
-				RDFUnmarshallerJena.PROPERTY_OBSERVER).getLiteral().getString();
-		final String sParameter = aMapping.getProperty(
-				RDFUnmarshallerJena.PROPERTY_PARAMETER).getLiteral()
-				.getString();
-		final String sValue = aMapping.getProperty(
-				RDFUnmarshallerJena.PROPERTY_VALUE).getLiteral().getString();
-		final Mapping oMapping = new Mapping();
-		oMapping.setObserver(this.mapOfObserver.get(sObserver));
-		oMapping.setParam(sParameter);
-		oMapping.setValue(sValue);
-	}
-
-	/**
 	 * Adds a value to the given parameter.
 	 * 
 	 * @param aParameter
@@ -189,7 +152,7 @@
 	 */
 	private void addValue(final Parameter aParameter, final Resource aValue) {
 		final String sValue = aValue.getProperty(
-				RDFUnmarshallerJena.PROPERTY_VALUE).getLiteral().getString();
+				RDFUnmarshallerJena.PROPERTY_REFERENCE).getLiteral().getString();
 		final Value oValue = aParameter.getValue(sValue);
 		if (null == oValue) {
 			RDFUnmarshallerJena.logger.warn("Value " + sValue
@@ -204,15 +167,6 @@
 			final Literal lLongName = siLongName.nextStatement().getLiteral();
 			this.addLongName(oValue, lLongName);
 		} // find and add longName of the Value
-		// TODO completer l'ajout de Value
-		// find and add mapping of the Value
-		for (final StmtIterator siMapping = aValue
-				.listProperties(RDFUnmarshallerJena.PROPERTY_HASMAPPING); siMapping
-				.hasNext();) {
-			final Resource aMapping = (Resource) siMapping.nextStatement()
-					.getObject();
-			this.addMapping(oValue, aMapping);
-		} // find and add mapping of the Value
 	}
 
 	/**
@@ -332,25 +286,9 @@
 	}
 
 	/**
-	 * @return Returns the observers.
-	 */
-	/*
-	 * public Map<String, Observer> getMapOfObserver () { return
-	 * this.mapOfObserver; }
-	 */
-
-	/**
-	 * @param mapOfTask
-	 *            The observers to set.
-	 */
-	public void setMapOfObserver(final Map<String, Observer> mapOfObserver) {
-		this.mapOfObserver = mapOfObserver;
-	}
-
-	/**
 	 * @return Returns the tasks.
 	 */
-	public Tasklist<String, Task> getMapOfTask() {
+	public Tasklist getMapOfTask() {
 		return this.mapOfTask;
 	}
 
@@ -358,7 +296,7 @@
 	 * @param mapOfTask
 	 *            The tasks to set.
 	 */
-	public void setMapOfTask(final Tasklist<String, Task> mapOfTask) {
+	public void setMapOfTask(final Tasklist mapOfTask) {
 		this.mapOfTask = mapOfTask;
 	}
 
@@ -378,14 +316,6 @@
 		PROPERTY_DESCRIPTION = pROPERTYDESCRIPTION;
 	}
 
-	public static Property getPROPERTY_HASMAPPING() {
-		return PROPERTY_HASMAPPING;
-	}
-
-	public static void setPROPERTY_HASMAPPING(Property pROPERTYHASMAPPING) {
-		PROPERTY_HASMAPPING = pROPERTYHASMAPPING;
-	}
-
 	public static Property getPROPERTY_HASPARAMETER() {
 		return PROPERTY_HASPARAMETER;
 	}
@@ -410,14 +340,6 @@
 		PROPERTY_LONGNAME = pROPERTYLONGNAME;
 	}
 
-	public static Property getPROPERTY_OBSERVER() {
-		return PROPERTY_OBSERVER;
-	}
-
-	public static void setPROPERTY_OBSERVER(Property pROPERTYOBSERVER) {
-		PROPERTY_OBSERVER = pROPERTYOBSERVER;
-	}
-
 	public static Property getPROPERTY_PARAMETER() {
 		return PROPERTY_PARAMETER;
 	}

Index: RDFUnmarshaller.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/tasklist/Attic/RDFUnmarshaller.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- RDFUnmarshaller.java	20 Aug 2009 14:06:22 -0000	1.1.2.2
+++ RDFUnmarshaller.java	20 Aug 2009 14:42:11 -0000	1.1.2.3
@@ -4,9 +4,6 @@
 // Please first read the full copyright statement in file COPYRIGHT.html
 package org.w3c.unicorn.tasklist;
 
-import java.util.Map;
-
-import org.w3c.unicorn.contract.Observer;
 import org.w3c.unicorn.util.Unmarshaller;
 
 /**
@@ -15,11 +12,8 @@
  */
 public interface RDFUnmarshaller extends Unmarshaller {
 
-	public abstract Tasklist<String, Task> getMapOfTask();
-
-	public abstract void setMapOfObserver(
-			final Map<String, Observer> mapOfObserver);
+	public abstract Tasklist getMapOfTask();
 
-	public abstract void setMapOfTask(final Tasklist<String, Task> mapOfTask);
+	public abstract void setMapOfTask(final Tasklist mapOfTask);
 
 }

Index: Tasklist.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/tasklist/Attic/Tasklist.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- Tasklist.java	20 Aug 2009 14:06:22 -0000	1.1.2.1
+++ Tasklist.java	20 Aug 2009 14:42:11 -0000	1.1.2.2
@@ -4,7 +4,7 @@
 
 import org.w3c.unicorn.Framework;
 
-public class Tasklist<K, V> extends LinkedHashMap<String, Task> {
+public class Tasklist extends LinkedHashMap<String, Task> {
 
 	private static final long serialVersionUID = -868579272922431097L;
 

Index: TasksListUnmarshaller.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/tasklist/Attic/TasksListUnmarshaller.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- TasksListUnmarshaller.java	20 Aug 2009 14:06:22 -0000	1.1.2.2
+++ TasksListUnmarshaller.java	20 Aug 2009 14:42:11 -0000	1.1.2.3
@@ -20,6 +20,6 @@
 	 * 
 	 * @return Returns the tasks.
 	 */
-	public abstract Tasklist<String, org.w3c.unicorn.tasklist.Task> getMapOfTask();
+	public abstract Tasklist getMapOfTask();
 
 }

Index: TaskListUnmarshallerBeans.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/tasklist/Attic/TaskListUnmarshallerBeans.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -d -r1.1.2.5 -r1.1.2.6
--- TaskListUnmarshallerBeans.java	20 Aug 2009 14:06:22 -0000	1.1.2.5
+++ TaskListUnmarshallerBeans.java	20 Aug 2009 14:42:11 -0000	1.1.2.6
@@ -60,7 +60,7 @@
 	 * The tasklist corresponding to the xml file
 	 */
 	//private Map<String, Task> mapOfTask;
-	private Tasklist<String, Task> mapOfTask;
+	private Tasklist mapOfTask;
 	
 	/**
 	 * The observers' list used to check some constraints on the tasks
@@ -73,7 +73,7 @@
 	public TaskListUnmarshallerBeans(final Map<String, Observer> mapOfObserver) {
 		TaskListUnmarshallerBeans.logger.trace("Constructor");
 		//this.mapOfTask = new LinkedHashMap<String, org.w3c.unicorn.tasklist.Task>();
-		this.mapOfTask = new Tasklist<String, org.w3c.unicorn.tasklist.Task>();
+		this.mapOfTask = new Tasklist();
 		this.mapOfObserver = mapOfObserver;
 	}
 
@@ -479,7 +479,7 @@
 		}
 	}
 
-	public Tasklist<String, org.w3c.unicorn.tasklist.Task> getMapOfTask() {
+	public Tasklist getMapOfTask() {
 		TaskListUnmarshallerBeans.logger.trace("getMapOfTask");
 		return this.mapOfTask;
 	}

Received on Thursday, 20 August 2009 14:42:23 UTC