本文整理汇总了Java中org.alfresco.service.cmr.search.SearchParameters.copy方法的典型用法代码示例。如果您正苦于以下问题:Java SearchParameters.copy方法的具体用法?Java SearchParameters.copy怎么用?Java SearchParameters.copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.search.SearchParameters
的用法示例。
在下文中一共展示了SearchParameters.copy方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyDecorations
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@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().getLocalName(),
sort.getSecond());
searchParametersCopy.addSort(sortDefinition);
}
}
return searchParametersCopy;
}
示例2: applyDecorations
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@Override
public SearchParameters applyDecorations(ActualEnvironment environment, SearchParameters searchParameters,
VirtualQuery query) throws VirtualizationException
{
// TODO: allow custom language and not only constraint appliers
if (SearchService.LANGUAGE_FTS_ALFRESCO.equals(searchParameters.getLanguage()))
{
SearchParameters searchParametersCopy = searchParameters.copy();
return applyFTS(searchParametersCopy);
}
else
{
throw new VirtualizationException("Unsupported constrating language " + searchParameters.getLanguage());
}
}
示例3: applyDecorations
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@Override
protected SearchParameters applyDecorations(ActualEnvironment environment, SearchParameters searchParameters,
VirtualQuery query)
{
if ((ignoreAspectQNames != null && !ignoreAspectQNames.isEmpty())
|| (ignoreTypeNames != null && !ignoreTypeNames.isEmpty()))
{
if (SearchService.LANGUAGE_FTS_ALFRESCO.equals(searchParameters.getLanguage()))
{
SearchParameters searchParametersCopy = searchParameters.copy();
return applyFTSDecorations(searchParametersCopy,
environment.getNamespacePrefixResolver());
}
else
{
throw new VirtualizationException("Unsupported constrating language " + searchParameters.getLanguage());
}
}
else
{
return searchParameters;
}
}
示例4: applyFTSDecorations
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
private SearchParameters applyFTSDecorations(SearchParameters searchParameters, NamespacePrefixResolver nspResolver)
{
SearchParameters constrainedParameters = searchParameters.copy();
String theQuery = constrainedParameters.getQuery();
theQuery = "(" + theQuery + ")";
if (ignoreAspectQNames != null)
{
for (QName ignoredAspect : ignoreAspectQNames)
{
theQuery = theQuery + " and " + "!ASPECT:'" + ignoredAspect.toPrefixString(nspResolver) + "'";
}
}
if (ignoreTypeNames != null)
{
for (QName ignoredType : ignoreTypeNames)
{
theQuery = theQuery + " and " + "!TYPE:'" + ignoredType.toPrefixString(nspResolver) + "'";
}
}
constrainedParameters.setQuery(theQuery);
return constrainedParameters;
}
示例5: executeQuery
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@Override
public ResultSet executeQuery(SearchParameters searchParameters, ADMLuceneSearcherImpl admLuceneSearcher)
{
String query = "PATH:\""+searchParameters.getQuery()+"\"";
SearchParameters sp = searchParameters.copy();
sp.setLanguage(SearchService.LANGUAGE_SOLR_FTS_ALFRESCO);
sp.setQuery(query);
return solrQueryLanguage.executeQuery(sp, admLuceneSearcher);
}
示例6: flattenDBQuery
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
private SearchParameters flattenDBQuery(SearchParameters sp)
{
if (sp.getFilterQueries().size() == 0)
{
return sp;
}
else
{
SearchParameters flatten = sp.copy();
StringBuilder queryBuilder = new StringBuilder();
queryBuilder.append("( ").append(sp.getQuery()).append(" )");
for(String filter : sp.getFilterQueries())
{
Matcher matcher = LuceneQueryLanguageSPI.AFTS_QUERY.matcher(filter);
if (matcher.find())
{
queryBuilder.append("AND ( ").append(matcher.group(2)).append(" )");
}
else
{
queryBuilder.append("AND ( ").append(filter).append(" )");
}
}
flatten.setQuery(queryBuilder.toString());
// the filter can be left and will be ignored by the DB query
return flatten;
}
}
示例7: applyDecorations
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@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;
}
示例8: applyFTS
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@Override
protected SearchParameters applyFTS(SearchParameters searchParameters)
{
String filePattern;
StringBuffer luceneReserved = new StringBuffer();
for(int i=0;i<value.toString().length();i++){
if(SearchLanguageConversion.DEF_LUCENE.isReserved(value.toString().charAt(i))){
luceneReserved.append(value.toString().charAt(i));
}
}
String luceneReservedStr=luceneReserved.toString();
String pattern =org.alfresco.util.ISO9075.encode(value.toString());
for (int i = 0; i < luceneReservedStr.length(); i++)
{
pattern = pattern.replace(org.alfresco.util.ISO9075.encode(luceneReservedStr.substring(i,i + 1)),
luceneReservedStr.substring(i,i + 1));
}
filePattern=SearchLanguageConversion.escapeForLucene(pattern);
SearchParameters constrainedParameters = searchParameters.copy();
String theQuery = constrainedParameters.getQuery();
StringBuilder sb = new StringBuilder();
sb.append("(" + theQuery + ")");
sb.append(" and (");
sb.append("TEXT:(").append(filePattern).append(") ");
sb.append("or (");
sb.append(" =").append(property.toPrefixString(this.nspResolver));
sb.append(":").append(filePattern);
sb.append(" ) ");
sb.append(")");
theQuery = sb.toString();
constrainedParameters.setQuery(theQuery);
return constrainedParameters;
}
示例9: applyDecorations
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@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;
}
示例10: applyFTS
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
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;
}