Kofax Communications Manager ComposerUI for HTML5 JavaScript API Web Developer's Guide
• tbeformatfunctions. Array. An array of format function objects to be presented to the end user in
the formatting dialog in the Text Block Editor. A format function consists of the name attribute and the
parameters attribute.
Example [{name: 'Concat', parameters: ['prefix']}, {name: 'AsNumber',
parameters: ['nr_of_decimals']}].
RunInfo
A RunInfo object is passed on the callback function to pass information about the run. A RunInfo object
contain values for the following attributes:
• starturl. String. The starturl passed to the Start call.
• sessionid. String. The sessionid passed to the Start call.
• jobid. String. The jobid passed to the Start call.
• elementid. String. The elementid passed to the Start call.
• options. RunOptions. The options object passed to the Start call.
In case of the onruncompleted callback, the following attribute is also available:
• hasbeeninteractive. Boolean. A boolean value that indicates whether any interaction was required
to compose the document. Based on this value, the business application may determine whether to
provide a button that leads the end user back to the last form of the interactive document composition.
Document
A Document object is passed on the onruncompleted callback. The object offers two methods: one is to
retrieve the content of the document, and the other to update it.
The GetContent method accepts one callback parameter:
• callback. Function(format, content). This method is called once the content of the document is
retrieved from the server. The format parameter contains the format of the result document (.doc, .docx,
or .pdf). The content attribute contains the actual content (base64 encoded).
The SetContent method accepts the content as its only parameter:
• content. Base64 string. The content that is uploaded to the server to replace the currently stored
content of the document.
Error
When an error occurs, an Error object is passed to the onrunfailed or onerror callback. This object
contains values for the following attributes:
• type. String. "http" or "ui."
• message. String. A message used to display the error to the end user.
• details. Object. An object containing more details about the error. The exact contents of the object
differs between error types.
For type "http," the error.details object contains the following attributes:
• url. String. The URL that is accessed.
• statuscode. Number. The http status code that is returned.
• statustext. String. The status text (if any) that is returned in the http header.
• responsetext. String. The response text (if any) that is returned in the response body.
19