Class A_CmsDirectEditProvider
java.lang.Object
org.opencms.workplace.editors.directedit.A_CmsDirectEditProvider
- All Implemented Interfaces:
Cloneable,I_CmsConfigurationParameterHandler,I_CmsDirectEditProvider
- Direct Known Subclasses:
CmsAdvancedDirectEditProvider,CmsDirectEditDefaultProvider,CmsDirectEditJspIncludeProvider
Basic functions for direct edit providers.
- Since:
- 6.2.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringDefault direct edit include file URI for post 6.2.3 direct edit providers.protected CmsObjectThe current users OpenCms context.protected CmsParameterConfigurationThe parameters form the configuration.protected intThe editor button style to use.protected StringValue of the "fileName" parameter.protected CmsMessagesUsed to access the editor messages.protected CmsDirectEditModeIndicates which direct edit mode is used.protected RandomUsed to generate the edit id's.Fields 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 TypeMethodDescriptionvoidaddConfigurationParameter(String paramName, String paramValue) Adds a configuration parameter to this parameter configurable class instance.Returns the parameters of this configurable class instance, ornullif the class does not need any parameters.protected StringReturns the given link resolved according to the OpenCms context and export rules.protected StringReturns the next random edit id.getResourceInfo(CmsDirectEditParams params, String resourceName) Calculates the direct edit resource information for the given VFS resource.voidinit(CmsObject cms, CmsDirectEditMode mode, String fileName) Initialize method for a new instance of the direct edit provider.voidInitializes a configuration after all parameters have been added.voidinsertDirectEditEmptyList(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) Inserts the direct edit HTML for empty lists in the provided JSP page context.voidinsertDirectEditListMetadata(javax.servlet.jsp.PageContext context, I_CmsContentLoadCollectorInfo info) Inserts HTML used as metadata for a collector list in the current JSP context.booleanisManual(CmsDirectEditMode mode) Returnstrueif this provider (currently) operates in manual mode.protected voidPrints the given content string to the given page context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencms.workplace.editors.directedit.I_CmsDirectEditProvider
insertDirectEditEnd, insertDirectEditIncludes, insertDirectEditStart, newInstance
-
Field Details
-
INCLUDE_FILE_DEFAULT
Default direct edit include file URI for post 6.2.3 direct edit providers.- See Also:
-
m_cms
The current users OpenCms context. -
m_configurationParameters
The parameters form the configuration. -
m_editButtonStyle
The editor button style to use. -
m_fileName
Value of the "fileName" parameter. -
m_messages
Used to access the editor messages. -
m_mode
Indicates which direct edit mode is used. -
m_rnd
Used to generate the edit id's.
-
-
Constructor Details
-
A_CmsDirectEditProvider
public A_CmsDirectEditProvider()
-
-
Method Details
-
addConfigurationParameter
Description copied from interface:I_CmsConfigurationParameterHandlerAdds a configuration parameter to this parameter configurable class instance.- Specified by:
addConfigurationParameterin interfaceI_CmsConfigurationParameterHandler- Parameters:
paramName- the name of the parameterparamValue- the value for the parameter- See Also:
-
getConfiguration
Description copied from interface:I_CmsConfigurationParameterHandlerReturns the parameters of this configurable class instance, ornullif the class does not need any parameters.- Specified by:
getConfigurationin interfaceI_CmsConfigurationParameterHandler- Returns:
- the parameters of this configurable class instance,
or
nullif the class does not need any parameters - See Also:
-
getResourceInfo
Calculates the direct edit resource information for the given VFS resource.This includes the direct edit permissions. If the permissions are not
CmsDirectEditPermissions.INACTIVE, then the resource and lock information is also included in the result.- Parameters:
params- the direct edit parametersresourceName- the name of the VFS resource to get the direct edit info for- Returns:
- the direct edit resource information for the given VFS resource
-
init
Description copied from interface:I_CmsDirectEditProviderInitialize method for a new instance of the direct edit provider.- Specified by:
initin interfaceI_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:
-
initConfiguration
Description copied from interface:I_CmsConfigurationParameterHandlerInitializes a configuration after all parameters have been added.- Specified by:
initConfigurationin interfaceI_CmsConfigurationParameterHandler- Throws:
CmsConfigurationException- if something goes wrong- See Also:
-
insertDirectEditEmptyList
public void insertDirectEditEmptyList(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) throws javax.servlet.jsp.JspException Description copied from interface:I_CmsDirectEditProviderInserts the direct edit HTML for empty lists in the provided JSP page context.- Specified by:
insertDirectEditEmptyListin interfaceI_CmsDirectEditProvider- Parameters:
context- the JSP page context to insert the HTML toparams- the parameters for the direct edit call- Throws:
javax.servlet.jsp.JspException- in case something goes wrong- See Also:
-
isManual
Description copied from interface:I_CmsDirectEditProviderReturnstrueif this provider (currently) operates in manual mode.In manual mode the direct edit HTML is inserted with
<cms:enditable mode="manual" /invalid input: '>'tags. Otherwise the direct edit HTML is automatically inserted in the current page.Some providers may not be able to operate in manual mode. These will always return
false.- Specified by:
isManualin interfaceI_CmsDirectEditProvider- Parameters:
mode- the mode of the current direct edit element- Returns:
trueif this provider (currently) operates in manual mode- See Also:
-
getLink
Returns the given link resolved according to the OpenCms context and export rules.- Parameters:
target- the link target to resolve- Returns:
- the given link resolved according to the OpenCms context and export rules
-
getNextDirectEditId
Returns the next random edit id.Random edit id's are used because to separate multiple direct edit buttons on one page.
- Returns:
- the next random edit id
-
print
protected void print(javax.servlet.jsp.PageContext context, String content) throws javax.servlet.jsp.JspException Prints the given content string to the given page context.Does not print anything if the content is
null.- Parameters:
context- the JSP page context to print the content tocontent- the content to print- Throws:
javax.servlet.jsp.JspException- in case the content could not be written to the page conext
-