How to render custom asset in liferay 7?

950 Views Asked by At

I created a custom entity and made it a custom asset. The entries are there in the database table assetentry.I want to render the asset in asset publisher. For this I made two classes *AssetRenderer and *AssetRendererFactory .I saw that *AssetRendererFactory constructor is being invoked but its getAssetRenderer() method is not being invoked. Any idea what might I be missing to render asset? Also I got my custom entity in the Asset type in the configuration link but when I select it, I got the contents of blogs portlet instead of my custom portlet. Please help.. any help would be appreciated. Thanx in advance..

1

There are 1 best solutions below

0
On

I think I had the same problem as you described.

The main problem was that I hadn’t indexed my custom entity by searching engine (Elasticsearch). Therefore, Asset publisher could not find any instance of my custom entity (I don’t know why Asset publisher returns all contents of blog, but I had the same problem).

When I wrote an indexer for my custom entity based on https://web.liferay.com/community/forums/-/message_boards/message/84418151 (deployed it and re-indexed custom entity), it started to work.