Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Dennis Greiffenberg
Extending the categories navigation
June 22, 2012 3:32 AM
Answer

Dennis Greiffenberg

Rank: Regular Member

Posts: 222

Join Date: April 30, 2007

Recent Posts

Hi all,

we already extended the categories navigation, so that we are able to select multiple categories from different vocabularies (conjunction).
Our current aim is to add a feature that displays the number of hits behind each asset (see attached sketch), similar to what Liferay's search offers by default.
However, for the time being, we haven't found a proper solution to this request. Every click on either category leads to a reload of the page, since the categories navigation submits this filter as URL-parameter.

To the best of our knowledge this is the only way to gather the information about the number of hits, which means, that for each and every asset listed by the categories navigation, a search request would need to be executed in the background.
Once this filter is modyfied by a user (so an additional asset is (de-)selected), so whole thing starts again :-?
This doesn't seem to be "too efficient", so we're wondering, what other option might be out there.

That's why I'm asking you guys for your kind support / ideas! emoticon

Any Feedback is greatly appreciated!

Looking forward to hearing from you.
Best regards,
Dennis
Attachment

Attachments: categorie_navigation.jpg (18.1k)
Oliver Bayer
RE: Extending the categories navigation
June 22, 2012 4:47 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 889

Join Date: February 18, 2009

Recent Posts

Hi Dennis,

not sure if I get your requirements right but I will try to give some -hopefully useful- hints emoticon.

The first time you're calling your modified categories navigation portlet I would sugguest to put all available categories and the results of each individual category into the session. So as soon as the user selects a filter you can retrieve the needed info from the session and do the filtering without "recalculating" all the stuff all the time. You can add a reload button so the user is able to refresh all the session data.

HTH Oli
Dennis Greiffenberg
RE: Extending the categories navigation
June 22, 2012 5:27 AM
Answer

Dennis Greiffenberg

Rank: Regular Member

Posts: 222

Join Date: April 30, 2007

Recent Posts

Hi Oli,

thanks for you quick reply! emoticon
Putting all relevant data into the session could be an option.

BUT, given I undestood correctly
- the 1st time the user loads a page would still take "some time" to load
- you can never really say when it's time to refresh the data (new categories have been added, etc.) and leaving that to the user (e.g. a button "reload") would simply be a "no go"...
- ...

So I'm not sure this would be the final solution or we'd still need some extra magic to get things going...

Anyway, many thanks for your reply and may be there'll be even more in this thread emoticon

Best regards,
Dennis
Oliver Bayer
RE: Extending the categories navigation
June 22, 2012 11:03 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 889

Join Date: February 18, 2009

Recent Posts

Hi,

it's me again, sorry emoticon.

So if a button is a "no go" you need an extra attribute (e.g. last-change-date) to be able to quickly check for updates. I would sugguest custom attributes or -if navigation categories aren't supported yet (I'm not sure atm)- use ExpandoTables on your own. If the last-change-date (to stick with my example) saved into the session is older than the one from expando call a backend method to retrieve the new data and save it into the session again. For this to work you have to modify the "save or update navigation categories" method so that the last-change-date is updated too (if you use ExpandoTables you have to delete the values as soon as the navigation category is deleted). Using that approach you only have a little overhead in checking the dates but you're gaining the advantage if there are no changes. This time you can use the values stored in the session.

HTH Oli
Hitoshi Ozawa
RE: Extending the categories navigation
June 23, 2012 11:37 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

It's supported by facet functionality in Solr. I think it's also included in Lucene.
Dennis Greiffenberg
RE: Extending the categories navigation
June 25, 2012 2:00 AM
Answer

Dennis Greiffenberg

Rank: Regular Member

Posts: 222

Join Date: April 30, 2007

Recent Posts

Hi Oli, hi Hitoshi,

thanks a million for your feedback! We'll have a look at both suggestions and see where we are from there emoticon

Best regards,
Dennis