Package org.opencms.ade.upload
Class CmsUploadBean
java.lang.Object
org.opencms.jsp.CmsJspBean
org.opencms.ade.upload.CmsUploadBean
Bean to be used in JSP scriptlet code that provides
access to the upload functionality.
- Since:
- 8.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default upload timeout.static final String
Key name for the session attribute that stores the id of the current listener. -
Constructor Summary
ConstructorDescriptionCmsUploadBean
(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Constructor, with parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic CmsUploadListener
getCurrentListener
(CmsUUID listenerId) Returns the listener for given CmsUUID.static String
getNewResourceName
(CmsObject cms, String fileName, String folder, boolean keepFileNames) Returns the VFS path for the given filename and folder.void
setUploadDelay
(int uploadDelay) Sets the uploadDelay.start()
Starts the upload.Methods inherited from class org.opencms.jsp.CmsJspBean
getCmsObject, getController, getJspContext, getMessage, getRequest, getRequestContext, getResponse, handleException, handleMissingFlexController, init, isNotInitialized, isSupressingExceptions, setContentType, setStatus, setSupressingExceptions
-
Field Details
-
DEFAULT_UPLOAD_TIMEOUT
The default upload timeout.- See Also:
-
SESSION_ATTRIBUTE_LISTENER_ID
Key name for the session attribute that stores the id of the current listener.- See Also:
-
-
Constructor Details
-
CmsUploadBean
public CmsUploadBean(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CmsException Constructor, with parameters.- Parameters:
context
- the JSP page context objectreq
- the JSP requestres
- the JSP response- Throws:
CmsException
- if something goes wrong
-
-
Method Details
-
getCurrentListener
Returns the listener for given CmsUUID.- Parameters:
listenerId
- the uuid- Returns:
- the according listener
-
getNewResourceName
public static String getNewResourceName(CmsObject cms, String fileName, String folder, boolean keepFileNames) Returns the VFS path for the given filename and folder.- Parameters:
cms
- the cms objectfileName
- the filename to combine with the folderfolder
- the folder to combine with the filenamekeepFileNames
- skip file name translation if true- Returns:
- the VFS path for the given filename and folder
-
setUploadDelay
Sets the uploadDelay.- Parameters:
uploadDelay
- the uploadDelay to set
-
start
Starts the upload.- Returns:
- the response String (JSON)
-