Foros de discusión

Service builder not generating filterFindBy methods

Pierre Roukens, modificado hace 8 años.

Service builder not generating filterFindBy methods

New Member Mensajes: 20 Fecha de incorporación: 19/01/14 Mensajes recientes
Hi all,

I'm using permissions checks and have defined portlet and model permissions. When I put these directly in /resource-actions/default.xml, all works as expected Service builder generates filterFindBy methods in the persistence service. But, when I create separate xml files to put the resource actions in, and use "<resource file="resource-actions/.....xml" />" in default.xml, and build the service layer, no filterFindBy methods are created?!

Am I doing something wrong or is this a bug?
thumbnail
Jan Geißler, modificado hace 8 años.

RE: Service builder not generating filterFindBy methods

Liferay Master Mensajes: 735 Fecha de incorporación: 5/07/11 Mensajes recientes
Which Portal version are you using?
Pierre Roukens, modificado hace 8 años.

RE: Service builder not generating filterFindBy methods

New Member Mensajes: 20 Fecha de incorporación: 19/01/14 Mensajes recientes
Hi Jan,

Thanks for your response! I'm using CE 6.2 GA4.

Regards,
Pierre
thumbnail
Jan Geißler, modificado hace 8 años.

RE: Service builder not generating filterFindBy methods

Liferay Master Mensajes: 735 Fecha de incorporación: 5/07/11 Mensajes recientes
And you are talking about the filterFindBy methods which you have defined in the Service.xml, right? If so, please verify this behavior and you should open a bug. In my mind, the resource permissions should not impact the findBy methods.
Pierre Roukens, modificado hace 8 años.

RE: Service builder not generating filterFindBy methods

New Member Mensajes: 20 Fecha de incorporación: 19/01/14 Mensajes recientes
The filterFindBy methods are created by servicebuilder. See Permission filtering on the service builder wiki page.
Finder methods are created automatically but these will return all the results. FilterFindBy method can also be generated under certain conditions and they will return the results filtered by permissions. The conditions are:
1. the entity has a simple primitive pk
2. the entity has permission checke registered in resource-actions/....xml
3. the entity has user id an group id fields
4. the finder method has group id in it

These are created when putting all permission settings in default.xml but not when I use includes.
thumbnail
Jan Geißler, modificado hace 8 años.

RE: Service builder not generating filterFindBy methods

Liferay Master Mensajes: 735 Fecha de incorporación: 5/07/11 Mensajes recientes
Ahh yes, Definitely a bug in my mind. I am assuming all the prerequisites are met. Also 2. clearly states that the permission checks should als be considered if you have different files for different entities.
Pierre Roukens, modificado hace 8 años.

RE: Service builder not generating filterFindBy methods

New Member Mensajes: 20 Fecha de incorporación: 19/01/14 Mensajes recientes
Yes, all prerequisites are met. And the methods are created when only using default.xml.
Created issue LPS-56028 for this.
Thanks Jan!
thumbnail
Jan Geißler, modificado hace 8 años.

RE: Service builder not generating filterFindBy methods

Liferay Master Mensajes: 735 Fecha de incorporación: 5/07/11 Mensajes recientes
Well at least you have a workaround, even if its not the clean and modularized way of doing things ; )
thumbnail
Philipp Schwarz, modificado hace 8 años.

RE: Service builder not generating filterFindBy methods

Junior Member Mensajes: 29 Fecha de incorporación: 19/10/12 Mensajes recientes
Thank you so much Pierre, this just saved me a lot of time!

I'm on 6.1.1 CE GA2 and it behaves exactly the same.

Cheers,
Phil