# HG changeset patch # User ymh # Date 1363217349 -3600 # Node ID 4f2511a70880d8c5e46c6aedadf4c59647b9bf03 # Parent 523f0647513e5aaa2f3b3f3d1eee79e07c4b54a8 add bin config from spaces. Add size to nodes. diff -r 523f0647513e -r 4f2511a70880 server/src/main/java/org/iri_research/renkan/controller/RenkanController.java --- a/server/src/main/java/org/iri_research/renkan/controller/RenkanController.java Wed Mar 13 15:47:08 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/controller/RenkanController.java Thu Mar 14 00:29:09 2013 +0100 @@ -6,6 +6,7 @@ import org.iri_research.renkan.RenkanException; import org.iri_research.renkan.models.Project; import org.iri_research.renkan.repositories.ProjectsRepository; +import org.iri_research.renkan.repositories.SpacesRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -29,7 +30,10 @@ private final Logger logger = LoggerFactory.getLogger(RenkanController.class); @Autowired - private ProjectsRepository projectRepository; + private ProjectsRepository projectsRepository; + + @Autowired + private SpacesRepository spacesRepository; private void checkCowebkey(String cowebkey, Project project) { if(cowebkey == null || cowebkey.isEmpty()) { @@ -62,7 +66,7 @@ throw new IllegalArgumentException("RenkanContoller.renkanProject: Project id is null or empty."); } - Project project = this.projectRepository.findOne(project_id); + Project project = this.projectsRepository.findOne(project_id); if(project == null) { throw new HttpClientErrorException(HttpStatus.NOT_FOUND, "Project " + project_id + " not found."); @@ -72,6 +76,7 @@ Map model = new HashMap(); model.put("project", project); + model.put("space", spacesRepository.findOne(project.getSpaceId())); return new ModelAndView("renkanProjectEdit", model); } diff -r 523f0647513e -r 4f2511a70880 server/src/main/java/org/iri_research/renkan/coweb/event/NodeSyncEventManager.java --- a/server/src/main/java/org/iri_research/renkan/coweb/event/NodeSyncEventManager.java Wed Mar 13 15:47:08 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/coweb/event/NodeSyncEventManager.java Thu Mar 14 00:29:09 2013 +0100 @@ -69,7 +69,9 @@ String node_id = (String)values.get("id"); - Node node = new Node(node_id, (String)values.get("title"), (String)values.get("description"), (String)values.get("uri"), (String)values.get("color"), creator_id, nodePosition, image, project_id); + Integer size = (Integer)values.get("size"); + + Node node = new Node(node_id, (String)values.get("title"), (String)values.get("description"), (String)values.get("uri"), (String)values.get("color"), creator_id, nodePosition, image, size, project_id); Integer position = (Integer)data.get("position"); diff -r 523f0647513e -r 4f2511a70880 server/src/main/java/org/iri_research/renkan/models/Node.java --- a/server/src/main/java/org/iri_research/renkan/models/Node.java Wed Mar 13 15:47:08 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/Node.java Thu Mar 14 00:29:09 2013 +0100 @@ -10,13 +10,14 @@ public class Node extends AbstractRenkanModel { - public Node(String id, String title, String description, String uri, String color, String createdBy, Point position, String image, String projectId) { + public Node(String id, String title, String description, String uri, String color, String createdBy, Point position, String image, Integer size, String projectId) { super(id, title, description, uri, color); this.projectId = projectId; this.createdBy = createdBy; this.position = position; this.image = image; + this.size = (size == null) ? 0 : size.intValue(); } @Field("project_id") @@ -29,12 +30,14 @@ private Point position = null; + private String image; + + private int size; + public Point getPosition() { return position; } - private String image; - public String getImage() { return image; } @@ -49,4 +52,9 @@ return createdBy; } + public int getSize() { + return size; + } + + } diff -r 523f0647513e -r 4f2511a70880 server/src/main/java/org/iri_research/renkan/models/Project.java --- a/server/src/main/java/org/iri_research/renkan/models/Project.java Wed Mar 13 15:47:08 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/Project.java Thu Mar 14 00:29:09 2013 +0100 @@ -91,7 +91,12 @@ this.created = date; } - + + @JsonProperty("space_id") + public String getSpaceId() { + return spaceId; + } + private String getRawKey(String prefix) { StringBuffer key = new StringBuffer(prefix!=null?prefix+"|":""); key.append(Constants.KEYHEX); diff -r 523f0647513e -r 4f2511a70880 server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html --- a/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html Wed Mar 13 15:47:08 2013 +0100 +++ b/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html Thu Mar 14 00:29:09 2013 +0100 @@ -20,12 +20,13 @@ +