- Add missing changes.
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="XMLMindmapSerializerFactory.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="PersistenceManager.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="DwrPersistenceManager.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="RestPersistenceManager.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="LocalStorageManager.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="EditorProperties.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="IconGroup.js"/>
|
||||
|
@@ -1,83 +1,57 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.DwrPersitenceManager = new Class({
|
||||
Extends:mindplot.PersistenceManager,
|
||||
initialize: function() {
|
||||
this.parent();
|
||||
},
|
||||
|
||||
saveMapXml : function(mapId, mapXml, pref, saveHistory, events) {
|
||||
window.MapEditorService.saveMap(mapId, mapXml, pref, saveHistory, {
|
||||
callback:function(response) {
|
||||
if (response.msgCode != "OK") {
|
||||
events.onError(response);
|
||||
} else {
|
||||
events.onSuccess(response);
|
||||
}
|
||||
},
|
||||
|
||||
errorHandler:function(message) {
|
||||
events.onError(message);
|
||||
},
|
||||
verb:"POST",
|
||||
async: true
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
loadMapDom : function(mapId) {
|
||||
$assert(mapId, "mapId can not be null");
|
||||
throw "This must be implemented";
|
||||
|
||||
// var result = {r:null};
|
||||
// window.MapEditorService.loadMap(mapId, {
|
||||
// callback:function(response) {
|
||||
//
|
||||
// if (response.msgCode == "OK") {
|
||||
// // Explorer Hack with local files ...
|
||||
// var xmlContent = response.content;
|
||||
// var domDocument = core.Utils.createDocumentFromText(xmlContent);
|
||||
// var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument);
|
||||
// var mindmap = serializer.loadFromDom(domDocument);
|
||||
// mindmap.setId(mapId);
|
||||
//
|
||||
// result.r = mindmap;
|
||||
// } else {
|
||||
// // Handle error message ...
|
||||
// var msg = response.msgDetails;
|
||||
// var monitor = core.ToolbarNotifier.getInstance();
|
||||
// monitor.logFatal("We're sorry, an error has occurred and we can't load your map. Please try again in a few minutes.");
|
||||
//// wLogger.error(msg);
|
||||
// }
|
||||
// },
|
||||
// verb:"GET",
|
||||
// async: false,
|
||||
// errorHandler:function(msg) {
|
||||
// var monitor = core.ToolbarNotifier.getInstance();
|
||||
// monitor.logFatal("We're sorry, an error has occurred and we can't load your map. Please try again in a few minutes.");
|
||||
//// wLogger.error(msg);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// return result.r;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.RESTPersistenceManager = new Class({
|
||||
Extends:mindplot.PersistenceManager,
|
||||
initialize: function(saveUrl) {
|
||||
this.parent();
|
||||
$assert(saveUrl, "saveUrl can not be null");
|
||||
this.saveUrl = saveUrl;
|
||||
},
|
||||
|
||||
saveMapXml : function(mapId, mapXml, pref, saveHistory, events) {
|
||||
|
||||
var data = {
|
||||
id:mapId,
|
||||
xml: mapXml,
|
||||
properties: pref
|
||||
};
|
||||
|
||||
var request = new Request({
|
||||
url:this.saveUrl + mapId,
|
||||
method: 'put',
|
||||
onSuccess:function(responseText, responseXML) {
|
||||
events.onSuccess();
|
||||
|
||||
},
|
||||
onException:function(headerName, value) {
|
||||
events.onError();
|
||||
},
|
||||
onFailure:function(xhr) {
|
||||
events.onError();
|
||||
},
|
||||
headers: {"Content-Type":"application/json","Accept":"application/json"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
});
|
||||
request.put(JSON.encode(data));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
@@ -59,7 +59,7 @@ mindplot.widget.IMenu = new Class({
|
||||
onError: function() {
|
||||
if (saveHistory) {
|
||||
saveElem.setStyle('cursor', 'pointer');
|
||||
$notify("Save could not be completed. Try latter");
|
||||
$notify("Save could not be completed. Try latter.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user