Split rest authentication into two. For web apps integration url is /c/restful/

This commit is contained in:
Paulo Gustavo Veiga
2012-11-10 17:19:28 -03:00
parent 6a9d1c684e
commit a228ea6ed5
39 changed files with 178 additions and 113 deletions

View File

@@ -50,14 +50,20 @@ mindplot.RESTPersistenceManager = new Class({
url:this.saveUrl.replace("{id}", mapId) + "?" + query,
method:'put',
async:!sync,
onSuccess:function (responseText, responseXML) {
events.onSuccess();
persistence.timestamp = responseText;
},
onException:function (headerName, value) {
console.log("onException....");
events.onError(persistence._buildError());
},
onFailure:function (xhr) {
console.log("onFailure....");
var responseText = xhr.responseText;
var error = null;
@@ -70,8 +76,16 @@ mindplot.RESTPersistenceManager = new Class({
events.onError(persistence._buildError());
throw new Error("Unexpected error saving. Error response is not json object:" + responseText);
}
} else {
var msg = {severity:"ERROR", message:$msg('SAVE_COULD_NOT_BE_COMPLETED')};
if (this.status == 405) {
msg = {severity:"ERROR", message:$msg('SESSION_EXPIRED')};
}
events.onError(msg);
}
},
headers:{"Content-Type":"application/json", "Accept":"application/json"},
emulation:false,
urlEncoded:false

View File

@@ -629,6 +629,7 @@ mindplot.Topic = new Class({
fade.addEvent('complete', function () {
});
fade.start();
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeShrinkEvent, model);
},