07-07-2013 11:03 AM
String queryString = "SELECT * FROM cmis:folder where contains('PATH:\"/cm:generalclassifiable//*\"')";
List<CmisObject> objList = new ArrayList<CmisObject>();
// execute query
ItemIterable<QueryResult> results = session.query(queryString, false);
System.out.println("TOTAL DE RESULTADOS => "+results.getTotalNumItems());
for (QueryResult qResult : results) {
String objectId = "";
PropertyData<?> propData = qResult.getPropertyById("cmis:objectId"); // Atom Pub binding
if (propData != null) {
objectId = (String) propData.getFirstValue();
} else {
objectId = qResult.getPropertyValueByQueryName("d.cmis:objectId"); // Web Services binding
}
CmisObject obj = session.getObject(session.createObjectId(objectId));
objList.add(obj);
}
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
int iCount = 1;
for (CmisObject result : objList) {
System.out.println("———————-\r\nResult " + iCount + ":");
System.out.println("id:" + result.getId());
System.out.println("name:" + result.getName());
System.out.println("created:" + dateFormat.format(result.getCreationDate().getTime()));
iCount ++;
}
07-19-2013 04:48 PM
07-22-2013 02:57 PM
String luceneQueryString = "PATH:\""+ROOT_CATEGORY+(categoryPath==null?"":encodeCategoryPath(categoryPath))+"\"";
Query query = new Query(Constants.QUERY_LANG_LUCENE, luceneQueryString);
QueryResult result = WebServiceFactory.getRepositoryService().query(STORE, query, true);
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.