RoundTrip events
List of the events in the RoundTrip JavaScript API.
taskStart (event ID: 78)
The taskStart event is fired whenever a RoundTrip process is
started. This invokes the method specified in the eventHandler parameter. If you
listen for this event, you must respond, by using the callback response method.
eventHandler, it would have the following
signature: eventHandler(78, taskId, callbackId, editModeSpecificParam)| Parameter | Description |
|---|---|
| 78 | The ID of the event. |
| taskId | The taskId of the current RoundTrip task. |
| callbackId | The callback ID to be passed in to the setEventHandlerCallbackResponse call
for this handler. |
| editModeSpecificParam | This parameter is present in Document Builder mode only and corresponds to the current
configuration. In redaction mode this parameter is not present. |
| Attributes | Description |
|---|---|
actions |
An array of JSON maps that indicate the actions to be performed in this document build. This is commonly referred to as a recipe. See the following code example. |
allow |
A Boolean that indicates whether the task corresponding to this
taskStartEvent must be allowed or canceled. |
showProgress |
A Boolean that indicates whether the progress dialog must be shown. |
config |
A JSON map that contains the mimeType attribute. |
mimeType |
A string that indicates the mime type of the Document Builder output document. Valid values are:
|
Example
The following code sample shows an example of the JSON configuration:
{
"actions":
[
{
"source":
{
"location":"http://localhost/input/pdf/agreement.pdf",
"versionInfo":"0",
"annotationHash":"md5"
},
"viewId":"Document BuilderControllerViewID",
"type":"LoadDocument"
},
{
"source":
{
"location":"http://localhost/input/pdf/p1.pdf",
"versionInfo":"0",
"annotationHash":"md5"
},
"viewId":"DocumentDataSource=[http://localhost/input/pdf/p1.pdf]",
"type":"LoadDocument"
},
{
"fromView":"DocumentDataSource=[http://localhost/input/pdf/p1.pdf]",
"fromFirstPage":1,
"fromLastPage":1,
"toView":"Document BuilderControllerViewID",
"toPage":2,
"type":"CopyPages"
},
{
"page":1,
"annotations":"[EMPTY]",
"viewId":"Document BuilderControllerViewID",
"type":"ReplaceAnnotations"
}
],
"allow":true,
"showProgress":true,
"config":
{
"mimeType":"application/pdf"
}
}
setEventHandlerCallbackResponse(callbackId, editModeSpecificParam)| Parameter | Description |
|---|---|
| callbackId | The callbackId passed to the eventHandler. |
| editModeSpecificParam |
|
taskStarted (event ID: 79)
The taskStarted event is fired after the callback for taskStart
was called. This event signals that the RoundTrip task is in progress.
eventHandler, it would have the following
signature: eventHandler(79, taskId, callbackId)| Parameter | Description |
|---|---|
| taskId | The taskId of the current RoundTrip task. |
| callbackId | The callback for this event can be used to cancel the document build. |
The callback response that is required for this event has the following signature:
setEventHandlerCallbackResponse(callbackId, status)
| Parameter | Description |
|---|---|
| callbackId | The callbackId passed to the eventHandler. |
| status | A string equal to one of the following values:
|
taskStatus (event ID: 80)
The taskStatus event is fired after the taskStarted event is
called. This event can be fired multiple times and is triggered when IBM
Daeja ViewONE receives progress from the server.
For example, if your handler is called eventHandler, it would have the following
signature:
eventHandler(80, taskId, status, editModeSpecificParam)
| Parameter | Description |
|---|---|
| taskId | The taskId of the current RoundTrip task. |
| status | A string that represents the current status of the task. The values can be as follows:
|
| editModeSpecificParam |
|
The callback response that is required for this event has the following signature:
setEventHandlerCallbackResponse(callbackId, editModeSpecificParam)