Class Index | File Index

Classes


Class Alfresco.FileUpload

Extends Alfresco.component.Base
FileUpload component.

Checks if Flash is installed or not and uses either the FlashUpload or
HtmlUpload component.

A multi file upload scenario could look like:

var fileUpload = Alfresco.getFileUploadInstance();
var multiUploadConfig =
{
siteId: siteId,
containerId: doclibContainerId,
path: docLibUploadPath,
filter: [],
mode: fileUpload.MODE_MULTI_UPLOAD,
}
this.fileUpload.show(multiUploadConfig);

If flash is installed it would use the FlashUpload component in multi upload mode
If flash isn't installed it would use the HtmlUpload in single upload mode instead.
Defined in: file-upload.js
Constructor Summary
Constructor Attributes Constructor Name and Description
 
FileUpload constructor.
Field Summary
Field Attributes Field Name and Description
 
The default config for the gui state for the uploader.
 
Shows uploader in multi upload mode.
 
Shows uploader in single update mode.
 
Shows uploader in single upload mode.
 
Object container for initialization options
 
The merged result of the defaultShowConfig and the config passed in
 
The uploader instance
Fields borrowed from class Alfresco.component.Base:
modules, services, widgets
Method Summary
Method Attributes Method Name and Description
 
hide()
 
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.FileUpload(htmlId)
FileUpload constructor.

FileUpload is considered a singleton so constructor should be treated as private,
please use Alfresco.getFileUploadInstance() instead.
Parameters:
{string} htmlId
The HTML id of the parent element
Returns:
{Alfresco.FileUpload} The new FileUpload 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.

{int} MODE_MULTI_UPLOAD
Shows uploader in multi upload mode.

{int} MODE_SINGLE_UPDATE
Shows uploader in single update mode.

{int} MODE_SINGLE_UPLOAD
Shows uploader in single upload mode.

{object} options
Object container for initialization options

{object} showConfig
The merged result of the defaultShowConfig and the config passed in
to the show method.

{Alfresco.FlashUpload or Alfresco.HtmlUpload} uploader
The uploader instance
Method Detail
hide()

show(config)
Show can be called multiple times and will display the uploader dialog
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, MODE_MULTI_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
htmlUploadURL: null, // Overrides default url to post the file to if the html version is used
flashUploadURL: null, // Overrides default url to post the files to if the flash version is used
username: null // If a file should be associated with a user
}

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Feb 16 2012 12:24:25 GMT-0000 (GMT)