Class CmsDirectEditJspIncludeProvider
- All Implemented Interfaces:
Cloneable,I_CmsConfigurationParameterHandler,I_CmsDirectEditProvider
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 the CmsDirectEditDefaultProvider by default.
This provider DOES NOT support CmsDirectEditMode.MANUAL mode.
- Since:
- 6.2.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPrefix for direct edit end elements, used on JPS pages that supply the direct edit html.static final StringPrefix for direct edit start elements, used on JPS pages that supply the direct edit html.static final StringDefault direct edit include file URI.static final StringElement name for direct edit includes.static final StringKey to identify the edit button style, used on JPS pages that supply the direct edit html.static final StringKey to identify the edit element, used on JPS pages that supply the direct edit html.static final StringKey to identify the edit language, used on JPS pages that supply the direct edit html.static final StringKey to identify the link to use for the "new" button (if enabled).static final StringKey to identify additional direct edit options, used e.g.static final StringKey to identify the edit target, used on JPS pages that supply the direct edit html.protected StringThe last direct edit element.protected StringThe last direct edit target.protected StringThe 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_rndFields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHODFields inherited from interface org.opencms.workplace.editors.directedit.I_CmsDirectEditProvider
ATTRIBUTE_DIRECT_EDIT_PROVIDER, ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringincludeDirectEditElement(javax.servlet.jsp.PageContext context, String jspIncludeFile, String element, String editTarget, String editElement, String editOptions, String editPermissions, String createLink) Includes the "direct edit" element that adds HTML for the editable area to the output page.voidinit(CmsObject cms, CmsDirectEditMode mode, String fileName) Initialize method for a new instance of the direct edit provider.voidinsertDirectEditEnd(javax.servlet.jsp.PageContext context) Inserts the "end direct edit" HTML in the provided JSP page context.voidinsertDirectEditIncludes(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) Inserts the "direct edit header" HTML in the provided JSP page context.booleaninsertDirectEditStart(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) Inserts the "start direct edit" HTML in the provided JSP page context.booleanisManual(CmsDirectEditMode mode) Returnsfalsebecause the JSP include provider does not support manual button placement.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 Details
-
DIRECT_EDIT_AREA_END
Prefix for direct edit end elements, used on JPS pages that supply the direct edit html.- See Also:
-
DIRECT_EDIT_AREA_START
Prefix for direct edit start elements, used on JPS pages that supply the direct edit html.- See Also:
-
DIRECT_EDIT_INCLUDE_FILE_URI_DEFAULT
Default direct edit include file URI.- See Also:
-
DIRECT_EDIT_INCLUDES
Element name for direct edit includes.- See Also:
-
DIRECT_EDIT_PARAM_BUTTONSTYLE
Key to identify the edit button style, used on JPS pages that supply the direct edit html.- See Also:
-
DIRECT_EDIT_PARAM_ELEMENT
Key to identify the edit element, used on JPS pages that supply the direct edit html.- See Also:
-
DIRECT_EDIT_PARAM_LOCALE
Key to identify the edit language, used on JPS pages that supply the direct edit html.- See Also:
-
DIRECT_EDIT_PARAM_NEWLINK
Key to identify the link to use for the "new" button (if enabled).- See Also:
-
DIRECT_EDIT_PARAM_OPTIONS
Key to identify additional direct edit options, used e.g. to control which direct edit buttons are displayed- See Also:
-
DIRECT_EDIT_PARAM_TARGET
Key to identify the edit target, used on JPS pages that supply the direct edit html.- See Also:
-
m_editElement
The last direct edit element. -
m_editTarget
The last direct edit target. -
m_permissions
The last calculated direct edit permissions.
-
-
Constructor Details
-
CmsDirectEditJspIncludeProvider
public CmsDirectEditJspIncludeProvider()
-
-
Method Details
-
includeDirectEditElement
public static String includeDirectEditElement(javax.servlet.jsp.PageContext context, String jspIncludeFile, String element, String editTarget, String editElement, String editOptions, String editPermissions, 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
Description copied from interface:I_CmsDirectEditProviderInitialize method for a new instance of the direct edit provider.- Specified by:
initin interfaceI_CmsDirectEditProvider- Overrides:
initin 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_CmsDirectEditProviderInserts 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_CmsDirectEditProviderInserts 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_CmsDirectEditProviderInserts 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:
truein case a direct edit element was opened,falseotherwise- Throws:
javax.servlet.jsp.JspException- in case something goes wrong- See Also:
-
isManual
Returnsfalsebecause the JSP include provider does not support manual button placement.- Specified by:
isManualin interfaceI_CmsDirectEditProvider- Overrides:
isManualin classA_CmsDirectEditProvider- Parameters:
mode- the mode of the current direct edit element- Returns:
trueif this provider (currently) operates in manual mode- See Also:
-
newInstance
Description copied from interface:I_CmsDirectEditProviderCreates 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:
-