List<Document> documentList = new ArrayList<Document>();
// build query
ObjectType type = session.getTypeDefinition(BaseTypeId.CMIS_DOCUMENT.value());
PropertyDefinition<?> objectIdPropDef = type.getPropertyDefinitions().get(PropertyIds.OBJECT_ID);
String ObjectIdQueryName = objectIdPropDef.getQueryName();
String queryString = MessageFormat.format(QUERY_SEARCH_DOCUMENTS, ObjectIdQueryName, type.getQueryName(), term);
System.out.println("Query : "+queryString);
// execute query
ItemIterable<QueryResult> results = session.query(queryString, false);
for (QueryResult qResult : results) {
String objectId = qResult.getPropertyValueByQueryName(ObjectIdQueryName);
System.out.println("objectId : "+objectId);
Document document = (Document)session.getObject(objectId);
documentList.add(document);
}
Searching documents containing 'test'…
Query : SELECT * FROM cmis:document WHERE CONTAINS('test')
Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Parsing exception!
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.parse(AbstractAtomPubService.java:531)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(DiscoveryServiceImpl.java:147)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(SessionImpl.java:557)
at org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(AbstractIterator.java:132)
at org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(CollectionIterator.java:48)
at fr.virage.service.impl.CMISRemoteServiceImpl.searchDocuments(CMISRemoteServiceImpl.java:110)
at fr.virage.Main.searchDocuments(Main.java:52)
at fr.virage.Main.main(Main.java:40)
Caused by: com.ctc.wstx.exc.WstxParsingException: Unrecognized XML directive; expected CDATA or comment ('<![CDATA[' or '<!–').
at [row,col {unknown-source}]: [89,17]
at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:605)
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTreeCommentOrCData(BasicStreamReader.java:3285)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2822)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.next(AtomPubParser.java:650)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.skip(AtomPubParser.java:633)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseElement(AtomPubParser.java:380)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseEntry(AtomPubParser.java:295)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseFeed(AtomPubParser.java:256)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parse(AtomPubParser.java:120)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.parse(AbstractAtomPubService.java:529)
… 7 more
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.