|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.workplace.CmsWorkplace
org.opencms.workplace.tools.CmsToolDialog
org.opencms.workplace.CmsDialog
org.opencms.workplace.list.A_CmsListDialog
org.opencms.workplace.list.A_CmsListResourceTypeDialog
org.opencms.workplace.explorer.CmsNewResource
org.opencms.workplace.explorer.CmsNewResourceUpload
public class CmsNewResourceUpload
The new resource upload dialog handles the upload of single files or zipped files.
The following files use this class:
Field Summary | |
---|---|
static int |
ACTION_APPLET
The value for the resource upload applet action. |
static int |
ACTION_APPLET_CHECK_OVERWRITE
The value for the resource upload applet action. |
static int |
ACTION_NEWFORM2
The value for the resource name form action. |
static int |
ACTION_SHOWERROR
The value for the resource upload applet action: error occurred. |
static int |
ACTION_SUBMITFORM2
The value for the resource name form submission action. |
static java.lang.String |
APPLET_FILEFILTER_IMAGES
Constant for pre selection of the file filter for web documents / snippets in the upload applet. |
static java.lang.String |
APPLET_FILEFILTER_OFFICE
Constant for pre selection of the file filter for office documents in the upload applet. |
static java.lang.String |
APPLET_FILEFILTER_WEB
Constant for pre selection of the file filter for web documents / snippets in the upload applet. |
static java.util.Map |
DEFAULT_APPLET_WINDOW_COLORS
Default setting for the applet JSP page colors (windows style). |
static java.lang.String |
DIALOG_CHECK_OVERWRITE
The value for the resource upload applet action. |
static java.lang.String |
DIALOG_SHOWERROR
The name for the resource form submission action. |
static java.lang.String |
DIALOG_SUBMITFORM2
The name for the resource form submission action. |
static java.lang.String |
PARAM_CLIENTFOLDER
Request parameter name for the upload folder name. |
static java.lang.String |
PARAM_NEWRESOURCENAME
Request parameter name for the new resource file name. |
static java.lang.String |
PARAM_REDIRECTURL
Request parameter name for the redirect url. |
static java.lang.String |
PARAM_TARGETFRAME
Request parameter name for the redirect target frame name. |
static java.lang.String |
PARAM_UNZIPFILE
Request parameter name for the upload file unzip flag. |
static java.lang.String |
PARAM_UPLOADERROR
Request parameter name for the upload file name. |
static java.lang.String |
PARAM_UPLOADFILE
Request parameter name for the upload file name. |
static java.lang.String |
PARAM_UPLOADFOLDER
Request parameter name for the upload folder name. |
Fields inherited from class org.opencms.workplace.explorer.CmsNewResource |
---|
ACTION_NEWFORM, ACTION_SUBMITFORM, BUTTON_NEXT, DEFAULT_SUFFIX, DELIM_PROPERTYVALUES, DIALOG_ADVANCED, DIALOG_NEWFORM, DIALOG_SUBMITFORM, DIALOG_TYPE, LIST_COLUMN_URI, PARAM_APPENDSUFFIXHTML, PARAM_CURRENTFOLDER, PARAM_NEWFORMURI, PARAM_NEWRESOURCEEDITPROPS, PARAM_NEWRESOURCETYPE, PARAM_NEWRESOURCEURI, SESSION_ATTR_ADVANCED, SESSION_ATTR_PAGE, VALUE_DEFAULT |
Fields inherited from class org.opencms.workplace.list.A_CmsListResourceTypeDialog |
---|
LIST_ACTION_SEL, LIST_COLUMN_ICON, LIST_COLUMN_NAME, LIST_COLUMN_SELECT, LIST_DETAIL_DESCRIPTION, LIST_ID, PARAM_SELECTED_TYPE |
Fields inherited from class org.opencms.workplace.tools.CmsToolDialog |
---|
PARAM_BASE, PARAM_FORCE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW |
Constructor Summary | |
---|---|
CmsNewResourceUpload(CmsJspActionElement jsp)
Public constructor with JSP action element. |
|
CmsNewResourceUpload(javax.servlet.jsp.PageContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Public constructor with JSP variables. |
Method Summary | |
---|---|
void |
actionCloseDialog()
Used to close the current JSP dialog. |
void |
actionUpdateFile()
Updates the file type and renames the file if desired. |
void |
actionUpload()
Uploads the specified file and unzips it, if selected. |
java.lang.String |
buildTypeList()
Builds the list of possible types for the uploaded file. |
static java.lang.String |
buildTypeList(CmsDialog dialog,
boolean useTypeId)
Builds the html for the list of possible types for the uploaded file. |
java.lang.String |
createAppletCode()
Creates the HTML code of the file upload applet with all required parameters. |
static java.lang.String |
createAppletCode(CmsJspActionElement jsp,
java.util.Locale locale,
java.lang.String currentFolder,
java.lang.String redirectUrl,
java.lang.String targetFrame,
java.util.Map appletWindowColors)
Creates the HTML code of the file upload applet with all required parameters. |
java.lang.String |
getParamClientFolder()
Returns the paramClientFolder. |
java.lang.String |
getParamNewResourceName()
Returns the new resource name of the uploaded file. |
java.lang.String |
getParamRedirectUrl()
Returns the paramRedirectUrl. |
java.lang.String |
getParamTargetFrame()
Returns the paramTargetFrame. |
java.lang.String |
getParamUnzipFile()
Returns true if the upload file should be unzipped, otherwise false. |
java.lang.String |
getParamUploadError()
Returns the upload error message for the error dialog. |
java.lang.String |
getParamUploadFile()
Returns the upload file name. |
java.lang.String |
getParamUploadFolder()
Returns the upload folder name. |
java.lang.String |
handleUploadOverwriteCheckRequest(javax.servlet.http.HttpServletRequest request)
Replies on the request of the upload applet for checking potential overwrites of VFS resources with the line based resources that do exist on the host. |
protected void |
initWorkplaceMembers(CmsJspActionElement jsp)
Initializes this workplace class instance. |
protected void |
initWorkplaceRequestValues(CmsWorkplaceSettings settings,
javax.servlet.http.HttpServletRequest request)
Analyzes the request for workplace parameters and adjusts the workplace settings accordingly. |
void |
setAppletWindowColors(java.util.Map appletWindowColors)
Sets the configurable colors for the applet window (content frame JSP). |
void |
setParamClientFolder(java.lang.String clientFolder)
Sets the client upload folder name. |
void |
setParamNewResourceName(java.lang.String newResourceName)
Sets the new resource name of the uploaded file. |
void |
setParamRedirectUrl(java.lang.String paramRedirectUrl)
Sets the paramRedirectUrl. |
void |
setParamTargetFrame(java.lang.String paramTargetFrame)
Sets the paramTargetFrame. |
void |
setParamUnzipFile(java.lang.String unzipFile)
Sets if the upload file should be unzipped. |
void |
setParamUploadError(java.lang.String uploadError)
Sets the upload error message for the error dialog. |
void |
setParamUploadFile(java.lang.String uploadFile)
Sets the upload file name. |
void |
setParamUploadFolder(java.lang.String uploadFolder)
Sets the upload folder name. |
boolean |
unzipUpload()
Returns if the upload file should be unzipped. |
Methods inherited from class org.opencms.workplace.list.A_CmsListResourceTypeDialog |
---|
customHtmlBeforeList, customHtmlEnd, defaultActionHtmlContent, executeListMultiActions, executeListSingleActions, fillDetails, getParamSelectedType, paramsAsHidden, setIndependentActions, setMultiActions, setParamSelectedType |
Methods inherited from class org.opencms.workplace.tools.CmsToolDialog |
---|
dialogTitle, getAdminTool, getCurrentToolPath, getParamBase, getParamForce, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, setParamForce, setParamPath, setParamRoot, setParamStyle, useNewStyle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ACTION_APPLET
public static final int ACTION_APPLET_CHECK_OVERWRITE
public static final int ACTION_NEWFORM2
public static final int ACTION_SHOWERROR
public static final int ACTION_SUBMITFORM2
public static final java.lang.String APPLET_FILEFILTER_IMAGES
public static final java.lang.String APPLET_FILEFILTER_OFFICE
public static final java.lang.String APPLET_FILEFILTER_WEB
public static final java.util.Map DEFAULT_APPLET_WINDOW_COLORS
public static final java.lang.String DIALOG_CHECK_OVERWRITE
public static final java.lang.String DIALOG_SHOWERROR
public static final java.lang.String DIALOG_SUBMITFORM2
public static final java.lang.String PARAM_CLIENTFOLDER
public static final java.lang.String PARAM_NEWRESOURCENAME
public static final java.lang.String PARAM_REDIRECTURL
public static final java.lang.String PARAM_TARGETFRAME
public static final java.lang.String PARAM_UNZIPFILE
public static final java.lang.String PARAM_UPLOADERROR
public static final java.lang.String PARAM_UPLOADFILE
public static final java.lang.String PARAM_UPLOADFOLDER
Constructor Detail |
---|
public CmsNewResourceUpload(CmsJspActionElement jsp)
jsp
- an initialized JSP action elementpublic CmsNewResourceUpload(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
context
- the JSP page contextreq
- the JSP requestres
- the JSP responseMethod Detail |
---|
public static java.lang.String buildTypeList(CmsDialog dialog, boolean useTypeId)
This method can be used by all workplace dialog classes to build radio input buttons to select a resource type.
dialog
- the dialog class instance which creates the type listuseTypeId
- if true, the resource type ID will be used for value attributes, otherwise the resource type names
public static java.lang.String createAppletCode(CmsJspActionElement jsp, java.util.Locale locale, java.lang.String currentFolder, java.lang.String redirectUrl, java.lang.String targetFrame, java.util.Map appletWindowColors)
jsp
- an initialized action elementlocale
- the locale to use for the appletcurrentFolder
- the folder to upload the resources toredirectUrl
- the URL to redirect to after uploadingtargetFrame
- the name of the target frame to redirect to after uploadingappletWindowColors
- the colors to use for the applet, if not provided, the default colors will be used
public void actionCloseDialog() throws javax.servlet.jsp.JspException
This method overwrites the close dialog method in the super class, because in case a new file was uploaded and the cancel button pressed, the uploaded file has to be deleted.
It tries to include the URI stored in the workplace settings. This URI is determined by the frame name, which has to be set in the framename parameter.
actionCloseDialog
in class CmsNewResource
javax.servlet.jsp.JspException
- if including an element failspublic void actionUpdateFile() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
- if inclusion of error dialog failspublic void actionUpload() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
- if inclusion of error dialog failspublic java.lang.String buildTypeList()
public java.lang.String createAppletCode()
public java.lang.String getParamClientFolder()
public java.lang.String getParamNewResourceName()
public java.lang.String getParamRedirectUrl()
public java.lang.String getParamTargetFrame()
public java.lang.String getParamUnzipFile()
public java.lang.String getParamUploadError()
public java.lang.String getParamUploadFile()
public java.lang.String getParamUploadFolder()
public java.lang.String handleUploadOverwriteCheckRequest(javax.servlet.http.HttpServletRequest request)
request
- the request sent by the applet
public final void setAppletWindowColors(java.util.Map appletWindowColors)
appletWindowColors
- the configurable colors for the applet window (content frame JSP).public void setParamClientFolder(java.lang.String clientFolder)
clientFolder
- the client upload folder namepublic void setParamNewResourceName(java.lang.String newResourceName)
newResourceName
- the new resource name of the uploaded filepublic void setParamRedirectUrl(java.lang.String paramRedirectUrl)
paramRedirectUrl
- the paramRedirectUrl to setpublic void setParamTargetFrame(java.lang.String paramTargetFrame)
paramTargetFrame
- the paramTargetFrame to setpublic void setParamUnzipFile(java.lang.String unzipFile)
unzipFile
- true if the upload file should be unzippedpublic void setParamUploadError(java.lang.String uploadError)
uploadError
- the upload error message for the error dialogpublic void setParamUploadFile(java.lang.String uploadFile)
uploadFile
- the upload file namepublic void setParamUploadFolder(java.lang.String uploadFolder)
uploadFolder
- the upload folder namepublic boolean unzipUpload()
protected void initWorkplaceMembers(CmsJspActionElement jsp)
CmsWorkplace
This method can be used in case there a workplace class was generated using
Class.forName(java.lang.String)
to initialize the class members.
initWorkplaceMembers
in class CmsWorkplace
jsp
- the initialized JSP contextCmsWorkplace.initWorkplaceMembers(org.opencms.jsp.CmsJspActionElement)
protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
CmsWorkplace
initWorkplaceRequestValues
in class CmsNewResource
settings
- the workplace settingsrequest
- the current requestCmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |