public class CmsDirectEditJspIncludeProvider extends A_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.
限定符和类型 | 字段和说明 |
---|---|
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. to control which direct edit buttons are displayed
|
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.
|
INCLUDE_FILE_DEFAULT, m_cms, m_configurationParameters, m_editButtonStyle, m_fileName, m_messages, m_mode, m_rnd
ATTRIBUTE_DIRECT_EDIT_PROVIDER, ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD
构造器和说明 |
---|
CmsDirectEditJspIncludeProvider() |
限定符和类型 | 方法和说明 |
---|---|
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)
Returns
false 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.
|
addConfigurationParameter, getConfiguration, getLink, getNextDirectEditId, getResourceInfo, initConfiguration, insertDirectEditEmptyList, print
public static final java.lang.String DIRECT_EDIT_AREA_END
public static final java.lang.String DIRECT_EDIT_AREA_START
public static final java.lang.String DIRECT_EDIT_INCLUDE_FILE_URI_DEFAULT
public static final java.lang.String DIRECT_EDIT_INCLUDES
public static final java.lang.String DIRECT_EDIT_PARAM_BUTTONSTYLE
public static final java.lang.String DIRECT_EDIT_PARAM_ELEMENT
public static final java.lang.String DIRECT_EDIT_PARAM_LOCALE
public static final java.lang.String DIRECT_EDIT_PARAM_NEWLINK
public static final java.lang.String DIRECT_EDIT_PARAM_OPTIONS
public static final java.lang.String DIRECT_EDIT_PARAM_TARGET
protected java.lang.String m_editElement
protected java.lang.String m_editTarget
protected java.lang.String m_permissions
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
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 linkjavax.servlet.jsp.JspException
- in case something goes wrongpublic void init(CmsObject cms, CmsDirectEditMode mode, java.lang.String fileName)
I_CmsDirectEditProvider
init
在接口中 I_CmsDirectEditProvider
init
在类中 A_CmsDirectEditProvider
cms
- the current users OpenCms contextmode
- the direct edit mode to usefileName
- link to a file that contains the direct edit HTML elements (optional)A_CmsDirectEditProvider.init(org.opencms.file.CmsObject, org.opencms.workplace.editors.directedit.CmsDirectEditMode, java.lang.String)
public void insertDirectEditEnd(javax.servlet.jsp.PageContext context) throws javax.servlet.jsp.JspException
I_CmsDirectEditProvider
context
- the JSP page context to insert the HTML tojavax.servlet.jsp.JspException
- in case something goes wrongI_CmsDirectEditProvider.insertDirectEditEnd(javax.servlet.jsp.PageContext)
public void insertDirectEditIncludes(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) throws javax.servlet.jsp.JspException
I_CmsDirectEditProvider
context
- the JSP page context to insert the HTML toparams
- the parameters for the direct edit includesjavax.servlet.jsp.JspException
- in case something goes wrongI_CmsDirectEditProvider.insertDirectEditIncludes(javax.servlet.jsp.PageContext, org.opencms.workplace.editors.directedit.CmsDirectEditParams)
public boolean insertDirectEditStart(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) throws javax.servlet.jsp.JspException
I_CmsDirectEditProvider
context
- the JSP page context to insert the HTML toparams
- the parameters for the direct edit calltrue
in case a direct edit element was opened, false
otherwisejavax.servlet.jsp.JspException
- in case something goes wrongI_CmsDirectEditProvider.insertDirectEditStart(javax.servlet.jsp.PageContext, org.opencms.workplace.editors.directedit.CmsDirectEditParams)
public boolean isManual(CmsDirectEditMode mode)
false
because the JSP include provider does not support manual button placement.isManual
在接口中 I_CmsDirectEditProvider
isManual
在类中 A_CmsDirectEditProvider
mode
- the mode of the current direct edit elementtrue
if this provider (currently) operates in manual modeI_CmsDirectEditProvider.isManual(org.opencms.workplace.editors.directedit.CmsDirectEditMode)
public I_CmsDirectEditProvider newInstance()
I_CmsDirectEditProvider
I_CmsDirectEditProvider.newInstance()