...
When putting a string in metadata sidecar that has the pattern #{...}
it will be evaluated using the Spring Expression Language. Inside an expression, you can reference the metadata using R(<Dotted key>)
or record(<Dotted key>)
for example R('Descriptive.Title')
or record('Descriptive.Title')
. Only dotted keys having a field definition are allowed.
Info |
---|
The |
...
The output of the metadata accessor R
or record
is the following depending on which field type the dotted key refers to:
Level | Case | Effect | Example Expression | Example Output |
---|---|---|---|---|
Top | SimpleField | String |
|
|
Top | ListField | List of Strings |
|
|
Top | MapField | Map of Strings |
|
|
Top | MultiItemField | Map of List of Strings |
|
|
Top | Others | Not allowed | ||
Sub | Child of ListField | List of Strings |
|
|
Sub | Child of MultiItemField | List of Strings |
|
|
Sub | Child of MapField | String |
|
|
Sub | Other | Not allowed |
Output after evaluating the expression
After evaluating all expressions in the input metadata sidecar, the result is a new metadata sidecar in JSON. The conversion follows the following rules
Output after evaluating the expression | Conversion into JSON |
---|---|
| JSON string |
| JSON boolean |
| JSON number |
| JSON array |
| JSON object |
| JSON object containing JSON arrays |
Notice how the string "#{{R('Dynamic.CustomTag')}}"
is evaluated into an array ["My custom tag"]
. The end result is a valid metadata sidecar for “Keywords” namely "Keywords": {"Keyword": ["My custom tag"]}
whereas before evaluating the expression "Keywords": {"Keyword": "#{...}"}
is not a strictly valid metadata sidecar because the value of "Keyword"
must be an array and not a string.
...