Class Alfresco.HtmlUpload
Extends Alfresco.component.Base
HtmlUpload component.
Popups a YUI panel and displays a filelist and buttons to browse for files
and upload them. Files can be removed and uploads can be cancelled.
For single file uploads version input can be submitted.
A multi file upload scenario could look like:
var htmlUpload = Alfresco.getHtmlUploadInstance();
var multiUploadConfig =
{
siteId: siteId,
containerId: doclibContainerId,
path: docLibUploadPath,
filter: [],
mode: htmlUpload.MODE_MULTI_UPLOAD,
}
this.htmlUpload.show(multiUploadConfig);
Popups a YUI panel and displays a filelist and buttons to browse for files
and upload them. Files can be removed and uploads can be cancelled.
For single file uploads version input can be submitted.
A multi file upload scenario could look like:
var htmlUpload = Alfresco.getHtmlUploadInstance();
var multiUploadConfig =
{
siteId: siteId,
containerId: doclibContainerId,
path: docLibUploadPath,
filter: [],
mode: htmlUpload.MODE_MULTI_UPLOAD,
}
this.htmlUpload.show(multiUploadConfig);
Defined in: html-upload.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Alfresco.HtmlUpload(htmlId)
HtmlUpload constructor.
|
| Field Attributes | Field Name and Description |
|---|---|
|
The default config for the gui state for the uploader.
|
|
|
Shows uploader in single update mode.
|
|
|
Shows uploader in single upload mode.
|
|
|
The merged result of the defaultShowConfig and the config passed in
|
|
|
HTMLElement of type div that displays the version input form.
|
- Fields borrowed from class Alfresco.component.Base:
- modules, options, services, widgets
| Method Attributes | Method Name and Description |
|---|---|
|
hide()
Hides the panel
|
|
|
onCancelButtonClick(event)
Fired when the user clicks the cancel button.
|
|
|
onReady()
Fired by YUI when parent element is available for scripting.
|
|
|
Called when a file failed to be uploaded
|
|
|
onUploadSuccess(response)
Called when a file has been successfully uploaded
|
|
|
show(config)
Show can be called multiple times and will display the uploader dialog
|
- Methods borrowed from class Alfresco.component.Base:
- attachLinkClickListeners, bind, createYUIButtons, destroy, fire, invokeAction, msg, onComponentLoaded, onComponentsLoaded, onReadyWrapper, refresh, setMessages, setOptions
Constructor Detail
Alfresco.HtmlUpload(htmlId)
HtmlUpload constructor.
HtmlUpload is considered a singleton so constructor should be treated as private,
please use Alfresco.getHtmlUploadInstance() instead.
HtmlUpload is considered a singleton so constructor should be treated as private,
please use Alfresco.getHtmlUploadInstance() instead.
- Parameters:
- {String} htmlId
- The HTML id of the parent element
- Returns:
- {Alfresco.HtmlUpload} The new HtmlUpload instance
Field Detail
{object}
defaultShowConfig
The default config for the gui state for the uploader.
The user can override these properties in the show() method to use the
uploader for both single & multi uploads and single updates.
The user can override these properties in the show() method to use the
uploader for both single & multi uploads and single updates.
{int}
MODE_SINGLE_UPDATE
Shows uploader in single update mode.
{int}
MODE_SINGLE_UPLOAD
Shows uploader in single upload mode.
{object}
showConfig
The merged result of the defaultShowConfig and the config passed in
to the show method.
to the show method.
{HTMLElement}
versionSection
HTMLElement of type div that displays the version input form.
Method Detail
hide()
Hides the panel
onCancelButtonClick(event)
Fired when the user clicks the cancel button.
Closes the panel.
Closes the panel.
- Parameters:
- {object} event
- a Button "click" event
onReady()
Fired by YUI when parent element is available for scripting.
Initial History Manager event registration
Initial History Manager event registration
onUploadFailure(e)
Called when a file failed to be uploaded
Informs the user.
Informs the user.
- Parameters:
- e
onUploadSuccess(response)
Called when a file has been successfully uploaded
Informs the user and reloads the doclib.
Informs the user and reloads the doclib.
- Parameters:
- response
show(config)
Show can be called multiple times and will display the uploader dialog
in different ways depending on the config parameter.
in different ways depending on the config parameter.
- Parameters:
- {object} config
- describes how the upload dialog should be displayed
The config object is in the form of:
{
siteId: {string}, // site to upload file(s) to
containerId: {string}, // container to upload file(s) to (i.e. a doclib id)
destination: {string}, // destination nodeRef to upload to if not using site & container
uploadPath: {string}, // directory path inside the component to where the uploaded file(s) should be save
updateNodeRef: {string}, // nodeRef to the document that should be updated
updateFilename: {string},// The name of the file that should be updated, used to display the tip
mode: {int}, // MODE_SINGLE_UPLOAD or MODE_SINGLE_UPDATE
filter: {array}, // limits what kind of files the user can select in the OS file selector
onFileUploadComplete: null, // Callback after upload
overwrite: false // If true and in mode MODE_XXX_UPLOAD it tells
// the backend to overwrite a versionable file with the existing name
// If false and in mode MODE_XXX_UPLOAD it tells
// the backend to append a number to the versionable filename to avoid
// an overwrite and a new version
}