@Name(value="FileManageActions") @Scope(value=EVENT) @Install(precedence=10) public class FileManageActionsBean extends Object implements FileManageActions
Modifier and Type | Field and Description |
---|---|
protected ClipboardActions |
clipboardActions |
static String |
COPY_ERROR |
protected DocumentActions |
documentActions |
protected CoreSession |
documentManager |
protected org.jboss.seam.faces.FacesMessages |
facesMessages |
protected FileManager |
fileManager |
protected static String |
FILES_PROPERTY |
protected static String |
FILES_SCHEMA |
protected String |
fileToRemove
Helper field to get the filename to remove.
|
protected UploadItemHolder |
fileUploadHolder |
protected UploadItemHolderCycleManager |
fileUploadHolderCycle |
protected Map<String,String> |
messages |
static String |
MOVE_ERROR |
static String |
MOVE_IMPOSSIBLE |
static String |
MOVE_OK |
static String |
MOVE_PUBLISH |
protected NavigationContext |
navigationContext |
static String |
PASTE_ERROR |
protected static String |
SECTION_DOCTYPE |
static String |
SECURITY_ERROR |
protected List<String> |
tmpFilePaths
Used to keep track of the path of the uploaded file (NXP-16745)
|
static String |
TRANSF_ERROR |
protected TypeManager |
typeManager |
NUXEO_JSF_TMP_DIR_PROP
Constructor and Description |
---|
FileManageActionsBean() |
Modifier and Type | Method and Description |
---|---|
String |
addBinaryFileFromPlugin(Blob blob,
String fullName,
DocumentModel targetContainer) |
String |
addBinaryFileFromPlugin(Blob blob,
String fullName,
String morePath) |
String |
addBinaryFileFromPlugin(byte[] content,
String mimetype,
String fullName,
String morePath)
Deprecated.
Use addBinaryFileFromPlugin(Blob, String, String) to avoid loading the data in memory as a Bytes
array
|
String |
addFile()
Creates a document from the file held in the fileUploadHolder.
|
String |
addFileFromPlugin(String content,
String mimetype,
String fullName,
String morePath,
Boolean UseBase64)
Deprecated.
use addBinaryFileFromPlugin with a Blob argument API to avoid loading the content in memory
|
String |
addFolderFromPlugin(String fullName,
String morePath) |
boolean |
canWrite()
Deprecated.
|
protected String |
checkMoveAllowed(DocumentRef docRef,
DocumentRef containerRef) |
String |
copyWithId(String docId) |
protected String |
createDocumentFromBlob(Blob blob,
String fullName,
String path) |
String |
display() |
static FileBlob |
getBlob(org.richfaces.event.FileUploadEvent uploadEvent) |
DocumentModel |
getChangeableDocument() |
protected String |
getErrorMessage(String errorType,
String errorInfo) |
protected String |
getErrorMessage(String errorType,
String errorInfo,
String errorLabel) |
protected FileManager |
getFileManagerService() |
String |
getFileName() |
InputStream |
getFileUpload() |
protected static String |
getJSFUploadTmpDirPath() |
Collection<NxUploadedFile> |
getUploadedFiles() |
String |
moveWithId(String docId,
String containerId) |
String |
pasteWithId(String docId) |
void |
performAction(javax.faces.event.ActionEvent event) |
void |
processUpload(org.richfaces.event.FileUploadEvent uploadEvent) |
String |
removeAllUploadedFile() |
String |
removeOneOrAllUploadedFiles(javax.faces.event.ActionEvent action)
Removes one of all uploaded files, depending on previous call to
FileManageActions.setFileToRemove(String) . |
String |
removeSingleUploadedFile() |
String |
removeUploadedFile(String fileName) |
void |
setChangeableDocument(DocumentModel changeableDocument) |
void |
setFileName(String fileName) |
void |
setFileToRemove(String fileToRemove)
Setter to get the filename to remove, works in conjunction with
FileManageActions.removeOneOrAllUploadedFiles(ActionEvent)
. |
void |
setFileUpload(InputStream fileUpload) |
void |
setUploadedFiles(Collection<NxUploadedFile> uploadedFiles) |
String |
validate() |
void |
validateMultiplesUpload() |
void |
validateMultipleUploadForDocument(DocumentModel current) |
public static final String TRANSF_ERROR
public static final String SECURITY_ERROR
public static final String MOVE_ERROR
public static final String COPY_ERROR
public static final String PASTE_ERROR
public static final String MOVE_IMPOSSIBLE
public static final String MOVE_PUBLISH
public static final String MOVE_OK
protected static final String FILES_SCHEMA
protected static final String FILES_PROPERTY
protected static final String SECTION_DOCTYPE
@In(create=true, required=false) protected CoreSession documentManager
@In(create=true) protected TypeManager typeManager
@In(create=true) protected NavigationContext navigationContext
@In(create=true) protected transient DocumentActions documentActions
@In(create=true) protected ClipboardActions clipboardActions
@In(create=true, required=false) protected UploadItemHolder fileUploadHolder
@In(create=true, required=false) protected UploadItemHolderCycleManager fileUploadHolderCycle
protected String fileToRemove
@In(create=true, required=false) protected org.jboss.seam.faces.FacesMessages facesMessages
protected FileManager fileManager
protected List<String> tmpFilePaths
public FileManageActionsBean()
protected FileManager getFileManagerService()
public String display()
display
in interface SimpleFileManager
display
in interface FileManageActions
public String addFile()
addFile
in interface FileManageActions
@Deprecated @WebRemote public boolean canWrite()
canWrite
in interface FileManageActions
protected String getErrorMessage(String errorType, String errorInfo)
protected String getErrorMessage(String errorType, String errorInfo, String errorLabel)
@Deprecated @WebRemote public String addFileFromPlugin(String content, String mimetype, String fullName, String morePath, Boolean UseBase64)
addFileFromPlugin
in interface FileManageActions
@WebRemote public String addBinaryFileFromPlugin(Blob blob, String fullName, String morePath)
addBinaryFileFromPlugin
in interface SimpleFileManager
@WebRemote public String addBinaryFileFromPlugin(Blob blob, String fullName, DocumentModel targetContainer)
addBinaryFileFromPlugin
in interface SimpleFileManager
protected String createDocumentFromBlob(Blob blob, String fullName, String path)
@Deprecated public String addBinaryFileFromPlugin(byte[] content, String mimetype, String fullName, String morePath)
@WebRemote public String addFolderFromPlugin(String fullName, String morePath)
addFolderFromPlugin
in interface FileManageActions
@WebRemote protected String checkMoveAllowed(DocumentRef docRef, DocumentRef containerRef)
@WebRemote public String moveWithId(String docId, String containerId)
moveWithId
in interface FileManageActions
@WebRemote public String copyWithId(String docId)
copyWithId
in interface FileManageActions
@WebRemote public String pasteWithId(String docId)
pasteWithId
in interface FileManageActions
public void processUpload(org.richfaces.event.FileUploadEvent uploadEvent)
protected static String getJSFUploadTmpDirPath()
public static FileBlob getBlob(org.richfaces.event.FileUploadEvent uploadEvent) throws IOException
IOException
public void validateMultiplesUpload() throws FileNotFoundException, IOException
FileNotFoundException
IOException
public void validateMultipleUploadForDocument(DocumentModel current) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public void performAction(javax.faces.event.ActionEvent event)
public InputStream getFileUpload()
getFileUpload
in interface FileManageActions
public void setFileUpload(InputStream fileUpload)
setFileUpload
in interface FileManageActions
public String getFileName()
getFileName
in interface FileManageActions
public void setFileName(String fileName)
setFileName
in interface FileManageActions
public DocumentModel getChangeableDocument()
public void setChangeableDocument(DocumentModel changeableDocument)
public Collection<NxUploadedFile> getUploadedFiles()
public void setUploadedFiles(Collection<NxUploadedFile> uploadedFiles)
@WebRemote public String removeSingleUploadedFile()
removeSingleUploadedFile
in interface FileManageActions
public void setFileToRemove(String fileToRemove)
FileManageActions
FileManageActions.removeOneOrAllUploadedFiles(ActionEvent)
.setFileToRemove
in interface FileManageActions
public String removeOneOrAllUploadedFiles(javax.faces.event.ActionEvent action)
FileManageActions
FileManageActions.setFileToRemove(String)
.
This is useful to remove files in an Ajax context to avoid Seam remoting, and still get the selected entry from JavaScript variables (see NXP-13234).
removeOneOrAllUploadedFiles
in interface FileManageActions
@WebRemote public String removeAllUploadedFile()
removeAllUploadedFile
in interface FileManageActions
@WebRemote public String removeUploadedFile(String fileName)
removeUploadedFile
in interface FileManageActions
Copyright © 2018 Nuxeo. All rights reserved.