当前位置: 首页>>代码示例>>Java>>正文


Java SearchParameters.copy方法代码示例

本文整理汇总了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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:SortConstraint.java

示例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());
    }

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:PropertyValueConstraint.java

示例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;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:IgnoreConstraint.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:IgnoreConstraint.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:SolrXPathQueryLanguage.java

示例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;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:30,代码来源:DbOrIndexSwitchingQueryLanguage.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:15,代码来源:PagingRequestConstraint.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:37,代码来源:NamePatternPropertyValueConstraint.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:15,代码来源:FilesFoldersConstraint.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:15,代码来源:PropertyValueConstraint.java


注:本文中的org.alfresco.service.cmr.search.SearchParameters.copy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。