The Content Navigator can be extended by additional commands to ease the work of editors and administrators.
Next to the Tcl or Java code that implements the functions of a custom command, the properties of such a command such as its name, multilingual titles, or required permissions need to be defined. Where and in which form this is done is described in this document. Finally, the command needs to be integrated into the menu or the toolbar or into the preview of the Content Navigator so that it can be used.
Three types of custom commands exist:
| Custom Command Type | Short Description |
|---|---|
| Tcl procedure | Tcl Script whose output is displayed in the browser |
| Wizard | Tcl script that creates and controls GUI dialogs |
| Servlet call | JSP or servlet that runs in the session and may read-access its data. |
Custom commands can be made available globally, i. e. independently of
files, for exactly one file, and for any number of files. Every command is
a bean entry in the itemRegistry.xml to be found
in the config directory of the the GUI web application, or in
the contentMenu.xml configuration file located in the
instance-specific config directory. An example:
<bean id="editImageWizard"
class="com.infopark.cm.htmlgui.browse.menuaction.CustomCommand">
<property name="titles"><map>
<entry key="en"><value>Image Editing</value></entry>
<entry key="de"><value>Bildbearbeitung</value></entry> </map>
</property>
<property name="selectionType"><value>single</value></property>
<property name="requiredObjectPermissions"><set>
<value>write</value>
<value>createChildren</value></set>
</property>
<property name="command">
<value>editImage::render</value>
</property>
<property name="dialog"><value>true</value></property>
<property name="objectTypes"><set>
<value>image</value></set>
</property>
<property name="necessaryPermission">
<value>wizardPermission</value>
</property>
</bean>
The elements and attributes in such a definition have the following meaning:
-
bean: Defines the custom command. The class to specify is the same for all commands.-
id: a unique identifier. -
class: must becom.infopark.cm.htmlgui.browse.menuaction.CustomCommand.
-
-
property name="titles": defines in themapsubelement the titles displayed in the GUI in the available languages. These languages are specified in thelocalizer.xy.xmlfiles (replacexywith the language code) thesharedirectory. -
property name="selectionType": Defines the scope of the command. In thevaluesublement one of the following values can be specified:-
nonefor global commands, -
singlefor commands that can be applied to exactly one file, -
extendedfor commands that can be applied to any number of files.
-
-
property name="requiredObjectPermissions": defines the file-specific permissions according to which file-specific menu commands (of thesingleorextendedselectionType) are filtered.singlemenu commands are not offered if the permissions have not been granted,extendedmenu commands are offered, however the filtered and not the original file list is passed to the corresponding command script. The permissionswrite,root, andcreateChildrencan be specified. -
property name="necessaryPermission": defines in thevaluesubelement the global permission which user must have been granted for being offered this command. You can specify one of the predefined global permissions well as any custom global permission such aswizardPermission, for example. -
property name="command": Defines in thevaluesubelement the name of the Tcl procedure to execute when the custom command is called. The procedure needs to be located in the instance-specificscript/cm/serverCmdsdirectory or in the corresponding directory belowFionaDir/share. -
property name="objectClasses": Defines in thesetsubelement a set of file formats to which the command is to be restricted. Insideset, each format is specified in avalueelement. If no file formats are specified then the command is not restricted to particular file formats. -
property name="objectTypes": Analogous to the restriction to file formats, commands can be restricted to a selection of the five file types. -
property name="servletURI": Specifies that the command has been implemented as a servlet. The URI of the servlet, relative to the GUI web applikation, is specified in thevaluesubelement. Apropertyelement withname="dialog"must not exist at the same time. -
property name="dialog": Determines that the command has been implemented as a wizard. Apropertyelement withname="servletURI"must not exist at the same time. The Tcl procedure that implements the wizard needs to be placed in the instance-specificscript/cm/serverCmdsdirectory or in the corresponding directory belowFionaDir/share. -
property name="dialogSize": Determines the size of the dialog window. Possible values are:-
tiny: see the dialog for changing the user's password as an example -
small: see the dialog for specifying the locally installed applications as an example -
large: see the window that is displayed when the Help -> About CMS Fiona menu command is selected from the menu -
parent: the same size as the window from which the wizard was opened – normally the main window -
none: no window; all output of the wizard is ignored
-
-
property name="outputsHtml": Specified whether the Tcl code returns HTML text (trueorfalse). IftrueHTML-specific characters are not converted and thehtml,body, andheadelements must not be present. -
property name="displayHeaderAndFooter": Specifies whether the header and footer areas are to be displayed or not (trueorfalse, respectively). If this item is missing,trueis assumed and the header and footer areas are displayed. If the header and footer areas are suppressed, not only the standard buttons but also the footer area buttons generated using thenpsButtontags (inButtonArea) are not present. -
property name="descriptions"andproperty name="sortKey": These optional elements change the way in which a wizard is listed on the Wizard Selection start area. As withtitles,descriptionsdefine the subtitles displayed in the available languages according to themapsubelement. By applying asortKey, you can modify the order of the wizards in the selection list.