Lookup Lists

Lookup Lists were introduced in to the JCAM family of products to overcome a problem with the rerstrictValues functions. Once the number of entries in the restrictValues function become more that three or four entries the lists become cumbersome. To overcome this it is now possible to have external files hold the lists of values. These are called Lookup Lists. They are included into the CAM template through the use of the CAM extension mechanism.

The format of the external files is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<look:LookupList xmlns:look="http://jcam.org.uk/LookupLists" name="version">
  <look:item name="Version 1" type="V" alt="One">1.0</look:item>
  <look:item name="Version 1.1" type="M" alt="One dot one">1.1</look:item>
  <look:item name="Version 2" type="V" alt="Two">2.0</look:item>
  <look:item name="Version 2.1" type="M" alt="Two dot one">2.1</look:item>
</look:LookupList>

The name attribute is mandatory and should be unique within a CAM template. The example given is really too simple.

Each item must have a name and a value. The type and the alt values are optional. For validation purposes the value of the look:item is used to validate the contents of the field being checked.

The reason for the 4 fields of an item is that this is based on the contents of the ISO standard for code lists.

Within the lookup function it is possible to include a filter. The filter points to a field via an XPath statement that contains a value that will be used to filter the list against the type value. So in the example above, the xpath would have to point to a field taht contained the value of either V or M. If the value was M the allowed values for the field being check would be 1.1 and 2.1.

Editing Lookup Lists

Within the CAM editor it is possible to create and edit lookup lists. This short flash film shows how this is done.

Using Lists is a Template

Before a lists can be used within a template it must be imported first. This tutorial shows you what you need to do.