Using Your Own Tcl Procedures

In any file, you can define your own Tcl procedures that you personally want available every time you start the Tcl shell. You can read them in using the Tcl command source.

During the initialization procedure, Tcl scripts are read from the following directories.

share/script/common/clientCmds
share/script/app/clientCmds
share/script/common/serverCmds
share/script/app/serverCmds

instance/default/script/common/clientCmds
instance/default/script/app/clientCmds
instance/default/script/common/serverCmds
instance/default/script/app/serverCmds

In the paths listed above, app stands for the application-specific script directory cm or ses. Please note that the Template Engine reads the scripts of the Content Management Server at startup. Scripts in the common/clientCmds and common/serverCmds directories are read by all applications at startup.

Scripts contained in the directories listed in the first group are common to all instances and are read by the corresponding CMS applications, independently of the instance.

You can place your instance-specific scripts in the directories listed in the second group. These scripts are read after the scripts of the first group so that procedures stemming from the first group can be redefined by instance-specific procedures if required.

Tcl scripts make it much easier to carry out repetitive and difficult tasks. You should check the functionality of your scripts with test data first, before working with the production data. In most cases, it is not possible to undo changes made with a script without difficulty.