Create Metadata Schema form for Custom MIME types
Metadata Schema form based on MIME types is very useful, when we cannot apply metadata schema on a folder as it contains mixed assets (image, video, pdf etc..). I have come across this requirement multiple times where client has mixed assets in its folder and he wants to have different metadata schema for different types of assets. Like for image a different type of form and for video a different type of form.
Even sometimes requirement comes like for different type of images clients wants different type of metadata schema forms. All of this use cases can be easily handled by creating Metadata Schema form based on MIME types.
Follow below steps to create Metadata Schema form for custom MIME types:-
AEM doesn’t comes with any default metadata schema forms for png image type. In this tutorials i will show you how to create custom metadata schema forms for png image type.
Note:- You can create any custom mime types like xyz of type image/xyz or video/xyz depending on your requirement.
- Navigate to Tools > Assets > Metadata Schema > default > image
- Select jpeg schema form, Copy it and Enter new Metadata Schema Form name (png).
- Click Copy.
- Select png metadata schema form and edit it, to add new fields based on your requirement.
- Lets add one text field to it.
- Form Right side Panel Drag and drop Single Line Text component on Form.
- Select the newly dropped component.
- Edit the component and add a Title, placeholder text as shown.
- Edit Map to Property from ./jcr:content/metadata/default to your property name that you want to map against it.(Like ./jcr:content/metadata/dc:title)
Note:- Map to Property specifies the relative path/name to the asset node where it is saved in the CRX repository. It starts with “./” because indicating that the path is under the asset’s node. - Click Save.
- Now navigate to /etc/dam/metadataeditor/mimetypemappings in crx/de.
- Add a new mimetypemapping.
- Click Save All.
That’s it, you have created new metadata schema based on mime type. As we have created this metadata schema under default, so it is already applied on all the folders that on which default metadata schema form is applied.
Note:- Modifying a jpeg schema under default/image only modifies the metadata layout (asset properties) for assets with MIME type IMAGE/JPEG. However, if you edit the default schema, your changes modify the metadata layout for all types of assets.
To test our png mime type based metadata schema , upload a png asset in a folder and check its properties.
Important Points to Notice:-
- You cannot delete the out of the box metadata schema forms in AEM Assets.
- You can add new tabs or form items to the metadata schema form. The tabs and form items derived from the parent are in the locked state. You cannot alter them at the child level.
- If you don’t want inherited tabs and field like BASIC, ADVANCED etc.. Create schema parallel to default metadata schema and override fields over there as shown in below screenshot:-
Hope this tutorial helps in increasing your knowledge.
Leave a Reply