Foros de discusión

Liferay Rating API

azhar shaikh, modificado hace 7 años.

Liferay Rating API

Junior Member Mensajes: 43 Fecha de incorporación: 29/08/15 Mensajes recientes
Hello Everyone,
I have used liferay-ui:rating tag for Like in my portlet.
Now I need to perform custom action such as notify the user whose content is liked.So how can I achieve this.
i have already gone through the liferay src and found rating.js and page.jsp.
There is one attribute "url" in liferay-ui:rating tag I cannot find any documentation on what it does ?
I created a action handler and passed its url. Now when I click thumbs button the handler is getting called but the ratings api is not updated
thumbnail
Amos Fong, modificado hace 7 años.

RE: Liferay Rating API

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
Hi Azhar,

One way you could do this is to write a portal hook, I'm not sure which liferay version you're using but here's the 6.2 docs:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/overriding-a-portal-service-using-a-hook

You can override the RatingsEntryLocalServiceImpl.updateEntry() method and from there, you can send an email to the original asset's creator looked up by the className and classPK.
azhar shaikh, modificado hace 7 años.

RE: Liferay Rating API

Junior Member Mensajes: 43 Fecha de incorporación: 29/08/15 Mensajes recientes
Amos Fong:
Hi Azhar,

One way you could do this is to write a portal hook, I'm not sure which liferay version you're using but here's the 6.2 docs:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/overriding-a-portal-service-using-a-hook

You can override the RatingsEntryLocalServiceImpl.updateEntry() method and from there, you can send an email to the original asset's creator looked up by the className and classPK.


Hi Amos,
I am using liferay 6.2.
There is url attribute in tag.I have passed an action url in that my handler is getting called but I dnt know how rating api works.I cannot find any document about Rating API
thumbnail
Amos Fong, modificado hace 7 años.

RE: Liferay Rating API

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
You shouldn't have to pass a URL in the taglib. I think it's if you want to have a custom action when users rate the asset. If you leave it blank, there should a default action that updates the ratings data.

Looking at the source code is probably the best documentation for this if you can't find it at dev.liferay.com.
azhar shaikh, modificado hace 7 años.

RE: Liferay Rating API (Respuesta)

Junior Member Mensajes: 43 Fecha de incorporación: 29/08/15 Mensajes recientes
Thanks for your help.I have found a solution.I wanted to notify user when someone comments on there post.
I have completed this by creating a resource handler .Will be posting the solution code soon