Message Boards
how to customize asset publisher filters by categories
Flavio Giordano, modified 4 Years ago.
how to customize asset publisher filters by categories
New Member Posts: 4 Join Date: 7/22/19 Recent Posts
Hi everyone,
I'm a beginner with Liferay 7.2 and Eclipse.
I'm trying to create a portlet that customizes the selection interface and the behaviour of the categories.
I realized that I have to act on two aspects:
1- overwrite, using fragments, the view.jsp of the com.liferay.asset.categories.selector.web bundle to show a different interface to selecting categories (it seems to be ok right now)
2- overwrite the assetpublisher code (I believe com.liferay.asset.publisher.web) responsible for executing the search query for the web contents filtered based on categories selected by the user.Regarding this second point it is not clear to me where to act.
In this first phase I would like to retrieve all the web contents that have a selected category or any children ones just filtering for the parent category.
Can you help me?
Thank you.
I'm a beginner with Liferay 7.2 and Eclipse.
I'm trying to create a portlet that customizes the selection interface and the behaviour of the categories.
I realized that I have to act on two aspects:
1- overwrite, using fragments, the view.jsp of the com.liferay.asset.categories.selector.web bundle to show a different interface to selecting categories (it seems to be ok right now)
2- overwrite the assetpublisher code (I believe com.liferay.asset.publisher.web) responsible for executing the search query for the web contents filtered based on categories selected by the user.Regarding this second point it is not clear to me where to act.
In this first phase I would like to retrieve all the web contents that have a selected category or any children ones just filtering for the parent category.
Can you help me?
Thank you.
Mohammed Yasin, modified 4 Years ago.
RE: how to customize asset publisher filters by categories
Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
Hi,
You can use the asset publisher portlet itself for your usecase
1. Configure only webcontent in asset publisher
2. Configure the categories which you want to be be filtered
You can use the asset publisher portlet itself for your usecase
1. Configure only webcontent in asset publisher
2. Configure the categories which you want to be be filtered
Flavio Giordano, modified 4 Years ago.
RE: how to customize asset publisher filters by categories
New Member Posts: 4 Join Date: 7/22/19 Recent Posts
Hi Mohammed, thank you for your answer. What I've noticed is that having 3 nested categories (eg. CatA > CatB > CatC) and assign one child (CatC) to a web content; if you then filter for a rule "Contains/All/Categories" and selecting CatA the content cant be retrieved.
That's what I'm looking for right now; anyway in future I should be able to personalise the selection query possibly more.
Could you suggest me how can I override the default selection query?
Regards,
Flavio
That's what I'm looking for right now; anyway in future I should be able to personalise the selection query possibly more.
Could you suggest me how can I override the default selection query?
Regards,
Flavio
Mohammed Yasin, modified 4 Years ago.
RE: how to customize asset publisher filters by categories
Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
Hi Flavio,
You wanted the Asset Publisher to filter with the child categories along with parent for this u may need to add parent as well as children in rule something like this Contains/Any/Categories" and selecting CatA CatB CatC.
You wanted the Asset Publisher to filter with the child categories along with parent for this u may need to add parent as well as children in rule something like this Contains/Any/Categories" and selecting CatA CatB CatC.
Flavio Giordano, modified 4 Years ago.
RE: how to customize asset publisher filters by categories
New Member Posts: 4 Join Date: 7/22/19 Recent Posts
Yes, adding all the categories in the filter is the expected asset publisher behaviour.
My goal is to achieve the same result only with the parent one.
I believe it could be possible with a project fragment but I don't know exactly which file I have to update.
Thank you,
Flavio
My goal is to achieve the same result only with the parent one.
I believe it could be possible with a project fragment but I don't know exactly which file I have to update.
Thank you,
Flavio