Handles requests retrieve documents from the repository and publishes the details of them when they're
retrieved.
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Members
-
archiveProgressUpdateFailureInterval :int
-
How long should we wait before triggering a request on a failed progress update?
Type:
- int
- Default Value:
- 5000
- Source:
-
archiveProgressUpdateInterval :int
-
How often should we request an update on an Archive's progress?
Type:
- int
- Default Value:
- 250
- Source:
-
cancelEditAPI :String
-
The URL used to cancel document editing
Type:
- String
- Default Value:
- [AlfConstants.PROXY_URI + "cancel-checkout/node/"]
- Source:
- To Do:
-
- should this be parameterised?
-
downloadAPI :String
-
The URL to the download API
Type:
- String
- Default Value:
- [AlfConstants.PROXY_URI + "api/internal/downloads"]
- Source:
- To Do:
-
- should this be parameterised?
-
downloadIFrame :element
-
This is a reference to an IFrame that gets created to handle download requests. An IFrame is required because it is possible that the full metadata for the node to download may need to be requested over an XHR request and the use of an IFrame prevents browser popup blocking occuring in this scenario. See AKU-757.
Type:
- element
- Since:
- 1.0.61
- Default Value:
- null
- Source:
-
encodeURIs :boolean
-
Overrides the default setting for encoding URIs
Type:
- boolean
- Default Value:
- false
- Source:
-
i18nRequirements :object[]
-
An array of the i18n files to use with this widget.
Type:
- object[]
- Default Value:
- [{i18nFile: "./i18n/DocumentService.properties"}]
- Source:
-
maxArchiveProgressRetryCount :int
-
How many times should we retry a failed archive progress request?
Type:
- int
- Default Value:
- 6
- Source:
-
rawData :boolean
-
Indicates whether or not XHR requests should be rooted directly to the Alfresco Repository and bypass the Share web-tier.
Type:
- boolean
- Since:
- 1.0.33
- Default Value:
- false
- Source:
Methods
-
onActionRequestArchiveProgressFailure(payload)
-
Handles the Archive progress failure.
Parameters:
Name Type Description payload
- Source:
-
onActionRequestArchiveProgressSuccess(payload)
-
Handles the Archive progress response.
Parameters:
Name Type Description payload
- Source:
-
onCancelEdit(payload)
-
Called to cancel the editing of a checked out file.
Parameters:
Name Type Description payload
object The payload supplied when the event was triggered. - Source:
-
onCancelEditNode(payload, node)
-
Call the Alfresco Repository API to cancel the editing the node provided.
Parameters:
Name Type Description payload
object The original payload from the request. node
string The node to cancel the editing on. - Source:
-
onCancelEditNodeSuccess(payload)
-
Triggered when the cancel edit call succeeds.
Parameters:
Name Type Description payload
The payload from the request to cancel editing - Source:
-
onDeleteDownloadArchive(payload)
-
Called to Delete a Download Archive, to clean up the server.
Parameters:
Name Type Description payload
- Source:
-
onDocumentRetrievedForDownload(payload)
-
This is the callback function from requests to retrieve the metadata for a node defined by the Search API called from the onSmartDownload function.
Parameters:
Name Type Description payload
object The full metadata of a node to download. - Since:
- 1.0.43
- Source:
-
onDownload(payload)
-
Handles requests to download a single document.
Parameters:
Name Type Description payload
object The published payload that should contain a node.contentURL attribute. - Since:
- 1.0.43
- Source:
Fires:
-
onDownloadAsZip(payload)
-
Handles requests to download one or more documents and/or folders as a ZIP archive.
Parameters:
Name Type Description payload
object The payload containing the nodes to archive and download - Since:
- 1.0.33
- Source:
-
onDownloadFile(payload)
-
Called to trigger an async file download.
Parameters:
Name Type Description payload
Payload supplied to the event - Source:
-
onGetParentNodeRef(payload)
-
Retrieve the nodeRef for a given node's parent, by requesting the details for that node.
Parameters:
Name Type Description payload
Object The publish event payload. - Source:
-
onGetParentNodeRefSuccess(payload)
-
Triggered by onGetParentNodeRef when the request returns successfully. This method processes the response to pull out the parent node, then triggers the originalResponseTopic that was passed into the request to get the parent nodeRef.
Parameters:
Name Type Description payload
Object The publish event payload. - Source:
-
onRequestArchive(payload)
-
Parameters:
Name Type Description payload
object - Source:
-
onRequestArchiveFailure(payload)
-
Called when the initial request to create the Download Archive Fails.
Parameters:
Name Type Description payload
- Source:
-
onRequestArchiveProgress(payload)
-
Are we nearly there yet? Can we download the Archive yet?
Parameters:
Name Type Description payload
- Source:
-
onRequestArchiveSuccess(payload)
-
Called when the initial request to create the Download Archive Succeeds.
Parameters:
Name Type Description payload
- Source:
-
onRequestDelayedArchiveProgress(payload)
-
Parameters:
Name Type Description payload
object - Source:
-
onRetrieveDocumentsRequest(payload)
-
Handles requests to retrieve documents. The payload should contain the following properties: path type site container filter page pageSize sortAscending sortField rootNode
Parameters:
Name Type Description payload
object The payload published on the topic - Source:
-
onRetrieveSingleDocumentRequest(payload)
-
Retrieves the details for a single document. This currently uses the Repository API and therefore won't collect any Share specific information such as actions, etc. However this could be updated to use a new WebScript in the future.
Parameters:
Name Type Description payload
object The payload defining the document to retrieve the details for. - Source:
-
onSmartDownload(payload)
-
This function is provided to handle downloads of selected items with some intelligence. If a single document is selected then it will be downloaded (via the onDownload), but if multiple items are selected then they will be downloaded as an archive (via the onDownloadAsZip) function. If a single folder is selected then it will be downloaded as an archive. This function is also able to cope with data provided by either the Document Library or Search APIs.
Parameters:
Name Type Description payload
object An object containing the items to download. - Since:
- 1.0.43
- Source:
-
registerSubscriptions()
-
- Since:
- 1.0.32
- Source:
Listens to Events:
- module:alfresco/core/topics#event:GET_DOCUMENT
- module:alfresco/core/topics#event:GET_DOCUMENT_LIST
- module:alfresco/core/topics#event:REQUEST_ARCHIVE
- module:alfresco/core/topics#event:REQUEST_ARCHIVE_PROGRESS
- module:alfresco/core/topics#event:DELETE_ARCHIVE
- module:alfresco/core/topics#event:DOWNLOAD
- module:alfresco/core/topics#event:DOWNLOAD_AS_ZIP
- module:alfresco/core/topics#event:DOWNLOAD_GENERATED_ARCHIVE
- module:alfresco/core/topics#event:CANCEL_EDIT
- module:alfresco/core/topics#event:GET_PARENT_NODEREF
- module:alfresco/core/topics#event:SMART_DOWNLOAD
- module:alfresco/core/topics#event:DOWNLOAD_ON_NODE_RETRIEVAL_SUCCESS