mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merge from SEAMIST3
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10735 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -32,7 +32,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.alfresco.cmis.dictionary.CMISCardinality;
|
||||
import org.alfresco.cmis.CMISCardinalityEnum;
|
||||
import org.alfresco.cmis.CMISJoinEnum;
|
||||
import org.alfresco.cmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.cmis.dictionary.CMISMapping;
|
||||
import org.alfresco.cmis.dictionary.CMISPropertyDefinition;
|
||||
@@ -40,7 +41,6 @@ import org.alfresco.cmis.dictionary.CMISScope;
|
||||
import org.alfresco.cmis.dictionary.CMISTypeId;
|
||||
import org.alfresco.cmis.search.CMISQueryException;
|
||||
import org.alfresco.cmis.search.CMISQueryOptions;
|
||||
import org.alfresco.cmis.search.JoinSupport;
|
||||
import org.alfresco.repo.search.impl.parsers.CMISLexer;
|
||||
import org.alfresco.repo.search.impl.parsers.CMISParser;
|
||||
import org.alfresco.repo.search.impl.parsers.FTSLexer;
|
||||
@@ -95,9 +95,9 @@ public class CMISQueryParser
|
||||
|
||||
private CMISMapping cmisMapping;
|
||||
|
||||
private JoinSupport joinSupport;
|
||||
private CMISJoinEnum joinSupport;
|
||||
|
||||
public CMISQueryParser(CMISQueryOptions options, CMISDictionaryService cmisDictionaryService, CMISMapping cmisMapping, JoinSupport joinSupport)
|
||||
public CMISQueryParser(CMISQueryOptions options, CMISDictionaryService cmisDictionaryService, CMISMapping cmisMapping, CMISJoinEnum joinSupport)
|
||||
{
|
||||
this.options = options;
|
||||
this.cmisDictionaryService = cmisDictionaryService;
|
||||
@@ -685,7 +685,7 @@ public class CMISQueryParser
|
||||
Map<String, CMISPropertyDefinition> propDefs = cmisDictionaryService.getPropertyDefinitions(typeId);
|
||||
for (CMISPropertyDefinition definition : propDefs.values())
|
||||
{
|
||||
if (definition.getCardinality() == CMISCardinality.SINGLE_VALUED)
|
||||
if (definition.getCardinality() == CMISCardinalityEnum.SINGLE_VALUED)
|
||||
{
|
||||
Function function = factory.getFunction(PropertyAccessor.NAME);
|
||||
QName propertyQName = cmisMapping.getPropertyQName(definition.getPropertyName());
|
||||
@@ -730,7 +730,7 @@ public class CMISQueryParser
|
||||
Map<String, CMISPropertyDefinition> propDefs = cmisDictionaryService.getPropertyDefinitions(typeId);
|
||||
for (CMISPropertyDefinition definition : propDefs.values())
|
||||
{
|
||||
if (definition.getCardinality() == CMISCardinality.SINGLE_VALUED)
|
||||
if (definition.getCardinality() == CMISCardinalityEnum.SINGLE_VALUED)
|
||||
{
|
||||
Function function = factory.getFunction(PropertyAccessor.NAME);
|
||||
QName propertyQName = cmisMapping.getPropertyQName(definition.getPropertyName());
|
||||
@@ -1007,7 +1007,7 @@ public class CMISQueryParser
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Source buildSource(CommonTree source, JoinSupport joinSupport, QueryModelFactory factory)
|
||||
private Source buildSource(CommonTree source, CMISJoinEnum joinSupport, QueryModelFactory factory)
|
||||
{
|
||||
if (source.getChildCount() == 1)
|
||||
{
|
||||
@@ -1015,7 +1015,7 @@ public class CMISQueryParser
|
||||
CommonTree singleTableNode = (CommonTree) source.getChild(0);
|
||||
if (singleTableNode.getType() == CMISParser.TABLE)
|
||||
{
|
||||
if (joinSupport == JoinSupport.NO_JOIN_SUPPORT)
|
||||
if (joinSupport == CMISJoinEnum.NO_JOIN_SUPPORT)
|
||||
{
|
||||
throw new UnsupportedOperationException("Joins are not supported");
|
||||
}
|
||||
@@ -1042,7 +1042,7 @@ public class CMISQueryParser
|
||||
}
|
||||
else
|
||||
{
|
||||
if (joinSupport == JoinSupport.NO_JOIN_SUPPORT)
|
||||
if (joinSupport == CMISJoinEnum.NO_JOIN_SUPPORT)
|
||||
{
|
||||
throw new UnsupportedOperationException("Joins are not supported");
|
||||
}
|
||||
@@ -1075,7 +1075,7 @@ public class CMISQueryParser
|
||||
joinType = JoinType.LEFT;
|
||||
}
|
||||
|
||||
if ((joinType == JoinType.LEFT) && (joinSupport == JoinSupport.INNER_JOIN_SUPPORT))
|
||||
if ((joinType == JoinType.LEFT) && (joinSupport == CMISJoinEnum.INNER_JOIN_SUPPORT))
|
||||
{
|
||||
throw new UnsupportedOperationException("Outer joins are not supported");
|
||||
}
|
||||
|
@@ -27,7 +27,10 @@ package org.alfresco.cmis.search.impl;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.cmis.CMISQueryEnum;
|
||||
import org.alfresco.cmis.CMISService;
|
||||
import org.alfresco.cmis.CMISFullTextSearchEnum;
|
||||
import org.alfresco.cmis.CMISJoinEnum;
|
||||
import org.alfresco.cmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.cmis.dictionary.CMISMapping;
|
||||
import org.alfresco.cmis.property.CMISPropertyService;
|
||||
@@ -36,8 +39,6 @@ import org.alfresco.cmis.search.CMISQueryService;
|
||||
import org.alfresco.cmis.search.CMISResultSet;
|
||||
import org.alfresco.cmis.search.CMISResultSetImpl;
|
||||
import org.alfresco.cmis.search.CmisFunctionEvaluationContext;
|
||||
import org.alfresco.cmis.search.FullTextSearchSupport;
|
||||
import org.alfresco.cmis.search.JoinSupport;
|
||||
import org.alfresco.repo.search.impl.querymodel.Query;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryEngine;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -123,7 +124,6 @@ public class CMISQueryServiceImpl implements CMISQueryService
|
||||
{
|
||||
CMISQueryParser parser = new CMISQueryParser(options, cmisDictionaryService, cmisMapping, getJoinSupport());
|
||||
Query query = parser.parse(queryEngine.getQueryModelFactory());
|
||||
System.out.println(query);
|
||||
|
||||
CmisFunctionEvaluationContext functionContext = new CmisFunctionEvaluationContext();
|
||||
functionContext.setCmisDictionaryService(cmisDictionaryService);
|
||||
@@ -148,6 +148,16 @@ public class CMISQueryServiceImpl implements CMISQueryService
|
||||
return query(options);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.alfresco.cmis.search.CMISQueryService#getPwcSearchable()
|
||||
*/
|
||||
public boolean getPwcSearchable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -158,14 +168,24 @@ public class CMISQueryServiceImpl implements CMISQueryService
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.alfresco.cmis.search.CMISQueryService#getQuerySupport()
|
||||
*/
|
||||
public CMISQueryEnum getQuerySupport()
|
||||
{
|
||||
return CMISQueryEnum.BOTH;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.alfresco.cmis.search.CMISQueryService#getFullTextSearchSupport()
|
||||
*/
|
||||
public FullTextSearchSupport getFullTextSearchSupport()
|
||||
public CMISFullTextSearchEnum getFullTextSearchSupport()
|
||||
{
|
||||
return FullTextSearchSupport.FULL_TEXT_AND_STRUCTURED;
|
||||
return CMISFullTextSearchEnum.FULL_TEXT_AND_STRUCTURED;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -173,9 +193,8 @@ public class CMISQueryServiceImpl implements CMISQueryService
|
||||
*
|
||||
* @see org.alfresco.cmis.search.CMISQueryService#getJoinSupport()
|
||||
*/
|
||||
public JoinSupport getJoinSupport()
|
||||
public CMISJoinEnum getJoinSupport()
|
||||
{
|
||||
return JoinSupport.NO_JOIN_SUPPORT;
|
||||
return CMISJoinEnum.NO_JOIN_SUPPORT;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user