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 triggers a search query.
The query is written in the 3djuump Infinite literal and search query language.
The search work on a main WorkingSetInterface pWorkingSetContext, and optionally a bigger WorkingSetInterface pGlobalWorkingSet.
If pGlobalWorkingSet is not undefined, then the search is done on documents inside pGlobalWorkingSet, and SearchDocumentResultInterface.isInWorkingSet
returns true if the document is in pWorkingSetContext and pGlobalWorkingSet, and false if in pGlobalWorkingSet and not in pWorkingSetContext.
If pGlobalWorkingSet is undefined, then the search is done on documents inside pWorkingSetContext and SearchDocumentResultInterface.isInWorkingSet
returns true.
The user may limit the search to only pMaxDocumentResult results (no more than 50), setting a bigger value tan 50 triggers an error. The user may also filter the result of the search with pMetadataNamesFilter.
The pMetadataNamesFilter parameter defines the fields to retrieve from the metadata documents that match the query.
The parameter must be a an array of string containing the fields that must be returned. An empty array means the full
document will all the metadata will be returned in the resulting SearchDocumentResultInterface.
For example : if pMetadataNamesFilter is set to ["Name", "srcfile"], the result will return the content of the field
Name and the field srcfile from the metadata document.
Returns a promise.
Please note that in case of multiple promises running at the same time on the same SearchInterface, the first promises will be signalled as cancelled, the last as ok, but all calls to getSearchDocuments after awaiting will return the same value.
If pWorkingSetContext, pGlobalWorkingSet are modified during the execution, then the call is cancelled (see cancelSearch).
Optional pGlobalWorkingSet: WorkingSetInterfaceA promise. The promise is resolved with the reason (success, cancelled, disposed, bad input). In case of success, the promise contains the search result.
Cancels the computation of the search query (if any).
A SearchInterfaceSignal.SearchCancelled signal is emitted if the SearchInterface is retrieving data.
true if the SearchInterface was running, else false.
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 list of all geometric instance ids which matched the search query from the last call of search.
An Uint32Array is returned if the SearchInterface has finished computing.
Use addEventListener on the event SearchInterfaceSignal.SearchReady to
know when the SearchInterface is ready. This array contains all the matching geometric instance ids regardless
of the maximum number of hits set in search.
DO NOT modify this data in place, this results in undefined behavior.
geometric instance ids, or undefined if the
SearchInterface is searching or if the SearchInterface is in error or cancelled.Tells the type of the given interface.
The type of the given interface.
Gets the last error returned by the search request.
The last error, or undefined if no error occurred or a search request is running.
The id of the last call to search.
Gets the list of all matching documents from the last call to the search function.
An array of SearchDocumentResultInterface is returned if the SearchInterface has finished computing. Use addEventListener on the event SearchInterfaceSignal.SearchReady to know when the SearchInterface is ready. The document content is filtered with the pMetadataNamesFilter set in the search function.
The result is limited to the maximum number of hits when search was called.
DO NOT modify this data in place, this results in undefined behavior.
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 search result would have returned more results if the search would have been limited to a superior maximum number of hits.
Returns true if the last search query contained more results than the maximum cap requested by the search and if the SearchInterface has finished computing.
Use addEventListener on the event SearchInterfaceSignal.SearchReady to
know when the SearchInterface is ready.
true if the search result count exceeded the max document result cap and if the SearchInterface is not running.
Tells if a search request has been cancelled.
This is generally the case after calling cancelSearch when the SearchInterface is performing a search.
true if a search request is cancelled.
Tells if this object has been gotten rid off.
true if dispose has been called on this object.
Tells if a search request is running.
This is the case after calling search.
true if a search request is running.
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.
Triggers a search query.
The query is written in the 3djuump Infinite literal and search query language.
The search work on a main WorkingSetInterface pWorkingSetContext, and optionally a bigger WorkingSetInterface pGlobalWorkingSet.
If pGlobalWorkingSet is not undefined, then the search is done on documents inside pGlobalWorkingSet, and SearchDocumentResultInterface.isInWorkingSet
returns true if the document is in pWorkingSetContext and pGlobalWorkingSet, and false if in pGlobalWorkingSet and not in pWorkingSetContext.
If pGlobalWorkingSet is undefined, then the search is done on documents inside pWorkingSetContext and SearchDocumentResultInterface.isInWorkingSet
returns true.
The user may limit the search to only pMaxDocumentResult results (no more than 50), setting a bigger value tan 50 triggers an error. The user may also filter the result of the search with pMetadataNamesFilter.
The pMetadataNamesFilter parameter defines the fields to retrieve from the metadata documents that match the query.
The parameter must be a an array of string containing the fields that must be returned. An empty array means the full
document will all the metadata will be returned in the resulting SearchDocumentResultInterface.
For example : if pMetadataNamesFilter is set to ["Name", "srcfile"], the result will return the content of the field
Name and the field srcfile from the metadata document.
An event SearchInterfaceSignal.SearchReady is fired when the search is finished, then getLastError() tells if the search was correctly performed.
Returns true if the search query is started (and therefore the search query is valid). If not, just call getLastError to
get the reason why the procedure failed.
If pWorkingSetContext, pGlobalWorkingSet are modified during the execution, then the call is cancelled (see cancelSearch).
Optional pGlobalWorkingSet: WorkingSetInterfacetrue if the search query (pQuery) is valid, in the case the SearchInterface has begun running.
The SearchInterface interface is used to search content in the DMU.
Please see Search.
The SearchInterface interfaces are created through the DataSessionInterface.createSearch method.
The list of signals the SearchInterface may trigger is available in the SearchInterfaceSignal enumeration.
The search request is triggered through the search method. The result is not available right away, but the event SearchInterfaceSignal.SearchReady is triggered when the result of the SearchInterface is available. The result is available through the getSearchDocuments getGeometricInstanceIds and hasOtherResults functions.
As said in Search, the search result consists in a list of metadata documents that match the query (an array of SearchDocumentResultInterface from getSearchDocuments), it may be interesting to find the
part instances, and thegeometric instancesthat are linked to this search query. The DocumentIdConverterInterface fulfill this requirement.The search result also provides right away the full list of
geometric instance idsthat are involved in the search result, regardless of the given cap included (the FULL list of allgeometric instance idsthat match the query are ALWAYS provided) with getGeometricInstanceIds.Warning : there may be cases when the getSearchDocuments, getGeometricInstanceIds are not available such as when the SearchInterface is fetching data, i.e. when isRunning returns true, or when the SearchInterface has been cancelled, i.e. when isCancelled returns true.
A SearchInterface may be interrupted (cancelled) when the SearchInterface is running and cancelSearch is called. In such cases, the SearchInterfaceSignal.SearchCancelled signal is fired, and shortly after, SearchInterfaceSignal.SearchReady signal is fired, but getSearchDocuments and getGeometricInstanceIds will return undefined. Just call search with another (or the same) query to trigger a new search request.
If you call multiple times search before receiving the SearchInterfaceSignal.SearchReady, only one SearchInterfaceSignal.SearchReady will be sent with the content of the last call to search.
The syntax of the search is explained in the 3djuump Infinite literal and search query language.
The search query must be provided with a maximum number of hits to help reduce server usage and bandwidth (max 50 at the moment). If the search result is capped to this value then hasOtherResults returns true.
The search query is always limited to a Working set (see Working Sets) from the WorkingSetInterface.
The search results may be filtered to include only a subset of the metadata inside the matching document, provided the search function is called with the list of metadata names to return.
or asynchronously :
Please make sure the destination browser supports promises before using async calls.
See