...
You can of course inherit from ImageData such as in the above case - but you are also welcome to inherit from the included defaults and simply extend on them with additional properties.
Code Block | ||
---|---|---|
| ||
[ContentType(GUID = "0af71ce8-1e4b-499b-bf24-24e7fce44121")]
[DigizuiteType(AssetTypeIds = new[] {GlobalConstants.AssetTypes.Image})]
public class ExtendedDigiImage : Image
{
[DigizuiteMediaFormat("imageSmall", "3C95F58F-5DD7-4AFB-B1C8-48E05901CE6D")]
public virtual Blob Small { get; set; }
} |
Property Mapping
If you want to map a property in Episerver to a metadata field in Digizuite that's not exposed through the default classes or the interfaces, it's not very hard. Just like with the type mapping, you simply have to create the property in Episerver and then attach the "DigizuitePropertyDigizuiteMetafield" attribute to it, indicating what the name of the json property in Digizuite is and the guid of the metafield, that you want to map to.
Code Block | ||||
---|---|---|---|---|
| ||||
[DigizuiteProperty(Name = "SoftwareDigizuiteMetafield("Description", "C8BB4AF3-1598-4EA4-8D7A-98D54EEAD977")] [CultureSpecific] public virtual string ExifSoftwareDescription { get; set; } |
In this case, we want to make the field "Exif SoftwareDescription" in Digizuite Digizuite usable in Episerver. Whether the field is editable in Episerver .
...
title | Note |
---|
...
is determined by the settings and rights in Digizuite. If the metafield is set to read only in Digizuite, then the field will be rendered as read only in Episerver and if the Episerver user in Digizuite does not have write access to the metafield.
The following episerver types are supported. Additionally, it is very important to map the Digizuite types to the correct Episerver types.
...
The table shows the mapping between episerver and digizuite types.
Episerver type | Digizuite type | Editable |
---|---|---|
Bool | Bit | Yes |
DateTime | DateTime | Yes |
String | String, float, link, note, uniqueVersion | Yes |
IList<string> | Tree, combovalue, multicombovalue | No |
IList<string> | editcombovalue, editmulticombovalue | Yes |
Int | Int | Yes |
Mapping custom fields
In order for the above property mapping to work, it is important to ensure that Digizuite also sends the specific metadata field to the Episerver integration - and that it's named the same was as specified in the attribute. This is done by customizing the output parameters for the "GetEpiserverAssets" search in the DAM Center, and adding the requested field as an output parameter, while ensuring it's named correctly.
You can read more about adding custom input and output parameters here: https://digizuite.atlassian.net/wiki/spaces/DD/pages/799604821/DFE+1.0.0+-+6+Customizing+input+and+output+metadata
...
Code Block | ||
---|---|---|
| ||
[DigizuiteMediaFormat("Small"imageSmall", "3C95F58F-5DD7-4AFB-B1C8-48E05901CE6D")] [ScaffoldColumn(false)] public virtual Blob Small { get; set; } |
This can simply be achieved by assigning the DigizuiteMediaFormat attribute to a Blob property in Episerver. The attribute should either contain part of the name of the media format, or the media format IDYou have to apply the json id and the guid of the mediaformat. This requires that the mediaformat has been added to the output parameters for the "GetEpiserverAssets" search in the DAM Center.
A cool benefit of this is that by assigning a blob, due to Episervers convention, you'll also get a pretty url pointing directly to that media format, like this: "/globalassets/digizuite/155-las-vegas.JPG/small" and we ensure the correct mimetype when requesting the asset.
Read more about Asset URL's here: https://digizuite.atlassian.net/wiki/spaces/DD/pages/799768707/DFE+1.0.0+-+8+Customizing+Asset+Urls
...