Bénigot Yves wrote:
>
> How can we program statistics such as :
> - the total number of documents
> - compute the number of documents per property values for a given property
> - compute a two dimensional table of the number of documents per property
> values for a given property couple
> ?
>
Here is a start:
QueryManager qm = session.getWorkspace().getQueryManager();
Query q = qm.createQuery("SELECT * FROM [nt:file] WHERE LOCALNAME() LIKE
'%.txt' and [\"jcr:createdBy\"] = 'anonymous'", Query.JCR_SQL2);
QueryResult qr = q.execute();
long stat = qr.getRows().getSize();
Considering you're using 2.0, be wary of [0]
[0] https://issues.apache.org/jira/browse/JCR-2765
--
View this message in context:
http://jackrabbit.510166.n4.nabble.com/Q-how-to-make-repository-content-statistics-tp3815458p3815803.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.