Class CmsDirectEditJspIncludeProvider
- java.lang.Object
-
- org.opencms.workplace.editors.directedit.A_CmsDirectEditProvider
-
- org.opencms.workplace.editors.directedit.CmsDirectEditJspIncludeProvider
-
- All Implemented Interfaces:
java.lang.Cloneable
,I_CmsConfigurationParameterHandler
,I_CmsDirectEditProvider
public class CmsDirectEditJspIncludeProvider extends A_CmsDirectEditProvider
Direct edit provider that uses the same JSP include based logic that has been the default before the 6.2.3 release.Even though placing the HTML of the direct edit buttons appears to be more "flexible" at first, there is a large overhead invloved using this provider as compared to an implementation like
CmsDirectEditDefaultProvider
. For every direct edit button on a page, a JSP include is processed twice using this provider, one include for the opening and one for the closing HTML. A JSP include is a costly operation, which means the performance of a website is be impacted if many content managers work on the system that makes great use of direct edit with a lot of elements on a page. In order to avoid this performance impact, OpenCms since version 6.2.3 uses theCmsDirectEditDefaultProvider
by default.This provider DOES NOT support
CmsDirectEditMode.MANUAL
mode.- Since:
- 6.2.3
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DIRECT_EDIT_AREA_END
Prefix for direct edit end elements, used on JPS pages that supply the direct edit html.static java.lang.String
DIRECT_EDIT_AREA_START
Prefix for direct edit start elements, used on JPS pages that supply the direct edit html.static java.lang.String
DIRECT_EDIT_INCLUDE_FILE_URI_DEFAULT
Default direct edit include file URI.static java.lang.String
DIRECT_EDIT_INCLUDES
Element name for direct edit includes.static java.lang.String
DIRECT_EDIT_PARAM_BUTTONSTYLE
Key to identify the edit button style, used on JPS pages that supply the direct edit html.static java.lang.String
DIRECT_EDIT_PARAM_ELEMENT
Key to identify the edit element, used on JPS pages that supply the direct edit html.static java.lang.String
DIRECT_EDIT_PARAM_LOCALE
Key to identify the edit language, used on JPS pages that supply the direct edit html.static java.lang.String
DIRECT_EDIT_PARAM_NEWLINK
Key to identify the link to use for the "new" button (if enabled).static java.lang.String
DIRECT_EDIT_PARAM_OPTIONS
Key to identify additional direct edit options, used e.g.static java.lang.String
DIRECT_EDIT_PARAM_TARGET
Key to identify the edit target, used on JPS pages that supply the direct edit html.protected java.lang.String
m_editElement
The last direct edit element.protected java.lang.String
m_editTarget
The last direct edit target.protected java.lang.String
m_permissions
The last calculated direct edit permissions.-
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
Constructors Constructor Description CmsDirectEditJspIncludeProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
includeDirectEditElement(javax.servlet.jsp.PageContext context, java.lang.String jspIncludeFile, java.lang.String element, java.lang.String editTarget, java.lang.String editElement, java.lang.String editOptions, java.lang.String editPermissions, java.lang.String createLink)
Includes the "direct edit" element that adds HTML for the editable area to the output page.void
init(CmsObject cms, CmsDirectEditMode mode, java.lang.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 JSP include provider does not support manual button placement.I_CmsDirectEditProvider
newInstance()
Creates a new instance of this direct edit provider with the same basic configuration.-
Methods inherited from class org.opencms.workplace.editors.directedit.A_CmsDirectEditProvider
addConfigurationParameter, getConfiguration, getLink, getNextDirectEditId, getResourceInfo, initConfiguration, insertDirectEditEmptyList, insertDirectEditListMetadata, print
-
-
-
-
Field Detail
-
DIRECT_EDIT_AREA_END
public static final java.lang.String DIRECT_EDIT_AREA_END
Prefix for direct edit end elements, used on JPS pages that supply the direct edit html.- See Also:
- Constant Field Values
-
DIRECT_EDIT_AREA_START
public static final java.lang.String DIRECT_EDIT_AREA_START
Prefix for direct edit start elements, used on JPS pages that supply the direct edit html.- See Also:
- Constant Field Values
-
DIRECT_EDIT_INCLUDE_FILE_URI_DEFAULT
public static final java.lang.String DIRECT_EDIT_INCLUDE_FILE_URI_DEFAULT
Default direct edit include file URI.- See Also:
- Constant Field Values
-
DIRECT_EDIT_INCLUDES
public static final java.lang.String DIRECT_EDIT_INCLUDES
Element name for direct edit includes.- See Also:
- Constant Field Values
-
DIRECT_EDIT_PARAM_BUTTONSTYLE
public static final java.lang.String DIRECT_EDIT_PARAM_BUTTONSTYLE
Key to identify the edit button style, used on JPS pages that supply the direct edit html.- See Also:
- Constant Field Values
-
DIRECT_EDIT_PARAM_ELEMENT
public static final java.lang.String DIRECT_EDIT_PARAM_ELEMENT
Key to identify the edit element, used on JPS pages that supply the direct edit html.- See Also:
- Constant Field Values
-
DIRECT_EDIT_PARAM_LOCALE
public static final java.lang.String DIRECT_EDIT_PARAM_LOCALE
Key to identify the edit language, used on JPS pages that supply the direct edit html.- See Also:
- Constant Field Values
-
DIRECT_EDIT_PARAM_NEWLINK
public static final java.lang.String DIRECT_EDIT_PARAM_NEWLINK
Key to identify the link to use for the "new" button (if enabled).- See Also:
- Constant Field Values
-
DIRECT_EDIT_PARAM_OPTIONS
public static final java.lang.String DIRECT_EDIT_PARAM_OPTIONS
Key to identify additional direct edit options, used e.g. to control which direct edit buttons are displayed- See Also:
- Constant Field Values
-
DIRECT_EDIT_PARAM_TARGET
public static final java.lang.String DIRECT_EDIT_PARAM_TARGET
Key to identify the edit target, used on JPS pages that supply the direct edit html.- See Also:
- Constant Field Values
-
m_editElement
protected java.lang.String m_editElement
The last direct edit element.
-
m_editTarget
protected java.lang.String m_editTarget
The last direct edit target.
-
m_permissions
protected java.lang.String m_permissions
The last calculated direct edit permissions.
-
-
Constructor Detail
-
CmsDirectEditJspIncludeProvider
public CmsDirectEditJspIncludeProvider()
-
-
Method Detail
-
includeDirectEditElement
public static java.lang.String includeDirectEditElement(javax.servlet.jsp.PageContext context, java.lang.String jspIncludeFile, java.lang.String element, java.lang.String editTarget, java.lang.String editElement, java.lang.String editOptions, java.lang.String editPermissions, java.lang.String createLink) throws javax.servlet.jsp.JspException
Includes the "direct edit" element that adds HTML for the editable area to the output page.- Parameters:
context
- the current JSP page contextjspIncludeFile
- the VFS path of the JSP that contains the direct edit HTML fragmentselement
- the editor element to includeeditTarget
- the direct edit targeteditElement
- the direct edit elementeditOptions
- the direct edit optionseditPermissions
- the direct edit permissionscreateLink
- the direct edit create link- Returns:
- the direct edit permissions
- Throws:
javax.servlet.jsp.JspException
- in case something goes wrong
-
init
public void init(CmsObject cms, CmsDirectEditMode mode, java.lang.String fileName)
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:
A_CmsDirectEditProvider.init(org.opencms.file.CmsObject, org.opencms.workplace.editors.directedit.CmsDirectEditMode, java.lang.String)
-
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:
I_CmsDirectEditProvider.insertDirectEditEnd(javax.servlet.jsp.PageContext)
-
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:
I_CmsDirectEditProvider.insertDirectEditIncludes(javax.servlet.jsp.PageContext, org.opencms.workplace.editors.directedit.CmsDirectEditParams)
-
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:
I_CmsDirectEditProvider.insertDirectEditStart(javax.servlet.jsp.PageContext, org.opencms.workplace.editors.directedit.CmsDirectEditParams)
-
isManual
public boolean isManual(CmsDirectEditMode mode)
Returnsfalse
because the JSP include 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:
I_CmsDirectEditProvider.isManual(org.opencms.workplace.editors.directedit.CmsDirectEditMode)
-
newInstance
public I_CmsDirectEditProvider 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:
I_CmsDirectEditProvider.newInstance()
-
-