Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
It is possible to add an object that will be included in the callback to avoid creating too many closures.
Calling twice addEventListener with the same parameters results in the second call to be ignored,
only unique pairs callback / object are allowed, in order to avoid calling multiple times the same
thing.
The id of the inserted callback (actually an UUID).
Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
The id of the inserted callback (actually an UUID).
Asynchronously gets the content of the specified attached document.
The attached document must not have a URL, any AttachedDocumentInfoInterface with a non empty documentUrl will return a promise with a bad input result.
The mime type sets the return type of the promise content, string if the attached document is a text one, Uint8Array if binary.
The AttachedDocumentInfoInterface is retrieved when using a InstanceMetadataInterface.getAttachedDocumentInfos.
Returns a promise.
The result may be undefined (getDocumentContent, AsyncDocumentContentGetterResult.value) if no such document was found, this is not an error, and AsyncDocumentContentGetterResult.reason is equal to AsyncResultReason.ARR_Success.
Please note that in case of multiple promises running at the same time on the same DocumentContentGetterInterface, the first promises will be signalled as cancelled, the last as ok, but all calls to getDocumentContent after awaiting will return the same value.
A promise. The promise is resolved with the reason (success, cancelled, disposed, bad input). In case of success, the promise contains the document content.
Asynchronously gets the content of the specified attached document by its id and mime type.
The mime type sets the return type of the promise, string if the attached document is a text one, Uint8Array if binary.
Returns a promise.
The result may be undefined (getDocumentContent, AsyncDocumentContentGetterResult.value) if no such document was found, this is not an error, and AsyncDocumentContentGetterResult.reason is equal to AsyncResultReason.ARR_Success.
Please note that in case of multiple promises running at the same time on the same DocumentContentGetterInterface, the first promises will be signalled as cancelled, the last as ok, but all calls to getDocumentContent after awaiting will return the same value.
Optional pMimeType: stringA promise. The promise is resolved with the reason (success, cancelled, disposed, bad input). In case of success, the promise contains the document content.
Cancels the computation of the attached document retrieving process (if any).
A DocumentContentGetterInterfaceSignal.DocumentContentCancelled signal is emitted if the DocumentContentGetterInterface is retrieving data.
true if the document retrieval procedure was running.
Gets rid of this object.
After this call, this object can no longer be used.
If the object is an InfiniteObjectDispatcherInterface, then the InfiniteObjectDispatcherInterfaceSignal.ObjectDisposed signal is emitted.
Further uses of the object (with the exception of isDisposed, getInfiniteObjectType and application id retrieval) will log a message with LogLevel.LL_UsingDisposedObject.
Gets the attached document information that was requested by a previous call to retrieveDocumentContent.
If retrieveDocumentContent was called with a attached document id, a "dummy" AttachedDocumentInfoInterface is created with the document id
and mime-type, and with empty other properties.
DO NOT modify this data in place, this results in undefined behavior.
Gets the content of the requested attached document.
The attached document content is returned if the DocumentContentGetterInterface has finished computing. Use addEventListener on the event DocumentContentGetterInterfaceSignal.DocumentContentReady to know when the DocumentContentGetterInterface is ready.
DO NOT modify this data in place, this results in undefined behavior.
The type of the data returned by the function depends on the mime type of the attached document.
Tells the type of the given interface.
The type of the given interface.
Gets the last error returned by the update of the DocumentContentGetterInterface.
The last error (if any, or undefined if no error occurred).
Each call to retrieveDocumentContent is assigned a request id.
This call tels the id of the last call to retrieveDocumentContent.
The id of the last call to retrieveDocumentContent.
Tells if the EventDispatcher has such a callback registered for the given event type.
true if such a listener is installed for the given type of event.
Tells if the DocumentContentGetterInterface has been cancelled.
This is generally the case after calling cancel when the DocumentContentGetterInterface is retrieving data.
true if the DocumentContentGetterInterface is cancelled.
Tells if this object has been gotten rid off.
true if dispose has been called on this object.
Tells if the DocumentContentGetterInterface is updating.
This is the case after calling retrieveDocumentContent.
true if the DocumentContentGetterInterface is updating.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
The listener object that was used when addEventListener was called.
true if the callback was removed else false.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
true if the callback was removed else false.
Removes a listener by its id.
If no such listener is found, then the function returns false and does nothing. You must use the return value of addEventListener to actually remove the listener.
true if the callback was removed else false.
Gets the content of the specified attached document.
The attached document must not have a URL, any AttachedDocumentInfoInterface with a non empty documentUrl will return false.
The mime type sets the return type of getDocumentContent, string if the attached document is a text one, Uint8Array if binary.
The AttachedDocumentInfoInterface is retrieved when using a InstanceMetadataInterface.getAttachedDocumentInfos.
The event DocumentContentGetterInterfaceSignal.DocumentContentReady is fired when the
attached document content result is ready.
Returns true if the attached document procedure retrieval is started. If not, just call getLastError to get the reason why the procedure failed.
The result may be undefined (getDocumentContent) if no such document was found.
true if the retrieval procedure has begun.
Gets the content of the specified attached document by its id and mime type.
The mime type sets the return type of getDocumentContent, string if the attached document is a text one, Uint8Array if binary.
The event DocumentContentGetterInterfaceSignal.DocumentContentReady is fired when the attached document content result is ready.
Returns true if the document procedure retrieval is started. If not, just call getLastError to get the reason why the procedure failed.
The result may be undefined (getDocumentContent) if no such document was found.
Optional pMimeType: stringtrue if the retrieval procedure has begun.
The DocumentContentGetterInterface interface is used to get the content of an attached document knowing its properties (this cannot be used to get metadata documents).
The attached document content can be retrieved by an AttachedDocumentInfoInterface obtained by a call to InstanceMetadataInterface.getAttachedDocumentInfos. If the user knows the
attached document idand its mime type, then the attached document can also be retrieved using this information and using DataSessionInterface.createAttachedDocumentInfo.attached document idsare string based.Warning : any attached document with a URL will NOT be retrieved.
The DocumentContentGetterInterface interfaces are created through the DataSessionInterface.createDocumentContentGetter method.
or asynchronously :
The list of signals the DocumentContentGetterInterface may trigger is available in the DocumentContentGetterInterfaceSignal enumeration.
The attached document retrieval procedure is triggered through the retrieveDocumentContent methods. The result is not available right away, but the event DocumentContentGetterInterfaceSignal.DocumentContentReady is triggered when the result of the DocumentContentGetterInterface is available. The result is available through the getDocumentContent function.
Warning : there may be cases when the getDocumentContent is not available such as when the DocumentContentGetterInterface is updating, i.e. when isRunning returns true, or when the DocumentContentGetterInterface has been cancelled, i.e. when isCancelled returns true.
A DocumentContentGetterInterface may be interrupted (cancelled) when the DocumentContentGetterInterface is updating and cancel is called. In such cases, the DocumentContentGetterInterfaceSignal.DocumentContentCancelled signal is fired, and shortly after, DocumentContentGetterInterfaceSignal.DocumentContentReady signal is fired, but getDocumentContent will return undefined. Just call retrieveDocumentContent with another (or the same) attached document properties to trigger a new retrieval.
If you call multiple times retrieveDocumentContent before receiving the DocumentContentGetterInterfaceSignal.DocumentContentReady, only one DocumentContentGetterInterfaceSignal.DocumentContentReady will be sent with the content of the last call to retrieveDocumentContent.
The result may be undefined (getDocumentContent) if no such document was found, this is not considered as an error.
The developer may trigger a download on the user browser by the following code :
Please refer to the AttachedDocumentInfoInterface for additional information.
See