ActionPluginConfiguration classes define the fields used to configure a plugin's behaviour.
See the examples.
Example:
public class EmailActionConfiguration implements ActionConfiguration {
Field | Default Value | Description |
description | The description of the action plugin. | |
autoRetrySupported | TRUE | Whether or not the action plugin will auto-retry after a failure. |
lockType | LockType.NONE | SHARED, EXCLUSIVE, NONE, DYNAMIC |
resourceConfiguration | If the action plugin uses a resource, this should be set to the appropriate `ResourceConfiguration` implementing class. |
Action Plugin Configuration Properties: Metadata Annotations
Action and resource configuration classes in JEF are “plain old java objects” (POJOs) and are serialised into Dalet Flex metadata definitions for the purposes of native Enterprise importing.
Java properties can be extended in order to define any additional metadata that is required by metadata definitions. For this purpose, JEF provides a metadata annotation library to augment java properties into configuration parameters that can be used in Enterprise.
Example:
@ConfigField(displayName = "Trust Self-Signed Certs", required = true, multiplicity = Multiplicity.NA, expressionEnabled = false
description = "Set to true if the external API URL is accessed via HTTPS and has a self-signed SSL certificate that is considered trusted.")
private boolean trustSelfSignedCerts;
Extendable Properties
ConfigField
Java configuration class properties can be extended using java annotations, in order to define metadata definition property parameters.
Example:
// BuiltIn Configuration classes
@ConfigField(displayName = "Source File", required = true,
description = "Details of the source file to import. If not specified, no media file will be imported into the asset. This can be used to create placeholder assets.")
private VFSLocation builtInClassVfsLocation; @ConfigField(displayName = "Colour Field", required = true)
private Colour builtInClassColour;
Properties for the ConfigField annotation:
Field | Default Value | Description |
displayName | The user-visible name for the field. Example: `displayName = "Script Contents"` | |
description | This usually tells a user the purpose of the field, and sometimes also example values. Example: `description = "Expression to derive the unique name used to identify the archived object in the external archive system; if expression is empty or resolves to an empty value, then the current asset filename will be used. For example: #{asset.originalFilename}."` | |
required | FALSE | Whether or not the field is mandatory. Some plugins have mandatory configuration fields that must be filled out. If a value is not entered in a mandatory field, the plugin cannot be saved and enabled. Example: `required = true` |
multiplicity | `Multiplicity.NA` | This is how many times a field can be replicated. Some fields can be created multiple times. The possible values are as follows:<br><li>`SINGLE`<br><li>`ZERO_TO_ONE`<br><li>`ZERO_TO_MANY`<br><li>`ONE_TO_MANY` |
expressionEnabled | FALSE | Whether or not the field may be specified as an expression. |
defaultValue | If the config field is not specified, then Dalet Flex will automatically populate it with this value. The default default (!) is empty. | |
secretEnabled | FALSE | Whether or not this field should be captured as a secret uuid. |
The following additional annotation properties are available:
-
ObjectField: formType, objectType, classNames, objectTypedId, variantId.
The ObjectField property is only applicable to built-in Dalet Flex objects such as: Dalet Flex objects, assets, and users. - OptionField (enum only): type (SINGLE, MULTI).
- ValidationField: validation, validationDescription, validationHandler, and maxLength.
Java properties are converted into metadata definition properties:
- Java primitives are mapped into metadata definition properties. These are as follows: String, float, long, double, integer, and boolean.
- Java wrappers are mapped into metadata definition properties. These are as follows: String, float, long, double, integer, and boolean.
- Java collections are mapped into metadata definition properties (list, map, and so on).
- Enumerated types are mapped into metadata definition multi options.
- Java POJO classes can be nested in a hierarchy.
Metadata annotation libraries provide preset built-in types:
- Built-in metadata annotation classes provide the base metadata definition types. Adding them as properties in POJOs hides the complexity of the parameter definitions: Action, Asset, Colour, Email, File, Flex Object, Image Validation, Key Value, Password, Protocol, Script, Synchronous Execution Action, Time, Time Code, User, VFSLocation.
- Collections of built-in types are supported (e.g. List<Asset>).
- VFSLocation now supports a Boolean sharded option. This is to support sharding of storage resources.
All of the properties listed above can be combined to produce both simple and complex metadata definition configurations.
Example:
A valid action configuration could be as follows:
@ActionPluginConfiguration(description = "example")
public class MetadataAnnotationE2EActionConfiguration implements ActionConfiguration { private String stringFieldWithoutFieldAnnotation;
private boolean primitiveBooleanFieldWithoutFieldAnnotation;
private PojoWithoutFieldAnnotation pojoWithoutFieldAnnotation;
...
@ConfigField(displayName = "Long Field Displayname", description = "Description", expressionEnabled = true)
private Long primitiveLongFieldWithAnnotation;
...
@ConfigField(displayName = "Pojo Object With ConfigField", description = "To test ConfigField Annotation on a Pojo object")
private PojoWithFieldAnnotation pojoObjectWithAnnotation;
...
@ConfigField(displayName = "Enum Object with ConfigField", description = "To test ConfigField Annotation and OptionField as type Multi on Enum object")
@OptionField(type = OptionTypes.MULTI)
@ObjectField(formType = FormType.MULTI_SELECT, objectType = "")
private EnumStatus enumWithAnnotation;
...
Comments
0 comments
Please sign in to leave a comment.