This renderer should be used to show an individual comment that can be switched into an edit mode that
shows a TinyMCE editor for updating the comment. Note that
the widget does not take responsibility for which users have the ability to toggle between read and edit
modes. It does not provide the controls to switch modes so the other controls for toggling mode should be
rendered based on the current user permissions. Examples of this approach can be found in the
CommentsList renderer.
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Extends
Members
-
controls :object
-
This will be instantiated as a map of the controls used by the widget. It has been added in order to be passed as a reference for the "assignToScope" attribute of the TinyMCE form control that is referenced in the widgetsForForm model. This attribute should not be configured or set.
Type:
- object
- Since:
- 1.0.68
- Default Value:
- null
- Source:
-
cssRequirements :object[]
-
An array of the CSS files to use with this widget.
Type:
- object[]
- Default Value:
- [{cssFile:"./css/EditableComment.css"}]
- Source:
-
i18nRequirements :object[]
-
An array of the i18n files to use with this widget.
Type:
- object[]
- Default Value:
- [{i18nFile: "./i18n/EditableComment.properties"}]
- Source:
-
okButtonLabel :string
-
Type:
- string
- Default Value:
- "comment.save"
- Source:
-
postParam :string
-
The parameter to post that contains the content.
Type:
- string
- Default Value:
- "content"
- Source:
-
propertyToRender :string
-
This should be set to the name of the property to render (e.g. "cm:name"). The property is expected to be in the properties map for the item being rendered.
Type:
- string
- Default Value:
- null
- Source:
-
publishGlobal :boolean
-
Indicates whether or not publications should be made globally. Default is true.
Type:
- boolean
- Default Value:
- true
- Source:
-
publishPayload :object
-
The payload to publish whenever a comment edit is saved.
Type:
- object
- Source:
-
publishPayloadModifiers :array
-
The default modifiers to use when processing the configured publishPayload.
Type:
- array
- Default Value:
- ["processCurrentItemTokens", "convertNodeRefToUrl","processInstanceTokens"]
- Source:
-
publishPayloadType :string
-
Defines the publish payload type. By default this is set to "PROCESS" as it is expected that we will need to process currentItem data to set a nodeRef in the "url" attribute of the default publishPayload.
Type:
- string
- Default Value:
- "PROCESS"
- Source:
-
publishTopic :string
-
The topic to publish whenever the internal form is posted. By default this is expected to work with the CrudService and uses its update topic but this can be easily overridden.
Type:
- string
- Default Value:
- "ALF_CRUD_UPDATE"
- Source:
-
readMode :boolean
-
Indicates whether or not the widget is in read mode or not. Default is true.
Type:
- boolean
- Default Value:
- true
- Source:
-
subscriptionTopic :string
-
The topic that will be subscribed to that will toggle between edit and read modes.
Type:
- string
- Default Value:
- "ALF_EDIT_COMMENT"
- Source:
-
widgetsForForm
-
- Source:
Methods
-
_makeSafe(unsafeHtml) → {object}
-
Convert the supplied, potentially-unsafe HTML into a safe document fragment
Parameters:
Name Type Description unsafeHtml
string The "unsafe" HTML - Source:
Returns:
The now-safe HTML as a document fragment- Type
- object
-
createWidgetDom()
-
Overrides the inherited function to construct the DOM for the widget using native browser capabilities.
- Since:
- 1.0.101
- Source:
-
onCancelEdit(payload)
-
Handles requests to cancel editing
Parameters:
Name Type Description payload
object The payload published on the cancellation topic - Source:
-
onEditRequest(payload)
-
This function switches the widget into edit mode. It will create the required editor as necessary the first time the function is called.
Parameters:
Name Type Description payload
object - Source:
-
onEditSave(payload)
-
Handles requests to save the updated comment.
Parameters:
Name Type Description payload
object The details of the comment update - Source:
-
postCreate()
-
- Source:
-
postMixInProperties()
-
Set up the attributes to be used when rendering the template.
- Source: