Module: alfresco/services/CommentService

alfresco/services/CommentService

This service is used to retrieve comments from an Alfresco Repository and has been created to primarily service the CommentsList. It is required in order to normalise the JSON response returned on the comments API. The CrudService is currently used to service create, update and delete comment requests, but this service may be updated in the future to handle those operations directly.

Author:
  • Dave Draper
License:
Source:

Members

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/CommentService.properties"}]
Source:

Methods

onCommentsRetrieved(response, requestConfig)

This is the success callback function that is used when retrieving comments. It updates each comment object to ensure that it contains a "displayName" attribute which can be used for the imageTitleProperty of a AvatarThumbnail.
Parameters:
Name Type Description
response object The object returned from the successful XHR request
requestConfig object The original configuration passed when the request was made
Source:

onGetComments(payload)

Parameters:
Name Type Description
payload object
Source:

registerSubscriptions()

Sets up the subscriptions for the CommentService
Since:
  • 1.0.32
Source:

updateComment(comment)

The comments API does not include the display name for the comment author. Instead it provides the first and last names as two separate attributes. This function updates a comment to create a displayName attribute that is the combination of the first and last name attributes.
Parameters:
Name Type Description
comment object The comment to update
Source: