Integrating the Template Engine

The Template Engine is responsible for incrementally exporting the content stored in the Content Management Server. To integrate the Template Engine into Fiona, please proceed as follows. Note, that under UNIX all commands need to be executed as the user who installed the CMS.

  • For all database types except SQLite:
    Create the database for the Template Engine first. Then edit the corresponding configuration file (for example config/oracle.xml) and enter its name in the server.xml file in the section te, entry database. The default is <database fileName="sqlite.xml"/>

  • Edit the file config/export.xml and set the value of export.incrementalUpdate.isActive to true.

  • If you wish to provide a search function on the live server, edit the file config/indexing.xml and set indexing.incrementalExport.isActive to true. Modify collectionSelection according to your preferences.

  • If necessary, create the required collections, by running the SES in single mode and executing the createCollection command.

  • To start and stop the Template Engine together with the other CMS applications in the future, add the TE to the list of applications in the start/stop script instance/default/config/rc.npsd.conf:

    set conf(apps) [list CM TE SES trifork]

    Please make sure that the CM is listed before the trifork because at startup the GUI requests data from the CM. The order of the other application shortcuts is irrelevant.

  • Run the Content Management Server in single mode to reset the incremental export and to publish the content:

    Attention: The command incrExport reset must only be used in single mode. It must only be executed if it is guaranteed that no write operations are performed on the data since this would corrupt the exported data. Therefore it is required to make sure the the CM is not running as a server and no other CMs are running or started in single mode while this command is being executed.

    # Under UNIX
    cd ~/FionaDir/instance/default/bin
    ./rc.npsd stop CM
    ./CM -single
    incrExport reset
    exit
    
    # Under Windows
    cd C:\Program Files\Infopark\FionaDir\instance\default\bin
    rc.npsd.bat stop CM
    CM -single
    incrExport reset
    exit

    See also the notes on jobs below.

  • Now start the CMS applications and execute the systemPublish job:

    # Under UNIX
    cd ~/FionaDir/instance/default/bin
    ./rc.npsd start
    ./client
    connect localhost 3001 root demo
    job withName systemPublish exec
    exit
    
    # Under Windows
    cd C:\Program Files\Infopark\FionaDir\instance\default\bin
    rc.npsd.bat
    client.bat
    connect localhost 3001 root demo
    job withName systemPublish exec
    exit
  • Using the the GUI or the Tcl client, configure the execution schedule of the Content Management Server's systemPublish job (see below) or execute this job manually each time you want the content to be transferred to the Template Engine.

  • Install a webserver to serve the exported documents from the directory instance/default/export/online/docs. Alternatively, configure the Trifork server so that it delivers the static documents.

Notes on Jobs

The predefined systemPublish job of the Content Management Server transfers updated data and versions from the Content Manager to the Template Engine. Then it instructs the Template Engine to export the data transferred and make the documents available to the server. This job can be executed manually using

job withName systemPublish exec

Additionally or alternatively the execution schedule of the job can be set so that the job is regularly executed, for example at midnight.:

job withName systemPublish set schedule {{minutes 0 hours 0}}

To transfer the updated data to the Template Engine without publishing them immediately, the systemTransferUpdates job can be used. This should be done after a large amount of data has been uploaded or updated.

For large websites where content is often modified it is recommended to use the systemTransferUpdates job several times a day to spread the load. The systemPublish job for initiating the publication process should be used less often.

Using the following example commands, you can define execution schedules for transferring the update information to the Template Engine every 15 minutes on working days and to publish the data daily at midnight:

job withName systemTransferUpdates set schedule \
  {{minutes {0 15 30 45} weekdays {1 2 3 4 5}}}
job withName systemPublish set schedule {{minutes 0 hours 0}}

The execution schedules can be edited comfortably in the GUI.