mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-12-24 04:13:47 +01:00
Fix encoding on map title.
This commit is contained in:
parent
6cd0f635d5
commit
24e2ba93f3
@ -113,17 +113,6 @@ CREATE TABLE COLLABORATION (
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE TAG (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
name VARCHAR(255)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
user_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE ACCESS_AUDITORY (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
login_date DATE,
|
||||
|
@ -19,8 +19,6 @@
|
||||
package com.wisemapping.model;
|
||||
|
||||
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
@ -105,7 +105,7 @@ public class Collaborator implements Serializable {
|
||||
int id = this.getId();
|
||||
String email = this.getEmail();
|
||||
|
||||
int result = (int) (id ^ (id >>> 32));
|
||||
int result = id ^ (id >>> 32);
|
||||
result = 31 * result + (email != null ? email.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
@ -83,13 +83,9 @@ public class Mindmap implements Serializable {
|
||||
@Basic(fetch = FetchType.LAZY)
|
||||
private byte[] zippedXml;
|
||||
|
||||
//~ Constructors .........................................................................................
|
||||
|
||||
public Mindmap() {
|
||||
}
|
||||
|
||||
//~ Methods ..............................................................................................
|
||||
|
||||
public void setUnzipXml(@NotNull byte[] value) {
|
||||
try {
|
||||
final byte[] zip = ZipUtils.bytesToZip(value);
|
||||
@ -318,11 +314,20 @@ public class Mindmap implements Serializable {
|
||||
final StringBuilder result = new StringBuilder();
|
||||
result.append("<map version=\"tango\">");
|
||||
result.append("<topic central=\"true\" text=\"");
|
||||
result.append(StringEscapeUtils.escapeXml(title));
|
||||
result.append(escapeXmlAttribute(title));
|
||||
result.append("\"/></map>");
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
static private String escapeXmlAttribute(String attValue) {
|
||||
// Hack: Find out of the box function.
|
||||
String result = attValue.replace("&", "&");
|
||||
result = result.replace("<", "<");
|
||||
result = result.replace("gt", ">");
|
||||
result = result.replace("\"", """);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Mindmap shallowClone() {
|
||||
final Mindmap result = new Mindmap();
|
||||
result.setDescription(this.getDescription());
|
||||
@ -353,18 +358,6 @@ public class Mindmap implements Serializable {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Label findLabel(int labelId) {
|
||||
Label result = null;
|
||||
for (Label label : this.labels) {
|
||||
if (label.getId() == labelId) {
|
||||
result = label;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void removeLabel(@NotNull final Label label) {
|
||||
this.labels.remove(label);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user