mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Allow 'cmis-sql-strict' query language in Node Browser.
- fix up Search Service to CMIS query engine wrappers git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@15015 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -54,6 +54,7 @@ import org.alfresco.service.namespace.QName;
|
||||
public class CMISResultSetMetaDataImpl implements CMISResultSetMetaData
|
||||
{
|
||||
private CMISQueryOptions options;
|
||||
private SearchParameters searchParams;
|
||||
|
||||
private Map<String, CMISResultSetColumn> columnMetaData;
|
||||
|
||||
@@ -62,6 +63,7 @@ public class CMISResultSetMetaDataImpl implements CMISResultSetMetaData
|
||||
public CMISResultSetMetaDataImpl(CMISQueryOptions options, Query query, CMISDictionaryService cmisDictionaryService, DictionaryService alfrescoDictionaryService)
|
||||
{
|
||||
this.options = options;
|
||||
this.searchParams = new SearchParameters(options);
|
||||
|
||||
Map<String, Selector> selectors = query.getSource().getSelectors();
|
||||
selectorMetaData = new LinkedHashMap<String, CMISResultSetSelector>();
|
||||
@@ -196,7 +198,7 @@ public class CMISResultSetMetaDataImpl implements CMISResultSetMetaData
|
||||
|
||||
public SearchParameters getSearchParameters()
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
return searchParams;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -204,15 +204,12 @@ public class CMISResultSetRowImpl implements CMISResultSetRow
|
||||
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
if(getCMISResultSet().getMetaData().getColumns().length == 1)
|
||||
if (nodeRefs.size() == 1)
|
||||
{
|
||||
return getNodeRef(getCMISResultSet().getMetaData().getColumns()[0].getName());
|
||||
return nodeRefs.values().iterator().next();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new UnsupportedOperationException("Ambiguous selector");
|
||||
}
|
||||
}
|
||||
|
||||
public QName getQName()
|
||||
{
|
||||
|
@@ -41,6 +41,7 @@ import net.sf.acegisecurity.ConfigAttribute;
|
||||
import net.sf.acegisecurity.ConfigAttributeDefinition;
|
||||
import net.sf.acegisecurity.afterinvocation.AfterInvocationProvider;
|
||||
|
||||
import org.alfresco.cmis.CMISResultSet;
|
||||
import org.alfresco.repo.search.SimpleResultSetMetaData;
|
||||
import org.alfresco.repo.search.impl.lucene.PagingLuceneResultSet;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryEngineResults;
|
||||
@@ -256,13 +257,13 @@ public class ACLEntryAfterInvocationProvider implements AfterInvocationProvider,
|
||||
}
|
||||
return decide(authentication, object, config, (ChildAssociationRef) returnedObject);
|
||||
}
|
||||
else if (ResultSet.class.isAssignableFrom(returnedObject.getClass()))
|
||||
else if (CMISResultSet.class.isAssignableFrom(returnedObject.getClass()))
|
||||
{
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("Result Set access");
|
||||
log.debug("CMIS Result Set - already checked permissions for " + object.getClass().getName());
|
||||
}
|
||||
return decide(authentication, object, config, (ResultSet) returnedObject);
|
||||
return returnedObject;
|
||||
}
|
||||
else if (PagingLuceneResultSet.class.isAssignableFrom(returnedObject.getClass()))
|
||||
{
|
||||
@@ -272,6 +273,14 @@ public class ACLEntryAfterInvocationProvider implements AfterInvocationProvider,
|
||||
}
|
||||
return decide(authentication, object, config, (PagingLuceneResultSet) returnedObject);
|
||||
}
|
||||
else if (ResultSet.class.isAssignableFrom(returnedObject.getClass()))
|
||||
{
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("Result Set access");
|
||||
}
|
||||
return decide(authentication, object, config, (ResultSet) returnedObject);
|
||||
}
|
||||
else if (QueryEngineResults.class.isAssignableFrom(returnedObject.getClass()))
|
||||
{
|
||||
if (log.isDebugEnabled())
|
||||
|
@@ -34,6 +34,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.MLAnalysisMode;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryOptions;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
|
||||
@@ -164,6 +165,30 @@ public class SearchParameters
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct from Query Options
|
||||
*
|
||||
* @param options
|
||||
*/
|
||||
public SearchParameters(QueryOptions options)
|
||||
{
|
||||
setBulkFetch(options.getFetchSize() > 0);
|
||||
setBulkFetchSize(options.getFetchSize());
|
||||
setSkipCount(options.getSkipCount());
|
||||
setMaxPermissionChecks(options.getMaxPermissionChecks());
|
||||
setMaxPermissionCheckTimeMillis(options.getMaxPermissionCheckTimeMillis());
|
||||
if (options.getMaxItems() >= 0)
|
||||
{
|
||||
setLimitBy(LimitBy.FINAL_SIZE);
|
||||
setLimit(options.getMaxItems());
|
||||
setMaxItems(options.getMaxItems());
|
||||
}
|
||||
else
|
||||
{
|
||||
setLimitBy(LimitBy.UNLIMITED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the search language
|
||||
*
|
||||
|
Reference in New Issue
Block a user