|
||||||
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.CmsMultiDialog
public abstract class CmsMultiDialog
The base class to build a dialog capable of multiple file operations.
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.
Field Summary | |
---|---|
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. |
Fields inherited from class org.opencms.workplace.tools.CmsToolDialog |
---|
PARAM_BASE, PARAM_FORCE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 |
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. |
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 java.lang.String DELIMITER_RESOURCES
public static final java.lang.String PARAM_RESOURCELIST
Constructor Detail |
---|
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 responseMethod Detail |
---|
public 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
in class 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 parameter
CmsException
- 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 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
in class 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
in class 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
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |