use of org.alfresco.service.cmr.search.SearchParameters in project alfresco-repository by Alfresco.
the class VirtualQueryImpl method createSearchParameters.
private SearchParameters createSearchParameters(boolean files, boolean folders, PagingRequest pagingRequest) throws VirtualizationException {
SearchParameters searchParameters = new SearchParameters();
if (store != null) {
searchParameters.addStore(new StoreRef(store));
} else {
searchParameters.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
}
searchParameters.setLanguage(language);
searchParameters.setQuery(filter(language, query, files, folders));
searchParameters.setQueryConsistency(QueryConsistency.TRANSACTIONAL_IF_POSSIBLE);
if (pagingRequest != null) {
searchParameters.setSkipCount(pagingRequest.getSkipCount());
searchParameters.setMaxItems(pagingRequest.getMaxItems());
}
return searchParameters;
}
use of org.alfresco.service.cmr.search.SearchParameters in project alfresco-repository by Alfresco.
the class FilesFoldersConstraint method applyDecorations.
@Override
protected SearchParameters applyDecorations(ActualEnvironment environment, SearchParameters searchParameters, VirtualQuery query) {
String queryString = searchParameters.getQuery();
String language = searchParameters.getLanguage();
String filteredQuery = filter(language, queryString, files, folders);
SearchParameters searchParametersCopy = searchParameters.copy();
searchParametersCopy.setQuery(filteredQuery);
return searchParametersCopy;
}
use of org.alfresco.service.cmr.search.SearchParameters in project alfresco-repository by Alfresco.
the class PagingRequestConstraint method applyDecorations.
@Override
protected SearchParameters applyDecorations(ActualEnvironment environment, SearchParameters searchParameters, VirtualQuery query) {
SearchParameters searchParametersCopy = searchParameters.copy();
if (pagingRequest != null) {
searchParametersCopy.setSkipCount(pagingRequest.getSkipCount());
searchParametersCopy.setMaxItems(pagingRequest.getMaxItems());
}
return searchParametersCopy;
}
use of org.alfresco.service.cmr.search.SearchParameters in project alfresco-repository by Alfresco.
the class SortConstraint method applyDecorations.
@Override
protected SearchParameters applyDecorations(ActualEnvironment environment, SearchParameters searchParameters, VirtualQuery query) {
SearchParameters searchParametersCopy = searchParameters.copy();
for (Pair<QName, Boolean> sort : sortProps) {
if (!IGNORED_SORT_PROPERTIES.contains(sort.getFirst())) {
SortDefinition sortDefinition = new SortDefinition(SortType.FIELD, sort.getFirst().getPrefixString(), sort.getSecond());
searchParametersCopy.addSort(sortDefinition);
}
}
return searchParametersCopy;
}
use of org.alfresco.service.cmr.search.SearchParameters in project alfresco-repository by Alfresco.
the class PropertyValueConstraint method applyFTS.
protected SearchParameters applyFTS(SearchParameters searchParameters) {
SearchParameters constrainedParameters = searchParameters.copy();
String theQuery = constrainedParameters.getQuery();
// TODO: introduce and use operator
theQuery = "(" + theQuery + ")" + " and " + "( " + "=" + property.toPrefixString(this.nspResolver) + ":" + "\"" + value.toString() + "\" )";
constrainedParameters.setQuery(theQuery);
return constrainedParameters;
}
Aggregations