Class CmsDirectEditDefaultProvider
java.lang.Object
org.opencms.workplace.editors.directedit.A_CmsDirectEditProvider
org.opencms.workplace.editors.directedit.CmsDirectEditDefaultProvider
- All Implemented Interfaces:
Cloneable
,I_CmsConfigurationParameterHandler
,I_CmsDirectEditProvider
- Direct Known Subclasses:
CmsDirectEditJQueryProvider
,CmsDirectEditTextButtonProvider
Provider for the OpenCms default graphical "direct edit" buttons.
Since OpenCms version 6.2.3, this provider is configured as the standard direct edit provider in a common OpenCms installation.
This provider DOES NOT support CmsDirectEditMode.MANUAL
mode.
- Since:
- 6.2.3
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
Indicates the permissions for the last element the was opened.Fields inherited from class org.opencms.workplace.editors.directedit.A_CmsDirectEditProvider
INCLUDE_FILE_DEFAULT, m_cms, m_configurationParameters, m_editButtonStyle, m_fileName, m_messages, m_mode, m_rnd
Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD
Fields inherited from interface org.opencms.workplace.editors.directedit.I_CmsDirectEditProvider
ATTRIBUTE_DIRECT_EDIT_PROVIDER, ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the end HTML for a disabled direct edit button.Returns the end HTML for an enabled direct edit button.protected String
getContentAsString
(CmsFile file) Helper method to convert the content of a resource to a string.Returns the direct edit include HTML to insert in the page beginning.void
init
(CmsObject cms, CmsDirectEditMode mode, String fileName) Initialize method for a new instance of the direct edit provider.void
insertDirectEditEnd
(javax.servlet.jsp.PageContext context) Inserts the "end direct edit" HTML in the provided JSP page context.void
insertDirectEditIncludes
(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) Inserts the "direct edit header" HTML in the provided JSP page context.boolean
insertDirectEditStart
(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) Inserts the "start direct edit" HTML in the provided JSP page context.boolean
isManual
(CmsDirectEditMode mode) Returnsfalse
because the default provider does not support manual button placement.Creates a new instance of this direct edit provider with the same basic configuration.protected CmsMacroResolver
Prepares the macro resolver which is used to process the included text file.startDirectEditDisabled
(CmsDirectEditParams params, CmsDirectEditResourceInfo resourceInfo) Returns the start HTML for a disabled direct edit button.startDirectEditEnabled
(CmsDirectEditParams params, CmsDirectEditResourceInfo resourceInfo) Returns the start HTML for an enabled direct edit button.Methods inherited from class org.opencms.workplace.editors.directedit.A_CmsDirectEditProvider
addConfigurationParameter, getConfiguration, getLink, getNextDirectEditId, getResourceInfo, initConfiguration, insertDirectEditEmptyList, insertDirectEditListMetadata, print
-
Field Details
-
m_lastPermissionMode
Indicates the permissions for the last element the was opened.
-
-
Constructor Details
-
CmsDirectEditDefaultProvider
public CmsDirectEditDefaultProvider()
-
-
Method Details
-
endDirectEditDisabled
Returns the end HTML for a disabled direct edit button.- Returns:
- the end HTML for a disabled direct edit button
-
endDirectEditEnabled
Returns the end HTML for an enabled direct edit button.- Returns:
- the end HTML for an enabled direct edit button
-
getDirectEditIncludes
Returns the direct edit include HTML to insert in the page beginning.t
- Parameters:
params
- the parameters for the direct edit includes- Returns:
- the direct edit include HTML to insert in the page beginning
-
init
Description copied from interface:I_CmsDirectEditProvider
Initialize method for a new instance of the direct edit provider.- Specified by:
init
in interfaceI_CmsDirectEditProvider
- Overrides:
init
in classA_CmsDirectEditProvider
- Parameters:
cms
- the current users OpenCms contextmode
- the direct edit mode to usefileName
- link to a file that contains the direct edit HTML elements (optional)- See Also:
-
insertDirectEditEnd
public void insertDirectEditEnd(javax.servlet.jsp.PageContext context) throws javax.servlet.jsp.JspException Description copied from interface:I_CmsDirectEditProvider
Inserts the "end direct edit" HTML in the provided JSP page context.- Parameters:
context
- the JSP page context to insert the HTML to- Throws:
javax.servlet.jsp.JspException
- in case something goes wrong- See Also:
-
insertDirectEditIncludes
public void insertDirectEditIncludes(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) throws javax.servlet.jsp.JspException Description copied from interface:I_CmsDirectEditProvider
Inserts the "direct edit header" HTML in the provided JSP page context.- Parameters:
context
- the JSP page context to insert the HTML toparams
- the parameters for the direct edit includes- Throws:
javax.servlet.jsp.JspException
- in case something goes wrong- See Also:
-
insertDirectEditStart
public boolean insertDirectEditStart(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) throws javax.servlet.jsp.JspException Description copied from interface:I_CmsDirectEditProvider
Inserts the "start direct edit" HTML in the provided JSP page context.- Parameters:
context
- the JSP page context to insert the HTML toparams
- the parameters for the direct edit call- Returns:
true
in case a direct edit element was opened,false
otherwise- Throws:
javax.servlet.jsp.JspException
- in case something goes wrong- See Also:
-
isManual
Returnsfalse
because the default provider does not support manual button placement.- Specified by:
isManual
in interfaceI_CmsDirectEditProvider
- Overrides:
isManual
in classA_CmsDirectEditProvider
- Parameters:
mode
- the mode of the current direct edit element- Returns:
true
if this provider (currently) operates in manual mode- See Also:
-
newInstance
Description copied from interface:I_CmsDirectEditProvider
Creates a new instance of this direct edit provider with the same basic configuration.- Returns:
- a new instance of this direct edit provider with the same basic configuration
- See Also:
-
startDirectEditDisabled
public String startDirectEditDisabled(CmsDirectEditParams params, CmsDirectEditResourceInfo resourceInfo) Returns the start HTML for a disabled direct edit button.- Parameters:
params
- the direct edit parametersresourceInfo
- contains information about the resource to edit- Returns:
- the start HTML for a disabled direct edit button
-
startDirectEditEnabled
public String startDirectEditEnabled(CmsDirectEditParams params, CmsDirectEditResourceInfo resourceInfo) Returns the start HTML for an enabled direct edit button.- Parameters:
params
- the direct edit parametersresourceInfo
- contains information about the resource to edit- Returns:
- the start HTML for an enabled direct edit button
-
getContentAsString
Helper method to convert the content of a resource to a string.- Parameters:
file
- the file- Returns:
- the file content as a string
- Throws:
CmsException
- if something goes wrong
-
prepareMacroResolverForIncludes
Prepares the macro resolver which is used to process the included text file.- Parameters:
params
- the direct edit parameters- Returns:
- the macro resolver
-