public class UploadManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PLUPLOAD_VERSION |
static java.lang.String |
REVISION |
| Modifier and Type | Method and Description |
|---|---|
void |
addUploadComponentScripts(JcmsJspContext ctxt)
Add all required CSS and JS files needed for an upload component to the current JSP context
|
static UploadManager |
getInstance()
Returns a UploadManager.
|
java.lang.String |
getUploadComponent(JcmsJspContext ctxt,
java.lang.String pfield)
Returns a String HTML component for upload.
|
java.lang.String |
getUploadComponent(JcmsJspContext ctxt,
java.lang.String pfield,
java.lang.String pdrop,
java.lang.String pbrowse,
boolean showFiles,
boolean showLogs)
Returns a String HTML component for upload.
|
java.lang.Object |
getUploadedFile(JcmsContext ctxt,
java.lang.String field,
boolean isFileDocument,
boolean override)
Performs upload for the given field to JCMS upload directory.
|
java.util.List<DocUploadInfo> |
getUploadedFileList(JcmsContext ctxt,
java.lang.String field,
boolean isFileDocument,
boolean override)
Performs upload for the given field to JCMS upload directory.
|
void |
removeAllFileItem(JcmsJspContext ctxt,
java.lang.String token,
java.lang.String field) |
org.apache.commons.fileupload.FileItem |
removeFileItem(JcmsJspContext ctxt,
java.lang.String token,
java.lang.String field,
java.lang.String filename)
Remove from session the first FileItem with the given name
|
java.lang.Object |
retrieveFileItem(JcmsContext ctxt,
java.lang.String token,
java.lang.String field)
Retrieve from session FileItem or List stored in session
|
DocUploadInfo |
retrieveUploadedFile(org.apache.commons.fileupload.FileItem item,
boolean isFileDocument,
boolean override)
Performs upload of a given FileItem to JCMS upload directory.
|
void |
storeFileItem(JcmsJspContext ctxt,
java.lang.String token,
java.lang.String field,
org.apache.commons.fileupload.FileItem fileItem)
Store the given FileItem in session to be retrieved later by DocUpload mechanism.
|
public static final java.lang.String REVISION
public static final java.lang.String PLUPLOAD_VERSION
public static UploadManager getInstance()
public void addUploadComponentScripts(JcmsJspContext ctxt)
ctxt - the current JcmsJspContext, must not be nuillpublic java.lang.String getUploadComponent(JcmsJspContext ctxt, java.lang.String pfield)
ctxt - the JcmsJspContextpfield - the field namepublic java.lang.String getUploadComponent(JcmsJspContext ctxt, java.lang.String pfield, java.lang.String pdrop, java.lang.String pbrowse, boolean showFiles, boolean showLogs)
ctxt - the JcmsJspContextpfield - the field namepdrop - (optional) label of the drop box (set null to bypass)pbrowse - (optional) label of the browse button (set null to bypass)showFiles - boolean true to generate list of filesshowLogs - boolean true to generate logspublic java.lang.Object getUploadedFile(JcmsContext ctxt, java.lang.String field, boolean isFileDocument, boolean override)
ctxt - JcmsContextfield - the submited fieldisFileDocument - upload to a FileDocument path upload/docs/...override - If file already exists, override or rename with current timemillispublic java.util.List<DocUploadInfo> getUploadedFileList(JcmsContext ctxt, java.lang.String field, boolean isFileDocument, boolean override)
ctxt - JcmsContextfield - the submited fieldisFileDocument - upload to a FileDocument upload/docs/...override - If file already exists, override or rename with current timemillispublic DocUploadInfo retrieveUploadedFile(org.apache.commons.fileupload.FileItem item, boolean isFileDocument, boolean override)
item - the FileItem handling uploaded file informationisFileDocument - upload to a Filedocument path upload/docs/...override - If file already exists, override or rename with current timemillispublic void storeFileItem(JcmsJspContext ctxt, java.lang.String token, java.lang.String field, org.apache.commons.fileupload.FileItem fileItem)
ctxt - the JcmsJspContexttoken - String the token used to store the object in session. It identify the page requestfield - String the field namefileItem - the FileItem to storepublic org.apache.commons.fileupload.FileItem removeFileItem(JcmsJspContext ctxt, java.lang.String token, java.lang.String field, java.lang.String filename)
ctxt - the JcmsJspContexttoken - String the token used to store the object in session. It identify the page requestfield - String the field namefilename - String the name of the FileItem to removepublic void removeAllFileItem(JcmsJspContext ctxt, java.lang.String token, java.lang.String field)
public java.lang.Object retrieveFileItem(JcmsContext ctxt, java.lang.String token, java.lang.String field)
ctxt - the JcmsJspContexttoken - String the token used to store the object in session. It identify the page requestfield - String the field nameCopyright © 2001-2017 Jalios SA. All Rights Reserved.