Module: alfresco/upload/UploadHistory

alfresco/upload/UploadHistory

This widget can be used to display the last few folders that the current user uploaded to. The upload history is managed by the UploadService and is persisted as a user preference. This user preference is requested when the widget loads and if provided will render each previous upload location using a configurable widget model.
Since:
  • 1.0.34
Author:
  • Dave Draper
License:
Source:

Members

currentHistoryTargets :object[]

This is used to keep track of all the targets that have been previously created so that they can be destroyed before re-rendering new targets.
Type:
  • object[]
Default Value:
  • null
Source:

i18nRequirements :object[]

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

preferenceName :string

The preference name to use for storing and retrieving upload location history. In order for this preference to be used it will also be necessary to ensure that the PreferenceService is included on the page.
Type:
  • string
Default Value:
  • "org.alfresco.share.upload.destination.history"
Source:

reloadSubscriptions :object[]

This is used to keep track of all the subscriptions that are created for each upload target. It is only necessary to create one subscription for each target no matter how many times that a target is created because it is the index that is used for the pubSubScope.
Type:
  • object[]
Default Value:
  • null
Source:

templateString :string

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

widgetsForUploadTargets :Array

This is the widget model used to render each upload target. The root widget should be an UploadFolder or a widget that extends it.
Type:
  • Array
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
Support:
  • This function is provided as an extension point and is safe to be overridden by extending or mixing modules (at least until the next major release).
Source:

createUploadTarget(nodeRef, index)

Creates a single upload target for the supplied NodeRef using the configured widgetsForUploadTargets model.
Parameters:
Name Type Description
nodeRef string The nodeRef to create the upload target for
index number The index of the node
Source:

createUploadTargets(value)

Splits the supplied string into an array of NodeRefs (using comma as the delimiter) and then iterates over that array calling createUploadTarget for each NodeRef.
Parameters:
Name Type Description
value string The preference value containing the nodeRefs to create upload targets for
Source:

postCreate()

Calls the render function to request and render the user upload history and then sets up a subscription for any further uploads that complete in order that the display can be refreshed.
Source:

render()

Makes a request for the current users upload history from their preferences and then with a callback to the createUploadTargets function to render the upload history.
Source: