[7.2] Add multi-categories filter on Asset Publisher

Benjamin Bini, modified 6 Years ago. New Member Posts: 5 Join Date: 7/18/13 Recent Posts
Hello,

We want to filter the Asset Publisher entries based on an external portlet where the user can select multiple categories.

We can't use the default Categories Navigation portlet because it allows to select only one category.

We figured out some options, but none seem perfect.
  • Develop an EXT to add a new public render parameter support for the AssetPublisher and filter on it in the DisplayContext
    • Seems a bit too complicated
  • Implement our own AssetPublisherCustomizer and implement "setAssetEntryQueryOptions "
    • Is it possible to do it without developing an EXT module ? AssetPublisherCustomizer is not exported from the AssetPublisherModule

What is your opinon on those option? Are there any other option?

Thank you for your help!
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Benjamin Bini:

We want to filter the Asset Publisher entries based on an external portlet where the user can select multiple categories.

We can't use the default Categories Navigation portlet because it allows to select only one category.

We figured out some options, but none seem perfect.
  • Develop an EXT to add a new public render parameter support for the AssetPublisher and filter on it in the DisplayContext
    • Seems a bit too complicated
  • Implement our own AssetPublisherCustomizer and implement "setAssetEntryQueryOptions "
    • Is it possible to do it without developing an EXT module ? AssetPublisherCustomizer is not exported from the AssetPublisherModule
What is your opinon on those option? Are there any other option?
Not sure if it's only CategoriesNavigation that's limited, it might be AssetPublisher as well. Generating the public render parameters (and replacing the CategoriesNavigation portlet) would be my preference, if AP picks up multiple categories in the way that you expect (is it "and" or "or" that you're after?)
I'm always shying away from modifying AP: It's one of the most complex portlets, and maintaining your modification will be a nightmare: The more complex a component is (e.g. AP), the more probable a change in a later patch or version is. And you'll have to constantly understand your changes, and the diff to the base implementation.
Maybe you need something a lot less flexible that AP and can implement that? Or maybe you don't shy away from that modification and maintenance...
Olaf Kock, modified 6 Years ago. New Member Posts: 5 Join Date: 7/18/13 Recent Posts
Hi Olaf,
The limitation definitely comes from AP as the public render parameter is just one "categoryId", not multiple categories ids.
The ext we would develop would be quite simple, just adding a few lines in "DefaultAssetPublisherCustomizer", but of course it means keeping track of it every new fix pack, quite a maintenance nightmare.
We could develop something less flexible but well, our client wants to be able to reuse the feature and we can't affort to develop a whole new "CustomAssetPublisher" right now.
AP is really powerful but we encounter so many limitations with it, it's quite frustrating sometimes, I think it needs some extension points.
I think I may suggest some AssetPublisher topics at the DevCon Unconference in November ;)
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Benjamin Bini:

...our client wants to be able to reuse the feature and we can't affort to develop a whole new "CustomAssetPublisher" right now.
AP is really powerful but we encounter so many limitations with it, it's quite frustrating sometimes, I think it needs some extension points.
I think I may suggest some AssetPublisher topics at the DevCon Unconference in November ;)
I understand - just providing the options. Sometimes "not being able to afford the development effort" means that you're forced to afford the maintenance effort. Which is often missed at the time of the initial decision.
The Unconference is a perfect place to discuss topics like this, with the relevant people. 
My thoughts also go into a different direction: Instead of touching the beast that Asset Publisher is, band-aid-ing with extension points, I could imagine a customizable FilteredContent portlet, that starts from a trivial starting point and allows to activate any of the various custom filters and extension points deployed to the runtime.
If someone else reading here doesn't know what Benjamin is talking about: Liferay Devcon has an additional "Day 0 Unconference" (which will sell out, so register early - don't come whining to me if you can't get a ticket any more because you registered late), used for intensive discussions with developers, product managers and other users. For "Devcon Day 1-2" we'll have enough space, it's just the Unconference, where we're limited in space.
Benjamin Bini, modified 6 Years ago. New Member Posts: 5 Join Date: 7/18/13 Recent Posts
Totally agree with your first part.
Also, the "FilteredContent" portlet is a really good idea, and I think it fits really well into Liferay's philosophy.  Especially with this "moder site building" project. Modern site have filterable content everywhere and search portlet is not customizable enough in term of design to fulfill this need.
A generic "FilteredContent" portlet, with content displayed in customizable ADT would be quite awesome.