diff src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java @ 10:90911b2da322

more work on permissions...
author casties
date Thu, 12 Jul 2012 17:01:32 +0200
parents b2bfc3bc9ba8
children bc90aaeb925d
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java	Thu Jul 12 12:54:46 2012 +0200
+++ b/src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java	Thu Jul 12 17:01:32 2012 +0200
@@ -20,6 +20,7 @@
 import de.mpiwg.itgroup.annotations.Actor;
 import de.mpiwg.itgroup.annotations.Annotation;
 import de.mpiwg.itgroup.annotations.Annotation.FragmentTypes;
+import de.mpiwg.itgroup.annotations.Person;
 
 /**
  * @author casties
@@ -102,7 +103,7 @@
 			Node creatorNode = creatorRel.getStartNode();
 			String uri = (String) creatorNode.getProperty("uri", null);
 			String name = (String) creatorNode.getProperty("name", null);
-            Actor creator = new Actor(false, uri, name);
+            Actor creator = new Person(uri, name);
             annot.setCreator(creator);
 			// just the first one
 			break;
@@ -163,17 +164,12 @@
 			}
 
 			/*
-			 * The name of the creator of this annotation.
+			 * The creator of this annotation.
 			 */
-			String creatorName = annot.getCreatorName();
-
-			/*
-			 * The URI of the creator of this annotation.
-			 */
-			String creatorUri = annot.getCreatorUri();
-			if (creatorUri != null) {
-				Node creator = getOrCreatePersonNode(creatorUri, creatorName);
-				getOrCreateRelation(creator, RelationTypes.CREATED, annotNode);
+			Actor creator = annot.getCreator();
+			if (creator != null) {
+				Node creatorNode = getOrCreatePersonNode(creator);
+				getOrCreateRelation(creatorNode, RelationTypes.CREATED, annotNode);
 			}
 
 			/*
@@ -341,7 +337,8 @@
 		return target;
 	}
 
-	protected Node getOrCreatePersonNode(String uri, String name) {
+	protected Node getOrCreatePersonNode(Actor actor) {
+	    /*
 		// Person is identified by URI
 		Index<Node> idx = getNodeIndex(NodeTypes.PERSON);
 		IndexHits<Node> persons = idx.get("uri", uri);
@@ -363,6 +360,8 @@
 			}
 		}
 		return person;
+		*/
+	    return null;
 	}
 
 	/**