本文整理汇总了Java中org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode类的典型用法代码示例。如果您正苦于以下问题:Java CMISQueryMode类的具体用法?Java CMISQueryMode怎么用?Java CMISQueryMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CMISQueryMode类属于org.alfresco.opencmis.search.CMISQueryOptions包,在下文中一共展示了CMISQueryMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPropertyToSelectorBinding
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
/**
* In strict mode you should not be able to refer to aspect properties direct from the type
* @throws Exception
*/
public void testPropertyToSelectorBinding() throws Exception
{
testQuery("SELECT cmis:parentId FROM cmis:document", 10, false, "cmis:objectId", new String(), true, CMISQueryMode.CMS_STRICT);
testQuery("SELECT * FROM cmis:document where cmis:parentId <> 'woof://woof/woof'", 10, false, "cmis:objectId", new String(), true, CMISQueryMode.CMS_STRICT);
testQuery("SELECT D.*, O.cmis:name FROM CMIS:DOCUMENT AS D JOIN CM:OWNABLE AS O ON D.cmis:objectId = O.cmis:objectId", 1, false, "cmis:objectId", new String(), true,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.cmis:name FROM CMIS:DOCUMENT AS D LEFT OUTER JOIN CM:OWNABLE AS O ON D.cmis:objectId = O.cmis:objectId where O.cm:owner is not null", 1, false, "cmis:objectId", new String(), true,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.cmis:name FROM CMIS:DOCUMENT AS D LEFT OUTER JOIN CM:OWNABLE AS O ON D.cmis:objectId = O.cmis:objectId where O.cm:owner is null", 1, false, "cmis:objectId", new String(), true,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.cmis:name FROM CMIS:DOCUMENT AS D LEFT OUTER JOIN CM:OWNABLE AS O ON D.cmis:objectId = O.cmis:objectId", 20, false, "cmis:objectId", new String(), true,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT * FROM cmis:document order by cmis:parentId", 10, false, "cmis:objectId", new String(), true, CMISQueryMode.CMS_STRICT);
testQuery("SELECT * FROM cmis:document where CONTAINS('cmis:parentId:*')", 10, false, "cmis:objectId", new String(), true, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
}
示例2: test_IN_TREE
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
@Category(RedundantTests.class)
public void test_IN_TREE() throws Exception
{
String id = cmisConnector.createNodeInfo(f0).getObjectId();
testQuery("SELECT * FROM cmis:folder WHERE IN_TREE('" + id + "')", 6, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder F WHERE IN_TREE(F, '" + id + "')", 6, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder X WHERE IN_TREE(F, '" + id + "')", 6, false, "cmis:objectId", new String(), true);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_TREE(D, '" + id + "')", 1, false, "cmis:objectId",
new String(), false, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_TREE('" + id + "')", 1, false, "cmis:objectId",
new String(), true, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_TREE('" + id + ";versionLabel" + "')", 0, false, "cmis:objectId",
new String(), true, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT * FROM cmis:folder WHERE IN_TREE('woof://woof/woof')", 0, false, "cmis:objectId", new String(), true);
testQuery("SELECT * FROM cmis:folder WHERE IN_TREE('woof://woof/woof;woof')", 0, false, "cmis:objectId", new String(), true);
}
示例3: test_IN_FOLDER
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
@Category(RedundantTests.class)
public void test_IN_FOLDER() throws Exception
{
String id = cmisConnector.createNodeInfo(f0).getObjectId();
testQuery("SELECT * FROM cmis:folder WHERE IN_FOLDER('" + id + "')", 2, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder F WHERE IN_FOLDER(F, '" + id + "')", 2, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder X WHERE IN_FOLDER(F, '" + id + "')", 2, false, "cmis:objectId", new String(), true);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_FOLDER(D, '" + id + "')", 1, false, "cmis:objectId",
new String(), false, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_FOLDER('" + id + "')", 1, false, "cmis:objectId",
new String(), true, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_FOLDER('" + id + ";versionLabel" + "')", 0, false, "cmis:objectId",
new String(), true, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
// TODO: Id + label is indistinguishable from label and so is never hit in the coes at the moment
// testQuery("SELECT * FROM cmis:folder WHERE IN_FOLDER('woof://woof/woof;woof')", 2, false, "cmis:objectId",
// new String(), false);
testQuery("SELECT * FROM cmis:folder WHERE IN_FOLDER('woof://woof/woof')", 0, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder WHERE IN_FOLDER('woof://woof/woof;woof')", 0, false, "cmis:objectId", new String(), false);
}
示例4: testAspectProperties
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
@Category(RedundantTests.class)
public void testAspectProperties()
{
CMISQueryOptions options = new CMISQueryOptions("SELECT * FROM cm:ownable O", rootNodeRef.getStoreRef());
options.setQueryMode(CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
CMISResultSet rs = cmisQueryService.query(options);
CMISResultSetMetaData md = rs.getMetaData();
assertNotNull(md.getQueryOptions());
assertEquals(13, md.getColumnNames().length);
assertNotNull(md.getColumn("O.cm:owner"));
assertEquals(1, md.getSelectors().length);
assertNotNull(md.getSelector("O"));
for (CMISResultSetRow row : rs)
{
System.out.println("\n\n");
System.out.println(row.getValues());
System.out.println("\n\n");
}
rs.close();
}
示例5: getCMISQuery
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
/**
*
* @param mode CMISQueryMode
* @param req SolrQueryRequest
* @param queryModelQuery Query
* @param cmisVersion CmisVersion
* @param alternativeDictionary String
* @return Query
* @throws ParseException
*/
public Query getCMISQuery(CMISQueryMode mode, Pair<SearchParameters, Boolean> searchParametersAndFilter, SolrQueryRequest req, org.alfresco.repo.search.impl.querymodel.Query queryModelQuery, CmisVersion cmisVersion, String alternativeDictionary) throws ParseException
{
SearchParameters searchParameters = searchParametersAndFilter.getFirst();
Boolean isFilter = searchParametersAndFilter.getSecond();
BaseTypeId[] validScopes = (mode == CMISQueryMode.CMS_STRICT) ? CmisFunctionEvaluationContext.STRICT_SCOPES : CmisFunctionEvaluationContext.ALFRESCO_SCOPES;
CmisFunctionEvaluationContext functionContext = getCMISFunctionEvaluationContext(mode, cmisVersion, alternativeDictionary);
Set<String> selectorGroup = queryModelQuery.getSource().getSelectorGroups(functionContext).get(0);
LuceneQueryBuilderContext<Query, Sort, ParseException> luceneContext = getLuceneQueryBuilderContext(searchParameters, req, alternativeDictionary, FTSQueryParser.RerankPhase.SINGLE_PASS);
@SuppressWarnings("unchecked")
LuceneQueryBuilder<Query, Sort, ParseException> builder = (LuceneQueryBuilder<Query, Sort, ParseException>) queryModelQuery;
org.apache.lucene.search.Query luceneQuery = builder.buildQuery(selectorGroup, luceneContext, functionContext);
ContextAwareQuery contextAwareQuery = new ContextAwareQuery(luceneQuery, Boolean.TRUE.equals(isFilter) ? null : searchParameters);
return contextAwareQuery;
}
示例6: test_IN_TREE
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
public void test_IN_TREE() throws Exception
{
String id = cmisConnector.createNodeInfo(f0).getObjectId();
testQuery("SELECT * FROM cmis:folder WHERE IN_TREE('" + id + "')", 6, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder F WHERE IN_TREE(F, '" + id + "')", 6, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder X WHERE IN_TREE(F, '" + id + "')", 6, false, "cmis:objectId", new String(), true);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_TREE(D, '" + id + "')", 1, false, "cmis:objectId",
new String(), false, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_TREE('" + id + "')", 1, false, "cmis:objectId",
new String(), true, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_TREE('" + id + ";versionLabel" + "')", 0, false, "cmis:objectId",
new String(), true, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT * FROM cmis:folder WHERE IN_TREE('woof://woof/woof')", 0, false, "cmis:objectId", new String(), true);
testQuery("SELECT * FROM cmis:folder WHERE IN_TREE('woof://woof/woof;woof')", 0, false, "cmis:objectId", new String(), true);
}
示例7: test_IN_FOLDER
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
public void test_IN_FOLDER() throws Exception
{
String id = cmisConnector.createNodeInfo(f0).getObjectId();
testQuery("SELECT * FROM cmis:folder WHERE IN_FOLDER('" + id + "')", 2, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder F WHERE IN_FOLDER(F, '" + id + "')", 2, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder X WHERE IN_FOLDER(F, '" + id + "')", 2, false, "cmis:objectId", new String(), true);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_FOLDER(D, '" + id + "')", 1, false, "cmis:objectId",
new String(), false, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_FOLDER('" + id + "')", 1, false, "cmis:objectId",
new String(), true, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT D.*, O.* FROM cmis:document AS D JOIN cm:ownable AS O ON D.cmis:objectId = O.cmis:objectId WHERE IN_FOLDER('" + id + ";versionLabel" + "')", 0, false, "cmis:objectId",
new String(), true, CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
// TODO: Id + label is indistinguishable from label and so is never hit in the coes at the moment
// testQuery("SELECT * FROM cmis:folder WHERE IN_FOLDER('woof://woof/woof;woof')", 2, false, "cmis:objectId",
// new String(), false);
testQuery("SELECT * FROM cmis:folder WHERE IN_FOLDER('woof://woof/woof')", 0, false, "cmis:objectId", new String(), false);
testQuery("SELECT * FROM cmis:folder WHERE IN_FOLDER('woof://woof/woof;woof')", 0, false, "cmis:objectId", new String(), false);
}
示例8: testAspectProperties
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
public void testAspectProperties()
{
CMISQueryOptions options = new CMISQueryOptions("SELECT * FROM cm:ownable O", rootNodeRef.getStoreRef());
options.setQueryMode(CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
CMISResultSet rs = cmisQueryService.query(options);
CMISResultSetMetaData md = rs.getMetaData();
assertNotNull(md.getQueryOptions());
assertEquals(13, md.getColumnNames().length);
assertNotNull(md.getColumn("O.cm:owner"));
assertEquals(1, md.getSelectors().length);
assertNotNull(md.getSelector("O"));
for (CMISResultSetRow row : rs)
{
System.out.println("\n\n");
System.out.println(row.getValues());
System.out.println("\n\n");
}
rs.close();
}
示例9: getCMISQuery
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
public Query getCMISQuery(CMISQueryMode mode, Pair<SearchParameters, Boolean> searchParametersAndFilter, IndexReader indexReader, org.alfresco.repo.search.impl.querymodel.Query queryModelQuery, CmisVersion cmisVersion, String alternativeDictionary)
throws ParseException
{
SearchParameters searchParameters = searchParametersAndFilter.getFirst();
Boolean isFilter = searchParametersAndFilter.getSecond();
BaseTypeId[] validScopes = (mode == CMISQueryMode.CMS_STRICT) ? CmisFunctionEvaluationContext.STRICT_SCOPES : CmisFunctionEvaluationContext.ALFRESCO_SCOPES;
CmisFunctionEvaluationContext functionContext = getCMISFunctionEvaluationContext(mode, cmisVersion, alternativeDictionary);
Set<String> selectorGroup = queryModelQuery.getSource().getSelectorGroups(functionContext).get(0);
LuceneQueryBuilderContext<Query, Sort, ParseException> luceneContext = getLuceneQueryBuilderContext(searchParameters, indexReader, alternativeDictionary);
@SuppressWarnings("unchecked")
LuceneQueryBuilder<Query, Sort, ParseException> builder = (LuceneQueryBuilder<Query, Sort, ParseException>) queryModelQuery;
org.apache.lucene.search.Query luceneQuery = builder.buildQuery(selectorGroup, luceneContext, functionContext);
ContextAwareQuery contextAwareQuery = new ContextAwareQuery(luceneQuery, Boolean.TRUE.equals(isFilter) ? null : searchParameters);
return contextAwareQuery;
}
示例10: executeQueryImpl
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
private ResultSet executeQueryImpl(SearchParameters searchParameters, ADMLuceneSearcherImpl admLuceneSearcher)
{
CMISQueryOptions options = CMISQueryOptions.create(searchParameters);
options.setQueryMode(CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
CapabilityJoin joinSupport = CapabilityJoin.INNERANDOUTER;
BaseTypeId[] validScopes = CmisFunctionEvaluationContext.ALFRESCO_SCOPES;
CmisFunctionEvaluationContext functionContext = new CmisFunctionEvaluationContext();
functionContext.setCmisDictionaryService(cmisDictionaryService);
functionContext.setValidScopes(validScopes);
CMISQueryParser parser = new CMISQueryParser(options, cmisDictionaryService, joinSupport);
org.alfresco.repo.search.impl.querymodel.Query queryModelQuery = parser.parse(new DBQueryModelFactory(), functionContext);
// build lucene query
Set<String> selectorGroup = null;
if (queryModelQuery.getSource() != null)
{
List<Set<String>> selectorGroups = queryModelQuery.getSource().getSelectorGroups(functionContext);
if (selectorGroups.size() == 0)
{
throw new UnsupportedOperationException("No selectors");
}
if (selectorGroups.size() > 1)
{
throw new UnsupportedOperationException("Advanced join is not supported");
}
selectorGroup = selectorGroups.get(0);
}
QueryEngineResults results = queryEngine.executeQuery(queryModelQuery, options, functionContext);
ResultSet resultSet = results.getResults().values().iterator().next();
return resultSet;
}
示例11: executeQueryUsingEngine
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
private Pair<Query, QueryEngineResults> executeQueryUsingEngine(QueryEngine queryEngine, CMISQueryOptions options)
{
CapabilityJoin joinSupport = getJoinSupport();
if (options.getQueryMode() == CMISQueryOptions.CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS)
{
joinSupport = CapabilityJoin.INNERANDOUTER;
}
// TODO: Refactor to avoid duplication of valid scopes here and in
// CMISQueryParser
BaseTypeId[] validScopes = (options.getQueryMode() == CMISQueryMode.CMS_STRICT) ? CmisFunctionEvaluationContext.STRICT_SCOPES
: CmisFunctionEvaluationContext.ALFRESCO_SCOPES;
CmisFunctionEvaluationContext functionContext = new CmisFunctionEvaluationContext();
functionContext.setCmisDictionaryService(cmisDictionaryService);
functionContext.setNodeService(nodeService);
functionContext.setValidScopes(validScopes);
CMISQueryParser parser = new CMISQueryParser(options, cmisDictionaryService, joinSupport);
QueryConsistency queryConsistency = options.getQueryConsistency();
if (queryConsistency == QueryConsistency.DEFAULT)
{
options.setQueryConsistency(QueryConsistency.EVENTUAL);
}
Query query = parser.parse(queryEngine.getQueryModelFactory(), functionContext);
QueryEngineResults queryEngineResults = queryEngine.executeQuery(query, options, functionContext);
return new Pair<Query, QueryEngineResults>(query, queryEngineResults);
}
示例12: testFunctionColumns
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
public void testFunctionColumns()
{
CMISQueryOptions options = new CMISQueryOptions(
"SELECT DOC.cmis:name AS cmis:name, \nLOWER(\tDOC.cmis:name \n), LOWER ( DOC.cmis:name ) AS Lcmis:name, UPPER ( DOC.cmis:name ) , UPPER(DOC.cmis:name) AS Ucmis:name, Score(), SCORE() AS S1, SCORE() AS SCORED FROM cmis:folder AS DOC",
rootNodeRef.getStoreRef());
options.setQueryMode(CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
CMISResultSet rs = cmisQueryService.query(options);
CMISResultSetMetaData md = rs.getMetaData();
assertNotNull(md.getQueryOptions());
assertEquals(8, md.getColumnNames().length);
assertNotNull(md.getColumn("cmis:name"));
assertNotNull(md.getColumn("LOWER(\tDOC.cmis:name \n)"));
assertNotNull(md.getColumn("Lcmis:name"));
assertNotNull(md.getColumn("UPPER ( DOC.cmis:name )"));
assertNotNull(md.getColumn("Ucmis:name"));
assertNotNull(md.getColumn("SEARCH_SCORE"));
assertNotNull(md.getColumn("S1"));
assertNotNull(md.getColumn("SCORED"));
assertEquals(1, md.getSelectors().length);
assertNotNull(md.getSelector("DOC"));
for (CMISResultSetRow row : rs)
{
System.out.println("\n\n");
System.out.println(row.getValues());
System.out.println("\n\n");
}
rs.close();
}
示例13: testDateFormattingErrors
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
public void testDateFormattingErrors() throws Exception
{
testQuery("SELECT * FROM cm:lockable L WHERE L.cm:expiryDate = TIMESTAMP '2012-12-12T12:12:12.012Z'", 1, false, "cmis:objectId", new String(), false,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT * FROM cm:lockable L WHERE L.cm:expiryDate = TIMESTAMP '2012-012-12T12:12:12.012Z'", 1, false, "cmis:objectId", new String(), false,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT * FROM cm:lockable L WHERE L.cm:expiryDate = TIMESTAMP '2012-2-12T12:12:12.012Z'", 0, false, "cmis:objectId", new String(), false,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT * FROM cm:lockable L WHERE L.cm:expiryDate = TIMESTAMP 'Mon Dec 12 12:12:12.012 GMT 2012'", 1, false, "cmis:objectId", new String(), true,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
}
示例14: testFTSConnectives
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
@Category(RedundantTests.class)
public void testFTSConnectives() throws Exception
{
testQuery("SELECT * FROM cmis:document where contains('\\'one\\' OR \\'zebra\\'')", doc_count-1, false, "cmis:objectId", new String(), false, CMISQueryMode.CMS_STRICT);
testQuery("SELECT * FROM cmis:document where contains('\\'one\\' or \\'zebra\\'')", doc_count-1, false, "cmis:objectId", new String(), false, CMISQueryMode.CMS_STRICT);
testQuery("SELECT * FROM cmis:document where contains('\\'one\\' \\'zebra\\'')", 1, false, "cmis:objectId", new String(), false, CMISQueryMode.CMS_STRICT);
testQuery("SELECT * FROM cmis:document where contains('\\'one\\' and \\'zebra\\'')", 1, false, "cmis:objectId", new String(), false,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT * FROM cmis:document where contains('\\'one\\' or \\'zebra\\'')", doc_count-1, false, "cmis:objectId", new String(), false,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
testQuery("SELECT * FROM cmis:document where contains('\\'one\\' \\'zebra\\'')", 1, false, "cmis:objectId", new String(), false,
CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
CMISQueryOptions options = new CMISQueryOptions("SELECT * FROM cmis:document where contains('\\'one\\' \\'zebra\\'')", rootNodeRef.getStoreRef());
// options.setQueryMode(CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
options.setDefaultFTSConnective(Connective.OR);
options.setDefaultFTSFieldConnective(Connective.OR);
CMISResultSet rs = cmisQueryService.query(options);
assertEquals(1, rs.length());
rs.close();
options = new CMISQueryOptions("SELECT * FROM cmis:document where contains('\\'one\\' \\'zebra\\'')", rootNodeRef.getStoreRef());
options.setQueryMode(CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
options.setDefaultFTSConnective(Connective.OR);
options.setDefaultFTSFieldConnective(Connective.OR);
options.setQueryMode(CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
rs = cmisQueryService.query(options);
assertEquals(doc_count-1, rs.length());
rs.close();
}
示例15: testOrderableProperty
import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode; //导入依赖的package包/类
private void testOrderableProperty(String propertyQueryName)
{
testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " ASC", 13, false, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
propertyQueryName);
testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, false, Order.DESCENDING, CMISQueryMode.CMS_STRICT,
propertyQueryName);
testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, true, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
propertyQueryName);
}