Site Manager Developer Manual / Version 2107
Table Of ContentsIn this chapter, you will learn how to extend the Site Manager with buttons and menu entries which call commands on the current selection. A command is called with a target as a parameter and it executes an operation on this target following the Command Pattern. Therefore, you need to register your command at a CommandManager.
Interface to implement
All commands implement the
Command interface.
You need to implement (or overwrite) the execute
and the isExecutable
methods. The
execute method gets the
Context and
target
as parameters (see Editor API for details).
Classes to subclass
There are a different predefined commands for different tasks. You can subclass each of them (or its subclasses) for your needs. Please refer to the Editor API for details.
Name | Description |
---|---|
CommandSequence | A command which consists of a sequence of simple commands. |
CreateProcessInstance | A command which creates a new WfProcessInstance from a WfProcess. |
EnumerationCommand | A command which operations on enumerations and executes the given Command. |
GlobalCommand | A GlobalCommand works on global, that is, application wide targets. It provides convenience methods to allow small and simple Commands. |
MapCommand | A generic command which works on a map. |
ResourceCommand | A command which works on resources. |
ResourceEnumerationCommand | A command which works on a set of resources. |
ResourceHolderCommand | A command which works on resource holders. |
SearchText | A command which searches for the text in text components. |
StringSelectionCommand | A command which acts on string selections. |
TextActionCommand | A command which bridges from commands to actions on text components. |
WfInstanceCommand | A command which works on a WfInstance. |
Table 4.6. Commands to subclass from
Integrate your command into the Site Manager using
editor.xml
There are no elements in the editor.xml
to integrate the commands directly. You need to subclass an
editor or view class.
Integrate the command into the document view
In this case you need to extend the
hox.corem.editor.generic.GenericDocumentView
class. The class can be added to theeditor.xml
file using the attributeviewClass
of the elementDocument
. See Section 4.8.3, “Add Command to Document View” for an example.Integrate the command into the explorer view
You simply need to set your own explorer view using the attribute
explorerViewClass
of the elementFrameFactory
in theeditor.xml
file. See Section 4.8.4, “Add Command to Explorer View” for an example.