annotationSaveHandler
Use this parameter to obtain all annotation data upon annotation saving.
You can call a specified JavaScript function when an annotation is saved and it passes the annotation data to that function. To enable this option, set the HTML parameter annotationSaveHandler with the name of the JavaScript function to be called in the page that loads IBM Daeja ViewONE.
To enable and use the annotation save handler, you must set the following parameters. The annotationSaveHandlerTimeout parameter specifies the timeout of the handler. If it is not present, the default is 120000 milliseconds (2 minutes).
| Setup | Parameter |
|---|---|
| Annotation save handler |
|
| Annotation save handler timeout |
|
The custom save handler must reply with OK for the annotation to save correctly.
Sending any other value other than OK results in an annotation save failure
dialog.
Sample syntax
<PARAM NAME="annotationSaveHandler" value="savefunc" />
savefunc(contentType, data)
is called with the annotation data and content type of that data when annotations are saved. It
assumes that the viewer was loaded with the annotationSaveHandler parameter as
shown in the previous example.<script type="text/javascript">
function savefunc(contentType, data)
{
alert("Content Type:" + contentType);
alert("Annotation Data: " + data);
var callbackId = ViewONE.getEventHandlerCallbackId();
ViewONE.setEventHandlerCallbackResponse(callbackId, "OK");
}
</script>