Terms and expressions used for extenders
Extender links and metadata filters use Apache Velocity Template Language (VTL – version 1.7 and VelocityTools version 2.0). Extenders for Objective
Object |
Reference name |
Example |
---|---|---|
Current object |
(unqualified) |
${id} is the object id of the current object. |
Current user |
currentUser |
${currentUser.name} is the name of the current user. |
Current timestamp |
date |
${date} is the current timestamp. See the Velocity DateTool for how to format dates. |
Configuration parameters in Constants.xml |
constants |
${constants.APPSERVER_HOST_1} is the value of the APPSERVER_HOST_1 parameter in Constants.xml. |
URL expression |
Example |
---|---|
Basic |
https://8objsydconnect.objective.com:8443/agent/confirm-share.xhtml?folderId=${id}&folderName=${name}&userId=${currentUser.id}&usersName=${currentUser.name}&shareType=publication |
Conditional logic using #if/#elseif/#else |
/api/resources/#if(${type} == "document")documents#elseif(${type} == "folder")folders}#{else}files#end/$id |
Single-valued catalogue field |
${fields.value("My Field 1")} ${fields.valueByFieldId("tA123")} |
Multi-valued catalogue field |
The getValuesByFieldId method returns an array. The values in the array can be referenced by the index in the array. For example: ${fields.values("My Field 2")[0]} ${fields.valuesByFieldId("tA124")[0]} |
Loops using #foreach |
More useful that the previous example, this expression loops through all the values of a multi-valued catalogue field returned in an array, allowing you to create a URL or a filter that depends on multiple values: #foreach( $fieldValue in ${fields.values("My Field 2")} ),$fieldValue#end |
Escaping special characters |
The following characters are special characters in VTL: $ # \ " ' ! To use these as literal characters in an expression, they need to be escaped. For example: $esc.dollar will escape the dollar character. See the Velocity EscapeTool for more examples. Any value within {} does not get evaluated. For example: {$ref} evaluates to $ref. |
Metadata filter expression |
$state == "DRAFT" && $extension == "docx" && $fields.value("My Field 1") == "Marketing" |