mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge from SEAMIST3
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10733 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -32,7 +32,9 @@ import org.alfresco.cmis.CMISService.TypesFilter;
|
||||
import org.alfresco.cmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.cmis.dictionary.CMISTypeDefinition;
|
||||
import org.alfresco.cmis.dictionary.CMISTypeId;
|
||||
import org.alfresco.cmis.search.CMISQueryOptions;
|
||||
import org.alfresco.cmis.search.CMISQueryService;
|
||||
import org.alfresco.cmis.search.CMISResultSet;
|
||||
import org.alfresco.cmis.search.FullTextSearchSupport;
|
||||
import org.alfresco.cmis.search.JoinSupport;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
@@ -215,6 +217,27 @@ public class CMISScript extends BaseScopableProcessorExtension
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve to a Types Filter
|
||||
*
|
||||
* NOTE: If specified types filter is not specified or invalid, the default types
|
||||
* filter is returned
|
||||
*
|
||||
* @param typesFilter types filter
|
||||
* @return resolved types filter
|
||||
*/
|
||||
private TypesFilter resolveTypesFilter(String typesFilter)
|
||||
{
|
||||
if (isValidTypesFilter(typesFilter))
|
||||
{
|
||||
return TypesFilter.valueOf(typesFilter);
|
||||
}
|
||||
else
|
||||
{
|
||||
return defaultTypesFilter;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds a Node with the repository given a reference
|
||||
*
|
||||
@@ -419,23 +442,21 @@ public class CMISScript extends BaseScopableProcessorExtension
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve to a Types Filter
|
||||
* Issue query
|
||||
*
|
||||
* NOTE: If specified types filter is not specified or invalid, the default types
|
||||
* filter is returned
|
||||
*
|
||||
* @param typesFilter types filter
|
||||
* @return resolved types filter
|
||||
* @param statement query statement
|
||||
* @param page
|
||||
*
|
||||
* @return paged result set
|
||||
*/
|
||||
private TypesFilter resolveTypesFilter(String typesFilter)
|
||||
public PagedResults query(String statement, Page page)
|
||||
{
|
||||
if (isValidTypesFilter(typesFilter))
|
||||
{
|
||||
return TypesFilter.valueOf(typesFilter);
|
||||
}
|
||||
else
|
||||
{
|
||||
return defaultTypesFilter;
|
||||
}
|
||||
CMISQueryOptions options = new CMISQueryOptions(statement, cmisService.getDefaultRootStoreRef());
|
||||
options.setSkipCount(page.getNumber());
|
||||
options.setMaxItems(page.getSize());
|
||||
CMISResultSet resultSet = cmisQueryService.query(options);
|
||||
Cursor cursor = paging.createCursor(resultSet.getLength() + (resultSet.hasMore() ? 1 : 0) , page);
|
||||
return paging.createPagedResult(resultSet, cursor);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user