Expand my Community achievements bar.

SOLVED

Metadata Schema question

Avatar

Level 2

Hi All,

We have a requirement where assets and content fragments are going to be created in a folder "ABC". We have a custom metadata schema associated with this folder.

However the problem is that for any asset upload, the title property has to be dc:title and for content fragment it has to be jcr:title correct ? How to handle this use case.

Does anyone have thoughts on how to handle such scenario ? Thanks for support in advance.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Assets display section picks up dc:title for assets and jcr:title for content fragments. (though we have an option of saving something in the form of dc:title at crx level)

Two of the below can be done (if its accepted in your project)

- common folder for both assets and fragments -> single schema -> two separate fields for title ( mapping for assets and mapping for content fragment - with respective labels)

- under main project folder -> two separate folders for assets and content fragments - separate schema definition for two folders.

View solution in original post

8 Replies

Avatar

Community Advisor

Hi Sreekanth,

Could you please elaborate your requirement with respect to title( of asset and content fragment)/ how you want them to be ?

Avatar

Level 2

Hi Vijis

I will try to explain the problem statement below.

1. We created a metadataschema "sample" and applied to folder "a/b/abc"

2. This folder "abc" may contain either binary asset ( like a pdf/image etc) or a content Fragment.

3. For binary. the title gets stored in dc:title where as for the content fragment (being a html) the title gets stored as jcr:title in crx right ? if that is the case how to create title field in the metadaschema. Whether it has Map to Property ./jcr:content/metadata/dc:title  or ./jcr:content/jcr:title ?

Avatar

Level 10

"For binary. the title gets stored in dc:title where as for the content fragment (being a html) the title gets stored as jcr:title in crx right"

This looks correct in terms of how AEM stores the information.

Avatar

Level 2

yah, But I want authors to see only one Title attribute from the metadata schema on that folder "abc" when they upload an asset or content fragment.  If both has different path's how to configure the Title for this metadataschema element is my concern point.

Avatar

Community Advisor

Hi Sreekanth,

Thanks for explaining in detail.

When we create a new fragment, the title and description that we author gets saved under jcr:content.

Eg: a/b/abc/content-frag/jcr:content (jcr:title and jcr:description being properties on jcr:content)

Content Fragment is part of AEM assets. Given this, we also have a metadata node under jcr:content(for fragment)which can hold properties like any other asset.

Eg: a/b/abc/content-frag/jcr:content/metadata.

In order to be consistent, we can have title property map to jcr:content/metadata/dc:title in schema definition which would work for fragment as well.

Note: Content Fragment's format alone is html (which would be evident by property dc:format in metadata node of content fragment).

Avatar

Community Advisor

Adding to the above, if you are trying to use for any other logic, above will help. (retrieving it as dc:title )

On assets listing/display, title that gets displayed will be dc:title for asset and for the fragment, it will be jcr:content/jcr:title (because this being the one that we authored when we first create the fragment)

Avatar

Level 2

Thanks Vijis for the detailed explanation.  But I did not understand the last piece of it "On assets listing/display", if we populate the title for content Fragment as well in dc:title, Authors cannot see the title for any of the content Fragments created eventhough the value exist in the crx on the dc:title.

Avatar

Correct answer by
Community Advisor

Assets display section picks up dc:title for assets and jcr:title for content fragments. (though we have an option of saving something in the form of dc:title at crx level)

Two of the below can be done (if its accepted in your project)

- common folder for both assets and fragments -> single schema -> two separate fields for title ( mapping for assets and mapping for content fragment - with respective labels)

- under main project folder -> two separate folders for assets and content fragments - separate schema definition for two folders.