public abstract class CmsMultiDialog extends CmsDialog
Extend this class for workplace dialogs that can perform operations on more than one VFS resource like copy, move, touch etc.
Provides methods to determine if a multi-resource operation has to be done and helper methods, e.g. to get the list of resources to work with.
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
DELIMITER_RESOURCES
The delimiter that is used in the resource list request parameter.
|
static java.lang.String |
PARAM_RESOURCELIST
Request parameter name for the resource list.
|
ACTION_CANCEL, ACTION_CLOSEPOPUP, ACTION_CLOSEPOPUP_SAVE, ACTION_CONFIRMED, ACTION_CONTINUE, ACTION_DEFAULT, ACTION_LOCKS_CONFIRMED, ACTION_OK, ACTION_REPORT_BEGIN, ACTION_REPORT_END, ACTION_REPORT_UPDATE, ACTION_SET, ACTION_WAIT, ATTRIBUTE_THROWABLE, BUTTON_ADVANCED, BUTTON_BACK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_CONTINUE, BUTTON_DETAILS, BUTTON_DISCARD, BUTTON_EDIT, BUTTON_OK, BUTTON_OK_NO_SUBMIT, BUTTON_SET, DIALOG_BACK, DIALOG_CANCEL, DIALOG_CONFIRMED, DIALOG_CONTINUE, DIALOG_INITIAL, DIALOG_LOCKS_CONFIRMED, DIALOG_OK, DIALOG_SET, DIALOG_WAIT, PARAM_ACTION, PARAM_CLOSELINK, PARAM_DIALOGTYPE, PARAM_ERRORSTACK, PARAM_FILE, PARAM_FRAMENAME, PARAM_ISPOPUP, PARAM_LOCK, PARAM_MESSAGE, PARAM_ORIGINALPARAMS, PARAM_PREACTIONDONE, PARAM_REDIRECT, PARAM_RESOURCE, PARAM_TARGET, PARAM_THREAD, PARAM_THREAD_HASNEXT, PARAM_TITLE, REPORT_BEGIN, REPORT_END, REPORT_UPDATE
PARAM_ADMIN_PROJECT, PARAM_BASE, PARAM_FORCE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW
DEBUG, DEFAULT_LANGUAGE, DEFAULT_LOCALE, DIALOG_PATH_COMMON, FILE_DIALOG_CLOSE, FILE_DIALOG_SCREEN_CONFIRM, FILE_DIALOG_SCREEN_ERROR, FILE_DIALOG_SCREEN_ERRORPAGE, FILE_DIALOG_SCREEN_WAIT, FILE_EXPLORER_FILELIST, FILE_REPORT_OUTPUT, HTML_END, HTML_START, PARAM_WP_EXPLORER_RESOURCE, PARAM_WP_PROJECT, PARAM_WP_SITE, PATH_DIALOGS, PATH_WORKPLACE, REQUEST_ATTRIBUTE_MULTIPART, REQUEST_ATTRIBUTE_RELOADTREE, RES_PATH_FILETYPES, RFS_PATH_RESOURCES, SESSION_WORKPLACE_CLASS, VFS_DIR_DEFAULTBODIES, VFS_DIR_TEMPLATES, VFS_PATH_COMMONS, VFS_PATH_EDITORS, VFS_PATH_GALLERIES, VFS_PATH_LOCALES, VFS_PATH_MODULES, VFS_PATH_RESOURCES, VFS_PATH_SYSTEM, VFS_PATH_VIEWS, VFS_PATH_WORKPLACE, VIEW_DIRECT_EDIT, VIEW_WORKPLACE
构造器和说明 |
---|
CmsMultiDialog(CmsJspActionElement jsp)
Public constructor.
|
CmsMultiDialog(javax.servlet.jsp.PageContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Public constructor with JSP variables.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addMultiOperationException(CmsException exc)
Adds an exception thrown during a multi resource operation to the multi exception.
|
java.lang.String |
buildLockHeaderBox()
Returns the html code to build the header box.
|
java.lang.String |
buildResourceList()
Builds the HTML for the resource list that is affected by the multi operation.
|
void |
checkMultiOperationException(I_CmsMessageBundle messages,
java.lang.String key)
Checks if an exception occurred during a multi resource operation, and throws a new exception if necessary.
|
protected boolean |
checkResourcePermissions(CmsPermissionSet required,
boolean neededForFolder)
Checks if the permissions of the current user on the single resource to use in the dialog are sufficient.
|
java.lang.String |
getParamResourcelist()
Returns the value of the resource list parameter, or null if the parameter is not provided.
|
java.util.List<java.lang.String> |
getResourceList()
Returns the resources that are defined for the dialog operation.
|
java.lang.String |
getResourceListAsParam()
Returns the value of the resourcelist parameter in form of a String separated
with
DELIMITER_RESOURCES , or the value of the resource parameter if the
first parameter is not provided (no multiple choice has been done. |
boolean |
isMultiOperation()
Returns true if the dialog operation has to be performed on multiple resources.
|
protected boolean |
isOperationOnFolder()
Checks if the resource operation is an operation on at least one folder.
|
protected abstract boolean |
performDialogOperation()
Performs the dialog operation for the selected resources.
|
void |
setDialogTitle(java.lang.String singleKey,
java.lang.String multiKey)
Sets the title of the dialog depending on the operation type, multiple or single operation.
|
void |
setParamResource(java.lang.String value)
Sets the value of the file parameter.
|
void |
setParamResourcelist(java.lang.String paramResourcelist)
Sets the value of the resourcelist parameter.
|
actionCloseDialog, appendDelimiter, buildAjaxResultContainer, buildAjaxWaitMessage, buildLockAdditionalOptions, buildLockConfirmationMessageJS, buildLockDialog, buildLockDialog, checkResourcePermissions, computeCurrentFolder, dialog, dialogBlock, dialogBlockEnd, dialogBlockStart, dialogButtonRow, dialogButtonRowEnd, dialogButtonRowStart, dialogButtons, dialogButtonsClose, dialogButtonsClose, dialogButtonsCloseDetails, dialogButtonsHtml, dialogButtonsOk, dialogButtonsOk, dialogButtonsOkCancel, dialogButtonsOkCancel, dialogButtonsOkCancelAdvanced, dialogButtonsSetOkCancel, dialogContent, dialogContentEnd, dialogContentStart, dialogEnd, dialogHead, dialogHorizontalSpacer, dialogLockButtons, dialogRow, dialogRowEnd, dialogRowStart, dialogScriptSubmit, dialogSeparator, dialogSpacer, dialogStart, dialogStart, dialogSubheadline, dialogToggleStart, dialogWhiteBox, dialogWhiteBoxEnd, dialogWhiteBoxStart, getAction, getAdministrationBackLink, getCancelAction, getDialogRealUri, getDialogUri, getOnlineHelpUriCustom, getParamAction, getParamCloseLink, getParamDialogtype, getParamFramename, getParamIsPopup, getParamMessage, getParamOriginalParams, getParamPreActionDone, getParamRedirect, getParamResource, getParamTitle, getState, hasCorrectLockstate, hasSiblings, htmlStart, htmlStart, htmlStart, htmlStartStyle, includeErrorpage, initCmsDialog, initWorkplaceRequestValues, isPopup, isPreEditor, pageHtml, pageHtml, setAction, setOnlineHelpUriCustom, setParamAction, setParamCloseLink, setParamDialogtype, setParamFramename, setParamIsPopup, setParamMessage, setParamOriginalParams, setParamPreActionDone, setParamRedirect, setParamTitle
computeUpLevelLink, dialogTitle, getAdminTool, getCurrentToolPath, getParamBase, getParamForce, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, setParamForce, setParamPath, setParamRoot, setParamStyle, useNewStyle
addMessages, addMessages, allParamsAsHidden, allParamsAsRequest, allParamValues, bodyEnd, bodyStart, bodyStart, buildSelect, buildSelect, button, button, buttonBar, buttonBar, buttonBarHorizontalLine, buttonBarLabel, buttonBarLabel, buttonBarLine, buttonBarLineSpacer, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, checkLock, checkLock, checkRole, decodeParamValue, fillParamValues, fillParamValues, getBroadcastMessageString, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStartSiteRoot, getStyleUri, getStyleUri, getStyleUri, getTemporaryFileName, htmlEnd, initMessages, initSettings, initTimeWarp, initUserSettings, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, isTemporaryFile, key, key, keyDefault, nullToEmpty, paramsAsHidden, paramsAsHidden, paramsAsParameterMap, paramsAsRequest, paramValues, resolveMacros, sendCmsRedirect, sendForward, setForwarded, shortKey, substituteSiteTitle, switchToCurrentProject, switchToTempProject
public static final java.lang.String DELIMITER_RESOURCES
public static final java.lang.String PARAM_RESOURCELIST
public CmsMultiDialog(CmsJspActionElement jsp)
jsp
- an initialized JSP action elementpublic CmsMultiDialog(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 responsepublic void addMultiOperationException(CmsException exc)
After iterating the dialog resources, use checkMultiOperationException(I_CmsMessageBundle, String)
to
display the multi exception depending on collected exceptions.
exc
- the exception that was thrownpublic java.lang.String buildResourceList()
public java.lang.String buildLockHeaderBox() throws CmsException
CmsDialog
buildLockHeaderBox
在类中 CmsDialog
CmsException
- if something goes wrongCmsDialog.buildLockHeaderBox()
public void checkMultiOperationException(I_CmsMessageBundle messages, java.lang.String key) throws CmsException
messages
- the message bundle to use for the exception message generationkey
- the key for the exception to throw with one parameterCmsException
- the exception that is thrown when the multi operation was not successfulpublic java.lang.String getParamResourcelist()
This parameter selects the resources to perform operations on.
public java.util.List<java.lang.String> getResourceList()
For single resource operations, the list contains one item: the resource name found in the request parameter value of the "resource" parameter.
public java.lang.String getResourceListAsParam()
DELIMITER_RESOURCES
, or the value of the resource parameter if the
first parameter is not provided (no multiple choice has been done.
This may be used for jsps as value for the parameter for resources PARAM_RESOURCELIST
.
public boolean isMultiOperation()
public void setDialogTitle(java.lang.String singleKey, java.lang.String multiKey)
singleKey
- the key for the single operationmultiKey
- the key for the multiple operationpublic void setParamResourcelist(java.lang.String paramResourcelist)
paramResourcelist
- the value of the resourcelist parameterpublic void setParamResource(java.lang.String value)
CmsDialog
setParamResource
在类中 CmsDialog
value
- the value to setCmsDialog.setParamResource(java.lang.String)
protected boolean checkResourcePermissions(CmsPermissionSet required, boolean neededForFolder)
For a multi resource operation, this returns always true, checks only for single resource operations.
checkResourcePermissions
在类中 CmsDialog
required
- the required permissions for the dialogneededForFolder
- if true, the permissions are required for the parent folder of the resource (e.g. for editors)CmsDialog.checkResourcePermissions(CmsPermissionSet, boolean)
protected boolean isOperationOnFolder()
protected abstract boolean performDialogOperation() throws CmsException
CmsException
- if operation was not successful