Description

The DirectEditContextObject is a Velocity Context Object for the OpenCms Module "at.infonova.opencms.modules.velocity" from Infonova Gmbh.

OpenCms is a Content Management System that is based on Open Source Software. Complex Intranet and Internet websites can be quickly and cost-effectively created, maintained and managed.

Config

This ContextObject must be configured in "WEB-INF/config/infonova-velocity.xml".

The entry could look like the following:

<opencms>
  <velocity>
    <velocity-context-objects>
      [...]
      <velocity-context-object
        name="directEdit"
        factory-class="at.infonova.opencms.modules.velocity.contextobjects.DirectEditContextObject$Factory" />
    </velocity-context-objects>
  </velocity>
</opencms>

After configuration the ContextObject a reboot of OpenCms is required.

Example Usage

After configuration the ContextObject it is available in all Velocity templates which are parsed by the OpenCms Module "at.infonova.opencms.modules.velocity" from Infonova Gmbh.

The default prefix of this ContextObject should be 'directEdit'.

After that, the following Methods are available:

  • ${directEdit.help} => This helptext.
  • ${directEdit.editable} => Marks the Request as Editable and returns the HTML Javascript code to enable DirectEdit.
  • ${directEdit.start} => returns the Start-TAG for DirectEdit of structured Content (XML-Content).
  • ${directEdit.start(java.lang.String element)} => returns the Start-TAG for DirectEdit Container of free text (XML-Page) and for the given element.
  • ${directEdit.startXmlContent(java.lang.String resourceName)} => returns the Start-TAG for DirectEdit Container of structured Content (XML-Content) for the given ReosourceName. Nested DirectEdit Container are allowed.
  • ${directEdit.end} => returns the End-TAG for DirectEdit.