This module provides simple display handling for file uploads. It displays completed, in progress and failed
file uploads in separate sections along with a displayed value of the overall upload progress.
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Extends
- alfresco/upload/_UploadsDisplayMixin
Members
-
aggregateProgressLabel :string
-
The description to display for the upload dialog.
Type:
- string
- Default Value:
- "aggregate-progress.label"
- Source:
-
cssRequirements :object[]
-
An array of the CSS files to use with this widget.
Type:
- object[]
- Default Value:
- [{cssFile:"./css/AlfUpload.css"}]
- Source:
-
description :string
-
The description to display for the upload dialog.
Type:
- string
- Default Value:
- "description.label"
- Source:
-
failedUploadsLabel :string
-
The description to display for the upload dialog.
Type:
- string
- Default Value:
- "failed.label"
- Source:
-
i18nRequirements :object[]
-
An array of the i18n files to use with this widget.
Type:
- object[]
- Default Value:
- [{i18nFile: "./i18n/AlfUpload.properties"}]
- Source:
-
inProgressFiles :object
-
A map of file IDs to the DOM element that describes them.
Type:
- object
- Default Value:
- null
- Source:
-
successfulUploadsLabel :string
-
The description to display for the upload dialog.
Type:
- string
- Default Value:
- "completed.label"
- Source:
-
templateString :String
-
The HTML template to use for the widget.
Type:
- String
- Source:
-
title :string
-
The title to display for upload dialog.
Type:
- string
- Default Value:
- "title.label"
- Source:
-
uploadedFiles :object
-
A map of the uploaded files.
Type:
- object
- Default Value:
- null
- Source:
-
uploadsInProgressLabel :string
-
The description to display for the upload dialog.
Type:
- string
- Default Value:
- "inprogress.label"
- Source:
Methods
-
addFailedFile(fileName, error)
-
This function handles displaying a file that could not be uploaded (where the failure was identified before any attempt was made to start uploading the file).
Parameters:
Name Type Description fileName
string The name of the file that could not be uploaded error
object The details of why the file could not be uploaded. - Source:
-
addInProgressFile(fileId)
-
This function handles displaying a file that an attempt will be made to upload. The updateUploadProgress will handle updating the upload progress.
Parameters:
Name Type Description fileId
string The unique id of the file - Source:
-
handleCompletedUpload(fileId, completionEvt, request)
-
This function handles the successful completion of a file upload. By default it moves the displayed file from the "In progress" section to the "Completed" section.
Parameters:
Name Type Description fileId
string The unique id of the file completionEvt
object The upload completions event request
object The request object used to attempt to upload the file - Source:
-
handleFailedUpload(fileId, completionEvt, request)
-
This function handles the failure to upload a file. By default it moves the displayed file from the "In Progress" section to the "Failed" section.
Parameters:
Name Type Description fileId
string The unique id of the file completionEvt
object The upload completions event request
object The request object used to attempt to upload the file - Source:
-
postCreate()
-
- Source:
-
postMixInProperties()
-
Initialise the labels of the dialog if they haven't already been set
- Source:
-
reset()
-
Resets the display.
- Source:
-
updateAggregateProgress(aggregateProgress)
-
Displays the overall upload progress of all the files.
Parameters:
Name Type Description aggregateProgress
number The aggregate progress as a decimal of 1. - Source:
-
updateUploadProgress(fileId, percentageComplete)
-
Updates the displayed progress for an individual file upload.
Parameters:
Name Type Description fileId
string The unique id of the file percentageComplete
number The current upload progress as a percentage - Source: