afs_doc_rename - AFS - Reference Guides

AFS Filters Description

Product
AFS
AFS_Version
7.11
Category
Reference Guides
language
English

The document rename filter can be used to rename a document according to the content of a XML/JSON layer of this document.

The filter is declared with the afs_doc_rename type. It is in the antidot-paf-misc package. It is a processor filter.

This filter can be instantiated only once at any given moment. It will not read the "instances" parameter in the configuration.

The Document rename filter specifications are described in the following table:

Parameter name

Mandatory

Type

Default

Description

path

Yes

string

N/A

The XPath or JSONPath

input_layer

No

layer

CONTENTS

It is the layer which contains the XML or JSON data.

nsmap

No

map

Empty

Namespaces map for interpreting the xpaths.

prefix

No

string

Empty string

A string to be appended before the uri. Can be used for instance in JSONPath where the concat method is not available

suffix

No

string

Empty string

A string to be appended after the uri. Can be used for instance in JSONPath where the concat method is not available

The filter uses an XPath or a JSONPath (according to the mime-type of the input layer) to build the new uri of this document. Be careful that in case of double name (i.e. the rename produces the same name for two different documents) the second document and beyond will NOT be renames and will be saved as FAILED.
Note: Note that the fn:document-uri() function is available in XPath and return the original uri of the document.