[daisy] COUNT in queries
Mark H
mailinglists at markhorgan.com
Wed Jul 26 11:32:04 CDT 2006
I came across that problem too - I wanted to select a random document. All I
could come with was to do a query (in the DocumentApple), like:
public class DocumentApple extends org.outerj.daisy.frontend.DocumentApple{
...
QueryManager queryManager = repository.getQueryManager();
SearchResultDocument results=queryManager.performQuery("select
id,$ProfileButtonX where documentType='Photo'", Locale.getDefault());
int numDocuments=results.getSearchResult().getRows().sizeOfRowArray();
viewData.put("numDocuments", numDocuments);
Mark H
-----Original Message-----
From: daisy-bounces at lists.cocoondev.org
[mailto:daisy-bounces at lists.cocoondev.org] On Behalf Of Yves Langisch
Sent: 26 July 2006 17:18
To: Daisy: open source CMS - general mailinglist
Subject: [daisy] COUNT in queries
Hi,
Is there an easy way to count the elements of the resultset returned by
a query? I couldn't find any COUNT function for the query language. My
current workaround is to read the size in my custom stylesheet from
<ns:resultInfo size="5" chunkOffset="1" chunkLength="5"/> which is not
very efficient in case of a big resultset (the whole resultset is in the
response).
Thanks
Yves
_______________________________________________
daisy community mailing list
Professional Daisy support:
http://outerthought.org/site/services/daisy/daisysupport.html
mail to: daisy at lists.cocoondev.org
list information: http://lists.cocoondev.org/mailman/listinfo/daisy
More information about the daisy
mailing list