This service handles requests to copy or move nodes from one location to another. It does this by displaying
a Dialog containing a ContainerPicker.
The Dialog is created via the DialogService
so it is imperative that is also included on the page (or an alternative service that handles the same publications).
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Mixes In
Members
-
copyAPI :string
-
URL to call to copy a document
Type:
- string
- Default Value:
- "slingshot/doclib/action/copy-to/node/"
- Source:
-
createLinkAPI :string
-
URL to call to create a link to a document
Type:
- string
- Since:
- 1.0.92
- Default Value:
- "api/node/doclink/"
- Source:
-
i18nRequirements :object[]
-
An array of the i18n files to use with this widget.
Type:
- object[]
- Default Value:
- [{i18nFile: "./i18n/CopyMoveService.properties"}]
- Source:
-
moveAPI :string
-
URL to call to move a document
Type:
- string
- Default Value:
- "slingshot/doclib/action/move-to/node/"
- Source:
-
repoNodeRef :string
-
This should be set to the NodeRef to be used to represent the root of the Repository. By default this is "alfresco://company/home" but can be configured to be any other value. When used in Alfresco Share this should be set to the configured value of
Type:
- string
- Default Value:
- "alfresco://company/home"
- Source:
-
supportLinkCreation :boolean
-
Indicates whether or not CopyMoveService should support the creation of links for files and folders
Type:
- boolean
- Since:
- 1.0.92
- Default Value:
- false
- Source:
Methods
-
onActionFailure(payload)
-
Handles failed actions by displaying a notification indicating that the action was not successful.
Parameters:
Name Type Description payload
object Fires:
-
onActionSuccess(payload)
-
Handles successful actions in one of two ways. When an attempt is made to move or copy more than one node it is possible that only some of the nodes will be moved/copied successfully. If all the nodes were moved or copied successfully then a simple notification is displayed indicating a successful action was completed, however if a partial success was reported then a prompt is displayed listing the nodes that could not be copied or moved.
Parameters:
Name Type Description payload
object Fires:
-
onCreateLinkActionFailure(payload)
-
Handles failed actions by displaying a notification indicating that the action was not successful.
Parameters:
Name Type Description payload
object - Since:
- 1.0.92
- Source:
Fires:
-
onCreateLinkActionSuccess(payload)
-
Handles successful actions. When an attempt is made to create link to more than one node it is possible that only for some of the nodes it will be created successfully. If for all the nodes the link was created successfully then a simple notification is displayed indicating a successful action was completed, or partial completed.
Parameters:
Name Type Description payload
object - Since:
- 1.0.92
- Source:
Fires:
-
onLocationSelected(urlPrefix, copy, payload, function)
-
Handles the actual copy,move or create link XHR call
Parameters:
Name Type Description urlPrefix
string The specific URL prefix to use for the action (e.g. either move or copy) copy
boolean A boolean indicating if this is a copy action or not payload
object The payload from confirmation of the action dialog function
function to call: create link or copy/move -
performAction(nodeRefs, urlPrefix, copy, location)
-
Makes an XHR call to move or copy the selected documents to the location provided.
Parameters:
Name Type Description nodeRefs
array An array of the nodes to move or copy urlPrefix
string The prefix to use in the action URL copy
boolean A boolean indicating if this is a copy action or not location
array The location to move or copy the documents to -
performCreateLinkAction(nodeRefs, urlPrefix, copy, location)
-
Makes an XHR call to create links for the selected documents to the location provided.
Parameters:
Name Type Description nodeRefs
array An array of the nodes to create links for urlPrefix
string The prefix to use in the action URL copy
boolean A boolean indicating if this is a copy action or not location
array The location where links will be created - Since:
- 1.0.92
- Source:
-
registerSubscriptions()
-
Sets up the service using the configuration provided.
- Since:
- 1.0.32
- Source: