Formula Fields in Cumulus

You can use Cumulus formula based fields values to automatically change the label colour of a database record based on the value of another field such as, in this case, “Copyright Status”. This greatly helps identify digital assets where the copyright has either expired or needs to be defined.

To edit the properties of the label field within Cumulus navigate to the field properties button and field values tab:

Cumulus -> Preferences -> Catalog Settings -> Record Fields -> Label -> Properties -> Field Values.

Choose “Use formula based field values” for the Field Value Mode.

Insert the following code into the Field Values Formula dialog box.

(fieldValue("Copyright Status",true)) == "Royalty Free
Stock Images" ? "4" : (fieldValue("Copyright Status"
true)) == "Commissioned Images" ? "5" : (fieldValue(
"Copyright Status", true)) == "Partner Images" ? "2"
: 1

The numerical value referenced within the formula code represents the colour that the label field will be changed to. i.e. RED = 1, GREEN = 4, BLUE = 5 and ORANGE = 2.

Set the “On Formula Error” setting.

The Copyright Status field is of type string list with three pre-defined values.

  1. Commissioned Images
  2. Partner Images
  3. Royalty Free Stock Images

Cumulus XSL translation

Use the XSL script shown below to format an XML file obtained from exporting user meta data from the Users catalog using the workgroup server client program within Canto Cumulus. The code helps creates a tab delimited text file containing four fields: Email Address, Login Name, First Name & Last Name. Choose “Apply XSL Transformation” and select the pre-prepared script when using the File -> Export drop-down menu used for exporting Cumulus record meta data.

<?xml version="1.0" encoding="UTF-8"?>
<!--
    Document   : UserExport.xsl.xml
    Created on : 1 Sept 2019
    Author     : Sam Martin
    Description: The goal is to transform the Cumulus XML Export file to a text 
    file which is tab delimited.
-->
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ns="http://www.canto.com/ns/Export/1.0"
    xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output method="text" indent="yes" encoding="utf-8" standalone="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
	<Root>
                <xsl:text>E-Mail Address&#09;Login Name&#09;First Name&#09;Last Name&#10;</xsl:text>
		<xsl:apply-templates select="/ns:Export/ns:Items/ns:Item"/>
	</Root>
</xsl:template>
<xsl:template match="ns:Item">
	<xsl:for-each select="ns:FieldValue">
		<xsl:value-of select="normalize-space(text())"/>
		<xsl:text>&#09;</xsl:text>
        </xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>