roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave <snoopd...@gmail.com>
Subject Re: How to get total number of records in specific category?
Date Wed, 08 Aug 2007 13:08:38 GMT
On 8/3/07, evgeniy.strokin@yahoo.com <evgeniy.strokin@yahoo.com> wrote:
> I need to have total number of records from specific category.
> I can use :
> getRecentWeblogEntries("/MyCategory", 9999).size()
> Is it the right way?

That doesn't seem like an efficient way to implement a # entries in
category count. Unfortunately, doing it right will require a Java code
change.

The right way is probably to add a method to WeblogManager, something like this:
   WeblogManager.getEntryCount(WeblogCategory cat, boolean recursive)

Then you'd need to expose that to templates, which you could do via
the Weblog object.
   Weblog.getEntryCount(WeblogCategory cat, boolean recursive)

You'd also need to add that same method to the WeblogWrapper.

If you are really interested file a patch, or at least an RFE in JIRA.
Somebody else might pick it up.

- Dave

Mime
View raw message