How to customize vovserver browser UI template fill-in pages


Background

The VOV browser user interface pages are a mix of older template-based pages filled in by vovserver, and newer CGI-based pages that are based on the VTK API.

This article describes how to customize the template-based pages, which are stored in $VOVDIR/etc/html

A typical template-based page has a header, body, and footer template, named like page.head, page.body, and page.footer.

Such pages contain a mix of literal HTML text, JavaScript, and fields that are indicated by @VARIABLE-NAME@.  
IMPORTANT: vovserver  loads and caches these templates at startup, and when the 'sanity check' command is received.

When rendering such a page, the vovserver fills in each @FIELD@ with values from its memory, then hands off the resulting stream of text to  the 'vovbytepump' binary, which sends the text to the browser client that requested the page.   This is done so that vovserver does not block while sending the page, which can be large in some cases.

Customizing

To customize a page, it is helpful to first load it and view the source, which will contain comments identifying the name of the template file, like
<!-- template project.start -->

There is a search path for the template files, which includes $VOVDIR/etc/html and <swd>/html, so it is best to test your modifications by copying files into a specific project's html subdirectory for testing.

Locate the template files that you need to modify in $VOVDIR/etc/html and copy them into your project's html subdirectory.  Note that LA, LM, and NC have product-specific project.start files, and that these are found under corresponding subdirectories.

After locating the part of the template that produces the part of the page you want to modify, edit your project's local file as needed, then save the file and run 'sanity check' to re-load the templates into vovserver.

View the page again in your browser, making sure that the page is not cached in the browser, e.g. by force-reloading.

Example:  Modifying the NC home page

A customer preferred the template-based Running Jobs page to the newer CGI-based one.   We showed them how to change the home-page link to show the template page, adding a link for the CGI-based page for those who want it.

This was done by copying $VOVDIR/etc/html/nc/project.start into the project-specific html directory and making the change shown by the following ed() script:

103c
<tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="white"><td><img src="@JOBS_RUNNING_ICON@" alt="" border="0" width="17" height="17"><a href="/running">Running&nbsp;jobs</a>&nbsp;<a href="/cgi/jobs.cgi">[cgi]</a></td><td align="right">@JOBS_RUNNING@&nbsp;</td></tr>
w project.start
q

This changed the default 'Running jobs' link back to the template page /running, and adds the  [cgi] link to the client-side CGI page.