add link for publish
authorymh <ymh.work@gmail.com>
Fri, 15 Mar 2013 10:38:05 +0100
changeset 80 5295e118320b
parent 79 f33771f3c510
child 81 555a094e2000
child 83 276514e62567
add link for publish
server/pom.xml
server/src/main/java/org/iri_research/renkan/Constants.java
server/src/main/java/org/iri_research/renkan/controller/RenkanController.java
server/src/main/java/org/iri_research/renkan/models/Project.java
server/src/main/webapp/WEB-INF/i18n/messages_en.properties
server/src/main/webapp/WEB-INF/i18n/messages_fr.properties
server/src/main/webapp/WEB-INF/templates/projectIndex.html
server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html
server/src/main/webapp/WEB-INF/templates/renkanProjectPublish.html
server/src/main/webapp/WEB-INF/templates/renkanProjectRender.html
server/src/main/webapp/static/data/simple-persist.php
server/src/main/webapp/static/data/test-data.json
server/src/main/webapp/static/js/corenkan.js
--- a/server/pom.xml	Thu Mar 14 13:48:35 2013 +0100
+++ b/server/pom.xml	Fri Mar 15 10:38:05 2013 +0100
@@ -14,7 +14,6 @@
         <jersey-version>1.17</jersey-version>
         <spring-version>3.2.1.RELEASE</spring-version>
         <spring-security-version>3.1.3.RELEASE</spring-security-version>
-        <!--jetty-version>9.0.0.RC0</jetty-version-->
         <jetty-version>8.1.9.v20130131</jetty-version>
         <junit-version>4.10</junit-version>
         <thymeleaf-version>2.0.16</thymeleaf-version>
@@ -80,6 +79,7 @@
                             <directory>../client/js</directory>
                             <includes>
                                 <include>i18n.js</include>
+                                <include>full-json.js</include>
                                 <include>*-bin.js</include>
                                 <include>models.js</include>
                                 <include>paper-renderer.js</include>
@@ -98,6 +98,13 @@
                             <directory>../client/img</directory>
                             <targetPath>static/img</targetPath>
                         </resource>
+                        <resource>
+                            <directory>../client/data</directory>
+                            <includes>
+                                <include>properties.json</include>
+                            </includes>
+                            <targetPath>static/data</targetPath>
+                        </resource>
                     </webResources>
                 </configuration>
             </plugin>
--- a/server/src/main/java/org/iri_research/renkan/Constants.java	Thu Mar 14 13:48:35 2013 +0100
+++ b/server/src/main/java/org/iri_research/renkan/Constants.java	Fri Mar 15 10:38:05 2013 +0100
@@ -40,4 +40,27 @@
 	public final static int SALT_LENGTH = 24;
 	public final static int PAGINATION_SIZE = 10;
 
+	public enum EditMode {
+		READ_ONLY(1),		
+		EDITION(2);
+		
+		private int value;
+		
+		private final static EditMode[] editModeValues = EditMode.values();
+		
+		private EditMode(int i) {
+			this.value = i;
+		}
+		
+		public static EditMode fromInt(int val) {
+			for(int i=0; i < editModeValues.length; i++) {
+				if(editModeValues[i].value == val)
+				{
+					return editModeValues[i];
+				}
+			}
+			return null;
+		}
+	}
+
 }
--- a/server/src/main/java/org/iri_research/renkan/controller/RenkanController.java	Thu Mar 14 13:48:35 2013 +0100
+++ b/server/src/main/java/org/iri_research/renkan/controller/RenkanController.java	Fri Mar 15 10:38:05 2013 +0100
@@ -3,6 +3,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.iri_research.renkan.Constants;
+import org.iri_research.renkan.Constants.EditMode;
 import org.iri_research.renkan.RenkanException;
 import org.iri_research.renkan.models.Project;
 import org.iri_research.renkan.repositories.ProjectsRepository;
@@ -12,6 +14,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
 import org.springframework.web.HttpMediaTypeNotSupportedException;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestHeader;
@@ -35,12 +38,12 @@
 	@Autowired
 	private SpacesRepository spacesRepository;
 	
-	private void checkCowebkey(String cowebkey, Project project) {
+	private void checkCowebkey(String cowebkey, Project project, Constants.EditMode editMode) {
 		if(cowebkey == null || cowebkey.isEmpty()) {
 			throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Cowebkey missing");
 		}
 		try {
-			if(!project.checkKey(cowebkey)) {
+			if(!project.checkKey(cowebkey, editMode)) {
 				throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Bad cowebkey");
 			}
 		} catch (RenkanException e) {
@@ -54,7 +57,8 @@
 			@PathVariable(value="project_id") String project_id,
 			@RequestHeader(value="Accept") String accept_header,
 			@RequestParam(value="cowebkey") String cowebkey
-			) throws HttpMediaTypeNotSupportedException {
+			) throws HttpMediaTypeNotSupportedException
+	{
 
 		this.logger.debug("renkanProject : " + project_id + " Accept : " + accept_header!=null?accept_header:"" + ", cowebkey: "+ cowebkey!=null?cowebkey:"");
 				
@@ -72,7 +76,7 @@
 			throw new HttpClientErrorException(HttpStatus.NOT_FOUND, "Project " + project_id + " not found.");
 		}
 		
-		this.checkCowebkey(cowebkey, project);
+		this.checkCowebkey(cowebkey, project, EditMode.EDITION);
 		
 		Map<String, Object> model = new HashMap<String, Object>();
 		model.put("project", project);
@@ -80,7 +84,27 @@
 		
 		return new ModelAndView("renkanProjectEdit", model);
 	}
+	
+	@RequestMapping(value="/pub/{project_id}", method = RequestMethod.GET, produces={"text/html;charset=UTF-8", "!image/*"})
+	public String renkanPublishProject(
+			Model model,
+			@PathVariable(value="project_id") String project_id,
+			@RequestParam(value="cowebkey") String cowebkey
+			)
+	{
+		if(project_id == null || project_id.length() == 0) {
+			throw new IllegalArgumentException("RenkanContoller.renkanProject: Project id is null or empty.");
+		}
 		
+		Project project = this.projectsRepository.findOne(project_id);
+
+		this.checkCowebkey(cowebkey, project, EditMode.READ_ONLY);
+		
+		model.addAttribute("project", project);
+		model.addAttribute("space", spacesRepository.findOne(project.getSpaceId()));
+		
+		return "renkanProjectPublish";
+	}
 	
 	/*@RequestMapping("/test")
 	public ModelAndView projectPrompt() {
--- a/server/src/main/java/org/iri_research/renkan/models/Project.java	Thu Mar 14 13:48:35 2013 +0100
+++ b/server/src/main/java/org/iri_research/renkan/models/Project.java	Fri Mar 15 10:38:05 2013 +0100
@@ -10,6 +10,7 @@
 
 import org.apache.commons.codec.binary.Hex;
 import org.iri_research.renkan.Constants;
+import org.iri_research.renkan.Constants.EditMode;
 import org.iri_research.renkan.RenkanException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -97,16 +98,22 @@
 		return spaceId;
 	}
 
-	private String getRawKey(String prefix) {		
+	private String getRawKey(String prefix, Constants.EditMode editMode) {		
 		StringBuffer key = new StringBuffer(prefix!=null?prefix+"|":"");
 		key.append(Constants.KEYHEX);
 		key.append(this.getId());
 		key.append('|');
 		key.append(this.getCreated().getTime());
+		key.append('|');
+		key.append(editMode.toString());
 		return key.toString();
 	}
 	
-	public String getKey() throws RenkanException {
+	public String getKey(int editMode) throws RenkanException {		
+		return this.getKey(EditMode.fromInt(editMode));
+	}
+	
+	public String getKey(Constants.EditMode editMode) throws RenkanException {
 		
 		// get salt
 		SecureRandom rand;
@@ -119,13 +126,13 @@
 		rand.nextBytes(salt);
 		String hex_salt = Hex.encodeHexString(salt);
 		
-		return hex_salt+"-"+this.getKey(hex_salt);
+		return hex_salt+"-"+this.getKey(hex_salt, editMode);
 		
 	}
 	
-	private String getKey(String hex_salt) throws RenkanException {
+	private String getKey(String hex_salt, Constants.EditMode editMode) throws RenkanException {
 		
-		String rawKey = this.getRawKey(hex_salt);
+		String rawKey = this.getRawKey(hex_salt, editMode);
 		
 		MessageDigest md;
 		try {
@@ -143,7 +150,7 @@
 		return key;		
 	}
 	
-	public boolean checkKey(String key) throws RenkanException {
+	public boolean checkKey(String key, Constants.EditMode editMode) throws RenkanException {
 		
 
 		if(key == null || key.isEmpty()) {
@@ -158,7 +165,7 @@
 		String salt = key_parts[0];
 		String signature = key_parts[1];
 		
-		String new_key = this.getKey(salt);
+		String new_key = this.getKey(salt, editMode);
 		
 		return new_key.equals(signature);
 	}
--- a/server/src/main/webapp/WEB-INF/i18n/messages_en.properties	Thu Mar 14 13:48:35 2013 +0100
+++ b/server/src/main/webapp/WEB-INF/i18n/messages_en.properties	Fri Mar 15 10:38:05 2013 +0100
@@ -8,7 +8,9 @@
 renkanIndex.project_name = Name
 renkanIndex.project_creation = Creation
 renkanIndex.project_edit = Edit
+renkanIndex.project_render = Render
 renkanIndex.project_edit_link = Edit project
+renkanIndex.project_render_link = render
 
 renkanIndex.space_exp = or create/open a space with the title
 renkanIndex.space_list = Spaces list
--- a/server/src/main/webapp/WEB-INF/i18n/messages_fr.properties	Thu Mar 14 13:48:35 2013 +0100
+++ b/server/src/main/webapp/WEB-INF/i18n/messages_fr.properties	Fri Mar 15 10:38:05 2013 +0100
@@ -9,7 +9,9 @@
 renkanIndex.project_title = Titre
 renkanIndex.project_creation = Creation
 renkanIndex.project_edit = Edition
+renkanIndex.project_render = Consult.
 renkanIndex.project_edit_link = Editer proj.
+renkanIndex.project_render_link = Consult. proj.
 
 renkanIndex.space_exp = ou bien créer un espace avec le titre
 renkanIndex.space_list = Liste des espace
--- a/server/src/main/webapp/WEB-INF/templates/projectIndex.html	Thu Mar 14 13:48:35 2013 +0100
+++ b/server/src/main/webapp/WEB-INF/templates/projectIndex.html	Fri Mar 15 10:38:05 2013 +0100
@@ -140,14 +140,18 @@
             <table>
               <thead>
                 <tr>
-                    <th th:text="#{renkanIndex.project_name}">Name</th><th th:text="#{renkanIndex.project_creation}">Creation</th><th th:text="#{renkanIndex.project_edit}">Edit</th>
+                    <th th:text="#{renkanIndex.project_name}">Name</th>
+                    <th th:text="#{renkanIndex.project_creation}">Creation</th>
+                    <th th:text="#{renkanIndex.project_edit}">Edit</th>
+                    <th th:text="#{renkanIndex.project_render}">render</th>
                 </tr>
               </thead>
               <tbody>
                 <tr th:each="project: ${page}">
                   <th th:text="${project.title}">title</th>
                   <td th:text="${#dates.format(project.created, #messages.msg('date.format'))}">date</td>
-                  <td><a href="#" th:href="@{'/p/'+${project.id}(cowebkey=${project.key})}" th:text="#{renkanIndex.project_edit_link}">Edit projet</a></td>
+                  <td><a href="#" th:href="@{'/p/'+${project.id}(cowebkey=${project.getKey(2)})}" th:text="#{renkanIndex.project_edit_link}">Edit projet</a></td>
+                  <td><a href="#" th:href="@{'/p/pub/'+${project.id}(cowebkey=${project.getKey(1)})}" th:text="#{renkanIndex.project_render_link}">Render projet</a></td>
                 </tr>
               </tbody>
             </table>            
--- a/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html	Thu Mar 14 13:48:35 2013 +0100
+++ b/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html	Fri Mar 15 10:38:05 2013 +0100
@@ -27,58 +27,53 @@
         <script type="text/javascript" th:inline="javascript">
             $(function() {
             	var renkan_config = {
-                    url: /*[[@{/rest/projects/}+${project.id}]]*/ "data/simple-persist.php",
                     static_url : /*[[@{/static/}]]*/ "",
                     bins: [
                         {
-                            bin: Rkns.Wikipedia.Bin,
+                            type: "Wikipedia",
                             lang: "en",
                             search: "Digital Humanities"
                         },
                         {
-                            bin: Rkns.Wikipedia.Bin,
+                            type: "Wikipedia",
                             lang: "ja",
                             search: "Digital Humanities"
                         },
                         {
-                            bin: Rkns.Twitter.Bin,
+                            type: "Twitter",
                             search: "Digital Humanities"
                         },
                         {
                             title: "LDT Project",
-                            bin: Rkns.Ldt.ProjectBin,
+                            type: "Ldt",
+                            ldt_type: "Project",
                             project_id: "67280b1c-ff30-11e0-a82d-00145ea49a02",
                             ldt_platform: "http://ldt.iri.centrepompidou.fr/"
                         }
                     ],
                     search: [
                         {
-                            type: Rkns.Wikipedia.Search,
+                            type: "Wikipedia",
                             lang: "fr"
                         }, 
                         {
-                            type: Rkns.Wikipedia.Search,
+                            type: "Wikipedia",
                             lang: "en"
                         }, 
                         {
-                            type: Rkns.Wikipedia.Search,
+                            type: "Wikipedia",
                             lang: "ja"
                         },
                         {
-                            type: Rkns.Twitter.Search
+                            type: "Twitter"
                         }
                     ],
+                    property_files: [
+                        /*[[@{/static/data/properties.json}]]*/ "data/properties.json",
+                    ],
                 };
             	var space_config = /*[[${space.binConfig}?${space.binConfig}:'{}']]*/"{}";
             	space_config = JSON.parse(space_config);
-            	for ( var i in (('bins' in space_config)?space_config.bins:[])) {
-					var bin_def = space_config.bins[i];
-            		bin_def.bin = eval(bin_def.bin);
-				}
-                for ( var i in (('search' in space_config)?space_config.search:[])) {
-                    var search_def = space_config.search[i];
-                	search_def.type = eval(bin_def.type);
-                }
                 var _renkan = new Rkns.Renkan($.extend({}, renkan_config, space_config));
                 var corenkanConfig = {
         	        projectId: /*[[${project.id}]]*/"new_project",
@@ -88,7 +83,6 @@
                 require({corenkanConfig: corenkanConfig}, ["corenkan"], function(corenkan) {            
                     corenkan.app.onStatusChange = function(status) {
                     	if(status == "ready") {
-                    	    _renkan.renderer.autoScale();
                     	}
                     };
                 });
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/webapp/WEB-INF/templates/renkanProjectPublish.html	Fri Mar 15 10:38:05 2013 +0100
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="fr" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
+    <head>
+        <meta charset="utf-8" />
+        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+        <title>RENKAN</title>
+        <meta name="description" content="" />
+        <meta name="author" content="Institut de Recherche et d'Innovation" />
+        <script src="lib/jquery.min.js" th:src="@{/static/lib/jquery.min.js}" ></script>
+        <script src="lib/jquery.mousewheel.min.js" th:src="@{/static/lib/jquery.mousewheel.min.js}"></script>
+        <script src="lib/underscore-min.js" th:src="@{/static/lib/underscore-min.js}"></script>
+        <script src="lib/backbone.js" th:src="@{/static/lib/backbone.js}"></script>
+        <script src="lib/backbone-relational.js" th:src="@{/static/lib/backbone-relational.js}"></script>
+        <script src="lib/paper.js" th:src="@{/static/lib/paper.js}"></script>
+        <script src="js/main.js" th:src="@{/static/js/main.js}"></script>
+        <script src="js/i18n.js" th:src="@{/static/js/i18n.js}"></script>
+        <script src="js/models.js" th:src="@{/static/js/models.js}"></script>
+        <script src="js/full-json.js" th:src="@{/static/js/full-json.js}"></script>
+        <script src="js/paper-renderer.js" th:src="@{/static/js/paper-renderer.js}"></script>        
+        <script type="text/javascript" th:inline="javascript">
+        /*<![CDATA[*/
+            var _renkan;
+            $(function() {
+                _renkan = new Rkns.Renkan({
+                	static_url:/*[[@{/static/}]]*/ "",
+                	read_only: true,
+                	url: /*[[@{/rest/projects/}+${project.id}]]*/ "../metadataplayer/json/renkan.json",
+                	property_files: [
+                	    /*[[@{/static/data/properties.json}]]*/ "data/properties.json",
+                	]
+                });
+                Rkns.jsonIO(_renkan, {
+                    url: /*[[@{/rest/projects/}+${project.id}]]*/ "../metadataplayer/json/renkan.json"
+                });
+            });
+        /*]]>*/    
+        </script>
+        <link rel="stylesheet" href="css/renkan.css" th:href="@{/static/css/renkan.css}"/>
+        <style type="text/css">
+        </style>
+    </head>
+
+    <body>
+        <div id="renkan"></div>
+    </body>
+</html>
--- a/server/src/main/webapp/WEB-INF/templates/renkanProjectRender.html	Thu Mar 14 13:48:35 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html lang="fr" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
-    <head>
-        <meta charset="utf-8" />
-        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
-        <title>Test de Rendu RENKAN</title>
-        <meta name="description" content="" />
-        <meta name="author" content="Institut de Recherche et d'Innovation" />
-        <script src="lib/jquery.min.js" th:src="@{/static/lib/jquery.min.js}"></script>
-        <script src="lib/jquery.mousewheel.min.js" th:src="@{/static/lib/jquery.mousewheel.min.js}"></script>
-        <script src="lib/underscore-min.js" th:src="@{/static/lib/underscore-min.js}"></script>
-        <script src="lib/backbone.js" th:src="@{/static/lib/backbone.js}"></script>
-        <script src="lib/backbone-relational.js" th:src="@{/static/lib/backbone-relational.js}"></script>
-        <script src="lib/paper.js" th:src="@{/static/lib/paper.js}"></script>
-        <script src="js/renkan-publish.js" th:src="@{/static/js/renkan-publish.js}"></script>
-        <script type="text/javascript" th:inline="javascript">
-        /*<![CDATA[*/
-            var _renkan;
-            $(function() {
-                _renkan = new Rkns.Renkan({static_url:/*[[@{/static/}]]*/ ""});
-                _renkan.addProject({
-                    url: /*[[@{/rest/projects/}+${project.id}]]*/ "../metadataplayer/json/renkan.json",
-                    callback: function(_proj) {
-                        if (_renkan.renderer) {
-                            _renkan.renderer.autoScale();
-                        }
-                    }
-                });
-                //_renkan.addProject({
-                //    url: "../metadataplayer/json/renkan.json"
-                //});
-                _renderer = _renkan.renderProjectAt(0);
-            });
-        /*]]>*/    
-        </script>
-        <link rel="stylesheet" href="css/renkan-publish.css" th:href="@{/static/css/renkan-publish.css}"/>
-        <style type="text/css">
-        </style>
-    </head>
-
-    <body>
-        <div id="renkan"></div>
-    </body>
-</html>
--- a/server/src/main/webapp/static/data/simple-persist.php	Thu Mar 14 13:48:35 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?php
-    header('Content-Type: application/json; charset=utf-8');
-    $file = "dynamic-data.json";
-    if (isset($_GET['reset']) && $_GET['reset']) {
-        $resetfile = "test-data.json";
-        file_put_contents($file, file_get_contents($resetfile));
-    }
-    if ($_SERVER['REQUEST_METHOD'] == 'PUT') {
-        file_put_contents($file, file_get_contents("php://input"));
-        echo json_encode(array("result" => "OK"));
-    } else {
-        echo file_get_contents($file);
-    }
-?>
\ No newline at end of file
--- a/server/src/main/webapp/static/data/test-data.json	Thu Mar 14 13:48:35 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,298 +0,0 @@
-{
-    "users": [
-        {
-            "_id": "u-anonymous",
-            "title": "anonymous",
-            "uri": "",
-            "description": "",
-            "color": "#dd00dd"
-        }, {
-            "_id": "u-cybunk",
-            "title": "Samuel",
-            "uri": "http://twitter.com/cybunk",
-            "description": "",
-            "color": "#e00000"
-        }, {
-            "_id": "u-raphv",
-            "title": "Raphael",
-            "uri": "http://twitter.com/raphv",
-            "description": "",
-            "color": "#00a000"
-        }
-    ],
-    "nodes": [
-        {
-            "_id": "node-2012-08-22-9da6eef6c6391d05-0001",
-            "title": "Chocs technologiques et tâches de l’université...",
-            "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/e328e188-ff2f-11e0-b9e1-00145ea49a02/#id=s_6C326EED-B91A-AEDF-032D-40D9A60AAD7E",
-            "description": "Bernard Stiegler:\nChocs technologiques et tâches de l’université. L'époque des digital studies\nベルナール・スティグレールによるプレゼンテーション『テクノロジーの衝撃と大学の諸課題――デジタル・スタディーズの時代』 (langue française フランス語)",
-            "position": {
-                "x": 35.50145330596697,
-                "y": -79.8809523809524
-            },
-            "image": "http://www.iri.centrepompidou.fr/dev/~veltr/hitachi-tests/img/ldt-segment.png",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "node-2012-08-22-9da6eef6c6391d05-0002",
-            "title": "Wiki: ベルナール・スティグレール",
-            "uri": "http://ja.wikipedia.org/wiki/%E3%83%99%E3%83%AB%E3%83%8A%E3%83%BC%E3%83%AB%E3%83%BB%E3%82%B9%E3%83%86%E3%82%A3%E3%82%B0%E3%83%AC%E3%83%BC%E3%83%AB",
-            "description": "|image_name = Bernard-Stiegler.jpg\n'''ベルナール・スティグレール'''('''Bernard Stiegler''',[[1952年]][[4月1日]] - )は、[[フランス]]の[[哲学者]]。\n",
-            "position": {
-                "x": -212.89325104742056,
-                "y": -142.05921029473706
-            },
-            "image": "http://www.iri.centrepompidou.fr/dev/~veltr/hitachi-tests/img/wikipedia.png",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "node-2012-08-22-9da6eef6c6391d05-0003",
-            "title": "Wiki: Bernard Stiegler",
-            "uri": "http://fr.wikipedia.org/wiki/Bernard_Stiegler",
-            "description": "Bernard Stiegler, né le 1 | avril | 1952, est un philosophe  français  qui axe sa réflexion sur les enjeux des mutations actuelles —  ... ",
-            "position": {
-                "x": -199.613212880364,
-                "y": -297.6715155910511
-            },
-            "image": "http://www.iri.centrepompidou.fr/dev/~veltr/hitachi-tests/img/wikipedia.png",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "node-2012-08-22-9da6eef6c6391d05-0004",
-            "title": "Tag: Stiegler",
-            "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/search/?search=Stiegler&field=all",
-            "description": "Tag 'Stiegler'",
-            "position": {
-                "x": -68.40773762286169,
-                "y": -205.76155213199334
-            },
-            "image": "http://www.iri.centrepompidou.fr/dev/~veltr/hitachi-tests/img/ldt-tag.png",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "node-2012-08-22-9da6eef6c6391d05-0009",
-            "title": "Wiki: Humanités numériques",
-            "uri": "http://fr.wikipedia.org/wiki/Humanit%C3%A9s_num%C3%A9riques",
-            "description": "une proposition de définition a été élaborée lors du THATCamp des 18 et 19 mai 2010 sous la forme d'un « Manifeste des digital humanities : ... ",
-            "position": {
-                "x": -227.84295519248332,
-                "y": 91.1816115015538
-            },
-            "image": "http://www.iri.centrepompidou.fr/dev/~veltr/hitachi-tests/img/wikipedia.png",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "node-2012-08-22-9da6eef6c6391d05-000a",
-            "title": "Wiki: デジタル・ヒューマニティーズ",
-            "uri": "http://ja.wikipedia.org/wiki/%E3%83%87%E3%82%B8%E3%82%BF%E3%83%AB%E3%83%BB%E3%83%92%E3%83%A5%E3%83%BC%E3%83%9E%E3%83%8B%E3%83%86%E3%82%A3%E3%83%BC%E3%82%BA",
-            "description": "...(digital humanities)は、コンピューティングと人文科学(humanities)諸分野と間の接点に関して調査、研究、教育、および�\n* Centre for Computing in the Humanities\n",
-            "position": {
-                "x": -221.48701615763574,
-                "y": 242.80740052545508
-            },
-            "image": "http://www.iri.centrepompidou.fr/dev/~veltr/hitachi-tests/img/wikipedia.png",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "node-2012-08-22-9da6eef6c6391d05-000b",
-            "title": "Digital studies",
-            "uri": "",
-            "description": "",
-            "position": {
-                "x": -62.798895620242085,
-                "y": 32.09820725365255
-            },
-            "created_by": "u-raphv"
-        }, {
-            "_id": "node-2012-08-22-9da6eef6c6391d05-000c",
-            "title": "Digital Humanities",
-            "uri": "",
-            "description": "",
-            "position": {
-                "x": -110.57020731070799,
-                "y": 160.92139209086253
-            },
-            "created_by": "u-raphv"
-        }, {
-            "_id": "node-2012-08-22-b778a9fc31296d6b-0008",
-            "title": "Les rétentions (Tweet)",
-            "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/e328e188-ff2f-11e0-b9e1-00145ea49a02/#id=a924b90c-46a1-4f0a-9e13-bcf69f7b5de0-127750274034049024",
-            "description": "Tweet by Vincent Puig: #tfcem Les rétentions primaires (perception) s'aggrégent et forment des rétentions secondaires (mémoire), gravées sur rétentions tertiaires",
-            "position": {
-                "x": 186.15055288633457,
-                "y": -184.66836073709257
-            },
-            "image": "http://a1.twimg.com/profile_images/379424006/PortaitVP120Ko_normal.jpg",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "node-2012-08-22-b778a9fc31296d6b-0009",
-            "title": "L'origine de la géométrie (Tweet)",
-            "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/e328e188-ff2f-11e0-b9e1-00145ea49a02/#id=5b34ae61-ffb1-4535-a479-007cb0ef57e8-127752118743474177",
-            "description": "Tweet by Vincent Puig: #tfcem L'origine de la géométrie: l'écriture est processus long de transindividuation. Nos tweets quasi temps réel sont de même nature++",
-            "position": {
-                "x": 87.82365160023906,
-                "y": -280.3591650733953
-            },
-            "image": "http://a1.twimg.com/profile_images/379424006/PortaitVP120Ko_normal.jpg",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "node-2012-08-22-b778a9fc31296d6b-000a",
-            "title": "Polemictweet : un outil Digital Studies (Tweet)",
-            "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/e328e188-ff2f-11e0-b9e1-00145ea49a02/#id=4b34e895-221b-467b-a0f2-8ff4ae87cae4-127758736415666177",
-            "description": "Tweet by Vincent Puig:\n#tfcem Polemictweet : un outil Digital Studies pensé à l'IRI comme rétention tertiaire numérique avec les même armes que l'industrie",
-            "position": {
-                "x": 168.59118089416432,
-                "y": 57.97933221077804
-            },
-            "image": "http://a1.twimg.com/profile_images/379424006/PortaitVP120Ko_normal.jpg",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "node-2012-08-22-b778a9fc31296d6b-000f",
-            "title": "Rétention (Définition AI)",
-            "uri": "http://arsindustrialis.org/vocabulaire-ars-industrialis/r%C3%A9tention",
-            "description": "Les rétentions sont ce qui est retenu ou recueilli par la conscience. Ce terme est emprunté à Husserl ; mais les rétentions tertiaires sont propres à la philosophie de Bernard Stiegler.\n\nLes rétentions sont des sélections : dans le flux de conscience que vous êtes vous ne pouvez pas tout retenir, ce que vous retenez est ce que vous êtes, mais ce que vous retenez dépend ce que vous avez déjà retenu.\n\nL’espèce humaine, étant originairement constituée par sa prothéticité, dispose d’une troisième mémoire, ni génétique, ni épigénétique : le milieu épiphylogénétique, comme ensemble des rétentions tertiaires formant des dispositifs rétentionels.",
-            "position": {
-                "x": 276.41820932461013,
-                "y": -62.82646518900019
-            },
-            "image": "http://www.arsindustrialis.org/sites/default/files/userfiles/user3/Logovocabulairenoir.JPG",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "node-2012-08-22-5b349e49066c1b01-0001",
-            "title": "Polemic Tweet",
-            "uri": "http://polemictweet.com/",
-            "description": "Polemic Tweet Web Site",
-            "position": {
-                "x": 220.96817493563964,
-                "y": 196.75746750735607
-            },
-            "image": "http://www.polemictweet.com/images/ENMI_2010_logo.gif",
-            "created_by": "u-cybunk"
-        }
-    ],
-    "edges": [
-        {
-            "_id": "edge-2012-08-22-9da6eef6c6391d05-0005",
-            "title": "is about",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-9da6eef6c6391d05-0002",
-            "to": "node-2012-08-22-9da6eef6c6391d05-0004",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "edge-2012-08-22-9da6eef6c6391d05-0006",
-            "title": "is about",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-9da6eef6c6391d05-0003",
-            "to": "node-2012-08-22-9da6eef6c6391d05-0004",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "edge-2012-08-22-9da6eef6c6391d05-0007",
-            "title": "speech by",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-9da6eef6c6391d05-0001",
-            "to": "node-2012-08-22-9da6eef6c6391d05-0004",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-0001",
-            "title": "is about",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-9da6eef6c6391d05-0001",
-            "to": "node-2012-08-22-9da6eef6c6391d05-000b",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-0002",
-            "title": "Are related to",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-9da6eef6c6391d05-000b",
-            "to": "node-2012-08-22-9da6eef6c6391d05-000c",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-0003",
-            "title": "is about",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-9da6eef6c6391d05-0009",
-            "to": "node-2012-08-22-9da6eef6c6391d05-000c",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-0004",
-            "title": "is about",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-9da6eef6c6391d05-000a",
-            "to": "node-2012-08-22-9da6eef6c6391d05-000c",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-000b",
-            "title": "is about",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-b778a9fc31296d6b-000a",
-            "to": "node-2012-08-22-9da6eef6c6391d05-000b",
-            "created_by": "u-raphv"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-000c",
-            "title": "tweeted during",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-b778a9fc31296d6b-0009",
-            "to": "node-2012-08-22-9da6eef6c6391d05-0001",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-000d",
-            "title": "tweeted during",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-b778a9fc31296d6b-0008",
-            "to": "node-2012-08-22-9da6eef6c6391d05-0001",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-000e",
-            "title": "tweeted during",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-b778a9fc31296d6b-000a",
-            "to": "node-2012-08-22-9da6eef6c6391d05-0001",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-0011",
-            "title": "is about",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-b778a9fc31296d6b-0008",
-            "to": "node-2012-08-22-b778a9fc31296d6b-000f",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "edge-2012-08-22-b778a9fc31296d6b-0012",
-            "title": "is about",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-b778a9fc31296d6b-000a",
-            "to": "node-2012-08-22-b778a9fc31296d6b-000f",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "edge-2012-08-22-5b349e49066c1b01-0002",
-            "title": "is about",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-b778a9fc31296d6b-000a",
-            "to": "node-2012-08-22-5b349e49066c1b01-0001",
-            "created_by": "u-cybunk"
-        }, {
-            "_id": "edge-2012-09-06-70cc0c2d5e1112d3-0001",
-            "title": "is an example of",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-b778a9fc31296d6b-000a",
-            "to": "node-2012-08-22-9da6eef6c6391d05-000b",
-            "created_by": "u-anonymous"
-        }, {
-            "_id": "edge-2012-09-06-70cc0c2d5e1112d3-0002",
-            "title": "tool used",
-            "uri": "",
-            "description": "",
-            "from": "node-2012-08-22-5b349e49066c1b01-0001",
-            "to": "node-2012-08-22-b778a9fc31296d6b-000a",
-            "created_by": "u-anonymous"
-        }
-    ]
-}
\ No newline at end of file
--- a/server/src/main/webapp/static/js/corenkan.js	Thu Mar 14 13:48:35 2013 +0100
+++ b/server/src/main/webapp/static/js/corenkan.js	Fri Mar 15 10:38:05 2013 +0100
@@ -104,7 +104,7 @@
     	obj = json.parse(state);
     	console.log("State response", obj);
     	obj['_id'] = obj['id'];
-    	this.project.set(obj, {silent: true});    	
+    	this.project.set(obj);
     };
     
     function prepareValues(obj,c) {
@@ -297,8 +297,9 @@
 	        		console.log(c);
 	        		values = {
 	        		    id: obj.id,
-	        		    type: "project",
-	        		    project_id: obj.id
+	        		    _type: "project",
+	        		    _project_id: obj.id,
+	        		    _user_id : (this.project.current_user!=null)?this.project.current_user.id:null
 	        		};
 	        		values[field] = c;
 	        		that.collab.sendSync("project", values);