public class CmsLock extends CmsMultiDialog implements I_CmsDialogHandler
The following files use this class:
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
ACTION_SUBMIT_NOCONFIRMATION
Value for the action: confirmed.
|
static java.lang.String |
DIALOG_SUBMIT_NOCONFIRMATION
Request parameter value for the action: submit form without user interaction.
|
static java.lang.String |
DIALOG_TYPE_LOCK
The dialog type: lock a resource.
|
static java.lang.String |
DIALOG_TYPE_LOCKCHANGE
The dialog type: Steal a lock.
|
static java.lang.String |
DIALOG_TYPE_LOCKS
The dialog type: locked subresources.
|
static java.lang.String |
DIALOG_TYPE_UNLOCK
The dialog type: unlock a resource.
|
static java.lang.String |
PARAM_INCLUDERELATED
Request parameter name for the 'include unpublished related resources' flag.
|
static java.lang.String |
PARAM_PROJECT_ID
Request parameter name for the project id.
|
static java.lang.String |
PARAM_PUBLISHSIBLINGS
Request parameter name for the publishsiblings parameter.
|
static java.lang.String |
PARAM_SHOWOWNLOCKS
Request parameter name for the 'show own locked resources' flag.
|
static java.lang.String |
PARAM_SOURCE_DIALOG
Request parameter name for the source dialog uri.
|
static java.lang.String |
PARAM_SUBRESOURCES
Request parameter name for the subresources parameter.
|
static int |
TYPE_LOCK
Type of the operation which is performed: lock resource.
|
static int |
TYPE_LOCKCHANGE
Type of the operation which is performed: steal a lock.
|
static int |
TYPE_LOCKS
Type of the operation which is performed: locked subresources.
|
static int |
TYPE_UNLOCK
Type of the operation which is performed: unlock resource.
|
static java.lang.String |
URI_LOCK_DIALOG
The lock dialog URI.
|
static java.lang.String |
URI_LOCKCHANGE_DIALOG
The steal lock dialog URI.
|
static java.lang.String |
URI_LOCKS_DIALOG
The locks dialog URI.
|
static java.lang.String |
URI_UNLOCK_DIALOG
The unlock dialog URI.
|
DELIMITER_RESOURCES, PARAM_RESOURCELISTACTION_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_UPDATEPARAM_ADMIN_PROJECT, PARAM_BASE, PARAM_FORCE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEWDEBUG, 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_WORKPLACEADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD| 构造器和说明 |
|---|
CmsLock()
Default constructor needed for dialog handler implementation.
|
CmsLock(CmsJspActionElement jsp)
Public constructor.
|
CmsLock(javax.servlet.jsp.PageContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Public constructor with JSP variables.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
actionToggleLock()
Performs the lock/unlock operation, will be called by the JSP page.
|
void |
addConfigurationParameter(java.lang.String paramName,
java.lang.String paramValue)
Adds a configuration parameter to this parameter configurable class instance.
|
java.lang.String |
buildDefaultConfirmationJS()
Returns the html code to build the dialogs default confirmation message js.
|
java.lang.String |
buildIncludeJs()
Returns the html code to include the needed js code.
|
java.lang.String |
buildLockRequest()
Returns the html code to build the lock request.
|
java.lang.String |
buildLockRequest(int hiddenTimeout,
boolean includeRelated)
Returns the html code to build the lock request.
|
java.lang.String |
buildReport()
Returns the report of all locked subresources.
|
java.lang.String |
dialogButtons()
Builds the necessary button row.
|
CmsLockFilter |
getBlockingFilter()
Returns the filter to get all blocking locks.
|
java.util.Set |
getBlockingLockedResources()
Returns locked resources that do not belong to the current user.
|
int |
getBlockingLocks()
Returns the number of blocking locks.
|
CmsParameterConfiguration |
getConfiguration()
Returns the parameters of this configurable class instance,
or
null if the class does not need any parameters. |
java.lang.String |
getConfirmationMessage(boolean state)
Returns the confirmation message.
|
static int |
getDialogAction(CmsObject cms)
Determines if the resource should be locked, unlocked or if the lock should be stolen.
|
java.lang.String |
getDialogHandler()
Returns the name of the handler which is used as key for the OpenCms runtime properties.
|
java.lang.String |
getDialogUri(java.lang.String resource,
CmsJspActionElement jsp)
Returns the dialog URI in the OpenCms VFS to the dialog selector class.
|
java.util.List |
getLockedResources()
Returns all the locked Resources.
|
CmsLockFilter |
getNonBlockingFilter()
Returns the filter to get all non blocking locks.
|
java.lang.String |
getParamIncluderelated()
Returns the 'include unpublished related resources' parameter value.
|
java.lang.String |
getParamProjectid()
Returns the project id parameter value.
|
java.lang.String |
getParamShowownlocks()
Returns the 'show own locked resources' parameter value.
|
void |
initConfiguration()
Initializes a configuration after all parameters have been added.
|
protected void |
initWorkplaceRequestValues(CmsWorkplaceSettings settings,
javax.servlet.http.HttpServletRequest request)
Analyzes the request for workplace parameters and adjusts the workplace
settings accordingly.
|
protected boolean |
performDialogOperation()
Performs the lock/unlock/steal lock operation.
|
protected void |
performSingleResourceOperation(java.lang.String resourceName,
int dialogAction)
Performs the lock state operation on a single resource.
|
void |
setBlockingFilter(CmsLockFilter blockingFilter)
Sets the filter to get all blocking locks.
|
void |
setNonBlockingFilter(CmsLockFilter nonBlockingFilter)
Sets the filter to get all non blocking locks.
|
void |
setParamIncluderelated(java.lang.String paramIncluderelated)
Sets the 'include unpublished related resources' parameter value.
|
void |
setParamProjectid(java.lang.String projectid)
Sets the project id parameter value.
|
void |
setParamShowownlocks(java.lang.String paramShowownlocks)
Sets the 'show own locked resources' parameter value.
|
boolean |
showConfirmation()
Determines whether to show the lock dialog depending on the users settings and the dilaog type.
|
addMultiOperationException, buildLockHeaderBox, buildResourceList, checkMultiOperationException, checkResourcePermissions, getParamResourcelist, getResourceList, getResourceListAsParam, isMultiOperation, isOperationOnFolder, setDialogTitle, setParamResource, setParamResourcelistactionCloseDialog, 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, isPopup, isPreEditor, pageHtml, pageHtml, setAction, setOnlineHelpUriCustom, setParamAction, setParamCloseLink, setParamDialogtype, setParamFramename, setParamIsPopup, setParamMessage, setParamOriginalParams, setParamPreActionDone, setParamRedirect, setParamTitlecomputeUpLevelLink, dialogTitle, getAdminTool, getCurrentToolPath, getParamBase, getParamForce, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, setParamForce, setParamPath, setParamRoot, setParamStyle, useNewStyleaddMessages, 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, switchToTempProjectpublic static final int ACTION_SUBMIT_NOCONFIRMATION
public static final java.lang.String DIALOG_SUBMIT_NOCONFIRMATION
public static final java.lang.String DIALOG_TYPE_LOCK
public static final java.lang.String DIALOG_TYPE_LOCKCHANGE
public static final java.lang.String DIALOG_TYPE_LOCKS
public static final java.lang.String DIALOG_TYPE_UNLOCK
public static final java.lang.String PARAM_INCLUDERELATED
public static final java.lang.String PARAM_PROJECT_ID
public static final java.lang.String PARAM_PUBLISHSIBLINGS
public static final java.lang.String PARAM_SHOWOWNLOCKS
public static final java.lang.String PARAM_SOURCE_DIALOG
public static final java.lang.String PARAM_SUBRESOURCES
public static final int TYPE_LOCK
public static final int TYPE_LOCKCHANGE
public static final int TYPE_LOCKS
public static final int TYPE_UNLOCK
public static final java.lang.String URI_LOCK_DIALOG
public static final java.lang.String URI_LOCKCHANGE_DIALOG
public static final java.lang.String URI_LOCKS_DIALOG
public static final java.lang.String URI_UNLOCK_DIALOG
public CmsLock()
public CmsLock(CmsJspActionElement jsp)
jsp - an initialized JSP action elementpublic CmsLock(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 static int getDialogAction(CmsObject cms)
cms - the CmsObjectpublic void actionToggleLock()
throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException - if problems including sub-elements occurpublic void addConfigurationParameter(java.lang.String paramName,
java.lang.String paramValue)
I_CmsConfigurationParameterHandleraddConfigurationParameter 在接口中 I_CmsConfigurationParameterHandlerparamName - the name of the parameterparamValue - the value for the parameterI_CmsConfigurationParameterHandler.addConfigurationParameter(java.lang.String, java.lang.String)public java.lang.String buildDefaultConfirmationJS()
public java.lang.String buildIncludeJs()
public java.lang.String buildLockRequest()
public java.lang.String buildLockRequest(int hiddenTimeout,
boolean includeRelated)
hiddenTimeout - the maximal number of millis the dialog will be hiddenincludeRelated - indicates if the report should include related resourcespublic java.lang.String buildReport()
throws javax.servlet.jsp.JspException,
javax.servlet.ServletException,
java.io.IOException
javax.servlet.jsp.JspException - if dialog actions failjava.io.IOException - in case of errros forwarding to the required result pagejavax.servlet.ServletException - in case of errros forwarding to the required result pagepublic java.lang.String dialogButtons()
public CmsLockFilter getBlockingFilter()
public java.util.Set getBlockingLockedResources()
public int getBlockingLocks()
public CmsParameterConfiguration getConfiguration()
I_CmsConfigurationParameterHandlernull if the class does not need any parameters.getConfiguration 在接口中 I_CmsConfigurationParameterHandlernull if the class does not need any parametersI_CmsConfigurationParameterHandler.getConfiguration()public java.lang.String getConfirmationMessage(boolean state)
state - if true everything is okpublic java.lang.String getDialogHandler()
I_CmsDialogHandlerStore the name of the key as a public String constant in the CmsDialogSelector class.
getDialogHandler 在接口中 I_CmsDialogHandlerI_CmsDialogHandler.getDialogHandler()public java.lang.String getDialogUri(java.lang.String resource,
CmsJspActionElement jsp)
I_CmsDialogHandlergetDialogUri 在接口中 I_CmsDialogHandlerresource - the selected resourcejsp - the CmsJspActionElementI_CmsDialogHandler.getDialogUri(java.lang.String, CmsJspActionElement)public java.util.List getLockedResources()
public CmsLockFilter getNonBlockingFilter()
public java.lang.String getParamIncluderelated()
public java.lang.String getParamProjectid()
public java.lang.String getParamShowownlocks()
public void initConfiguration()
I_CmsConfigurationParameterHandlerpublic void setBlockingFilter(CmsLockFilter blockingFilter)
blockingFilter - the filter to setpublic void setNonBlockingFilter(CmsLockFilter nonBlockingFilter)
nonBlockingFilter - the filter to setpublic void setParamIncluderelated(java.lang.String paramIncluderelated)
paramIncluderelated - the 'include unpublished related resources' parameter value to setpublic void setParamProjectid(java.lang.String projectid)
projectid - the project id parameter value to setpublic void setParamShowownlocks(java.lang.String paramShowownlocks)
paramShowownlocks - the 'show own locked resources' parameter value to setpublic boolean showConfirmation()
In case of locking a folder, a confirmation dialog is needed if any sub resources are already locked.
protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
CmsWorkplaceinitWorkplaceRequestValues 在类中 CmsDialogsettings - the workplace settingsrequest - the current requestCmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)protected boolean performDialogOperation()
throws CmsException
performDialogOperation 在类中 CmsMultiDialogCmsException - if operation is not successfulprotected void performSingleResourceOperation(java.lang.String resourceName,
int dialogAction)
throws CmsException
resourceName - the resource name to perform the operation ondialogAction - the lock action: lock, unlock or change lockCmsException - if the operation fails