Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Filtering AssetListScreenlet
Hi!
I tried to filter AssetListScreenlet, I can filter by category, tags, but is it possible to filter by articleId?
In https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/asset/kernel/service/persistence/AssetEntryQuery.java I didn't find parameter for this.
How can I resolve this?Thank you!
I tried to filter AssetListScreenlet, I can filter by category, tags, but is it possible to filter by articleId?
In https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/asset/kernel/service/persistence/AssetEntryQuery.java I didn't find parameter for this.
How can I resolve this?Thank you!
Hi,
You can use keyword for filtering with article id
You can use keyword for filtering with article id
Thank you! Can you send me an example? for multiple articleIds
I dont think you can search multiple article ids in single keyword but directly articleid you can search using keyword
This is the problem... I must ... In keywords I can't use articleId.
Normally when you know the article you want to display, you configure the portlet (or screenlet in your case) to use a Manual Query where you are able to then "pick the item" rather than using a Dynamic query. To my knowledge, you can't add "ids" to the asset entry query when you configure it -- I guess because you aren't supposed to know what they are?
Do you need more than one article? or are you looking to just configure a single item?

Hi! I want to filter asset list by articles, or by some data in articles like date, for example which article's date data in the given interval.
Another behaviour is We made a service for User's favorites. User's checking some article into his favorite store (we store articleIds). These articles have different structureId and different Activity to show. I'd like to show him his mixes favorites in another function that hasn't any filter and I want to forward to the specified Activity. So I want to filter assetListScreenlet by articleIds. Can I resolve this, or I must create my own implementation?
Another behaviour is We made a service for User's favorites. User's checking some article into his favorite store (we store articleIds). These articles have different structureId and different Activity to show. I'd like to show him his mixes favorites in another function that hasn't any filter and I want to forward to the specified Activity. So I want to filter assetListScreenlet by articleIds. Can I resolve this, or I must create my own implementation?
I think the bad news is, that sounds too custom to use the generic out of the box. I think you are going to have to build your own screenlet for that one. The out of the box AssetPublisher (and corresponding Screenlet) are really just used for basic listing and filtering.
You should still be able to leverage the Liferay API to do most of the heavy lifting for you -- but I don't think, if I understand your requirements, the AssetEntryQuery will work for all of your use cases. Sounds to me like you are going to have to leverage the Journal API, and for some of your more complicated scenarios, I think you might be stuck using a Dynamic Query (as I think someone else on the thread may have suggested)
If you need help figuring out how to use other parts of the API though, don't hesitate to ask.
You should still be able to leverage the Liferay API to do most of the heavy lifting for you -- but I don't think, if I understand your requirements, the AssetEntryQuery will work for all of your use cases. Sounds to me like you are going to have to leverage the Journal API, and for some of your more complicated scenarios, I think you might be stuck using a Dynamic Query (as I think someone else on the thread may have suggested)
If you need help figuring out how to use other parts of the API though, don't hesitate to ask.
Thank you, I think we must create our service. :-(
Yeah, I know, it can be a bummer sometimes. But, try to think of all the great stuff that you DON'T have to do that Liferay is doing for you out of the box. You're probably still way ahead of the game. If nothing else, at least you know that the Liferay community is here to help when you need it.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™