[Yanel-commits] rev 38500 -
public/yanel/trunk/src/realms/yanel-website/content
michi at wyona.com
michi at wyona.com
Tue Sep 9 23:37:14 CEST 2008
Author: michi
Date: 2008-09-09 23:37:14 +0200 (Tue, 09 Sep 2008)
New Revision: 38500
Modified:
public/yanel/trunk/src/realms/yanel-website/content/f97143ee-1cc7-445c-9f36-0d59455fbc2a
Log:
save function added
Modified: public/yanel/trunk/src/realms/yanel-website/content/f97143ee-1cc7-445c-9f36-0d59455fbc2a
===================================================================
--- public/yanel/trunk/src/realms/yanel-website/content/f97143ee-1cc7-445c-9f36-0d59455fbc2a 2008-09-09 21:26:14 UTC (rev 38499)
+++ public/yanel/trunk/src/realms/yanel-website/content/f97143ee-1cc7-445c-9f36-0d59455fbc2a 2008-09-09 21:37:14 UTC (rev 38500)
@@ -71,9 +71,30 @@
<a name="saving"/>
<h2>Saving data</h2>
<p>
-...
+In order to save data from Xopus to the server one needs to implement a custom javascript save function (and also an exit function):
</p>
+<pre>
+// This function is called when the save button is pressed, or when the save function is called on an XMLDocument.
+function mySaveFunction(uri, xmlDocument)
+{
+ // HTTP POST the XML document
+ var result = HTTPTools.postXML(uri, xmlDocument,"UTF-8");
+
+ // Show a dialog with the result.
+ //return confirm("Called save\n" + "Result: " + result + "\n");
+}
+
+// Register the save function.
+IO.setSaveXMLFunction(mySaveFunction);
+
+// Set exit URL:
+var exitURL = unescape(window.location.href).split('#')[0].split('?')[0] + '?yanel.resource.usecase=checkin';
+//alert(exitURL);
+
+Editor.setExitURL(exitURL);
+</pre>
+
<a name="lookup"/>
<h2>Lookup</h2>
<p>
More information about the Yanel-commits
mailing list