Installation Instructions
templateDokuJob is a script written in TCL, intended to be implemented in Infopark's CMS Fiona. templateDokuJob generates an overview of a site's layout files (templates). This document explains how the script is integrated into an instance of the CMS.
Licence
templateDokuJob has been developed by Jetaido GmbH and is released as free software, licenced via the GPL. You have the right to freely install and distribute it. We distribute templateDokuJob without any warranty or responsibility for any damages that might occur to your system.
Requirements
You need
- a running version of Infopark CMS Fiona (developed and tested in version 6.6.0)
- write access to the folder instance/default/scripts/cm/serverCmds of the Infopark CMS Fiona installation directory
- the right to add a new job to Infopark CMS Fiona (this is usually granted to members of the administrators group)
- and of course a copy of the file templateDokuJob.tcl, that you can download here
Implementation
Step 1: Copy the script
Copy the file templateDokuJob.tcl into your instance/default/scripts/cm/serverCmds folder. Make sure it is accessible for your 'nps' user. Restart the CM process so that the tcl file is sourced.
Step 2: Create a file for the job's output
Create the file in which you want to save the output of the script. In this example, we create a file "templateDoku" in the folder /misc/docu of our CMS. Make sure, that the file is of an appropriate type (folder or document file). Remember the file's full path, as we need this information later to configure the job.
(You can click on any of the images to enlarge them.)
Step 3: Create a new Job
Create a new job by clicking on "Extras", "System Configuration", "Jobs" and "New".
You can enter the following information:
Name: "templateDokuJob"
Title: "Documentation Job for a site's templates"
Comment: "Creates a documentation of the layout files (templates) involved in building a site"
Schedule: Select "Create Schedule", "Minute 1", "Hour 1", "Monday", "Ok" for the job to be executed on each monday at 01:01 o'clock.
Script: Copy the following code into the script field:
#config
set file "/business/overview"
set docuFile "/misc/docu/templateDoku"
set releaseFile no
#action
set result 1
set docu [templateDokuJob $file mastertemplate]
#saving results
catch {obj withPath $docuFile edit}
catch {obj withPath $docuFile take}
obj withPath $docuFile editedContent set blob $docu
obj withPath $docuFile editedContent resolveRefs
if {releaseFile == "yes"} {
catch {obj withPath $docuFile release}
}
Make sure you replace the value of the variable 'docuFile' in the code with the full path of the file you created in step 2.
Make also sure you replace the value of the variable 'file' with the full path of a file of your site that you want to use as a starting point for the template documentation. The 'file' parameter is necessary to calculate which templates are used. Starting from the given file the valid template versions are found.
If you want to release the file, that contains the templateDoku, simply change the value of the variable releaseFile from 'no' to 'yes'. The templateDoku will then be published.
Step 4: Run the Job
Save the new job and run it. After some seconds, you can view the file, that you created in Step 2 using the internal preview of the Infopark CMS Fiona. You should see a list of all layouts that are directly or indirectly used by the file's mastertemplate.
Please note: Only layout files (templates) referenced by the valid mastertemplate will be listed.
Main content layouts and unused layouts will not appear in the list.
You may want to start your layout files with
<npsgui><!-- here goes some comment --></npsgui>
to add value to the output of the job and have a better documentation of your layout files.