2006/unicorn/src/org/w3c/unicorn/tasklist RDFUnmarshallerJena.java,1.1.2.5,1.1.2.6

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

Modified Files:
      Tag: dev2
	RDFUnmarshallerJena.java 
Log Message:
no more exception thrown. If an rdf file references an unknown task, a warning is logged but the parsing continues.

Index: RDFUnmarshallerJena.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/tasklist/Attic/RDFUnmarshallerJena.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
--- RDFUnmarshallerJena.java	17 Aug 2009 09:06:17 -0000	1.1.2.5
+++ RDFUnmarshallerJena.java	18 Aug 2009 11:51:34 -0000	1.1.2.6
@@ -9,6 +9,7 @@
 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;
@@ -80,9 +81,7 @@
 	 */
 	public void addURL(final URL aURL) throws IOException {
 		RDFUnmarshallerJena.logger.trace("addURL");
-		if (RDFUnmarshallerJena.logger.isDebugEnabled()) {
-			RDFUnmarshallerJena.logger.debug("URL : " + aURL + ".");
-		}
+		RDFUnmarshallerJena.logger.debug("URL : " + aURL + ".");
 		final Model aModel = ModelFactory.createDefaultModel();
 		aModel.read(aURL.openStream(), null);
 		this.aModel.add(aModel);
@@ -271,10 +270,14 @@
 		if (oTask == null) {
 			// TODO creer et initialiser une Task si les informations peuvent
 			// TODO etre mise uniquement dans le fichier rdf
-			RDFUnmarshallerJena.logger.error("No task with reference : "
-					+ aReference.getLiteral().getString() + ".");
-			throw new Exception("No task with reference : "
-					+ aReference.getLiteral().getString() + ".");
+			//RDFUnmarshallerJena.logger.error("No task with reference : "
+			//		+ aReference.getLiteral().getString() + ".");
+			//throw new Exception("No task with reference : "
+			//		+ aReference.getLiteral().getString() + ".");
+			Framework.logger.warn("> Found unused metadata for: " + aReference.getLiteral().getString());
+			return;
+		} else {
+			Framework.logger.debug("> Found metadata for: " + aReference.getLiteral().getString());
 		}
 		RDFUnmarshallerJena.logger.debug("Reference : "
 				+ aReference.getObject().toString() + ".");

Received on Tuesday, 18 August 2009 11:51:46 UTC