- Add support for starred.

- Remove tags temporally.
This commit is contained in:
Paulo Gustavo Veiga 2012-05-29 22:36:32 -03:00
parent 5d1399017f
commit 4f95ad04ca
32 changed files with 368 additions and 72 deletions

View File

@ -140,10 +140,10 @@ public class FreemindExporter
final String shape = mindmapTopic.getShape(); final String shape = mindmapTopic.getShape();
if (shape != null && !shape.isEmpty()) { 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; String style = shape;
if (ShapeStyle.ROUNDED_RETAGLE.getStyle().equals(shape)) { if (ShapeStyle.ROUNDED_RECTANGLE.getStyle().equals(shape)) {
style = "bubble"; style = "bubble";
} }
freemindNode.setSTYLE(style); freemindNode.setSTYLE(style);

View File

@ -128,7 +128,7 @@ public class FreemindImporter
convertNodeProperties(freeNode, wiseTopic); convertNodeProperties(freeNode, wiseTopic);
wiseTopic.setShape(ShapeStyle.ROUNDED_RETAGLE.getStyle()); wiseTopic.setShape(ShapeStyle.ROUNDED_RECTANGLE.getStyle());
mindmapMap.getTopic().add(wiseTopic); mindmapMap.getTopic().add(wiseTopic);
mindmapMap.setName(mapName); mindmapMap.setName(mapName);
@ -631,7 +631,7 @@ public class FreemindImporter
String result = node.getSTYLE(); String result = node.getSTYLE();
// In freemind a node without style is a line // In freemind a node without style is a line
if ("bubble".equals(result)) { if ("bubble".equals(result)) {
result = ShapeStyle.ROUNDED_RETAGLE.getStyle(); result = ShapeStyle.ROUNDED_RECTANGLE.getStyle();
} else { } else {
result = ShapeStyle.LINE.getStyle(); result = ShapeStyle.LINE.getStyle();
} }

View File

@ -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;
}
}

View File

@ -19,7 +19,6 @@
package com.wisemapping.model; package com.wisemapping.model;
import com.wisemapping.util.ZipUtils; import com.wisemapping.util.ZipUtils;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.io.IOException; import java.io.IOException;
@ -33,17 +32,18 @@ public class MindMap {
private static final String UTF_8 = "UTF-8"; private static final String UTF_8 = "UTF-8";
//~ Instance fields ...................................................................................... //~ Instance fields ......................................................................................
private int id;
private Calendar creationTime; private Calendar creationTime;
private String creator; private String creator;
private String description; private String description;
private int id;
private boolean isPublic; private boolean isPublic;
private Calendar lastModificationTime; private Calendar lastModificationTime;
private String lastModifierUser; private String lastModifierUser;
private Set<MindmapUser> mindmapUsers = new HashSet<MindmapUser>(); private Set<MindmapUser> mindmapUsers = new HashSet<MindmapUser>();
private Set<CollaboratorProperties> collaboratorProperties = new HashSet<CollaboratorProperties>();
private User owner; private User owner;
private String properties; private String properties;
private String tags; private String tags;
@ -219,6 +219,41 @@ public class MindMap {
return owner; return owner;
} }
public Set<CollaboratorProperties> getCollaboratorProperties() {
return collaboratorProperties;
}
public void setCollaboratorProperties(@NotNull Set<CollaboratorProperties> collaboratorProperties) {
this.collaboratorProperties = collaboratorProperties;
}
private CollaboratorProperties findUserProperty(@NotNull Collaborator collaborator) {
final Set<CollaboratorProperties> 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) { public static String getDefaultMindmapXml(@NotNull final String title) {
final StringBuilder result = new StringBuilder(); final StringBuilder result = new StringBuilder();

View File

@ -21,9 +21,9 @@ package com.wisemapping.model;
public enum ShapeStyle public enum ShapeStyle
{ {
LINE("line"), LINE("line"),
ROUNDED_RETAGLE("rounded rectagle"), ROUNDED_RECTANGLE("rounded rectagle"),
RECTAGLE("rectagle"), RECTANGLE("rectagle"),
ELIPSE("elipse"); ELLIPSE("elipse");
private String style; private String style;

View File

@ -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; 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"}) @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "text/html", "application/xml"})
@ResponseBody @ResponseBody
public ModelAndView getMindmap(@PathVariable int id) throws IOException { public ModelAndView getMindmap(@PathVariable int id) throws IOException {
final User user = com.wisemapping.security.Utils.getUser();
final MindMap mindMap = mindmapService.getMindmapById(id); 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); return new ModelAndView("mapView", "map", map);
} }
@ -54,7 +73,7 @@ public class MindmapController extends BaseController {
mindmaps.add(mindmap); mindmaps.add(mindmap);
} }
} }
final RestMindmapList restMindmapList = new RestMindmapList(mindmaps); final RestMindmapList restMindmapList = new RestMindmapList(mindmaps, user);
return new ModelAndView("mapsView", "list", restMindmapList); 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"}) @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT) @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 MindMap mindMap = mindmapService.getMindmapById(id);
final User user = Utils.getUser(); 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"}) @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT) @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 MindMap mindMap = mindmapService.getMindmapById(id);
final User user = Utils.getUser(); 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"}) @RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT) @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 MindMap mindMap = mindmapService.getMindmapById(id);
final User user = Utils.getUser(); 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}") @RequestMapping(method = RequestMethod.DELETE, value = "/maps/{id}")
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateMap(@PathVariable int id) throws IOException, WiseMappingException { public void updateMap(@PathVariable int id) throws IOException, WiseMappingException {

View File

@ -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.MindMap;
import com.wisemapping.model.User; import com.wisemapping.model.User;
@ -20,6 +39,12 @@ public enum MindmapFilter {
return mindmap.getOwner().equals(user); 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") { SHARED_WITH_ME("shared_with_me") {
@Override @Override
boolean accept(@NotNull MindMap mindmap, @NotNull User user) { boolean accept(@NotNull MindMap mindmap, @NotNull User user) {

View File

@ -1,10 +1,10 @@
package com.wisemapping.rest.model; package com.wisemapping.rest.model;
import com.wisemapping.model.Collaborator;
import com.wisemapping.model.MindMap; import com.wisemapping.model.MindMap;
import com.wisemapping.model.User; import com.wisemapping.model.User;
import org.codehaus.jackson.annotate.*; import org.codehaus.jackson.annotate.*;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -27,7 +27,8 @@ import java.util.TimeZone;
) )
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class RestMindmap { public class RestMindmap {
@JsonIgnore
private Collaborator collaborator;
@JsonIgnore @JsonIgnore
private MindMap mindmap; private MindMap mindmap;
@JsonIgnore @JsonIgnore
@ -39,12 +40,13 @@ public class RestMindmap {
} }
public 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.mindmap = mindmap;
this.collaborator = collaborator;
} }
public String getCreationTime() { public String getCreationTime() {
@ -147,6 +149,18 @@ public class RestMindmap {
return mindmap.getProperties(); 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 @JsonIgnore
public MindMap getDelegated() { public MindMap getDelegated() {
return this.mindmap; return this.mindmap;

View File

@ -1,6 +1,7 @@
package com.wisemapping.rest.model; package com.wisemapping.rest.model;
import com.wisemapping.model.Collaborator;
import com.wisemapping.model.MindMap; import com.wisemapping.model.MindMap;
import com.wisemapping.model.User; import com.wisemapping.model.User;
import org.codehaus.jackson.annotate.*; 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.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
@ -29,6 +29,7 @@ public class RestMindmapInfo {
@JsonIgnore @JsonIgnore
private MindMap mindmap; private MindMap mindmap;
private Collaborator collaborator;
@JsonIgnore @JsonIgnore
static private SimpleDateFormat sdf; static private SimpleDateFormat sdf;
@ -38,12 +39,13 @@ public class RestMindmapInfo {
} }
public 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.mindmap = mindmap;
this.collaborator = collaborator;
} }
public String getCreationTime() { public String getCreationTime() {
@ -93,7 +95,14 @@ public class RestMindmapInfo {
} }
public void setId(int id) { 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) { public void setTitle(String title) {

View File

@ -1,6 +1,7 @@
package com.wisemapping.rest.model; package com.wisemapping.rest.model;
import com.wisemapping.model.Collaborator;
import com.wisemapping.model.MindMap; import com.wisemapping.model.MindMap;
import org.codehaus.jackson.annotate.JsonAutoDetect; import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -25,13 +26,13 @@ public class RestMindmapList {
private List<RestMindmapInfo> mindmapsInfo; private List<RestMindmapInfo> mindmapsInfo;
public RestMindmapList() { public RestMindmapList() {
this(Collections.<MindMap>emptyList()); this(Collections.<MindMap>emptyList(), null);
} }
public RestMindmapList(@NotNull List<MindMap> mindmaps) { public RestMindmapList(@NotNull List<MindMap> mindmaps, @NotNull Collaborator collaborator) {
this.mindmapsInfo = new ArrayList<RestMindmapInfo>(); this.mindmapsInfo = new ArrayList<RestMindmapInfo>();
for (MindMap mindMap : mindmaps) { for (MindMap mindMap : mindmaps) {
this.mindmapsInfo.add(new RestMindmapInfo(mindMap)); this.mindmapsInfo.add(new RestMindmapInfo(mindMap, collaborator));
} }
} }

View File

@ -0,0 +1,29 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.wisemapping.model.CollaboratorProperties" table="MINDMAP_COLLABORATOR_PROPERTIES">
<id name="id">
<generator class="increment"/>
</id>
<property name="starred" column="starred" unique="false" not-null="true"/>
<!-- Read-only association property -->
<many-to-one name="mindmap"
column="MINDMAP_ID"
not-null="true"
class="com.wisemapping.model.MindMap"
/>
<many-to-one name="collaborator"
column="COLLABORATOR_ID"
not-null="true"
class="com.wisemapping.model.Collaborator"
/>
</class>
</hibernate-mapping>

View File

@ -29,6 +29,13 @@
<one-to-many class="com.wisemapping.model.MindmapUser"/> <one-to-many class="com.wisemapping.model.MindmapUser"/>
</set> </set>
<set name="collaboratorProperties"
cascade="all, delete-orphan"
inverse="true">
<key column="MINDMAP_ID" not-null="true"/>
<one-to-many class="com.wisemapping.model.CollaboratorProperties"/>
</set>
</class> </class>
</hibernate-mapping> </hibernate-mapping>

View File

@ -2,6 +2,9 @@ log4j.rootLogger=WARN, stdout, R
log4j.logger.com.wisemapping=WARN,stdout,R log4j.logger.com.wisemapping=WARN,stdout,R
log4j.logger.org.springframework=WARN,stdout,R log4j.logger.org.springframework=WARN,stdout,R
log4j.logger.org.codehaus.jackson=WARN,stdout,R log4j.logger.org.codehaus.jackson=WARN,stdout,R
log4j.logger.org.hibernate.SQL=DEBUG, stdout,R
log4j.additivity.org.hibernate.SQL=false
# Stdout logger <20> # Stdout logger <20>
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender

View File

@ -27,6 +27,7 @@
<value>com/wisemapping/model/Collaborator.hbm.xml</value> <value>com/wisemapping/model/Collaborator.hbm.xml</value>
<value>com/wisemapping/model/MindMap.hbm.xml</value> <value>com/wisemapping/model/MindMap.hbm.xml</value>
<value>com/wisemapping/model/MindmapUser.hbm.xml</value> <value>com/wisemapping/model/MindmapUser.hbm.xml</value>
<value>com/wisemapping/model/CollaboratorProperties.hbm.xml</value>
<value>com/wisemapping/model/UserLogin.hbm.xml</value> <value>com/wisemapping/model/UserLogin.hbm.xml</value>
<value>com/wisemapping/model/MindMapHistory.hbm.xml</value> <value>com/wisemapping/model/MindMapHistory.hbm.xml</value>
</list> </list>

View File

@ -137,20 +137,6 @@
<property name="userService" ref="userService"/> <property name="userService" ref="userService"/>
</bean> </bean>
<bean id="tagValidator" class="com.wisemapping.validator.TagValidator">
</bean>
<bean id="tagsController" class="com.wisemapping.controller.TagsController">
<property name="sessionForm" value="false"/>
<property name="commandName" value="tag"/>
<property name="commandClass" value="com.wisemapping.view.TagBean"/>
<property name="validator" ref="tagValidator"/>
<property name="formView" value="mindmapTags"/>
<property name="successView" value="closeDialog"/>
<property name="mindmapService" ref="mindmapService"/>
<property name="userService" ref="userService"/>
</bean>
<bean id="multipartResolver" <bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes --> <!-- one of the properties available; the maximum file size in bytes -->
@ -196,7 +182,6 @@
<prop key="/c/cooker.htm">cookerController</prop> <prop key="/c/cooker.htm">cookerController</prop>
<prop key="/c/settings.htm">settingsController</prop> <prop key="/c/settings.htm">settingsController</prop>
<prop key="/c/editProfile.htm">editProfileController</prop> <prop key="/c/editProfile.htm">editProfileController</prop>
<prop key="/c/tags.htm">tagsController</prop>
<prop key="/c/history.htm">historyController</prop> <prop key="/c/history.htm">historyController</prop>
</props> </props>
</property> </property>

View File

@ -132,6 +132,10 @@ input#selectAll {
/* ----------------------------- Misc ----------------------------------- */ /* ----------------------------- Misc ----------------------------------- */
.messagesPanel {
width: @body-width;
}
.dataTables_empty { .dataTables_empty {
text-align: center; text-align: center;
} }
@ -174,3 +178,23 @@ input#selectAll {
margin-right: 2%; margin-right: 2%;
margin-top: 80px 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;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

View File

@ -71,7 +71,7 @@ jQuery.fn.dataTableExt.selectAllMaps = function() {
$(this).prop("checked", false); $(this).prop("checked", false);
}); });
} }
updateStatus(); updateStatusToolbar();
}; };
jQuery.fn.dataTableExt.getSelectedMapsIds = function() { jQuery.fn.dataTableExt.getSelectedMapsIds = function() {
@ -93,7 +93,7 @@ jQuery.fn.dataTableExt.removeSelectedRows = function() {
trs.each(function() { trs.each(function() {
$('#mindmapListTable').dataTable().fnDeleteRow(this); $('#mindmapListTable').dataTable().fnDeleteRow(this);
}); });
updateStatus(); updateStatusToolbar();
}; };
@ -179,7 +179,7 @@ jQuery.fn.dialogForm = function(options) {
// Update toolbar events ... // Update toolbar events ...
function updateStatus() { function updateStatusToolbar() {
// Mark column row selection values ... // Mark column row selection values ...
$("#mindmapListTable tbody input:checked").parent().parent().addClass('row-selected'); $("#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;
}

View File

@ -31,25 +31,31 @@
sAjaxSource : "../service/maps", sAjaxSource : "../service/maps",
sAjaxDataProp: 'mindmapsInfo', sAjaxDataProp: 'mindmapsInfo',
fnInitComplete: function() { fnInitComplete: function() {
$('#mindmapListTable tbody').change(updateStatus); $('#mindmapListTable tbody').change(updateStatusToolbar);
$('#mindmapListTable .starredOff').click(function() {
updateStarred(this);
});
}, },
aoColumns: [ aoColumns: [
{ {
sTitle : '<input type="checkbox" id="selectAll"/>', sTitle : '<input type="checkbox" id="selectAll"/>',
sWidth : "15px", sWidth : "55px",
sClass : "select", sClass : "select",
bSortable : false, bSortable : false,
bSearchable : false, bSearchable : false,
mDataProp: "starred",
bUseRendered : false,
fnRender : function(obj) { fnRender : function(obj) {
return '<input type="checkbox" id="' + obj.aData.id + '"/>'; return '<input type="checkbox" id="' + obj.aData.id + '"/><span data-mid="' + obj.aData.id + '" class="' + (obj.aData.starred ? 'starredOn' : 'starredOff') + '"></span>';
} }
}, },
{ {
sTitle : "Name", sTitle : "Name",
sWidth:"270px",
bUseRendered : false, bUseRendered : false,
mDataProp: "title", mDataProp: "title",
fnRender : function(obj) { fnRender : function(obj) {
return '<a href="c/maps/' + obj.aData.id + '/edit.htm">' + obj.aData.title + '</a>'; return '<span class="starOff"></span><a href="c/maps/' + obj.aData.id + '/edit.htm">' + obj.aData.title + '</a>';
} }
}, },
{ {
@ -224,11 +230,6 @@
$("#actionButtons .shareMap").click(function() { $("#actionButtons .shareMap").click(function() {
}); });
$("#actionButtons .tagMap").click(function() {
});
$("#actionButtons .tags").click(function() {
});
$('#foldersContainer li').click(function(event) { $('#foldersContainer li').click(function(event) {
// Deselect previous option ... // Deselect previous option ...
@ -277,6 +278,7 @@
<li data-filter="all" class="active"><a href="#"><i class="icon-inbox icon-white"></i> All</a></li> <li data-filter="all" class="active"><a href="#"><i class="icon-inbox icon-white"></i> All</a></li>
<li data-filter="my_maps"><a href="#"><i class="icon-user"></i> My Maps</a></li> <li data-filter="my_maps"><a href="#"><i class="icon-user"></i> My Maps</a></li>
<li data-filter="shared_with_me"><a href="#"><i class="icon-share"></i> Shared With Me</a></li> <li data-filter="shared_with_me"><a href="#"><i class="icon-share"></i> Shared With Me</a></li>
<li data-filter="starred"><a href="#"><i class="icon-star"></i> Starred</a></li>
<li data-filter="public"><a href="#"><i class="icon-globe"></i> Public Maps</a></li> <li data-filter="public"><a href="#"><i class="icon-globe"></i> Public Maps</a></li>
</ul> </ul>
</div> </div>
@ -312,7 +314,6 @@
<li id="publishBtn"><a href="#" onclick="return false"><i class="icon-globe"></i> Publish</a> <li id="publishBtn"><a href="#" onclick="return false"><i class="icon-globe"></i> Publish</a>
</li> </li>
<li id="shareBtn"><a href="#" onclick="return false"><i class="icon-share"></i> Share</a></li> <li id="shareBtn"><a href="#" onclick="return false"><i class="icon-share"></i> Share</a></li>
<li id="tagBtn"><a href="#" onclick="return false"><i class="icon-tags"></i> Tag</a></li>
<li id="historyBtn"><a href="#" onclick="return false"><i class="icon-time"></i> History</a> <li id="historyBtn"><a href="#" onclick="return false"><i class="icon-time"></i> History</a>
</li> </li>
</ul> </ul>

View File

@ -76,9 +76,6 @@
</div> </div>
</div> </div>
<div id="collaboration" class="buttonContainer"> <div id="collaboration" class="buttonContainer">
<div id="tagIt" class="buttonOn">
<img src="../images/tag.png"/>
</div>
<div id="shareIt" class="buttonOn"> <div id="shareIt" class="buttonOn">
<img src="../images/share.png"/> <img src="../images/share.png"/>
</div> </div>

View File

@ -13,7 +13,7 @@ password varchar(255) NOT NULL,
activationCode BIGINT NOT NULL, activationCode BIGINT NOT NULL,
activation_date DATE, activation_date DATE,
allowSendEmail CHAR(1) NOT NULL, allowSendEmail CHAR(1) NOT NULL,
FOREIGN KEY(colaborator_id) REFERENCES colaborator(id) FOREIGN KEY(colaborator_id) REFERENCES COLABORATOR(id)
); );
CREATE TABLE MINDMAP ( CREATE TABLE MINDMAP (
@ -21,10 +21,10 @@ id INTEGER NOT NULL IDENTITY,
title VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL,
description VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL,
xml LONGVARBINARY NOT NULL, xml LONGVARBINARY NOT NULL,
public BOOLEAN not null, public BOOLEAN NOT NULL,
creation_date DATETIME, creation_date DATETIME,
edition_date DATETIME, edition_date DATETIME,
owner_id INTEGER not null, owner_id INTEGER NOT NULL,
tags varchar(1014) , tags varchar(1014) ,
last_editor varchar(255) , last_editor varchar(255) ,
creator_user varchar(255) , creator_user varchar(255) ,
@ -32,6 +32,15 @@ editor_properties varchar(512)
--FOREIGN KEY(owner_id) REFERENCES USER(colaborator_id) --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 CREATE TABLE MINDMAP_HISTORY
(id INTEGER NOT NULL IDENTITY, (id INTEGER NOT NULL IDENTITY,
xml LONGVARBINARY NOT NULL, xml LONGVARBINARY NOT NULL,
@ -44,15 +53,15 @@ CREATE TABLE MINDMAP_COLABORATOR
colaborator_id INTEGER NOT NULL, colaborator_id INTEGER NOT NULL,
mindmap_id INTEGER NOT NULL, mindmap_id INTEGER NOT NULL,
role_id INTEGER NOT NULL, role_id INTEGER NOT NULL,
FOREIGN KEY(colaborator_id) REFERENCES colaborator(id), FOREIGN KEY(colaborator_id) REFERENCES COLABORATOR(id),
FOREIGN KEY(mindmap_id) REFERENCES mindmap(id) FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id)
); );
CREATE TABLE TAG CREATE TABLE TAG
(id INTEGER NOT NULL IDENTITY, (id INTEGER NOT NULL IDENTITY,
name varchar(255) NOT NULL, name varchar(255) NOT NULL,
user_id INTEGER 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 CREATE TABLE USER_LOGIN

View File

@ -33,9 +33,18 @@ editor_properties varchar(512) CHARACTER SET utf8 ,
FOREIGN KEY(owner_id) REFERENCES USER(colaborator_id) FOREIGN KEY(owner_id) REFERENCES USER(colaborator_id)
) CHARACTER SET utf8 ; ) CHARACTER SET utf8 ;
CREATE TABLE MINDMAP_HISTORY
( CREATE TABLE MINDMAP_COLLABORATOR_PROPERTIES(
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, 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, xml blob NOT NULL,
mindmap_id INTEGER NOT NULL, mindmap_id INTEGER NOT NULL,
creation_date datetime, creation_date datetime,