The editable() method

This method includes direct edit scriptlets, nescessary to use the direct edit feature for page elements.

It must be set inside the HTML head to use the "editable" parameter  in the include method for page elements.

In the generated HTML page, the tag is replaced by the JavaScript code, nescessary for direct editing.

You can also define different direct edit providers. A direct edit provider generates the direct edit buttons.

 

Parameters:

 

Name Description
java.lang.boolean isEditable Includes the direct edit scriptlet only if set to "true".

Parameters:

Name Description
java.lang.boolean isEditable see above
java.lang.String filename Path of a file in the OpenCms VFS which  filename for the direct edit provider.

 

Parameters:

Name Description
java.lang.String provider the direct edit provider class name
java.lang.String mode Mode of the provider. Can  be "AUTO" for automatic placement of the direct edit buttons or "MANUAL".
java.lang.String filename Path of a file in the OpenCms VFS which  filename for the direct edit provider. (can be null)

 

 

To place the  direct edit buttons manually, you must use the following methods to mark the start and (optionally) the end where the HTML-Code of the buttons should be included in your template:

The editableManualOpen() method

This method marks the start where the direct edit code should be placed. The method returns a boolean value that is used in the following method:

The editableManualOpen() method

Parameters:

Name Description
java.lang.boolean needsClose The result of the ediableManualOpen() method must be used here.

 

Example usage:

Include the direct edit scriptlet.

org.opencms.jsp.CmsJspActionElement cms = 
new org.opencms.jsp.CmsJspActionElement(pageContext, request, response);

cms.editable(true);

 

Include the direct edit scriptlet for the text button provider

org.opencms.jsp.CmsJspActionElement cms = 
new org.opencms.jsp.CmsJspActionElement(pageContext, request, response);

cms.editable("org.opencms.workplace.editors.directedit.CmsDirectEditTextButtonProvider",
"AUTO", null);