npsGuiControl

By means of subelements, this element allows you to perform particular actions in the GUI web application.

The available actions are npsRefresh for reloading the file hierarchy, npsSelect for selecting a file, and npsCommit for informing the GUI about changes to the draft version of a file.

Reloading the File Hierarchy

<npsGuiControl>
  <npsRefresh identifier="id" depth="depth"/>
</npsGuiControl>

npsRefresh is an empty element that has the following attributes:

  • identifier: The value of this attribute, id, determines the ID of the CMS file to update.
  • depth determines the scope of the update process and can be one of the following values:
    • node: Only the specified file is updated.
    • children: The file and, in case of folders, all its immediate subfiles are updated.
    • subtree: The subtree of which the file is the root is updated.

Selecting a File

<npsGuiControl>
  <npsSelect identifier="id"/>
</npsGuiControl>

Using npsSelect, a file in the file hierarchy can be selected. identifier has the same meaning as with npsRefresh.

Informing the GUI about Content Changes

<npsGuiControl>
  <npsCommit value="true"/>
</npsGuiControl>

If you have specified a wizard for editing a field, the GUI ensures that the requirements for editing are met, for example by creating a draft version of the file concerned.

To inform the GUI about changes to the version, use npsCommit. If this is omitted, the version might be reverted, meaning that the changes are lost.

Usage in Wizards

NpsGuiControl elements can be comfortably generated in wizards by calling helper procedures part of the share/script/cm/serverCmds/wizardLib.tcl Tcl library.

Reloading the File Hierarchy
addNpsRefresh obj_id depth

Creates an npsRefresh element.

  • obj_id ID of the file to be reloaded.
  • depth Depth of the refresh.
    • node: Only the specified file is updated.
    • children: The file and, in case of folders, all its direct subfiles are updated.
    • subtree: The subtree of which the file is the origin is updated.

Example:

addNpsRefresh 2001 subtree
Selecting a File
addNpsSelect obj_id

Creates an npsSelect element.

  • obj_id ID of the file to be selected.

Example:

addNpsSelect 2001
Informing the GUI about Content Changes
addNpsCommit obj_id

Creates an npsCommit element.

  • obj_id ID of the CMS file that was changed and should be reloaded by the GUI.

Example:

addNpsCommit 2001