Finish moving mindmap loading to rest.
This commit is contained in:
@@ -33,18 +33,21 @@
|
||||
// Configure designer options ...
|
||||
var options = loadDesignerOptions();
|
||||
|
||||
<c:if test="${!memoryPersistence}">
|
||||
<c:if test="${!memoryPersistence && !readOnlyMode}">
|
||||
options.persistenceManager = new mindplot.RESTPersistenceManager(
|
||||
{
|
||||
documentUrl:"c/restful/maps/{id}/document",
|
||||
revertUrl:"c/restful/maps/{id}/history/latest",
|
||||
lockUrl:"c/restful/maps/{id}/lock",
|
||||
timestamp: "${lockTimestamp}?${lockTimestamp}:0",
|
||||
session: "${lockSession}?${lockSession}:0"
|
||||
timestamp: "${lockTimestamp}",
|
||||
session: "${lockSession}"
|
||||
}
|
||||
);
|
||||
|
||||
</c:if>
|
||||
<c:if test="${memoryPersistence || readOnlyMode}">
|
||||
options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}/document/xml");
|
||||
</c:if>
|
||||
|
||||
var userOptions = ${mindmap.properties};
|
||||
options.zoom = userOptions.zoom;
|
||||
options.readOnly = ${!!readOnlyMode};
|
||||
|
@@ -6,7 +6,6 @@
|
||||
<%--@elvariable id="mindmap" type="com.wisemapping.model.Mindmap"--%>
|
||||
<%--@elvariable id="editorTryMode" type="java.lang.Boolean"--%>
|
||||
<%--@elvariable id="editorTryMode" type="java.lang.String"--%>
|
||||
<%--@elvariable id="mapXml" type="com.wisemapping.model.User"--%>
|
||||
|
||||
|
||||
<html>
|
||||
@@ -27,7 +26,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
var mapId = '${mindmap.id}';
|
||||
var mapXml = '${mindmap.xmlAsJsLiteral}';
|
||||
|
||||
$(document).addEvent('loadcomplete', function (resource) {
|
||||
|
||||
// Configure designer options ...
|
||||
@@ -45,14 +44,15 @@
|
||||
// Print is read only ...
|
||||
options.readOnly = true;
|
||||
|
||||
// Configure persistence ...
|
||||
options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}/document/xml");
|
||||
|
||||
// Build designer ...
|
||||
var designer = buildDesigner(options);
|
||||
|
||||
// Load map from XML ...
|
||||
var parser = new DOMParser();
|
||||
var domDocument = parser.parseFromString(mapXml, "text/xml");
|
||||
|
||||
var mindmap = mindplot.PersistenceManager.loadFromDom(mapId, domDocument);
|
||||
// Load map ...
|
||||
var persistence = mindplot.PersistenceManager.getInstance();
|
||||
var mindmap = mindmap = persistence.load(mapId);
|
||||
designer.loadMap(mindmap);
|
||||
|
||||
$('zoomIn').addEvent('click', function () {
|
||||
|
@@ -4,7 +4,6 @@
|
||||
<%--@elvariable id="mindmap" type="com.wisemapping.model.Mindmap"--%>
|
||||
<%--@elvariable id="editorTryMode" type="java.lang.Boolean"--%>
|
||||
<%--@elvariable id="editorTryMode" type="java.lang.String"--%>
|
||||
<%--@elvariable id="mapXml" type="com.wisemapping.model.User"--%>
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
@@ -60,7 +59,6 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
var mapId = '${mindmap.id}';
|
||||
var mapXml = '${mindmap.xmlAsJsLiteral}';
|
||||
|
||||
$(document).addEvent('loadcomplete', function (resource) {
|
||||
|
||||
@@ -78,14 +76,15 @@
|
||||
// Print is read only ...
|
||||
options.readOnly = true;
|
||||
|
||||
// Configure loader ...
|
||||
options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}/document/xml.xml");
|
||||
|
||||
// Build designer ...
|
||||
var designer = buildDesigner(options);
|
||||
|
||||
// Load map from XML ...
|
||||
var parser = new DOMParser();
|
||||
var domDocument = parser.parseFromString(mapXml, "text/xml");
|
||||
|
||||
var mindmap = mindplot.PersistenceManager.loadFromDom(mapId, domDocument);
|
||||
// Load map ...
|
||||
var persistence = mindplot.PersistenceManager.getInstance();
|
||||
var mindmap = mindmap = persistence.load(mapId);
|
||||
designer.loadMap(mindmap);
|
||||
|
||||
$('zoomIn').addEvent('click', function () {
|
||||
|
Reference in New Issue
Block a user