Class CmsAdvancedDirectEditProvider
- java.lang.Object
-
- org.opencms.workplace.editors.directedit.A_CmsDirectEditProvider
-
- org.opencms.workplace.editors.directedit.CmsAdvancedDirectEditProvider
-
- All Implemented Interfaces:
java.lang.Cloneable
,I_CmsConfigurationParameterHandler
,I_CmsDirectEditProvider
- Direct Known Subclasses:
CmsToolbarDirectEditProvider
public class CmsAdvancedDirectEditProvider extends A_CmsDirectEditProvider
Provider for the OpenCms AdvancedDirectEdit.Since OpenCms version 8.0.0.
This provider DOES NOT support
CmsDirectEditMode.MANUAL
mode.- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsAdvancedDirectEditProvider.SitemapDirectEditPermissions
Direct edit permissions according to the sitemap configuration.
-
Field Summary
Fields Modifier and Type Field Description protected int
m_lastPermissionMode
Indicates the permissions for the last element the was opened.protected boolean
m_useIds
True if the elements should be assigned randomly generated ids.-
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 CmsAdvancedDirectEditProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
endDirectEditDisabled()
Returns the end HTML for a disabled direct edit button.java.lang.String
endDirectEditEnabled()
Returns the end HTML for an enabled direct edit button.java.lang.String
getRandomId()
Generates a random element id.CmsDirectEditResourceInfo
getResourceInfo(CmsDirectEditParams params, java.lang.String resourceName)
Calculates the direct edit resource information for the given VFS resource.protected boolean
hasUploadSupport()
Checks if upload for binaries are supported by this 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.void
insertDirectEditListMetadata(javax.servlet.jsp.PageContext context, I_CmsContentLoadCollectorInfo info)
Inserts HTML used as metadata for a collector list in the current JSP 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.I_CmsDirectEditProvider
newInstance()
Creates a new instance of this direct edit provider with the same basic configuration.java.lang.String
startDirectEditDisabled(CmsDirectEditParams params, CmsDirectEditResourceInfo resourceInfo)
Returns the start HTML for a disabled direct edit button.java.lang.String
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, init, initConfiguration, insertDirectEditEmptyList, print
-
-
-
-
Field Detail
-
m_lastPermissionMode
protected int m_lastPermissionMode
Indicates the permissions for the last element the was opened.
-
m_useIds
protected boolean m_useIds
True if the elements should be assigned randomly generated ids.
-
-
Constructor Detail
-
CmsAdvancedDirectEditProvider
public CmsAdvancedDirectEditProvider()
-
-
Method Detail
-
endDirectEditDisabled
public java.lang.String endDirectEditDisabled()
Returns the end HTML for a disabled direct edit button.- Returns:
- the end HTML for a disabled direct edit button
-
endDirectEditEnabled
public java.lang.String endDirectEditEnabled()
Returns the end HTML for an enabled direct edit button.- Returns:
- the end HTML for an enabled direct edit button
-
getRandomId
public java.lang.String getRandomId()
Generates a random element id.- Returns:
- a random element id
-
getResourceInfo
public CmsDirectEditResourceInfo getResourceInfo(CmsDirectEditParams params, java.lang.String resourceName)
Description copied from class:A_CmsDirectEditProvider
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.- Overrides:
getResourceInfo
in classA_CmsDirectEditProvider
- 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
- See Also:
Similar to the method in the superclass, but removes the write permission check, as this is handled differently.
-
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)
-
insertDirectEditListMetadata
public void insertDirectEditListMetadata(javax.servlet.jsp.PageContext context, I_CmsContentLoadCollectorInfo info) throws javax.servlet.jsp.JspException
Description copied from interface:I_CmsDirectEditProvider
Inserts HTML used as metadata for a collector list in the current JSP context.- Specified by:
insertDirectEditListMetadata
in interfaceI_CmsDirectEditProvider
- Overrides:
insertDirectEditListMetadata
in classA_CmsDirectEditProvider
- Parameters:
context
- the current JSP contextinfo
- the collector lsit information- Throws:
javax.servlet.jsp.JspException
- if something goes wrong- See Also:
A_CmsDirectEditProvider.insertDirectEditListMetadata(javax.servlet.jsp.PageContext, org.opencms.gwt.shared.I_CmsContentLoadCollectorInfo)
-
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 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:
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()
-
startDirectEditDisabled
public java.lang.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 java.lang.String startDirectEditEnabled(CmsDirectEditParams params, CmsDirectEditResourceInfo resourceInfo) throws JSONException
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
- Throws:
JSONException
- if a JSON handling error occurs
-
hasUploadSupport
protected boolean hasUploadSupport()
Checks if upload for binaries are supported by this provider.- Returns:
- true if binary upload is supported
-
-