Document counts from Spaces
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2010 05:56 PM
Has anybody run mysql database queries in alfresco backend to find the number of documents under a particluar Space/folder? or found other ways to get document counts in Alfresco? Thanks for your help Steve
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2010 09:23 AM
Below, the code I use for this :
You need to use lucene query for this
/** * number of documents having parent's folder as pSrcNodeRef and of type pType<br> * * @param pType * Type de document à retourner * @param pSrcNodeRef * Dossier source où sont les documents * @return number of doc. in pSrcFolder of type pType */ public Integer getDocumentListCount(QName pType, NodeRef pSrcNodeRef) { MscValidateUtil.validateNotNull( pType ); MscValidateUtil.validateNotNull( pSrcNodeRef ); MscValidateUtil.validate( Arrays.asList( pSrcNodeRef ), ContentModel.TYPE_FOLDER, nodeService ); String lSrcFolderName = (String) nodeService.getProperty( pSrcNodeRef, ContentModel.PROP_NAME ); ResultSet lResultSet = searchService.query( MscStoreEnum.WORKSPACE_SPACES_STORE.getStoreRef(), SearchService.LANGUAGE_LUCENE, "+PATH:\"/app:company_home/cm:" + lSrcFolderName + "/*\"" + " +TYPE:\"" + pType + "\"" ); lResultSet.getResultSetMetaData().getSearchParameters().setLimitBy( LimitBy.UNLIMITED ); return lResultSet.length(); }
You need to use lucene query for this
