Merge remote-tracking branch 'origin/develop' into feature/remove_mootols
Conflicts: mindplot/src/main/javascript/widget/LinkIconTooltip.js wise-webapp/src/main/webapp/jsp/mindmapExport.jsp
This commit is contained in:
@@ -21,6 +21,7 @@ package com.wisemapping.exporter;
|
||||
public class ExportProperties {
|
||||
private ExportFormat format;
|
||||
private String baseImgPath;
|
||||
private String version;
|
||||
|
||||
public ExportFormat getFormat() {
|
||||
return format;
|
||||
@@ -40,6 +41,14 @@ public class ExportProperties {
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
static public class GenericProperties extends ExportProperties {
|
||||
private GenericProperties(ExportFormat format) {
|
||||
super(format);
|
||||
|
@@ -18,6 +18,7 @@
|
||||
|
||||
package com.wisemapping.exporter;
|
||||
|
||||
import com.wisemapping.importer.VersionNumber;
|
||||
import org.apache.batik.parser.AWTTransformProducer;
|
||||
import org.apache.batik.parser.ParseException;
|
||||
import org.apache.batik.parser.TransformListParser;
|
||||
@@ -142,6 +143,7 @@ public class ExporterFactory {
|
||||
}
|
||||
case FREEMIND: {
|
||||
final FreemindExporter exporter = new FreemindExporter();
|
||||
exporter.setVersion(new VersionNumber(properties.getVersion()));
|
||||
exporter.export(xml.getBytes(UTF_8_CHARSET_NAME), output);
|
||||
break;
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@
|
||||
package com.wisemapping.exporter;
|
||||
|
||||
|
||||
import com.wisemapping.importer.VersionNumber;
|
||||
import com.wisemapping.importer.freemind.FreemindConstant;
|
||||
import com.wisemapping.importer.freemind.FreemindIconConverter;
|
||||
import com.wisemapping.jaxb.wisemap.Note;
|
||||
import com.wisemapping.model.Mindmap;
|
||||
@@ -42,6 +44,7 @@ import java.io.OutputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -49,12 +52,10 @@ import java.util.Map;
|
||||
public class FreemindExporter
|
||||
implements Exporter {
|
||||
|
||||
private static final String FREE_MIND_VERSION = "0.9.0";
|
||||
private static final String POSITION_LEFT = "left";
|
||||
private static final String POSITION_RIGHT = "right";
|
||||
|
||||
private com.wisemapping.jaxb.freemind.ObjectFactory objectFactory;
|
||||
private static final String EMPTY_FONT_STYLE = ";;;;;";
|
||||
private Map<String, Node> nodesMap = null;
|
||||
private VersionNumber version = FreemindConstant.SUPPORTED_FREEMIND_VERSION;
|
||||
|
||||
public void export(Mindmap map, OutputStream outputStream) throws ExportException {
|
||||
export(map.getUnzipXml(), outputStream);
|
||||
@@ -71,7 +72,7 @@ public class FreemindExporter
|
||||
mindmapMap = (com.wisemapping.jaxb.wisemap.Map) JAXBUtils.getMapObject(stream, "com.wisemapping.jaxb.wisemap");
|
||||
|
||||
final com.wisemapping.jaxb.freemind.Map freemindMap = objectFactory.createMap();
|
||||
freemindMap.setVersion(FREE_MIND_VERSION);
|
||||
freemindMap.setVersion(this.getVersionNumber());
|
||||
|
||||
final List<TopicType> topics = mindmapMap.getTopic();
|
||||
|
||||
@@ -98,8 +99,9 @@ public class FreemindExporter
|
||||
|
||||
final List<RelationshipType> relationships = mindmapMap.getRelationship();
|
||||
for (RelationshipType relationship : relationships) {
|
||||
Node srcNode = nodesMap.get(relationship.getSrcTopicId());
|
||||
Node dstNode = nodesMap.get(relationship.getDestTopicId());
|
||||
// FIXME:invert srcNode and dstNode to correct a bug in the wise mind map representation
|
||||
Node srcNode = nodesMap.get(relationship.getDestTopicId());
|
||||
Node dstNode = nodesMap.get(relationship.getSrcTopicId());
|
||||
|
||||
|
||||
// Workaround for nodes without relationship associated ...
|
||||
@@ -136,6 +138,7 @@ public class FreemindExporter
|
||||
private void addNodeFromTopic(@NotNull final TopicType mainTopic, @NotNull final Node destNode) throws IOException, SAXException, ParserConfigurationException {
|
||||
final List<TopicType> currentTopic = mainTopic.getTopic();
|
||||
|
||||
Collections.sort(currentTopic, new VerticalPositionComparator());
|
||||
for (TopicType topicType : currentTopic) {
|
||||
final Node newNode = objectFactory.createNode();
|
||||
nodesMap.put(topicType.getId(), newNode);
|
||||
@@ -149,9 +152,9 @@ public class FreemindExporter
|
||||
if (position != null) {
|
||||
String xPos = position.split(",")[0];
|
||||
int x = Integer.valueOf(xPos);
|
||||
newNode.setPOSITION((x < 0 ? POSITION_LEFT : POSITION_RIGHT));
|
||||
newNode.setPOSITION((x < 0 ? FreemindConstant.POSITION_LEFT : FreemindConstant.POSITION_RIGHT));
|
||||
} else {
|
||||
newNode.setPOSITION(POSITION_LEFT);
|
||||
newNode.setPOSITION(FreemindConstant.POSITION_LEFT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,17 +177,23 @@ public class FreemindExporter
|
||||
}
|
||||
}
|
||||
|
||||
freemindNode.setBACKGROUNDCOLOR(mindmapTopic.getBgColor());
|
||||
String wiseShape = mindmapTopic.getShape();
|
||||
if (wiseShape != null && !ShapeStyle.LINE.equals(ShapeStyle.fromValue(wiseShape))) {
|
||||
freemindNode.setBACKGROUNDCOLOR(mindmapTopic.getBgColor());
|
||||
}
|
||||
final String shape = mindmapTopic.getShape();
|
||||
if (shape != null && !shape.isEmpty()) {
|
||||
if (isRoot && !ShapeStyle.ROUNDED_RECTANGLE.getStyle().endsWith(shape) || !isRoot && !ShapeStyle.LINE.getStyle().endsWith(shape)) {
|
||||
|
||||
String style = shape;
|
||||
if (ShapeStyle.ROUNDED_RECTANGLE.getStyle().equals(shape)) {
|
||||
if (ShapeStyle.ROUNDED_RECTANGLE.getStyle().equals(shape) || ShapeStyle.ELLIPSE.getStyle().equals(shape)) {
|
||||
style = "bubble";
|
||||
}
|
||||
freemindNode.setSTYLE(style);
|
||||
}
|
||||
} else if (!isRoot) {
|
||||
String style = "fork";
|
||||
freemindNode.setSTYLE(style);
|
||||
}
|
||||
|
||||
addIconNode(freemindNode, mindmapTopic);
|
||||
@@ -274,15 +283,15 @@ public class FreemindExporter
|
||||
final Font font = objectFactory.createFont();
|
||||
final String[] part = fontStyle.split(";", 6);
|
||||
int countParts = part.length;
|
||||
boolean updated = false;
|
||||
boolean fontNodeNeeded = false;
|
||||
|
||||
if (!fontStyle.endsWith(EMPTY_FONT_STYLE)) {
|
||||
if (!fontStyle.endsWith(FreemindConstant.EMPTY_FONT_STYLE)) {
|
||||
int idx = 0;
|
||||
|
||||
// Font name
|
||||
if (idx < countParts && part[idx].length() != 0) {
|
||||
font.setNAME(part[idx]);
|
||||
updated = true;
|
||||
fontNodeNeeded = true;
|
||||
}
|
||||
idx++;
|
||||
|
||||
@@ -290,11 +299,11 @@ public class FreemindExporter
|
||||
if (idx < countParts && part[idx].length() != 0) {
|
||||
final String size = part[idx];
|
||||
if (size != null && !size.isEmpty()) {
|
||||
int freeSize = Integer.parseInt(size);
|
||||
Integer fsize = wiseToFreeFontSize.get(freeSize);
|
||||
if(fsize!=null){
|
||||
font.setSIZE(BigInteger.valueOf(fsize));
|
||||
updated = true;
|
||||
int wiseSize = Integer.parseInt(size);
|
||||
Integer freeSize = wiseToFreeFontSize.get(wiseSize);
|
||||
if(freeSize!=null){
|
||||
font.setSIZE(BigInteger.valueOf(freeSize));
|
||||
fontNodeNeeded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -303,23 +312,26 @@ public class FreemindExporter
|
||||
// Font Color
|
||||
if (idx < countParts && part[idx].length() != 0) {
|
||||
freemindNode.setCOLOR(part[idx]);
|
||||
updated = true;
|
||||
}
|
||||
idx++;
|
||||
|
||||
// Font Styles
|
||||
if (idx < countParts && part[idx].length() != 0) {
|
||||
font.setBOLD(Boolean.TRUE.toString());
|
||||
updated = true;
|
||||
fontNodeNeeded = true;
|
||||
}
|
||||
idx++;
|
||||
|
||||
if (idx < countParts && part[idx].length() != 0) {
|
||||
font.setITALIC(Boolean.TRUE.toString());
|
||||
updated = true;
|
||||
fontNodeNeeded = true;
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
if (fontNodeNeeded) {
|
||||
// font size should be set if freemind node has font properties note
|
||||
if (font.getSIZE() == null) {
|
||||
font.setSIZE(BigInteger.valueOf(wiseToFreeFontSize.get(8)));
|
||||
}
|
||||
freemindNode.getArrowlinkOrCloudOrEdge().add(font);
|
||||
}
|
||||
}
|
||||
@@ -342,4 +354,15 @@ public class FreemindExporter
|
||||
}
|
||||
|
||||
|
||||
public VersionNumber getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(VersionNumber version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getVersionNumber() {
|
||||
return this.getVersion().getVersion();
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,26 @@
|
||||
package com.wisemapping.exporter;
|
||||
|
||||
import com.wisemapping.jaxb.wisemap.TopicType;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class VerticalPositionComparator implements Comparator<TopicType> {
|
||||
|
||||
@Override
|
||||
public int compare(TopicType o1, TopicType o2) {
|
||||
final String myPosition = o1.getPosition();
|
||||
final String otherPosition = o2.getPosition();
|
||||
int result;
|
||||
if (otherPosition == null) {
|
||||
result = -1;
|
||||
} else if (myPosition == null) {
|
||||
result = 1;
|
||||
} else {
|
||||
int myPositionY = Integer.parseInt(myPosition.split(",")[1]);
|
||||
int otherPositionY = Integer.parseInt(otherPosition.split(",")[1]);
|
||||
result = myPositionY - otherPositionY;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.wisemapping.importer.freemind;
|
||||
|
||||
import com.wisemapping.importer.VersionNumber;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
public interface FreemindConstant {
|
||||
|
||||
public static final String LAST_SUPPORTED_FREEMIND_VERSION = "1.0.1";
|
||||
public static final VersionNumber SUPPORTED_FREEMIND_VERSION = new VersionNumber(LAST_SUPPORTED_FREEMIND_VERSION);
|
||||
public static final String CODE_VERSION = "tango";
|
||||
|
||||
public static final int SECOND_LEVEL_TOPIC_HEIGHT = 25;
|
||||
public static final int ROOT_LEVEL_TOPIC_HEIGHT = SECOND_LEVEL_TOPIC_HEIGHT;
|
||||
public static final int CENTRAL_TO_TOPIC_DISTANCE = 200;
|
||||
public static final int TOPIC_TO_TOPIC_DISTANCE = 90;
|
||||
|
||||
public static final int FONT_SIZE_HUGE = 15;
|
||||
public static final int FONT_SIZE_LARGE = 10;
|
||||
public static final int FONT_SIZE_NORMAL = 8;
|
||||
public static final int FONT_SIZE_SMALL = 6;
|
||||
|
||||
public static final String NODE_TYPE = "NODE";
|
||||
public static final String BOLD = "bold";
|
||||
public static final String ITALIC = "italic";
|
||||
public static final String EMPTY_FONT_STYLE = ";;;;;";
|
||||
public static final String EMPTY_NOTE = "";
|
||||
|
||||
public static final String POSITION_LEFT = "left";
|
||||
public static final String POSITION_RIGHT = "right";
|
||||
|
||||
public final static Charset UTF_8_CHARSET = Charset.forName("UTF-8");
|
||||
|
||||
}
|
@@ -33,9 +33,7 @@ import com.wisemapping.jaxb.wisemap.Link;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.*;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.w3c.dom.*;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
@@ -46,37 +44,17 @@ import java.io.InputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
public class FreemindImporter
|
||||
implements Importer {
|
||||
|
||||
public static final String CODE_VERSION = "tango";
|
||||
public static final int SECOND_LEVEL_TOPIC_HEIGHT = 25;
|
||||
public static final int ROOT_LEVEL_TOPIC_HEIGHT = SECOND_LEVEL_TOPIC_HEIGHT;
|
||||
public static final int CENTRAL_TO_TOPIC_DISTANCE = 200;
|
||||
public static final int TOPIC_TO_TOPIC_DISTANCE = 90;
|
||||
public static final String NODE_TYPE = "NODE";
|
||||
private com.wisemapping.jaxb.wisemap.ObjectFactory mindmapObjectFactory;
|
||||
private static final String POSITION_LEFT = "left";
|
||||
private static final String BOLD = "bold";
|
||||
private static final String ITALIC = "italic";
|
||||
private static final String EMPTY_NOTE = "";
|
||||
private java.util.Map<String, TopicType> nodesMap = null;
|
||||
private List<RelationshipType> relationships = null;
|
||||
private static final String EMPTY_FONT_STYLE = ";;;;;";
|
||||
private final static Charset UTF_8_CHARSET = Charset.forName("UTF-8");
|
||||
private final static int ORDER_SEPARATION_FACTOR = 2;
|
||||
private static final VersionNumber SUPPORTED_FREEMIND_VERSION = new VersionNumber("0.9.0");
|
||||
|
||||
|
||||
private int currentId;
|
||||
private static final int FONT_SIZE_HUGE = 15;
|
||||
private static final int FONT_SIZE_LARGE = 10;
|
||||
public static final int FONT_SIZE_NORMAL = 8;
|
||||
private static final int FONT_SIZE_SMALL = 6;
|
||||
|
||||
public static void main(String argv[]) {
|
||||
|
||||
@@ -120,13 +98,8 @@ public class FreemindImporter
|
||||
final String version = freemindMap.getVersion();
|
||||
if (version != null) {
|
||||
|
||||
// Is freemind mindmap ?
|
||||
if (version.charAt(0) != '0') {
|
||||
throw new ImporterException("Mindmap is not a FreeMind document. Document type info " + version);
|
||||
}
|
||||
|
||||
final VersionNumber mapVersion = new VersionNumber(version);
|
||||
if (SUPPORTED_FREEMIND_VERSION.isGreaterThan(mapVersion)) {
|
||||
if (mapVersion.isGreaterThan(FreemindConstant.SUPPORTED_FREEMIND_VERSION)) {
|
||||
throw new ImporterException("FreeMind version " + mapVersion.getVersion() + " is not supported.");
|
||||
}
|
||||
}
|
||||
@@ -135,7 +108,7 @@ public class FreemindImporter
|
||||
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
final com.wisemapping.jaxb.wisemap.Map mindmapMap = mindmapObjectFactory.createMap();
|
||||
mindmapMap.setVersion(CODE_VERSION);
|
||||
mindmapMap.setVersion(FreemindConstant.CODE_VERSION);
|
||||
currentId = 0;
|
||||
|
||||
final Node freeNode = freemindMap.getNode();
|
||||
@@ -156,7 +129,7 @@ public class FreemindImporter
|
||||
addRelationships(mindmapMap);
|
||||
|
||||
JAXBUtils.saveMap(mindmapMap, baos);
|
||||
wiseXml = new String(baos.toByteArray(), UTF_8_CHARSET);
|
||||
wiseXml = new String(baos.toByteArray(), FreemindConstant.UTF_8_CHARSET);
|
||||
result.setXmlStr(wiseXml);
|
||||
result.setTitle(mapName);
|
||||
result.setDescription(description);
|
||||
@@ -235,6 +208,8 @@ public class FreemindImporter
|
||||
TopicType currentWiseTopic = wiseParent;
|
||||
|
||||
int order = 0;
|
||||
int firstLevelRightOrder = 0;
|
||||
int firstLevelLeftOrder = 1;
|
||||
for (Object element : freeChilden) {
|
||||
|
||||
if (element instanceof Node) {
|
||||
@@ -252,13 +227,19 @@ public class FreemindImporter
|
||||
if (depth != 1) {
|
||||
norder = order++;
|
||||
} else {
|
||||
norder = calcFirstLevelOrder(freeChilden, freeChild);
|
||||
if (freeChild.getPOSITION() != null && freeChild.getPOSITION().equals(FreemindConstant.POSITION_LEFT)) {
|
||||
norder = firstLevelLeftOrder;
|
||||
firstLevelLeftOrder = firstLevelLeftOrder + 2;
|
||||
} else {
|
||||
norder = firstLevelRightOrder;
|
||||
firstLevelRightOrder = firstLevelRightOrder + 2;
|
||||
}
|
||||
}
|
||||
wiseChild.setOrder(norder);
|
||||
|
||||
// Convert node position
|
||||
int childrenCount = freeChilden.size();
|
||||
final String position = convertPosition(wiseParent, freeChild, depth, norder, childrenCount);
|
||||
int childrenCountSameSide = getChildrenCountSameSide(freeChilden, freeChild);
|
||||
final String position = convertPosition(wiseParent, freeChild, depth, norder, childrenCountSameSide);
|
||||
wiseChild.setPosition(position);
|
||||
|
||||
// Convert the rest of the node properties ...
|
||||
@@ -297,7 +278,7 @@ public class FreemindImporter
|
||||
String textNote = hook.getText();
|
||||
if (textNote == null) // It is not a note is a BlinkingNodeHook or AutomaticLayout Hook
|
||||
{
|
||||
textNote = EMPTY_NOTE;
|
||||
textNote = FreemindConstant.EMPTY_NOTE;
|
||||
mindmapNote.setValue(textNote);
|
||||
currentWiseTopic.setNote(mindmapNote);
|
||||
}
|
||||
@@ -305,13 +286,13 @@ public class FreemindImporter
|
||||
final Richcontent content = (Richcontent) element;
|
||||
final String type = content.getTYPE();
|
||||
|
||||
if (type.equals(NODE_TYPE)) {
|
||||
if (type.equals(FreemindConstant.NODE_TYPE)) {
|
||||
String text = html2text(content);
|
||||
currentWiseTopic.setText(text);
|
||||
} else {
|
||||
String text = html2text(content);
|
||||
final com.wisemapping.jaxb.wisemap.Note mindmapNote = new com.wisemapping.jaxb.wisemap.Note();
|
||||
text = text != null ? text : EMPTY_NOTE;
|
||||
text = text != null ? text : FreemindConstant.EMPTY_NOTE;
|
||||
mindmapNote.setValue(text);
|
||||
currentWiseTopic.setNote(mindmapNote);
|
||||
|
||||
@@ -320,8 +301,9 @@ public class FreemindImporter
|
||||
final Arrowlink arrow = (Arrowlink) element;
|
||||
RelationshipType relt = mindmapObjectFactory.createRelationshipType();
|
||||
String destId = arrow.getDESTINATION();
|
||||
relt.setSrcTopicId(freeParent.getID());
|
||||
relt.setDestTopicId(destId);
|
||||
// FIXME: invert srcTopic and dstTopic to correct a bug in the wise mind map representation
|
||||
relt.setSrcTopicId(destId);
|
||||
relt.setDestTopicId(freeParent.getID());
|
||||
final String endinclination = arrow.getENDINCLINATION();
|
||||
if (endinclination != null) {
|
||||
String[] inclination = endinclination.split(";");
|
||||
@@ -348,50 +330,27 @@ public class FreemindImporter
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the freemind node following this pattern:
|
||||
* <p/>
|
||||
* 0 -> 3
|
||||
* 1 -> 1
|
||||
* 2 -> 0
|
||||
* 3 -> 2
|
||||
* 4 -> 4
|
||||
*/
|
||||
private int calcFirstLevelOrder(@NotNull List<Object> freeChilden, @Nullable Node freeChild) {
|
||||
final List<Node> nodes = new ArrayList<Node>();
|
||||
int result;
|
||||
private int getChildrenCountSameSide(@NotNull List<Object> freeChildren, Node freeChild) {
|
||||
int result = 0;
|
||||
String childSide = freeChild.getPOSITION();
|
||||
if (childSide == null) {
|
||||
childSide = FreemindConstant.POSITION_RIGHT;
|
||||
}
|
||||
|
||||
// Collect all the nodes of the same side ...
|
||||
for (Object child : freeChilden) {
|
||||
// Count all the nodes of the same side ...
|
||||
for (Object child : freeChildren) {
|
||||
if (child instanceof Node) {
|
||||
Node node = (Node) child;
|
||||
|
||||
final String side = node.getPOSITION();
|
||||
if (side == freeChild.getPOSITION() || freeChild.getPOSITION().equals(side)) {
|
||||
nodes.add(node);
|
||||
String side = node.getPOSITION();
|
||||
if (side == null) {
|
||||
side = FreemindConstant.POSITION_RIGHT;
|
||||
}
|
||||
if (childSide.equals(side)) {
|
||||
result++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// What is the index of the current node ?
|
||||
int nodeIndex = 0;
|
||||
for (Node node : nodes) {
|
||||
if (node == freeChild) {
|
||||
break;
|
||||
}
|
||||
nodeIndex++;
|
||||
}
|
||||
|
||||
int size = nodes.size();
|
||||
int center = (size - 1) / 2;
|
||||
result = nodeIndex - center;
|
||||
|
||||
if (result < 0) {
|
||||
result = (result * ORDER_SEPARATION_FACTOR * -2) - 1;
|
||||
|
||||
} else {
|
||||
result = result * ORDER_SEPARATION_FACTOR * 2;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -410,11 +369,11 @@ public class FreemindImporter
|
||||
|
||||
// Problem on setting X position:
|
||||
// Text Size is not taken into account ...
|
||||
int x = CENTRAL_TO_TOPIC_DISTANCE + ((depth - 1) * TOPIC_TO_TOPIC_DISTANCE);
|
||||
int x = FreemindConstant.CENTRAL_TO_TOPIC_DISTANCE + ((depth - 1) * FreemindConstant.TOPIC_TO_TOPIC_DISTANCE);
|
||||
if (depth == 1) {
|
||||
|
||||
final String side = freeChild.getPOSITION();
|
||||
x = x * (side != null && POSITION_LEFT.equals(side) ? -1 : 1);
|
||||
x = x * (side != null && FreemindConstant.POSITION_LEFT.equals(side) ? -1 : 1);
|
||||
} else {
|
||||
final Coord coord = Coord.parse(wiseParent.getPosition());
|
||||
x = x * (coord.isOnLeftSide() ? -1 : 1);
|
||||
@@ -425,23 +384,21 @@ public class FreemindImporter
|
||||
int y;
|
||||
if (depth == 1) {
|
||||
|
||||
// Follow the following algorithm ...
|
||||
// Order: 3 = -100 1
|
||||
// Order: 1 = -50 2
|
||||
// Order: 0 = 0 3
|
||||
// Order: 2 = 50 4
|
||||
// Order: 4 = 100 5
|
||||
// pair order numbers represent nodes at the right
|
||||
// odd order numbers represent nodes at the left
|
||||
if (order % 2 == 0) {
|
||||
y = ROOT_LEVEL_TOPIC_HEIGHT * order;
|
||||
int multiplier = ((order + 1) - childrenCount) * 2;
|
||||
y = multiplier * FreemindConstant.ROOT_LEVEL_TOPIC_HEIGHT;
|
||||
} else {
|
||||
y = -ROOT_LEVEL_TOPIC_HEIGHT * (order + 1);
|
||||
int multiplier = (order - childrenCount) * 2;
|
||||
y = multiplier * FreemindConstant.ROOT_LEVEL_TOPIC_HEIGHT;
|
||||
}
|
||||
} else {
|
||||
|
||||
// Problem: What happen if the node is more tall than what is defined here.
|
||||
Coord coord = Coord.parse(wiseParent.getPosition());
|
||||
int parentY = coord.y;
|
||||
y = parentY - ((childrenCount / 2) * SECOND_LEVEL_TOPIC_HEIGHT - (order * SECOND_LEVEL_TOPIC_HEIGHT));
|
||||
y = parentY - ((childrenCount / 2) * FreemindConstant.SECOND_LEVEL_TOPIC_HEIGHT - (order * FreemindConstant.SECOND_LEVEL_TOPIC_HEIGHT));
|
||||
|
||||
|
||||
}
|
||||
@@ -573,14 +530,14 @@ public class FreemindImporter
|
||||
// 10 Large
|
||||
// 15 Huge
|
||||
if (font != null) {
|
||||
final int fontSize = ((font.getSIZE() == null || font.getSIZE().intValue() < 8) ? BigInteger.valueOf(FONT_SIZE_NORMAL) : font.getSIZE()).intValue();
|
||||
int wiseFontSize = FONT_SIZE_SMALL;
|
||||
final int fontSize = ((font.getSIZE() == null || font.getSIZE().intValue() < 8) ? BigInteger.valueOf(FreemindConstant.FONT_SIZE_NORMAL) : font.getSIZE()).intValue();
|
||||
int wiseFontSize = FreemindConstant.FONT_SIZE_SMALL;
|
||||
if (fontSize >= 24) {
|
||||
wiseFontSize = FONT_SIZE_HUGE;
|
||||
wiseFontSize = FreemindConstant.FONT_SIZE_HUGE;
|
||||
} else if (fontSize >= 16) {
|
||||
wiseFontSize = FONT_SIZE_LARGE;
|
||||
wiseFontSize = FreemindConstant.FONT_SIZE_LARGE;
|
||||
} else if (fontSize >= 12) {
|
||||
wiseFontSize = FONT_SIZE_NORMAL;
|
||||
wiseFontSize = FreemindConstant.FONT_SIZE_NORMAL;
|
||||
}
|
||||
fontStyle.append(wiseFontSize);
|
||||
|
||||
@@ -597,19 +554,19 @@ public class FreemindImporter
|
||||
// Bold ...
|
||||
if (font != null) {
|
||||
boolean hasBold = Boolean.parseBoolean(font.getBOLD());
|
||||
fontStyle.append(hasBold ? BOLD : "");
|
||||
fontStyle.append(hasBold ? FreemindConstant.BOLD : "");
|
||||
}
|
||||
fontStyle.append(";");
|
||||
|
||||
// Italic ...
|
||||
if (font != null) {
|
||||
boolean hasItalic = Boolean.parseBoolean(font.getITALIC());
|
||||
fontStyle.append(hasItalic ? ITALIC : "");
|
||||
fontStyle.append(hasItalic ? FreemindConstant.ITALIC : "");
|
||||
}
|
||||
fontStyle.append(";");
|
||||
|
||||
final String result = fontStyle.toString();
|
||||
return result.equals(EMPTY_FONT_STYLE) ? null : result;
|
||||
return result.equals(FreemindConstant.EMPTY_FONT_STYLE) ? null : result;
|
||||
}
|
||||
|
||||
private
|
||||
|
@@ -23,7 +23,8 @@ public enum ShapeStyle
|
||||
LINE("line"),
|
||||
ROUNDED_RECTANGLE("rounded rectagle"),
|
||||
RECTANGLE("rectagle"),
|
||||
ELLIPSE("elipse");
|
||||
ELLIPSE("elipse"),
|
||||
IMAGE("image");
|
||||
|
||||
private String style;
|
||||
|
||||
@@ -35,5 +36,14 @@ public enum ShapeStyle
|
||||
public String getStyle()
|
||||
{
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
public static ShapeStyle fromValue(String value) {
|
||||
for (ShapeStyle shapeStyle : ShapeStyle.values()) {
|
||||
if (shapeStyle.getStyle().equals(value)) {
|
||||
return shapeStyle;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Shape value \"" + value + "\" doesn't match with a value shape style.");
|
||||
}
|
||||
}
|
||||
|
@@ -114,13 +114,14 @@ public class MindmapController extends BaseController {
|
||||
return new ModelAndView("transformViewWise", values);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/freemind"}, params = {"download=mm"})
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/freemind"}, params = {"download=mm","version"})
|
||||
@ResponseBody
|
||||
public ModelAndView retrieveDocumentAsFreemind(@PathVariable int id) throws IOException, MapCouldNotFoundException {
|
||||
public ModelAndView retrieveDocumentAsFreemind(@PathVariable int id, @RequestParam(value = "version") String version) throws IOException, MapCouldNotFoundException {
|
||||
final Mindmap mindMap = findMindmapById(id);
|
||||
final Map<String, Object> values = new HashMap<String, Object>();
|
||||
values.put("content", mindMap.getXmlStr());
|
||||
values.put("filename", mindMap.getTitle());
|
||||
values.put("version", version);
|
||||
return new ModelAndView("transformViewFreemind", values);
|
||||
}
|
||||
|
||||
|
@@ -56,6 +56,7 @@ public class TransformView extends AbstractView {
|
||||
|
||||
final String content = (String) viewMap.get("content");
|
||||
final String filename = (String) viewMap.get("filename");
|
||||
final String version = (String) viewMap.get("version");
|
||||
|
||||
// Build format properties ...
|
||||
final ExportProperties properties = ExportProperties.create(exportFormat);
|
||||
@@ -63,6 +64,9 @@ public class TransformView extends AbstractView {
|
||||
final ExportProperties.ImageProperties imageProperties = (ExportProperties.ImageProperties) properties;
|
||||
imageProperties.setSize(ExportProperties.ImageProperties.Size.LARGE);
|
||||
}
|
||||
if (version != null) {
|
||||
properties.setVersion(version);
|
||||
}
|
||||
|
||||
// Set format content type...
|
||||
final String contentType = exportFormat.getContentType();
|
||||
|
@@ -35,7 +35,8 @@ EXPORT=Exportar
|
||||
SVG_EXPORT_FORMAT=Scalable Vector Graphics (SVG)
|
||||
PDF_EXPORT_FORMAT=Portable Document Format (PDF)
|
||||
IMG_EXPORT_FORMAT=Imatge(PNG/JPEG)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT_09 = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 1.0.1)
|
||||
DELETE=Esborrar
|
||||
LOGIN_ERROR=El nom d'usuari o la contrasenya no són correctes
|
||||
USER_INACTIVE=Perdo, el seu compre encara no ha estar activar. Rebrà un correu amb les dades d'activació.
|
||||
@@ -162,7 +163,7 @@ ADD_MESSAGE=Afegir un missatge
|
||||
WHO_CAN_ACCESS=Qui pot accedir
|
||||
IS_OWNER=És propietari
|
||||
OPTIONAL_CUSTOM_MESSAGE=Opcional\: Incloure un missatge personalitzat
|
||||
IMPORT_MINDMAP_INFO=És possible importar mapes en format FreeMind 0.9 i WiseMapping. Seleccioni el fitxer a importar.
|
||||
IMPORT_MINDMAP_INFO=És possible importar mapes en format FreeMind 1.0.1 i WiseMapping. Seleccioni el fitxer a importar.
|
||||
VIEW=veure
|
||||
YOU=Vostè
|
||||
INFO_UPDATE_SUCCESS=La seva informació s'ha actualitzat correctament.
|
||||
|
@@ -38,7 +38,8 @@ EXPORT=Exportieren
|
||||
SVG_EXPORT_FORMAT=Skalierbare Vektor Graphik (SVG)
|
||||
PDF_EXPORT_FORMAT=Portables Dokumenten Format (PDF)
|
||||
IMG_EXPORT_FORMAT=Bilddatei (PNG/JPEG)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT_09 = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 1.0.1)
|
||||
WISEMAPPING_EXPORT_FORMAT = WiseMapping
|
||||
LAST_UPDATE=Zuletzt geändert
|
||||
LAST_UPDATE_BY=Zuletzt geändert von
|
||||
@@ -99,7 +100,7 @@ UNEXPECTED_ERROR=Outch!!. Ein unerwarteter Fehler ist aufgetreten.
|
||||
UNEXPECTED_ERROR_DETAILS=Es tut uns Leid! Es ist ein Fehler aufgetreten der es uns nicht ermöglicht Ihre Anfrage zu bearbeiten. Bitte versuchen Sie es noch einmal oder gehen Sie zur Anfangsseite.
|
||||
NO_ENOUGH_PERMISSIONS=Outch!!. Diese map ist nicht mehr verfügbar.
|
||||
NO_ENOUGH_PERMISSIONS_DETAILS=Sie haben nicht die erforderlichen Rechte, um sich diese map anzusehen. Diese map ist entweder privat oder wurde gelöscht.
|
||||
IMPORT_MINDMAP_INFO=Sie können FreeMind 0.9 und WiseMapping maps in Ihre List von maps importieren. Wählen Sie die Datei zum Import.
|
||||
IMPORT_MINDMAP_INFO=Sie können FreeMind 1.0.1 und WiseMapping maps in Ihre List von maps importieren. Wählen Sie die Datei zum Import.
|
||||
PRINT=Drucken
|
||||
IMPORT_MAP_ERROR=FreeMind Datei konnte nicht importiert werden. {0}
|
||||
MAP_TITLE_ALREADY_EXISTS=Sie haben schon eine map mit identischem Namen.
|
||||
|
@@ -40,7 +40,8 @@ EXPORT=Export
|
||||
SVG_EXPORT_FORMAT=Scalable Vector Graphics (SVG)
|
||||
PDF_EXPORT_FORMAT=Portable Document Format (PDF)
|
||||
IMG_EXPORT_FORMAT=Image File (PNG/JPEG)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT_09 = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 1.0.1)
|
||||
WISEMAPPING_EXPORT_FORMAT = WiseMapping
|
||||
LAST_UPDATE=Last Update
|
||||
LAST_UPDATE_BY=Last Update By
|
||||
@@ -103,7 +104,7 @@ UNEXPECTED_ERROR_DETAILS=We're sorry, an error has occurred and we can't process
|
||||
UNEXPECTED_ERROR_SERVER_ERROR=We're sorry, an error has occurred and we can't process your request. Refresh the page and try again. If the problem persist, click below on "Raise An Issue" to open a ticket.
|
||||
NO_ENOUGH_PERMISSIONS=Outch!!. This map is not available anymore.
|
||||
NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted.
|
||||
IMPORT_MINDMAP_INFO=You can import FreeMind 0.9 and WiseMapping maps to your list of maps. Select the file you want to import.
|
||||
IMPORT_MINDMAP_INFO=You can import FreeMind 1.0.1 and WiseMapping maps to your list of maps. Select the file you want to import.
|
||||
PRINT=Print
|
||||
IMPORT_MAP_ERROR=FreeMind file could not be imported. {0}
|
||||
MAP_TITLE_ALREADY_EXISTS=You have already a map with the same name
|
||||
|
@@ -35,7 +35,8 @@ EXPORT=Exportar
|
||||
SVG_EXPORT_FORMAT=Scalable Vector Graphics (SVG)
|
||||
PDF_EXPORT_FORMAT=Portable Document Format (PDF)
|
||||
IMG_EXPORT_FORMAT=Imagen (PNG/JPEG)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT_09 = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 1.0.1)
|
||||
DELETE=Borrar
|
||||
LOGIN_ERROR=El nombre de usuario o la contraseña introducidos no son correctos.
|
||||
USER_INACTIVE=Disculpe, su cuenta aun no ha sido activada. Usted recibirá una notificación por email tan pronto la activemos.
|
||||
@@ -66,7 +67,7 @@ ACCOUNT_DETAIL=Desea cambiar sus preferencias? Este es el lugar.
|
||||
SVG_EXPORT_FORMAT_DETAILS=Scalable Vector Graphics (SVG) es un XML markup language para describir gráficos vectoriale de dos dimensiones. Este formato le permitira imprimir sus mapas sin perdida de calidad o resolución.
|
||||
PDF_EXPORT_FORMAT_DETAILS=Obtenga su mapa como un documento (PDF) para compartirlo y usarlo en sus presentaciones.
|
||||
IMG_EXPORT_FORMAT_DETAILS=Obtenga una representación gráfica de su mapa incluyendo todo los colores y formas para reusarlo en documentos o para ser archivado
|
||||
FREEMIND_EXPORT_FORMAT_DETAILS = FreeMind un aplicación de escritorio gratuita de diseno de mapas mentales
|
||||
FREEMIND_EXPORT_FORMAT_DETAILS = FreeMind una aplicación de escritorio gratuita de diseño de mapas mentales
|
||||
TERMSOFUSE=Términos de uso
|
||||
PRIVACYPOLICY= Politica de privacidad
|
||||
EXPORT_DETAILS=Exporte el mapa en el formato que desee y comience a utilizarlo en sus presentaciones
|
||||
@@ -164,7 +165,7 @@ ADD_MESSAGE=Agregar un mensaje
|
||||
WHO_CAN_ACCESS=Quienes pueden acceder
|
||||
IS_OWNER=Es dueño
|
||||
OPTIONAL_CUSTOM_MESSAGE=Opcional\: Incluir un mensaje personalizado
|
||||
IMPORT_MINDMAP_INFO=Es posible importar mapas en formato FreeMind 0.9 y WiseMapping. Seleccione el archivo a importar.
|
||||
IMPORT_MINDMAP_INFO=Es posible importar mapas en formato FreeMind 1.0.1 y WiseMapping. Seleccione el archivo a importar.
|
||||
VIEW=ver
|
||||
YOU=Vos
|
||||
INFO_UPDATE_SUCCESS=Your info has been changed successfully
|
||||
|
@@ -43,7 +43,8 @@ EXPORT=Exporter
|
||||
SVG_EXPORT_FORMAT=Scalable Vector Graphics (SVG)
|
||||
PDF_EXPORT_FORMAT=Portable Document Format (PDF)
|
||||
IMG_EXPORT_FORMAT=Fichier Graphique (PNG/JPEG)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT_09 = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 1.0.1)
|
||||
WISEMAPPING_EXPORT_FORMAT = WiseMapping
|
||||
LAST_UPDATE=Date dernière modification
|
||||
LAST_UPDATE_BY=Dernière modification par
|
||||
@@ -104,7 +105,7 @@ UNEXPECTED_ERROR=Aïe!!. Une erreur inattendue est survenue.
|
||||
UNEXPECTED_ERROR_DETAILS=Désolé, une erreur s'est produite et nous ne pouvons pas exécuter votre demande. Essayez à nouveau, ou retournez à la page d'accueil.
|
||||
NO_ENOUGH_PERMISSIONS=Aïe!!. Cette carte n'est plus accessible.
|
||||
NO_ENOUGH_PERMISSIONS_DETAILS=Vous n'avez pas les droits d'accès suffisants pour voir cette carte. Cette carte est devenue privée, ou a été détruite.
|
||||
IMPORT_MINDMAP_INFO=Vous pouvez importer des cartes FreeMind 0.9 et WiseMapping dans votre liste de cartes. Choisissez le fichier à importer.
|
||||
IMPORT_MINDMAP_INFO=Vous pouvez importer des cartes FreeMind 1.0.1 et WiseMapping dans votre liste de cartes. Choisissez le fichier à importer.
|
||||
PRINT=Imprimer
|
||||
IMPORT_MAP_ERROR=Le fichier FreeMind n'a pas pu être importé. {0}
|
||||
MAP_TITLE_ALREADY_EXISTS=Vous avez déjà une carte portant le même nom.
|
||||
|
@@ -38,7 +38,8 @@ EXPORT=Esporta
|
||||
SVG_EXPORT_FORMAT=Scalable Vector Graphics (SVG)
|
||||
PDF_EXPORT_FORMAT=Portable Document Format (PDF)
|
||||
IMG_EXPORT_FORMAT=File Immagine (PNG/JPEG)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (versione 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT_09 = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 1.0.1)
|
||||
WISEMAPPING_EXPORT_FORMAT = WiseMapping
|
||||
LAST_UPDATE=Ultimo Aggiornamento
|
||||
LAST_UPDATE_BY=Ultimo aggiornamento da
|
||||
@@ -99,7 +100,7 @@ UNEXPECTED_ERROR=Oops!! Si è verificato un errore inaspettato.
|
||||
UNEXPECTED_ERROR_DETAILS=Siamo spiacenti, si è verificato un errore e non possiamo procedere nella tua richiesta. Prego, provare più tardi o torna alla home page.
|
||||
NO_ENOUGH_PERMISSIONS=Oops!!. Questa mappa non è più disponibile.
|
||||
NO_ENOUGH_PERMISSIONS_DETAILS=Non hai sufficienti diritti per visualizzare questa mappa. Il suo stato è cambiato in Privato oppure è stata eliminata.
|
||||
IMPORT_MINDMAP_INFO=Puoi importare mappe da FreeMind 0.9 e da WiseMapping sulla tua lista di mappe. Seleziona il file da importare.
|
||||
IMPORT_MINDMAP_INFO=Puoi importare mappe da FreeMind 1.0.1 e da WiseMapping sulla tua lista di mappe. Seleziona il file da importare.
|
||||
PRINT=Stampa
|
||||
IMPORT_MAP_ERROR=Il file FreeMind non può essere importato. {0}
|
||||
MAP_TITLE_ALREADY_EXISTS=Esiste già una mappa con lo stesso nome
|
||||
|
@@ -36,7 +36,8 @@ EXPORT=Exportar
|
||||
SVG_EXPORT_FORMAT=Gráfico Vetorial Escalável (SVG)
|
||||
PDF_EXPORT_FORMAT=Formato de Documento Portável (PDF)
|
||||
IMG_EXPORT_FORMAT=Arquivo de Imagem (PNG/JPEG)
|
||||
FREEMIND_EXPORT_FORMAT = Exportar para o Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT_09 = Exportar para o Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT = Exportar para o Freemind (version 1.0.1)
|
||||
WISEMAPPING_EXPORT_FORMAT = WiseMapping
|
||||
LAST_UPDATE=Última Atualização
|
||||
LAST_UPDATE_BY=Última Atualização
|
||||
@@ -97,7 +98,7 @@ UNEXPECTED_ERROR=Opa!!. Ocorreu um erro inesperado.
|
||||
UNEXPECTED_ERROR_DETAILS=Lamentamos, ocorreu um erro e não podemos processar a sua solicitação. Por favor, tente novamente ou vá para a página Inicial.
|
||||
NO_ENOUGH_PERMISSIONS=Opa!!. Este mapa não está mais disponível.
|
||||
NO_ENOUGH_PERMISSIONS_DETAILS=Você não tem privilégios suficientes para ver este mapa. Este mapa foi alterado para privado ou deletado.
|
||||
IMPORT_MINDMAP_INFO=Você pode importar mapas do FreeMind 0.9 e do WiseMapping para sua lista de mapas. Selecione o arquivo que você quer importar.
|
||||
IMPORT_MINDMAP_INFO=Você pode importar mapas do FreeMind 1.0.1 e do WiseMapping para sua lista de mapas. Selecione o arquivo que você quer importar.
|
||||
PRINT=Imprimir
|
||||
IMPORT_MAP_ERROR=O arquivo FreeMind não pode ser importado. {0}
|
||||
MAP_TITLE_ALREADY_EXISTS=Você já tem um mapa com o mesmo nome
|
||||
|
@@ -99,7 +99,7 @@ UNEXPECTED_ERROR=晕!!不可预知的错误。
|
||||
UNEXPECTED_ERROR_DETAILS=抱歉,突遭错误,我们无法处理你的请求。 请重试或者访问首页。
|
||||
NO_ENOUGH_PERMISSIONS=晕!!此图不可访问。
|
||||
NO_ENOUGH_PERMISSIONS_DETAILS=你没有权限访问这张图。此图已修改访问权限或者已删除。
|
||||
IMPORT_MINDMAP_INFO=你可以导入 FreeMind 0.9 和 WiseMapping 格式的思维导图。选择你想要导入的文件。
|
||||
IMPORT_MINDMAP_INFO=你可以导入 FreeMind 1.0.1 和 WiseMapping 格式的思维导图。选择你想要导入的文件。
|
||||
PRINT=打印
|
||||
IMPORT_MAP_ERROR=FreeMind 文件不能导入。
|
||||
MAP_TITLE_ALREADY_EXISTS=已有同名称图
|
||||
|
@@ -38,7 +38,8 @@ EXPORT=導出
|
||||
SVG_EXPORT_FORMAT=可縮放向量圖形(SVG)
|
||||
PDF_EXPORT_FORMAT=便攜檔格式(PDF)
|
||||
IMG_EXPORT_FORMAT=圖像檔(PNG/JPEG)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT_09 = Freemind (version 0.9.0)
|
||||
FREEMIND_EXPORT_FORMAT = Freemind (version 1.0.1)
|
||||
WISEMAPPING_EXPORT_FORMAT = WiseMapping
|
||||
LAST_UPDATE=最近更新
|
||||
LAST_UPDATE_BY=最近更新者
|
||||
@@ -99,7 +100,7 @@ UNEXPECTED_ERROR=暈!!不可預知的錯誤。
|
||||
UNEXPECTED_ERROR_DETAILS=抱歉,突遭錯誤,我們無法處理你的請求。 請重試或者訪問首頁。
|
||||
NO_ENOUGH_PERMISSIONS=暈!!此圖不可訪問。
|
||||
NO_ENOUGH_PERMISSIONS_DETAILS=你沒有許可權訪問這張圖。此圖已修改訪問許可權或者已刪除。
|
||||
IMPORT_MINDMAP_INFO=你可以導入 FreeMind 0.9 和 WiseMapping 格式的思維導圖。選擇你想要導入的檔。
|
||||
IMPORT_MINDMAP_INFO=你可以導入 FreeMind 1.0.1 和 WiseMapping 格式的思維導圖。選擇你想要導入的檔。
|
||||
PRINT=列印
|
||||
IMPORT_MAP_ERROR=FreeMind 檔不能導入。
|
||||
MAP_TITLE_ALREADY_EXISTS=已有同名稱圖
|
||||
|
@@ -26,6 +26,7 @@
|
||||
var svgXml = context.method == "POST" ? window.document.getElementById('workspaceContainer').innerHTML : "";
|
||||
$('svgXml').setAttribute('value', svgXml);
|
||||
$('download').setAttribute('value', context.formatType);
|
||||
$('version').setAttribute('value', context.version);
|
||||
iframeForm.submit();
|
||||
}
|
||||
if (MooDialog.Request.active) {
|
||||
@@ -44,4 +45,5 @@
|
||||
enctype="application/x-www-form-urlencoded" id="iframeExportForm">
|
||||
<input name="svgXml" id="svgXml" value="" type="hidden"/>
|
||||
<input name="download" id="download" type="hidden" value="mm"/>
|
||||
<input name="version" id="version" type="hidden" value=""/>
|
||||
</form>
|
@@ -10,10 +10,16 @@
|
||||
enctype="application/x-www-form-urlencoded" id="dialogMainForm">
|
||||
<input name="svgXml" id="svgXml" value="" type="hidden"/>
|
||||
<input name="download" type="hidden" value="mm"/>
|
||||
<input name="version" type="hidden" value=""/>
|
||||
<fieldset>
|
||||
<label for="freemind">
|
||||
<input type="radio" id="freemind" name="exportFormat" value="mm" checked="checked"/>
|
||||
<input type="radio" id="freemind" name="exportFormat" value="mm" version="1.0.1" checked="checked"/>
|
||||
<strong><spring:message code="FREEMIND_EXPORT_FORMAT"/></strong><br/>
|
||||
</label>
|
||||
|
||||
<label for="freemind09">
|
||||
<input type="radio" id="freemind09" name="exportFormat" value="mm" version="0.9.0"/>
|
||||
<strong><spring:message code="FREEMIND_EXPORT_FORMAT_09"/></strong><br/>
|
||||
<spring:message code="FREEMIND_EXPORT_FORMAT_DETAILS"/>
|
||||
</label>
|
||||
|
||||
@@ -98,7 +104,7 @@
|
||||
// No way to obtain map svg. Hide panels..
|
||||
if (window.location.pathname.match(/\/[0-9]+\/edit/)) {
|
||||
$('#exportInfo').hide();
|
||||
$('#freemind,#pdf,#svg,#odt,#txt,#xls,#mmap').click('click', function (event) {
|
||||
$('#freemind,#freemind09,#pdf,#svg,#odt,#txt,#xls,#mmap').click('click', function (event) {
|
||||
$('#imgFormat').hide();
|
||||
});
|
||||
|
||||
@@ -114,7 +120,6 @@
|
||||
// If the map is opened, use the latest model ...
|
||||
var formatType = $('#dialogMainForm input:checked').attr('value');
|
||||
var form = $('#dialogMainForm');
|
||||
|
||||
// Restore default ..
|
||||
form.attr('action', 'c/restful/maps/${mindmap.id}.' + formatType);
|
||||
|
||||
@@ -134,6 +139,11 @@
|
||||
|
||||
}
|
||||
|
||||
var version = $('#dialogMainForm input:checked').attr('version');
|
||||
if (version) {
|
||||
$('#dialogMainForm input[name=version]').attr('value', version);
|
||||
}
|
||||
|
||||
$('#dialogMainForm input[name=download]').attr('value', formatType);
|
||||
form.submit();
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
<div class="form-group">
|
||||
<label for="description" class="control-label col-md-2"><spring:message code="DESCRIPTION"/>: </label>
|
||||
<div class="col-md-10">
|
||||
<textarea type="text" name="description" id="description"
|
||||
<textarea name="description" id="description"
|
||||
placeholder="<spring:message code="MAP_DESCRIPTION_HINT"/>" class="form-control" maxlength="255"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,12 +46,46 @@
|
||||
|
||||
$('#dialogMainForm').submit(function (event) {
|
||||
// Load form parameters ...
|
||||
var title = $('#dialogMainForm #title').attr('value');
|
||||
var title = $('#dialogMainForm #title').val();
|
||||
title = title == undefined ? "" : title;
|
||||
|
||||
var description = $('#dialogMainForm #description').attr('value');
|
||||
var description = $('#dialogMainForm #description').val();
|
||||
description = description == undefined ? "" : description;
|
||||
|
||||
var onSuccess = function (data, textStatus, jqXHR) {
|
||||
var resourceId = data.getResponseHeader("ResourceId");
|
||||
window.location = "c/maps/" + resourceId + "/edit";
|
||||
};
|
||||
|
||||
var onError = function (jqXHR, textStatus, errorThrown) {
|
||||
if (jqXHR.status == 400) {
|
||||
var errors = JSON.parse(jqXHR.responseText);
|
||||
// Mark fields with errors ...
|
||||
var fieldErrors = errors.fieldErrors;
|
||||
if (fieldErrors) {
|
||||
for (var fieldName in fieldErrors) {
|
||||
// Mark the field with errors ...
|
||||
var message = fieldErrors[fieldName];
|
||||
var inputField = $("#dialogMainForm input[name='" + fieldName + "']");
|
||||
$("#dialogMainForm").find(".errorMessage").text(message).addClass("alert alert-danger");
|
||||
inputField.parent().addClass('error');
|
||||
}
|
||||
}
|
||||
var globalErrors = errors.globalErrors;
|
||||
if (globalErrors) {
|
||||
for (var error in globalErrors) {
|
||||
// Mark the field with errors ...
|
||||
$("#dialogMainForm").find(".errorMessage").text(error).addClass("alert alert-danger");
|
||||
inputField.parent().addClass('error');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(errorThrown);
|
||||
console.log(jqXHR);
|
||||
$('#messagesPanel div').text(errorThrown).parent().show();
|
||||
}
|
||||
};
|
||||
|
||||
// Save status on click ...
|
||||
jQuery.ajax("c/restful/maps?title=" + encodeURI(title) + "&description=" + encodeURI(description),
|
||||
{
|
||||
@@ -60,37 +94,10 @@
|
||||
type:'POST',
|
||||
dataType:'json',
|
||||
contentType:contentType,
|
||||
success:function (data, textStatus, jqXHR) {
|
||||
var resourceId = jqXHR.getResponseHeader("ResourceId");
|
||||
window.location = "c/maps/" + resourceId + "/edit";
|
||||
},
|
||||
error:function (jqXHR, textStatus, errorThrown) {
|
||||
if (jqXHR.status == 400) {
|
||||
var errors = JSON.parse(jqXHR.responseText);
|
||||
// Mark fields with errors ...
|
||||
var fieldErrors = errors.fieldErrors;
|
||||
if (fieldErrors) {
|
||||
for (var fieldName in fieldErrors) {
|
||||
// Mark the field with errors ...
|
||||
var message = fieldErrors[fieldName];
|
||||
var inputField = $("#dialogMainForm input[name='" + fieldName + "']");
|
||||
$("#dialogMainForm").find(".errorMessage").text(message).addClass("alert alert-danger");
|
||||
inputField.parent().addClass('error');
|
||||
}
|
||||
}
|
||||
var globalErrors = errors.globalErrors;
|
||||
if (globalErrors) {
|
||||
for (var error in globalErrors) {
|
||||
// Mark the field with errors ...
|
||||
$("#dialogMainForm").find(".errorMessage").text(error).addClass("alert alert-danger");
|
||||
inputField.parent().addClass('error');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(errorThrown);
|
||||
console.log(jqXHR);
|
||||
$('#messagesPanel div').text(errorThrown).parent().show();
|
||||
}
|
||||
statusCode: {
|
||||
201: onSuccess,
|
||||
400: onError,
|
||||
default: onError
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
|
Reference in New Issue
Block a user