This service should be used for the creation, uploading, updating and deletion of nodes from an
Alfresco Repository. When using for deleting nodes it is important to ensure that the
DialogService is included on the page (or an
alternative service that handles dialog creation requests). When uploading new content or updating
existing content then it is important to ensure that the UploadService
is included on the page.
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Members
-
_currentNode :object
-
The current Node that content will be worked relative to.
Type:
- object
- Default Value:
- null
- Source:
-
i18nRequirements :object[]
-
An array of the i18n files to use with this widget.
Type:
- object[]
- Default Value:
- [{i18nFile: "./i18n/ContentService.properties"}]
- Source:
-
widgetsForUpdate :object[]
-
These are the widgets to render in a dialog when updating an existing Node. A file selection control along with version increment radio buttons and comment text box are rendered.
Type:
- object[]
- Source:
-
widgetsForUpload :object[]
-
These are the widgets to render in a dialog for basic content upload (e.g. uploading new content rather than updating the content of an existing Node). By default only a basic file selection control will be displayed.
Type:
- object[]
- Source:
Methods
-
handleCurrentNodeChange()
-
- Source:
-
onActionDeleteConfirmation(payload)
-
This function is called when the user confirms that they wish to delete a document
Parameters:
Name Type Description payload
object An object containing the details of the document(s) to be deleted. - Source:
-
onActionDeleteSuccess(payload)
-
This action will be called when documents are successfully deleted
Parameters:
Name Type Description payload
object - Source:
Fires:
-
onContentCreationFailure(response, originalRequestConfig)
-
This is a generic failure callback for content creation.
Parameters:
Name Type Description response
object The response from the request originalRequestConfig
object The configuration passed on the original request - Since:
- 1.0.64
- Source:
Fires:
-
onContentCreationSuccess(response, originalRequestConfig)
-
This is a generic success callback handler for content creation that simply publishes a request to reload the current data.
Parameters:
Name Type Description response
object The response from the request originalRequestConfig
object The configuration passed on the original request - Source:
Fires:
-
onCreateContent(payload)
-
This handles requests to create content.
Parameters:
Name Type Description payload
object The details of the content to create - Source:
-
onDeleteContent(payload)
-
This handles requests to delete content
Parameters:
Name Type Description payload
object The details of the content to update - Source:
-
onEditBasicMetadata(node)
-
Parameters:
Name Type Description node
object The node to display the metadata for - Source:
-
onEditBasicMetadataReceived(payload)
-
This function will be called in response to a documents details being successfully retrieved.
Parameters:
Name Type Description payload
object - Source:
-
onEditBasicMetadataRequest(payload)
-
Handles requests to edit the basic metadata of the node provided.
Parameters:
Name Type Description payload
object An object containing the node to edit - Source:
-
onFileUploadComplete()
-
This function is called once the document upload is complete. It publishes a request to reload the current document list data.
- Source:
-
onFileUploadRequest(payload)
-
This function will be called whenever the AlfFormDialog created by the [showUploader function]{@link module:alfresco/services/ContentService#showUploader} is confirmed to trigger a dialog. This will destroy the dialog and pass the supplied payload onto the AlfUpload module to actually perform the upload. It is necessary to destroy the dialog to ensure that all the subscriptions are removed to prevent subsequent upload requests from processing old data.
Parameters:
Name Type Description payload
object The file upload data payload to pass on - Source:
Fires:
-
onUpdateContent(payload)
-
This handles requests to update content
Parameters:
Name Type Description payload
object The details of the content to update - Source:
-
registerSubscriptions()
-
Sets up the subscriptions for the ContentService
- Since:
- 1.0.32
- Source:
Listens to Events:
- module:alfresco/core/topics#event:CREATE_CONTENT_REQUEST
- module:alfresco/core/topics#event:DELETE_CONTENT
- module:alfresco/core/topics#event:UPLOAD_TO_UNKNOWN_LOCATION
-
showUploader(payload)
-
This function will open a AlfFormDialog containing a [file select form control]{@link module:alfresco/forms/controls/FileSelect} so that the user can select one or more files to upload. When the dialog is confirmed the onFileUploadRequest function will be called to destroy the dialog and pass the upload request on.
Parameters:
Name Type Description payload
object - Source:
Fires:
-
showUploadLocationPicker(payload)
-
Publishes a request to create a form dialog containing a file picker and a location so that the user can choose what to upload and where to upload it.
Parameters:
Name Type Description payload
object The payload from the upload request - Since:
- 1.0.34
- Source:
Fires: