Module: alfresco/services/actions/CreateTemplateContentService

alfresco/services/actions/CreateTemplateContentService

This service handles requests to create new nodes from templates found in the Alfresco Repository Data Dictionary. The templates will be found in the "Node Templates" and "Space Templates" folders. When creating a folder template the user will be prompted to override the name, title and description of the template, but when creating a node template the source node will just be directly copied.

Author:
  • Dave Draper
License:
Source:

Members

i18nRequirements :object[]

An array of the i18n files to use with this service.
Type:
  • object[]
Default Value:
  • [{i18nFile: "./i18n/CreateTemplateContentService.properties"}]
Source:

Methods

createTemplate(sourceNodeRef, targetNodeRef)

Makes the XHR request to create the templated content.
Parameters:
Name Type Description
sourceNodeRef string The NodeRef of the node to use as the template
targetNodeRef string The NodeRef of the node to create the new content in
Source:

onCreateTemplateContent(payload)

Creates new content based on the nodeRef supplied.
Parameters:
Name Type Description
payload object
Source:

onPromptForOverrides(payload)

This function requests a dialog to prompt the user as to whether they wish to override any of the default template data for the new content item.
Parameters:
Name Type Description
payload object The payload containing the request data.
Source:

registerSubscriptions()

Sets up the service using the configuration provided. This will check to see what aspects are available, addable and removable. If no addble or removable aspects are explicitly configured then it is assumed that all available aspects are both addable and removable. Only aspects that are configured as being available will be displayed in the manage aspects picker, only aspects that are addable can be added in the manage aspects picker and only aspects that are removable can be removed in the manage aspects picker.
Since:
  • 1.0.32
Source:

templateContentCreateFailure(response, originalRequestConfig)

Parameters:
Name Type Description
response object The response from the request
originalRequestConfig object The configuration passed on the original request
Source:

templateContentCreateSuccess(response, originalRequestConfig)

Parameters:
Name Type Description
response object The response from the request
originalRequestConfig object The configuration passed on the original request
Source:
Fires:

<inner> onOverridesProvided(payload)

Handles overrides provided by the user, simply unsubscribes any subscription handles contained in the payload and then calls createTemplate to create the content.
Parameters:
Name Type Description
payload object The payload from the original request.
Source: