I'd like to use a custom asset (based on cq:Page as jcr:primaryType).
I have managed to extend the create button to create my custom asset in a folder in the DAM.
In classic UI (/damadmin#) is see my custom asset in the list and can manage/edit it.
However, I don't see my custom asset not in touch UI (/assets.html).
How can I register my custom asset for that it can be picked up as datasource for the collection displayed on /assets.html?
Many thanks in advance,
Benno
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Luthiger
Please fallow the below steps and try it :
1.Create a new file named my-custom-asset.xml in the /apps/<your-app>/install directory of your AEM instance.
2.Add the following XML code to the file:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
sling:configFactoryPid="com.day.cq.dam.core.impl.AssetMimeTypeServiceImpl">
<mime.types.jcr.xml>
<jcr:root xmlns:mime="http://www.day.com/jcr/mime/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="nt:unstructured">
<my-custom-asset
jcr:primaryType="nt:unstructured"
jcr:mixinTypes="[mix:mimeType]"
mime:extension="my-custom-extension"
mime:type="application/my-custom-asset"/>
</jcr:root>
</mime.types.jcr.xml>
</jcr:root>
3.Replace my-custom-asset with the name of your custom asset type, my-custom-extension with the file extension for your custom asset type, and application/my-custom-asset with the MIME type for your custom asset type.
4.Save the file and build and deploy your package to your AEM instance.
5.After the package is deployed, go to the Touch UI Assets console (/assets.html) and click on the "Create" button. Your custom asset type should now be visible in the list of available asset types.
@Raja_ReddyThank you for your fast reply.
I've added the mime types configuration in my apps /install folder. However, my custom asset is still not picked up in the collections displaying the assets on /assets.html.
What irritates me is that I cannot find any reference to AssetMimeTypeServiceImpl in my jcr (except for the install file I've just created).
I have Adobe Experience Manager (6.5.17.0) installed.
@Luthiger Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
@kautuk_sahni Unfortunately, the tip with the my-custom-asset.xml did not work for me.
I had some success using a filter component on sling.filter.resourceTypes=dam/gui/coral/components/commons/ui/shell/datasources/assetsdatasource.
With this filter, I was able to add my custom assets found in a directory. I wrapped them with a org.apache.sling.api.resource.ResourceWrapper that returns a resourceType (ResourceWrapper.getResourceType()) pointing to the template that renders the row in the list of asset resources.
It kind of works, but I have the impression that there should be a better solution to this problem.
I would be grateful if you could give me more information.
Best,
Benno
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies