diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java index dae68cce..96e0d3d3 100755 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java @@ -140,10 +140,10 @@ public class FreemindExporter final String shape = mindmapTopic.getShape(); if (shape != null && !shape.isEmpty()) { - if (isRoot && !ShapeStyle.ROUNDED_RETAGLE.getStyle().endsWith(shape) || !isRoot && !ShapeStyle.LINE.getStyle().endsWith(shape)) { + if (isRoot && !ShapeStyle.ROUNDED_RECTANGLE.getStyle().endsWith(shape) || !isRoot && !ShapeStyle.LINE.getStyle().endsWith(shape)) { String style = shape; - if (ShapeStyle.ROUNDED_RETAGLE.getStyle().equals(shape)) { + if (ShapeStyle.ROUNDED_RECTANGLE.getStyle().equals(shape)) { style = "bubble"; } freemindNode.setSTYLE(style); diff --git a/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java b/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java index 43fafb87..fb6a8dbb 100755 --- a/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java @@ -128,7 +128,7 @@ public class FreemindImporter convertNodeProperties(freeNode, wiseTopic); - wiseTopic.setShape(ShapeStyle.ROUNDED_RETAGLE.getStyle()); + wiseTopic.setShape(ShapeStyle.ROUNDED_RECTANGLE.getStyle()); mindmapMap.getTopic().add(wiseTopic); mindmapMap.setName(mapName); @@ -631,7 +631,7 @@ public class FreemindImporter String result = node.getSTYLE(); // In freemind a node without style is a line if ("bubble".equals(result)) { - result = ShapeStyle.ROUNDED_RETAGLE.getStyle(); + result = ShapeStyle.ROUNDED_RECTANGLE.getStyle(); } else { result = ShapeStyle.LINE.getStyle(); } diff --git a/wise-webapp/src/main/java/com/wisemapping/model/CollaboratorProperties.java b/wise-webapp/src/main/java/com/wisemapping/model/CollaboratorProperties.java new file mode 100644 index 00000000..1326ce11 --- /dev/null +++ b/wise-webapp/src/main/java/com/wisemapping/model/CollaboratorProperties.java @@ -0,0 +1,69 @@ +/* +* Copyright [2011] [wisemapping] +* +* Licensed under WiseMapping Public License, Version 1.0 (the "License"). +* It is basically the Apache License, Version 2.0 (the "License") plus the +* "powered by wisemapping" text requirement on every single page; +* you may not use this file except in compliance with the License. +* You may obtain a copy of the license at +* +* http://www.wisemapping.org/license +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package com.wisemapping.model; + +import org.jetbrains.annotations.NotNull; + +public class CollaboratorProperties { + private long id; + private boolean starred; + private Collaborator collaborator; + private MindMap mindmap; + + + public CollaboratorProperties(@NotNull Collaborator collaborator, @NotNull MindMap mindmap) { + this.collaborator = collaborator; + this.mindmap = mindmap; + } + + public CollaboratorProperties(){ + + } + + public boolean getStarred() { + return starred; + } + + public void setStarred(boolean starred) { + this.starred = starred; + } + public Collaborator getCollaborator() { + return collaborator; + } + + public void setCollaborator(Collaborator collaborator) { + this.collaborator = collaborator; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public MindMap getMindmap() { + return mindmap; + } + + public void setMindmap(@NotNull MindMap mindmap) { + this.mindmap = mindmap; + } +} diff --git a/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java b/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java index 93a8c278..a149f176 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/MindMap.java @@ -19,7 +19,6 @@ package com.wisemapping.model; import com.wisemapping.util.ZipUtils; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import java.io.IOException; @@ -33,17 +32,18 @@ public class MindMap { private static final String UTF_8 = "UTF-8"; //~ Instance fields ...................................................................................... - + private int id; private Calendar creationTime; private String creator; private String description; - private int id; private boolean isPublic; private Calendar lastModificationTime; private String lastModifierUser; private Set mindmapUsers = new HashSet(); + private Set collaboratorProperties = new HashSet(); + private User owner; private String properties; private String tags; @@ -86,7 +86,7 @@ public class MindMap { throws IOException { byte[] result = this.xml; if (result != null) { - result = ZipUtils.stringToZip(new String(result, UTF_8)); + result = ZipUtils.stringToZip(new String(result, UTF_8)); } return result; } @@ -219,6 +219,41 @@ public class MindMap { return owner; } + public Set getCollaboratorProperties() { + return collaboratorProperties; + } + + public void setCollaboratorProperties(@NotNull Set collaboratorProperties) { + this.collaboratorProperties = collaboratorProperties; + } + + private CollaboratorProperties findUserProperty(@NotNull Collaborator collaborator) { + final Set collaboratorProperties = this.getCollaboratorProperties(); + CollaboratorProperties result = null; + for (CollaboratorProperties collaboratorProperty : collaboratorProperties) { + final Collaborator propCollab = collaboratorProperty.getCollaborator(); + if (propCollab != null && propCollab.getEmail().equals(collaborator.getEmail())) { + result = collaboratorProperty; + break; + } + } + return result; + } + + public void setStarred(@NotNull Collaborator collaborator, boolean value) { + CollaboratorProperties collaboratorProperties = this.findUserProperty(collaborator); + if (collaboratorProperties == null) { + collaboratorProperties = new CollaboratorProperties(collaborator, this); + } + collaboratorProperties.setStarred(value); + this.getCollaboratorProperties().add(collaboratorProperties); + } + + public boolean isStarred(@NotNull Collaborator collaborator) { + final CollaboratorProperties collaboratorProperty = this.findUserProperty(collaborator); + return collaboratorProperty != null && collaboratorProperty.getStarred(); + } + public static String getDefaultMindmapXml(@NotNull final String title) { final StringBuilder result = new StringBuilder(); diff --git a/wise-webapp/src/main/java/com/wisemapping/model/ShapeStyle.java b/wise-webapp/src/main/java/com/wisemapping/model/ShapeStyle.java index b8f26e05..3f84dfaf 100755 --- a/wise-webapp/src/main/java/com/wisemapping/model/ShapeStyle.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/ShapeStyle.java @@ -21,9 +21,9 @@ package com.wisemapping.model; public enum ShapeStyle { LINE("line"), - ROUNDED_RETAGLE("rounded rectagle"), - RECTAGLE("rectagle"), - ELIPSE("elipse"); + ROUNDED_RECTANGLE("rounded rectagle"), + RECTANGLE("rectagle"), + ELLIPSE("elipse"); private String style; diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java index 2d2012c6..0b7fa7b5 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -1,3 +1,21 @@ +/* +* Copyright [2011] [wisemapping] +* +* Licensed under WiseMapping Public License, Version 1.0 (the "License"). +* It is basically the Apache License, Version 2.0 (the "License") plus the +* "powered by wisemapping" text requirement on every single page; +* you may not use this file except in compliance with the License. +* You may obtain a copy of the license at +* +* http://www.wisemapping.org/license +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + package com.wisemapping.rest; @@ -35,8 +53,9 @@ public class MindmapController extends BaseController { @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "text/html", "application/xml"}) @ResponseBody public ModelAndView getMindmap(@PathVariable int id) throws IOException { + final User user = com.wisemapping.security.Utils.getUser(); final MindMap mindMap = mindmapService.getMindmapById(id); - final RestMindmap map = new RestMindmap(mindMap); + final RestMindmap map = new RestMindmap(mindMap, user); return new ModelAndView("mapView", "map", map); } @@ -54,7 +73,7 @@ public class MindmapController extends BaseController { mindmaps.add(mindmap); } } - final RestMindmapList restMindmapList = new RestMindmapList(mindmaps); + final RestMindmapList restMindmapList = new RestMindmapList(mindmaps, user); return new ModelAndView("mapsView", "list", restMindmapList); } @@ -137,7 +156,7 @@ public class MindmapController extends BaseController { @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void changeMapTitle(@RequestBody String title, @PathVariable int id) throws WiseMappingException { + public void updateMapTitle(@RequestBody String title, @PathVariable int id) throws WiseMappingException { final MindMap mindMap = mindmapService.getMindmapById(id); final User user = Utils.getUser(); @@ -156,7 +175,7 @@ public class MindmapController extends BaseController { @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void changeMapDescription(@RequestBody String description, @PathVariable int id) throws WiseMappingException { + public void updateMapDescription(@RequestBody String description, @PathVariable int id) throws WiseMappingException { final MindMap mindMap = mindmapService.getMindmapById(id); final User user = Utils.getUser(); @@ -169,7 +188,7 @@ public class MindmapController extends BaseController { @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void changeMapPublish(@RequestBody String value, @PathVariable int id) throws WiseMappingException { + public void updatePublishState(@RequestBody String value, @PathVariable int id) throws WiseMappingException { final MindMap mindMap = mindmapService.getMindmapById(id); final User user = Utils.getUser(); @@ -184,6 +203,18 @@ public class MindmapController extends BaseController { } + @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"}) + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void updateStarredState(@RequestBody String value, @PathVariable int id) throws WiseMappingException { + + final MindMap mindMap = mindmapService.getMindmapById(id); + final User user = Utils.getUser(); + + // Update map status ... + mindMap.setStarred(user, Boolean.parseBoolean(value)); + updateMindmap(true, mindMap, user); + } + @RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}") @ResponseStatus(value = HttpStatus.NO_CONTENT) public void updateMap(@PathVariable int id) throws IOException, WiseMappingException { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapFilter.java b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapFilter.java index 435a3ab1..be6b53d0 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapFilter.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapFilter.java @@ -1,5 +1,24 @@ -package com.wisemapping.rest; +/* +* Copyright [2011] [wisemapping] +* +* Licensed under WiseMapping Public License, Version 1.0 (the "License"). +* It is basically the Apache License, Version 2.0 (the "License") plus the +* "powered by wisemapping" text requirement on every single page; +* you may not use this file except in compliance with the License. +* You may obtain a copy of the license at +* +* http://www.wisemapping.org/license +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + + +package com.wisemapping.rest; import com.wisemapping.model.MindMap; import com.wisemapping.model.User; @@ -20,6 +39,12 @@ public enum MindmapFilter { return mindmap.getOwner().equals(user); } }, + STARRED("starred") { + @Override + boolean accept(@NotNull MindMap mindmap, @NotNull User user) { + return mindmap.isStarred(user); + } + }, SHARED_WITH_ME("shared_with_me") { @Override boolean accept(@NotNull MindMap mindmap, @NotNull User user) { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java index dfb06625..9f24595f 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmap.java @@ -1,10 +1,10 @@ package com.wisemapping.rest.model; +import com.wisemapping.model.Collaborator; import com.wisemapping.model.MindMap; import com.wisemapping.model.User; import org.codehaus.jackson.annotate.*; -import org.codehaus.jackson.map.annotate.JsonSerialize; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -27,7 +27,8 @@ import java.util.TimeZone; ) @JsonIgnoreProperties(ignoreUnknown = true) public class RestMindmap { - + @JsonIgnore + private Collaborator collaborator; @JsonIgnore private MindMap mindmap; @JsonIgnore @@ -39,12 +40,13 @@ public class RestMindmap { } public RestMindmap() { - this(new MindMap()); + this(new MindMap(), null); } - public RestMindmap(@NotNull MindMap mindmap) { + public RestMindmap(@NotNull MindMap mindmap, @NotNull Collaborator collaborator) { this.mindmap = mindmap; + this.collaborator = collaborator; } public String getCreationTime() { @@ -147,6 +149,18 @@ public class RestMindmap { return mindmap.getProperties(); } + public boolean getStarred() { + boolean result = false; + if (collaborator != null) { + result = mindmap.isStarred(collaborator); + } + return result; + } + + public void setStarred(boolean value) { + mindmap.setStarred(collaborator, value); + } + @JsonIgnore public MindMap getDelegated() { return this.mindmap; diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java index ec7ab603..ee8a741a 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java @@ -1,6 +1,7 @@ package com.wisemapping.rest.model; +import com.wisemapping.model.Collaborator; import com.wisemapping.model.MindMap; import com.wisemapping.model.User; import org.codehaus.jackson.annotate.*; @@ -10,7 +11,6 @@ import org.jetbrains.annotations.Nullable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; -import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; @@ -29,6 +29,7 @@ public class RestMindmapInfo { @JsonIgnore private MindMap mindmap; + private Collaborator collaborator; @JsonIgnore static private SimpleDateFormat sdf; @@ -38,12 +39,13 @@ public class RestMindmapInfo { } public RestMindmapInfo() { - this(new MindMap()); + this(new MindMap(), null); } - public RestMindmapInfo(@NotNull MindMap mindmap) { + public RestMindmapInfo(@NotNull MindMap mindmap, @Nullable Collaborator collaborator) { this.mindmap = mindmap; + this.collaborator = collaborator; } public String getCreationTime() { @@ -93,7 +95,14 @@ public class RestMindmapInfo { } public void setId(int id) { - mindmap.setId(id); + } + + public boolean getStarred() { + return mindmap.isStarred(collaborator); + } + + public void setStarred(int value) { + } public void setTitle(String title) { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java index 6f3fc348..438f4f2e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapList.java @@ -1,6 +1,7 @@ package com.wisemapping.rest.model; +import com.wisemapping.model.Collaborator; import com.wisemapping.model.MindMap; import org.codehaus.jackson.annotate.JsonAutoDetect; import org.jetbrains.annotations.NotNull; @@ -25,13 +26,13 @@ public class RestMindmapList { private List mindmapsInfo; public RestMindmapList() { - this(Collections.emptyList()); + this(Collections.emptyList(), null); } - public RestMindmapList(@NotNull List mindmaps) { + public RestMindmapList(@NotNull List mindmaps, @NotNull Collaborator collaborator) { this.mindmapsInfo = new ArrayList(); for (MindMap mindMap : mindmaps) { - this.mindmapsInfo.add(new RestMindmapInfo(mindMap)); + this.mindmapsInfo.add(new RestMindmapInfo(mindMap, collaborator)); } } diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/CollaboratorProperties.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/CollaboratorProperties.hbm.xml new file mode 100644 index 00000000..5ed22664 --- /dev/null +++ b/wise-webapp/src/main/resources/com/wisemapping/model/CollaboratorProperties.hbm.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/MindMap.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/MindMap.hbm.xml index 6ccc5a2c..442ed721 100644 --- a/wise-webapp/src/main/resources/com/wisemapping/model/MindMap.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/MindMap.hbm.xml @@ -27,7 +27,14 @@ inverse="true"> - + + + + + + diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/MindmapUser.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/MindmapUser.hbm.xml index aea6b936..7db2c720 100644 --- a/wise-webapp/src/main/resources/com/wisemapping/model/MindmapUser.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/MindmapUser.hbm.xml @@ -17,7 +17,7 @@ column="MINDMAP_ID" not-null="true" class="com.wisemapping.model.MindMap" - /> + /> com/wisemapping/model/Collaborator.hbm.xml com/wisemapping/model/MindMap.hbm.xml com/wisemapping/model/MindmapUser.hbm.xml + com/wisemapping/model/CollaboratorProperties.hbm.xml com/wisemapping/model/UserLogin.hbm.xml com/wisemapping/model/MindMapHistory.hbm.xml diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml index 9f9dc9e0..4f8c6c05 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml @@ -137,20 +137,6 @@ - - - - - - - - - - - - - - @@ -196,7 +182,6 @@ cookerController settingsController editProfileController - tagsController historyController diff --git a/wise-webapp/src/main/webapp/css/mymaps.less b/wise-webapp/src/main/webapp/css/mymaps.less index 999bad7d..1de4082d 100644 --- a/wise-webapp/src/main/webapp/css/mymaps.less +++ b/wise-webapp/src/main/webapp/css/mymaps.less @@ -132,6 +132,10 @@ input#selectAll { /* ----------------------------- Misc ----------------------------------- */ +.messagesPanel { + width: @body-width; +} + .dataTables_empty { text-align: center; } @@ -174,3 +178,23 @@ input#selectAll { margin-right: 2%; margin-top: 80px } + +span.starredOff{ + background: url('../images/star-off.png') no-repeat center left; + padding: 10px; + margin: 0 0px 0 15px; +} + +span.starredOff:hover{ + background: url('../images/star-off-hover.png') no-repeat center left; +} + +span.starredOn{ + background: url('../images/star-on.png') no-repeat center left; + padding: 10px; + margin: 0 0px 0 15px; +} + +span.starredOn:hover{ + background: url('../images/star-on-hover.png') no-repeat center left; +} \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/images/back_disabled.jpg b/wise-webapp/src/main/webapp/images/back_disabled.jpg deleted file mode 100644 index 1e73a546..00000000 Binary files a/wise-webapp/src/main/webapp/images/back_disabled.jpg and /dev/null differ diff --git a/wise-webapp/src/main/webapp/images/back_enabled.jpg b/wise-webapp/src/main/webapp/images/back_enabled.jpg deleted file mode 100644 index a6d764c7..00000000 Binary files a/wise-webapp/src/main/webapp/images/back_enabled.jpg and /dev/null differ diff --git a/wise-webapp/src/main/webapp/images/forward_disabled.jpg b/wise-webapp/src/main/webapp/images/forward_disabled.jpg deleted file mode 100644 index 28a9dc53..00000000 Binary files a/wise-webapp/src/main/webapp/images/forward_disabled.jpg and /dev/null differ diff --git a/wise-webapp/src/main/webapp/images/forward_enabled.jpg b/wise-webapp/src/main/webapp/images/forward_enabled.jpg deleted file mode 100644 index 598c075f..00000000 Binary files a/wise-webapp/src/main/webapp/images/forward_enabled.jpg and /dev/null differ diff --git a/wise-webapp/src/main/webapp/images/icon_list.png b/wise-webapp/src/main/webapp/images/icon_list.png deleted file mode 100644 index ce13eaf6..00000000 Binary files a/wise-webapp/src/main/webapp/images/icon_list.png and /dev/null differ diff --git a/wise-webapp/src/main/webapp/images/icon_triangle_grey_12x13.gif b/wise-webapp/src/main/webapp/images/icon_triangle_grey_12x13.gif deleted file mode 100644 index 0bb01df5..00000000 Binary files a/wise-webapp/src/main/webapp/images/icon_triangle_grey_12x13.gif and /dev/null differ diff --git a/wise-webapp/src/main/webapp/images/star-off-hover.png b/wise-webapp/src/main/webapp/images/star-off-hover.png new file mode 100644 index 00000000..2f904f1b Binary files /dev/null and b/wise-webapp/src/main/webapp/images/star-off-hover.png differ diff --git a/wise-webapp/src/main/webapp/images/star-off.png b/wise-webapp/src/main/webapp/images/star-off.png new file mode 100644 index 00000000..6b6aa3e1 Binary files /dev/null and b/wise-webapp/src/main/webapp/images/star-off.png differ diff --git a/wise-webapp/src/main/webapp/images/star-on-hover.png b/wise-webapp/src/main/webapp/images/star-on-hover.png new file mode 100644 index 00000000..23f71065 Binary files /dev/null and b/wise-webapp/src/main/webapp/images/star-on-hover.png differ diff --git a/wise-webapp/src/main/webapp/images/star-on.png b/wise-webapp/src/main/webapp/images/star-on.png new file mode 100644 index 00000000..dc865a5e Binary files /dev/null and b/wise-webapp/src/main/webapp/images/star-on.png differ diff --git a/wise-webapp/src/main/webapp/js/mymaps.js b/wise-webapp/src/main/webapp/js/mymaps.js index 9dd60bfa..3580547e 100644 --- a/wise-webapp/src/main/webapp/js/mymaps.js +++ b/wise-webapp/src/main/webapp/js/mymaps.js @@ -71,7 +71,7 @@ jQuery.fn.dataTableExt.selectAllMaps = function() { $(this).prop("checked", false); }); } - updateStatus(); + updateStatusToolbar(); }; jQuery.fn.dataTableExt.getSelectedMapsIds = function() { @@ -93,7 +93,7 @@ jQuery.fn.dataTableExt.removeSelectedRows = function() { trs.each(function() { $('#mindmapListTable').dataTable().fnDeleteRow(this); }); - updateStatus(); + updateStatusToolbar(); }; @@ -179,7 +179,7 @@ jQuery.fn.dialogForm = function(options) { // Update toolbar events ... -function updateStatus() { +function updateStatusToolbar() { // Mark column row selection values ... $("#mindmapListTable tbody input:checked").parent().parent().addClass('row-selected'); @@ -206,4 +206,51 @@ function updateStatus() { } +// Update toolbar events ... +function updateStarred(spanElem) { + $(spanElem).removeClass('starredOff'); + $(spanElem).addClass('starredOn'); + + // Retrieve row data ... + var tableElem = $('#mindmapListTable'); + var trElem = $(spanElem).parent().parent(); + var rowData = tableElem.dataTable().fnGetData(trElem[0]); + + // Update status ... + var starred = !rowData.starred; + var mapId = rowData.id; + if (starred) { + $(spanElem).removeClass('starredOff'); + $(spanElem).addClass('starredOn'); + } else { + $(spanElem).removeClass('starredOn'); + $(spanElem).addClass('starredOff'); + } + + jQuery.ajax("service/maps/" + mapId + "/starred", { + async:false, + dataType: 'json', + data: "" + starred, + type: 'PUT', + contentType:"text/plain", + success : function() { + if (starred) { + $(spanElem).removeClass('starredOff'); + $(spanElem).addClass('starredOn'); + } else { + $(spanElem).removeClass('starredOn'); + $(spanElem).addClass('starredOff'); + } + }, + error: function(jqXHR, textStatus, errorThrown) { + $('#messagesPanel div').text(errorThrown).parent().show(); + } + }); + + // Finally update st + rowData.starred = starred; +} + + + diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index 799a5b36..413afe3b 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -31,25 +31,31 @@ sAjaxSource : "../service/maps", sAjaxDataProp: 'mindmapsInfo', fnInitComplete: function() { - $('#mindmapListTable tbody').change(updateStatus); + $('#mindmapListTable tbody').change(updateStatusToolbar); + $('#mindmapListTable .starredOff').click(function() { + updateStarred(this); + }); }, aoColumns: [ { sTitle : '', - sWidth : "15px", + sWidth : "55px", sClass : "select", bSortable : false, bSearchable : false, + mDataProp: "starred", + bUseRendered : false, fnRender : function(obj) { - return ''; + return ''; } }, { sTitle : "Name", + sWidth:"270px", bUseRendered : false, mDataProp: "title", fnRender : function(obj) { - return '' + obj.aData.title + ''; + return '' + obj.aData.title + ''; } }, { @@ -224,11 +230,6 @@ $("#actionButtons .shareMap").click(function() { }); - $("#actionButtons .tagMap").click(function() { - }); - - $("#actionButtons .tags").click(function() { - }); $('#foldersContainer li').click(function(event) { // Deselect previous option ... @@ -277,6 +278,7 @@
  • All
  • My Maps
  • Shared With Me
  • +
  • Starred
  • Public Maps
  • @@ -309,10 +311,9 @@ Duplicate
  • Rename
  • Print
  • -
  • Publish +
  • Publish
  • Share
  • -
  • Tag
  • History
  • diff --git a/wise-webapp/src/main/webapp/jsp/toolbar.jsf b/wise-webapp/src/main/webapp/jsp/toolbar.jsf index 3fe7fe17..f23d4986 100644 --- a/wise-webapp/src/main/webapp/jsp/toolbar.jsf +++ b/wise-webapp/src/main/webapp/jsp/toolbar.jsf @@ -76,10 +76,7 @@
    -
    - -
    -
    +
    diff --git a/wise-webapp/src/test/sql/hsql/create-schemas.sql b/wise-webapp/src/test/sql/hsql/create-schemas.sql index b8751239..ce6aa8c3 100644 --- a/wise-webapp/src/test/sql/hsql/create-schemas.sql +++ b/wise-webapp/src/test/sql/hsql/create-schemas.sql @@ -13,18 +13,18 @@ password varchar(255) NOT NULL, activationCode BIGINT NOT NULL, activation_date DATE, allowSendEmail CHAR(1) NOT NULL, -FOREIGN KEY(colaborator_id) REFERENCES colaborator(id) +FOREIGN KEY(colaborator_id) REFERENCES COLABORATOR(id) ); CREATE TABLE MINDMAP ( id INTEGER NOT NULL IDENTITY, -title VARCHAR(255) NOT NULL, +title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, xml LONGVARBINARY NOT NULL, -public BOOLEAN not null, +public BOOLEAN NOT NULL, creation_date DATETIME, edition_date DATETIME, -owner_id INTEGER not null, +owner_id INTEGER NOT NULL, tags varchar(1014) , last_editor varchar(255) , creator_user varchar(255) , @@ -32,6 +32,15 @@ editor_properties varchar(512) --FOREIGN KEY(owner_id) REFERENCES USER(colaborator_id) ); +CREATE TABLE MINDMAP_COLLABORATOR_PROPERTIES +(id INTEGER NOT NULL IDENTITY, +mindmap_id INTEGER NOT NULL, +collaborator_id INTEGER NOT NULL, +starred BOOLEAN NOT NULL, +FOREIGN KEY(collaborator_id) REFERENCES COLABORATOR(id), +FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id) +); + CREATE TABLE MINDMAP_HISTORY (id INTEGER NOT NULL IDENTITY, xml LONGVARBINARY NOT NULL, @@ -44,15 +53,15 @@ CREATE TABLE MINDMAP_COLABORATOR colaborator_id INTEGER NOT NULL, mindmap_id INTEGER NOT NULL, role_id INTEGER NOT NULL, -FOREIGN KEY(colaborator_id) REFERENCES colaborator(id), -FOREIGN KEY(mindmap_id) REFERENCES mindmap(id) +FOREIGN KEY(colaborator_id) REFERENCES COLABORATOR(id), +FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id) ); CREATE TABLE TAG (id INTEGER NOT NULL IDENTITY, name varchar(255) NOT NULL, user_id INTEGER NOT NULL, ---FOREIGN KEY(user_id) REFERENCES user(colaborator_id) +--FOREIGN KEY(user_id) REFERENCES USER(colaborator_id) ); CREATE TABLE USER_LOGIN diff --git a/wise-webapp/src/test/sql/mysql/create-schemas.sql b/wise-webapp/src/test/sql/mysql/create-schemas.sql index 2d9abf24..afb1d845 100644 --- a/wise-webapp/src/test/sql/mysql/create-schemas.sql +++ b/wise-webapp/src/test/sql/mysql/create-schemas.sql @@ -33,9 +33,18 @@ editor_properties varchar(512) CHARACTER SET utf8 , FOREIGN KEY(owner_id) REFERENCES USER(colaborator_id) ) CHARACTER SET utf8 ; -CREATE TABLE MINDMAP_HISTORY -( + +CREATE TABLE MINDMAP_COLLABORATOR_PROPERTIES( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, +mindmap_id INTEGER NOT NULL, +collaborator_id INTEGER NOT NULL, +starred BOOL NOT NULL default 0, +FOREIGN KEY(collaborator_id) REFERENCES COLABORATOR(id), +FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id) +) CHARACTER SET utf8; + +CREATE TABLE MINDMAP_HISTORY +(id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, xml blob NOT NULL, mindmap_id INTEGER NOT NULL, creation_date datetime,