this.callbackArguments = new Array();this.callbackArguments[URL] = url; this.callbackArguments[CALLBACK] = callback; this.callbackArguments[ENTRYID] = entryId; this.callbackArguments[TITLE] = title.replace(/]]>/g, "]]>"); this.callbackArguments[AUTHOR] = author; this.callbackArguments[POSTTEXT] = postText.replace(/]]>/, "]]>");
var xmlSubmit = "<savedpostdata><entryid>"+callbackArguments[ENTRYID]+"</entryid>";xmlSubmit += "<title><![CDATA["+callbackArguments[TITLE]+"]]></title>";xmlSubmit += "<author>"+callbackArguments[AUTHOR]+"</author>";xmlSubmit += "<posttext><![CDATA["+callbackArguments[POSTTEXT]+"]]></posttext>";xmlSubmit += "</savedpostdata>"; request.open("POST", this.url, true);request.setRequestHeader('Content-Type', 'text/xml');request.send(xmlSubmit);
Entry entry = dataService.GetEntry(entryId);if ( entry != null ) { entry = dataService.GetEntryForEdit( entryId ); Entry modifiedEntry = entry.Clone(); modifiedEntry.Content = textToSave; modifiedEntry.Title = title; modifiedEntry.Author = author; modifiedEntry.Syndicated = false; modifiedEntry.IsPublic = false; modifiedEntry.ModifiedUtc = DateTime.Now.ToUniversalTime(); modifiedEntry.Categories = ""; dataService.SaveEntry(modifiedEntry, null); }
else // similar code, but creating a new entry instead.
Remember Me