org.opencms.ade.upload
Class CmsUploadBean

java.lang.Object
  extended by org.opencms.jsp.CmsJspBean
      extended by org.opencms.ade.upload.CmsUploadBean

public class CmsUploadBean
extends CmsJspBean

Bean to be used in JSP scriptlet code that provides access to the upload functionality.

Since:
8.0.0

Field Summary
static int DEFAULT_UPLOAD_TIMEOUT
          The default upload timeout.
static String SESSION_ATTRIBUTE_LISTENER_ID
          Key name for the session attribute that stores the id of the current listener.
 
Constructor Summary
CmsUploadBean(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Constructor, with parameters.
 
Method Summary
static CmsUploadListener getCurrentListener(CmsUUID listenerId)
          Returns the listener for given CmsUUID.
static String getNewResourceName(CmsObject cms, String fileName, String folder)
          Returns the VFS path for the given filename and folder.
 void setUploadDelay(int uploadDelay)
          Sets the uploadDelay.
 String start()
          Starts the upload.
 
Methods inherited from class org.opencms.jsp.CmsJspBean
getCmsObject, getController, getJspContext, getMessage, getRequest, getRequestContext, getResponse, handleException, init, isNotInitialized, isSupressingExceptions, setContentType, setStatus, setSupressingExceptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_UPLOAD_TIMEOUT

public static final int DEFAULT_UPLOAD_TIMEOUT
The default upload timeout.

See Also:
Constant Field Values

SESSION_ATTRIBUTE_LISTENER_ID

public static final String SESSION_ATTRIBUTE_LISTENER_ID
Key name for the session attribute that stores the id of the current listener.

See Also:
Constant Field Values
Constructor Detail

CmsUploadBean

public CmsUploadBean(javax.servlet.jsp.PageContext context,
                     javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse res)
Constructor, with parameters.

Parameters:
context - the JSP page context object
req - the JSP request
res - the JSP response
Method Detail

getCurrentListener

public static CmsUploadListener getCurrentListener(CmsUUID listenerId)
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)
Returns the VFS path for the given filename and folder.

Parameters:
cms - the cms object
fileName - the filename to combine with the folder
folder - the folder to combine with the filename
Returns:
the VFS path for the given filename and folder

setUploadDelay

public void setUploadDelay(int uploadDelay)
Sets the uploadDelay.

Parameters:
uploadDelay - the uploadDelay to set

start

public String start()
Starts the upload.

Returns:
the response String (JSON)