Constructor
new DocumentModule(requestService, config)
Creates a new documents module.
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
requestService | RequestService | The request service. | ||||||||||||||||||
config | object | The configuration of UD-Viz. Properties
|
- Source
Classes
Members
provider :DocumentProvider
The document provider filters the list of documents.
- Source
service :DocumentService
The document service holds the list of documents fetched from the server.
- Source
view :DocumentView
The document view represents the user interface for the documents.
- Source
Methods
addEventListener(event, action)
Adds an event listener to the document provider. There are two types of events :
DocumentModule.EVENT_FILTERED_DOCUMENTS_UPDATED
fires when the list of filtered documents changesDocumentModule.EVENT_DISPLAYED_DOC_CHANGED
fires when the displayed document changes.
Name | Type | Description |
---|---|---|
event | string | The event to register. Can only be |
action | cbAction | The listener. |
- Source
addFilter(filter)
Adds a filter to the filtering pipeline.
Name | Type | Description |
---|---|---|
filter | DocumentFilter | The new filter to add. |
- Source
changeDocumentSource(newSource, authenticateopt) → {DocumentSource}
Changes the document source (the object representing the server URLs to fetch the documents).
Name | Type | Attributes | Description |
---|---|---|---|
newSource | DocumentSource | The new document source. | |
authenticate | boolean | <optional> | Specifies wether authentication should be used for the document fetch requests. |
- Source
The previous document source.
- Type:
- DocumentSource
(async) refreshDocumentList()
Updates the filtered documents list by fetching them from the DocumentService
and applying the successive filters. Triggers the DOCUMENT_LIST_UPDATED
and then the DISPLAYED_DOCUMENT_CHANGED
events.
- Source
removeEventListener(action)
Removes an event listener from the document provider.
Name | Type | Description |
---|---|---|
action | cbAction | The listener to remove. |
- Source