asset.configure Property Definitions
The asset.configure
callback serves the following two purposes:
- Defines asset type specific metadata regarding ES (i.e., the field used as the thumbnail field or the life cycle to be attached to asset instances).
- Allows you to alter the properties that have been defined in the RXT definition.
When processing the asset.configure
callback method, the extension model first evaluates asset.configure
callback, which is defined in the default asset.js,
and then the current callback. This allows you to selectively modify meta and RXT properties.
The following properties are returned from the asset.configure
callback method:
Property | Description | Default Value | Example |
---|---|---|---|
name | The name of the asset that appears in the RXT. | N/A | |
label | Overrides the name of a particular field that is specified in the default RXT. | N/A | Author |
type | Overrides the type of a particular field that is specified in the default RXT (e.g., If the All the above field input types except the | N/A | file |
readonly | Defines whether the user can edit this field or not. This is currently implemented in the Publisher add asset form (e.g., the provider field read only). | false | true |
hidden | Determines if the automatically populated value is hidden or not. This is currently implemented in the Publisher add and edit asset form (e.g., the createdtime field is hidden). | false | true |
auto | Defines whether the values are automatically populated or not. The attributes that are displayed using this field can not be edited. This is currently implemented in the Publisher add and edit asset form (e.g., the provider field). | false | true |
placeholder | Allows you to add a placeholder text for a specific field. | N/A | Provide a valid service name. |
Example 4 - Overriding properties in the RXT template
The table section of the configuration specifies properties that are overridden in the RXT template. This is shown in the code snippet below. The fields are referenced by the table as it appears in the RXT definition. As an example the name
attribute that appears in the overview table must appear within the overview.fields
property. If you reference a field that does not exist, it is silently ignored by the processor and a warning log is printed.
table: { overview: { fields: { provider: { readonly: true }, name: { name: { name: 'name', label: 'Name' }, validation: function() {} }, version: { name: { label: 'Version' } } } }, images: { fields: { thumbnail: { type: 'file' }, banner: { type: 'file' } } } },
The meta
property of the asset.configure
callback method allows you to specify meta properties relevant to ES. The following code snippet demonstrates the use of the meta
property:
meta: { lifecycle: { name: 'SampleLifeCycle2', commentRequired: false, defaultAction: 'Promote', deletableStates: [], publishedStates: ['Published'], }, ui: { icon: 'icon-cog' }, thumbnail: 'images_thumbnail', banner: 'images_banner', }
meta
element definitions
The following are the properties that can be specified in the meta
block:
Property | Description | Example |
---|---|---|
| The life cycle to be attached to asset instance. | ‘SampleLifeCycle2’ |
| Indicates whether a comment should be recorded when a life-cycle state changes. | false |
meta.lifecycle.defaultLifecycleEnabled | If this property is set to true, the lifecycle defined in the asset extension is used as the lifecycle for the asset type. If this property is set to false, the lifecycle defined in the RXT is used as the lifecycle of the asset type. By default this property is true. | true |
| The life-cycle action to be invoked when the life cycle is attached. | ‘Promote’ |
| The states in which asset instances can be deleted. | [‘Deleted’] |
| The states in which asset instances can be published. | [‘Published’] |
meta.lifecycle.lifecycleEnabled | Whether the lifecycle behavior is enabled for this asset type or not. | true |
| The icon to be used as the asset type. | ‘icon-cog’ |
| ‘overview_category’ | |
| The fields that can be used to search for instances of the asset type. | [‘all’] or [‘overview_name’, ‘overview_description’] |
| The attribute used as the thumbnail field. | ‘images_thumbnail’ |
| The attribute used as the banner field. | ‘images_banner’ |
meta.versionAttribute | The attribute that is mapped to the version attribute (e.g., if the asset type is a ebook, ISBN can be mapped as the version). | |
meta.providerAttribute | The attribute that is mapped to the provider attribute. The provider is the user who uploaded the asset. (e.g., map owner to provider) | |
| The attribute used to track the temporal behavior of an asset type. | ‘overview_createdtime’ |
meta.grouping.groupingEnabled | ||
meta.grouping.groupingAttributes | ||
meta.permissions.configureRegistryPermissions |