Constructor
new DocumentService(requestService, configServer)
Constructs a new document service.
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
requestService | RequestService | The request service. | ||||||||||||||||||||
configServer | object | The server configuration. Properties
|
Classes
Members
authenticate :boolean
If authentication should be used for the request.
- boolean
documents :Array.<Document>
The list of documents.
- Array.<Document>
requestService :RequestService
The request service.
- RequestService
source :DocumentSource
The object that defines the server URLs to fetch documents.
Methods
(async) fetchDocumentImage(doc) → {string}
Fetches the image corresponding to the given document.
Name | Type | Description |
---|---|---|
doc | Document | The document to fetch the image. |
The data string of the image.
- Type:
- string
(async) fetchDocuments() → {Promise.<Array.<Document>>}
Fetches the documents from the server and return them in an array.
A promise with an array of fetched documents
- Type:
- Promise.<Array.<Document>>
setSource(docSource, authenticateopt) → {DocumentSource}
Sets the source of documents.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
docSource | DocumentSource | The document source. | ||
authenticate | boolean | <optional> | false | Specifies if authentication should be used to fetch documents. |
The previous source.
- Type:
- DocumentSource