Enumeration DocumentContentGetterInterfaceSignal

The DocumentContentGetterInterfaceSignal lists all the signals that may be sent by the DocumentContentGetterInterface.

These signals are emitted by the DocumentContentGetterInterface when some data is available.

/** 
* Sample to illustrate how to download an attached document.
*/
import { DataSessionInterface, DocumentContentGetterInterface, AttachedDocumentInfoInterface, DocumentContentGetterInterfaceSignal, tListenerCallback } from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;
// user callback code called when the document data content is ready
let myCallback : tListenerCallback;

const lDocumentContentGetterInterface : DocumentContentGetterInterface = lDataSession.createDocumentContentGetter();
// get an AttachedDocumentInfoInterface from an IdCardGetterInterface
// ....
let lAttachedDocumentInfo : AttachedDocumentInfoInterface;

lDocumentContentGetterInterface.addEventListener(DocumentContentGetterInterfaceSignal.DocumentContentReady, myCallback);

// if no url, then we can retrieve data content
if (lAttachedDocumentInfo.documentUrl === '')
{
lDocumentContentGetterInterface.retrieveDocumentContent(lAttachedDocumentInfo);
}
// myCallback will be called when the data is available

Please refer to the DocumentContentGetterInterface for more information.
Events

Enumeration Members

DocumentContentCancelled: "cancelled"

Signal sent by the DocumentContentGetterInterface when the DocumentContentGetterInterface has been cancelled.

Such an event is fired if the DocumentContentGetterInterface was updating and DocumentContentGetterInterface.cancel is called. The DocumentContentReady signal will be triggered shortly after.

No attachment for events of this type.

DocumentContentReady: "ready"

Signal sent by the DocumentContentGetterInterface when the DocumentContentGetterInterface is ready, i.e. DocumentContentGetterInterface.getDocumentContent can be called.

Warning, the DocumentContentReady signal is sent when DocumentContentGetterInterface.cancel is called and the DocumentContentGetterInterface is updating.

The attachment is a string telling the request id of the call to DocumentContentGetterInterface.retrieveDocumentContent (DocumentContentGetterInterface.getLastRequestId).