Foros de discusión

Tag Cloud Filtering using hooks

hossain juber, modificado hace 9 años.

Tag Cloud Filtering using hooks

New Member Mensaje: 1 Fecha de incorporación: 14/08/14 Mensajes recientes
I need to filter certain tags from the tag cloud. I am thinking about using a hook to accomplish that. Per documentation hooks can be used in 4 different ways, I tried all 4 ways without any success. To me it looks like "Overriding a portal service' is the way to go I tried playing around with AssetTagServiceWrapper, the problem is that this service gets called during sign in, I am looking for a service that triggers every time the tag cloud gets displayed. Basically I am trying to get to the underlying collection that holds the tag cloud. Once I can hold on to the collection, I am assuming I can manipulate it.

Any help is greatly appreciated.

Regards,
Juber
thumbnail
Olaf Kock, modificado hace 9 años.

RE: Tag Cloud Filtering using hooks

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
It might be easier to just start your own Tag Cloud portlet from scratch (or copy Liferay's implementation) and display only the tags that are interesting to you. Also, filtering tags for some aspects sounds weird to me - as tags are so dynamic in nature. A new tag can be added any time without warning - I don't understand your problem, but it might be wise to use categories instead of tags. They're inherently more stable: You'll need to enter categories before you can use them, while you can freely invent new tags every time you're tagging an asset.
Javier Vera, modificado hace 9 años.

RE: Tag Cloud Filtering using hooks

New Member Mensajes: 18 Fecha de incorporación: 1/08/14 Mensajes recientes
Hey Olaf, good day.
I have been wondering how to implement this option too, maybe or not using Hooks as i am already working on a custom portlet.
Maybe you could give a hint on how to start.
This is what i've been thinking...

1- get all the tags registered for the custom class (built in service.xml)
2- locate those tags on a table or div inside the jsp in a way its ordered by the most hot one (most inserts)
3- make those tags listed links
4- call from those links to a new page where the filtered result is posted.

i dont know if this approach would be the most accurate but you seem to have way more experience than some of us in this tech, so maybe you could give a hand with the idea..?

btw, Juber, i belive if you are running out of time like most of developers then you should try Olaf's suggestion, since i myself have been trying to obtain a code example off this yet i have not found anything...