clientTemplate rules

Build 1501 on 14/Nov/2017  This topic last edited on: 21/Mar/2016, at 18:34

A clientTemplate object contains a list of object types, and for each one specifies which data to get, how to compose the file name, and how to update the object from the modified data.

The combination of all this is called a rule.

Here is a list of rules as it appears in clientTemplate editing form:

extapp7

The third line of the above screenshot defines the rule for objects of type "image"(specified in the Type column), defined as follows:

Save on the client file the content of the data attribute (the Attribute column).

Use the name attribute of the image object as the name of the file written to the client (the Expression column).

When the modified file is submitted to the server, process it with the updateImage workflow that will modify the object (the Workflow column).

Do not use any plug-in.

The fifth line of the above screenshot defines the rule for object of type "audio", with the addition that the plug-in "File4Dalet" must be used to store/retrieve local data (because audios in this case are edited with the Dalet system; that has its own database).

More formally:

Attribute specifies the name of the attribute containing the data to be saved on the client file;

Expression contains an XPath expression that executed against the XML of the object itself producing the name of the file – in the example above this expression is just @name = the value of the name attribute = the name of the image, but it can be something more complex (e.g., concat(@id,@name) that produces a file name by concatenating the object id with its name).

Workflow specifies the name of the workflow that updates the object in the system.

Service plug-in specifies the name of the File4 plug-in accessing data within the third-party application data store for objects of the specified type.

See also

Editable object data: attribute value or object XML