ROADS Logo

Introduction and contents | Previous | Next

Day 5 - 12:00 pm Configuring the ROADS Template Editor


Having already made the changes I wanted in to the files in /roads-v2.1/config/mktemp-views/ I decided to tackle the files in the /roads-v2.1/config/multilingual/UK-English/mktemp/ directory first. I began with the editformhead.html which gives the header for the template editor screen. I edited both this and editformtail.html to tidy up the header and footer. I also wanted to change the main form layout as well however. Again this would require a little script hacking.

I used the 'perl -spi -e' option to change the HTML generated by /roads-v2.1/lib/mktemp-editform.pl file:

N.B. A warning from Jon Knight: - The one liner doesn't work under csh on Suns; it really needs to be:
perl -spi -e "s/<STRONG>/<BR><STRONG>/g" * 
otherwise it just blows up.

N.B. Be sure to take a copy of this file before touching it.

perl -spi -e 's!<TEXTAREA!<TEXTAREA WRAP=""!g' mktemp-editform.pl
perl -spi -e 's!WRAP=""!WRAP="VIRTUAL"!g' mktemp-editform.pl
perl -spi -e 's!H2>!H4>!g' mktemp-editform.pl
perl -spi -e 's!H1>!H3>!g' mktemp-editform.pl
perl -spi -e 's!<TD ALIGN="TOP">!<P>!g' mktemp-editform.pl
perl -spi -e 's!</TD>!</P>!g' mktemp-editform.pl
perl -spi -e 's!</TABLE>!!g' mktemp-editform.pl
perl -spi -e 's!<TABLE>!!g' mktemp-editform.pl
perl -spi -e 's!<TR>!!g' mktemp-editform.pl
perl -spi -e 's!</TR>!!g' mktemp-editform.pl
perl -spi -e 's!<UL>!!g' mktemp-editform.pl
perl -spi -e 's!</UL>!!g' mktemp-editform.pl
perl -spi -e 's!<LI>!<BR>!g' mktemp-editform.pl

I removed the table elements in order to place the field label at the top left of the form element rather than on the same line. This meant I could make my text boxes and text areas larger and easier to fill in. At the same time I added 'WRAP="VIRTUAL" attributes to any TEXTAREAs generated as this improves the usability of the interface enormously.

ROADS template editor

ROADS template editor

Having done all this I noticed that my Subject cluster was not displaying properly. This was because I had made a typo in the /roads-v2.1/config/mktemp-views/service file.

I decided that I only wanted two fields from the Author and Admin clusters displayed in my DOCUMENT and SERVICE templates so I edited the corresponding files in the /roads-v2.1/config/mktemp-views/ directory and replaced the relevant lines as follows:


Author-Name:Common elements:
Author-Email:Common elements:
Admin-Name:Quick Edit:Common elements:
Admin-Email:Quick Edit:Common elements:

I decided that I wanted the 'Variant' and 'Cluster' buttons tidier and smaller on my installation so I edited the mktemp-editform.pl script again to do this.

I was still unhappy about the excess buttons which were displayed so I decided to take these clusters out of the template outlines themselves. I cd'd to the /roads-v2.1/config/outlines/ directory and edited the 'service' and 'document' files to remove the 'Owner', 'Sponsoring', 'Relation' and 'Publisher' clusters from 'service' and all the 'Owner', 'Relation' and 'Sponsoring' clusters from 'document'. I also took the opportunity to resize a number of the fields.

Tip: To change the size of the TEXT and TEXTAREA form elements in the template editor you must change the field entry in the corresponding file in the /roads-v2.1/config/outlines/ directory. The first two settings are for the number of columns and rows of the corresponding form element (each setting is separated by a colon ':'). So to set the Title field in the SERVICE template type to 60 columns by 2 rows you would have the following entry in the /roads-v2.1/config/outlines/service file:

Template-Type:           SERVICE

Handle::::m:
Template-Version:::1:o:
Title:60:2::m:

I decided to add a default 'Subject', 'Admin' and 'Author' cluster to my 'Quick Edit' template view so I edited my Admin. Centre HTML to include this in the form.

<INPUT TYPE="hidden" NAME="clusterSubject" VALUE="1">

<INPUT TYPE="hidden" NAME="clusterAdmin" VALUE="1">
<INPUT TYPE="hidden" NAME="clusterAuthor" VALUE="1">
<INPUT TYPE="hidden" NAME="variantsize" VALUE="1">

I thought that next I should go back and finish off the files in the /roads-v2.1/config/multilingual/UK-English/mktemp/ directory. I had decided to tackle the clusterhead.html, clusteronlybottom.html and clustervariantsize.html files. It occurred to me however that these files were somewhat redundant now it was possible to add new clusters and variants direct from the main editor form. I decided to edit the /roadsv2.1/lib/ROADS/Render.pm file again and include the following lines in the admin.pl search results forms to skip this step in the editing process. N.B. This is NOT a good idea if you intend to use template types other than those I have chosen. You will need to add a line for every cluster in every template outline you use.

<INPUT TYPE="hidden" NAME="asksize" VALUE="sizes">

<INPUT TYPE="hidden" NAME="partdone" VALUE="yes">
<INPUT TYPE="hidden" NAME="clusterSubject" VALUE="0">
<INPUT TYPE="hidden" NAME="clusterPublisher" VALUE="0">
<INPUT TYPE="hidden" NAME="clusterAdmin" VALUE="0">
<INPUT TYPE="hidden" NAME="clusterAuthor" VALUE="0">
<INPUT TYPE="hidden" NAME="variantsize" VALUE="0">

I also noticed that any fields with notes attached looked messy. To fix this I added breaks in the /roads-v2.1/config/multilingual/UK-English/mktemp-notes/ files.

perl -spi -e 's!<STRONG>!<BR><STRONG>!g' *

Going back to the /roads-v2.1/config/multilingual/UK-English/mktemp/ directory I decided to edit the addedok.html and editedok.html files. Again I just used pico.

I also tidied up the missingmandatory.html file. After that I used the perl -spi option to remove the style sheet references in all the files in this directory and switched all <H1> tags to <H3> and all <H2> tags to <H4>.

I decided to make the background colour of the template editor change depending on which template type had been chosen. I did this with a style sheet, calling it the same name as the template type:

<LINK REL="StyleSheet" HREF="/<HTDOCS>/<TEMPLATETYPE>.css" TYPE="text/css">

I had now nearly finished configuring my gateway :-) There was just the subject listings to do.


Introduction and contents | Previous | Next

Last updated: February 1999 - paul.hollands@bris.ac.uk