Module: alfresco/dnd/DroppedItemWrapper

alfresco/dnd/DroppedItemWrapper

This widget is used to wrap dropped items in a DragAndDropTarget. It provides a drag handle (for re-ordering or dragging to other targets) as well as edit and delete buttons. It is also reponsible for managing the state of the item that it represents as well as rendering the a representation of that item.
Author:
  • Dave Draper
License:
Source:

Members

cssRequirements :Array

An array of the CSS files to use with this widget.
Type:
  • Array
Source:

deleteAltText :string

The message to display as alt text for the delete image. This will also be displayed as a title on the image.
Type:
  • string
Default Value:
  • "droppedItemWrapper.delete.alt.text"
Source:

deleteImg :string

The name of the file to use for the delete image. This is expected to be in the css/images relative path of the widget.
Type:
  • string
Default Value:
  • "trashcan-16.png"
Source:

downAltText :string

The message to display as alt text for the move down image. This will also be displayed as a title on the image.
Type:
  • string
Default Value:
  • "droppedItemWrapper.down.alt.text"
Source:

downImg :string

The name of the file to use for the move down image. This is expected to be in the css/images relative path of the widget.
Type:
  • string
Default Value:
  • "move-down.png"
Source:

editAltText :string

The message to display as alt text for the edit image. This will also be displayed as a title on the image.
Type:
  • string
Default Value:
  • "droppedItemWrapper.edit.alt.text"
Source:

editImg :string

The name of the file to use for the edit image. This is expected to be in the css/images relative path of the widget.
Type:
  • string
Default Value:
  • "edit-16.png"
Source:

editPublishGlobal :boolean

Indicates whether the edit publication should be published globally.
Type:
  • boolean
Default Value:
  • true
Source:

editPublishPayload :object

This is the payload that will be published when a request is made to edit the value of the item represented by this wrapper. If required the
Type:
  • object
Source:

editPublishPayloadItemMixin :boolean

This indicates whether ot not the payload should have the "currentItem" attribute mixed into it. By default this is set to false.
Type:
  • boolean
Default Value:
  • false
Source:

editPublishPayloadModifiers :string[]

This defines any processor functions that should be used to process the editPublishPayload. These will only be applied if the editPublishPayloadType is configured to be "PROCESS" (which is the default behaviour).
Type:
  • string[]
Default Value:
  • ["processCurrentItemTokens"]
Source:

editPublishPayloadType :string

This is the type of payload defined by the editPublishPayload. By default this is set to "PROCESS" indicating that the payload contains tokens to be substituted.
Type:
  • string
Default Value:
  • "PROCESS"
Source:

editPublishToParent :boolean

Indicates whether edit publications should be published on the parent scope.
Type:
  • boolean
Default Value:
  • false
Source:

editPublishTopic :string

This is the topic that is published when a request is made to edit the value of the item represented by this wrapper. The default behaviour is to request that a dialog be displayed.
Type:
  • string
Default Value:
  • "ALF_CREATE_FORM_DIALOG_REQUEST"
Source:

i18nRequirements :object

The array of file(s) containing internationalised strings.
Type:
  • object
Default Value:
  • [{i18nFile: "./i18n/DroppedItemWrapper.properties"}]
Source:

showEditButton :boolean

This controls whether or not the edit button is displayed. By default it is not and this should only be configured to be true when using a modelling service that is configured to provide edit configuration for the item.
Type:
  • boolean
Default Value:
  • false
Source:

templateString :string

The HTML template to use for the widget.
Type:
  • string
Source:

upAltText :string

The message to display as alt text for the move up image. This will also be displayed as a title on the image.
Type:
  • string
Default Value:
  • "droppedItemWrapper.up.alt.text"
Source:

upImg :string

The name of the file to use for the move up image. This is expected to be in the css/images relative path of the widget.
Type:
  • string
Default Value:
  • "move-up.png"
Source:

value :object

This is the value that the wrapper represents.
Type:
  • object
Default Value:
  • null
Source:

Methods

allWidgetsProcessed(widgets)

This is an extension point for handling the completion of calls to processWidgets
Parameters:
Name Type Description
widgets Array An array of all the widgets that have been processed
Source:

getValue() → {object}

Returns the current value of the item.
Source:
Returns:
The value represented by the dropped item.
Type
object

onEditSave(payload)

Handles submission of the dialog requested when the user edits the value of the widget. This will mix the published value into the current value (rather than overwriting it) and then destroy and previously rendered widgets and re-create them using the updated value.
Parameters:
Name Type Description
payload object The updated value for the item.
Source:

onItemDelete(evt)

Emits a custom a event to indicate that the widget should be deleted. TODO: Should this prompt the user with a confirmation dialog?
Parameters:
Name Type Description
evt object The click event that triggers the delete.
Source:

onItemDown()

Moves the item down one place.
Source:

onItemEdit(evt)

Publishes a request to get the configuration model for the current item. This request is expected to be handled by a DndModellingService.
Parameters:
Name Type Description
evt object The click event that triggers the delete.
Source:

onItemUp()

Moves the item up one place.
Source:

postCreate()

Source:

postMixInProperties()

Sets up images and translations for alt text and titles.
Source:

setWidgetValue(widget)

Sets the value of the supplied widget with the current value.
Parameters:
Name Type Description
widget object The widget to set the value of.
Source:

<inner> onEditConfig(item, resolvedPromise)

Handles the data provided by a DndModellingService requested when the user edits the current item. This will request the creation of a new dialog to display the form widgets expected to have been provided in the resolved promise.
Parameters:
Name Type Description
item object The current item being edited.
resolvedPromise promise A resolved promise that is expected to contain a widgets array
Source: