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


Java CannedQuery.execute方法代码示例

本文整理汇总了Java中org.alfresco.query.CannedQuery.execute方法的典型用法代码示例。如果您正苦于以下问题:Java CannedQuery.execute方法的具体用法?Java CannedQuery.execute怎么用?Java CannedQuery.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.query.CannedQuery的用法示例。


在下文中一共展示了CannedQuery.execute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listMembersPaged

import org.alfresco.query.CannedQuery; //导入方法依赖的package包/类
public PagingResults<SiteMembership> listMembersPaged(String shortName, boolean collapseGroups, List<Pair<SiteService.SortFields, Boolean>> sortProps, PagingRequest pagingRequest)
  {
      CannedQueryPageDetails pageDetails = new CannedQueryPageDetails(pagingRequest.getSkipCount(), pagingRequest.getMaxItems());

      // sort details
      CannedQuerySortDetails sortDetails = null;
      if(sortProps != null)
      {
          List<Pair<? extends Object, SortOrder>> sortPairs = new ArrayList<Pair<? extends Object, SortOrder>>(sortProps.size());
          for (Pair<SiteService.SortFields, Boolean> sortProp : sortProps)
          {
              sortPairs.add(new Pair<SiteService.SortFields, SortOrder>(sortProp.getFirst(), (sortProp.getSecond() ? SortOrder.ASCENDING : SortOrder.DESCENDING)));
          }
          
          sortDetails = new CannedQuerySortDetails(sortPairs);
      }

      SiteMembersCannedQueryParams parameterBean = new SiteMembersCannedQueryParams(shortName, collapseGroups);
      CannedQueryParameters params = new CannedQueryParameters(parameterBean, pageDetails, sortDetails, pagingRequest.getRequestTotalCountMax(), pagingRequest.getQueryExecutionId());

CannedQuery<SiteMembership> query = new SiteMembersCannedQuery(this, personService, nodeService, params);

      CannedQueryResults<SiteMembership> results = query.execute();

      return getPagingResults(pagingRequest, results);
  }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:SiteServiceImpl.java

示例2: listContainers

import org.alfresco.query.CannedQuery; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public PagingResults<FileInfo> listContainers(String shortName, PagingRequest pagingRequest)
{
    SiteContainersCannedQueryFactory sitesContainersCannedQueryFactory = (SiteContainersCannedQueryFactory)cannedQueryRegistry.getNamedObject("siteContainersCannedQueryFactory");

    CannedQueryPageDetails pageDetails = new CannedQueryPageDetails(pagingRequest.getSkipCount(), pagingRequest.getMaxItems());
    CannedQuerySortDetails sortDetails = new CannedQuerySortDetails(new Pair<Object, SortOrder>(SiteContainersCannedQueryParams.SortFields.ContainerName, SortOrder.ASCENDING));
    SiteContainersCannedQueryParams parameterBean = new SiteContainersCannedQueryParams(getSiteNodeRef(shortName));
    CannedQueryParameters params = new CannedQueryParameters(parameterBean, pageDetails, sortDetails, pagingRequest.getRequestTotalCountMax(), pagingRequest.getQueryExecutionId());

    CannedQuery<FileInfo> query = sitesContainersCannedQueryFactory.getCannedQuery(params);
    
    CannedQueryResults<FileInfo> results = query.execute();

    return getPagingResults(pagingRequest, results);        
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:SiteServiceImpl.java

示例3: getAuthoritiesImpl

import org.alfresco.query.CannedQuery; //导入方法依赖的package包/类
private <T> PagingResults<T> getAuthoritiesImpl(AuthorityType type, NodeRef containerRef, String displayNameFilter, String sortBy, boolean sortAscending, PagingRequest pagingRequest, AbstractPagingResults<T> finalResults)
{
    Long start = (logger.isDebugEnabled() ? System.currentTimeMillis() : null);
    
    if (type != null)
    {
        switch (type)
        {
        case GROUP:
        case ROLE:
        case USER:
            // drop through
            break;
        default:
            throw new UnsupportedOperationException("Unexpected authority type: "+type);
        }
    }
    
    // get canned query
    GetAuthoritiesCannedQueryFactory getAuthoritiesCannedQueryFactory = (GetAuthoritiesCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_AUTHS_LIST);
    CannedQuery<AuthorityInfo> cq = getAuthoritiesCannedQueryFactory.getCannedQuery(type, containerRef, displayNameFilter, sortBy, sortAscending, pagingRequest);
    
    // execute canned query
    final CannedQueryResults<AuthorityInfo> results = cq.execute();

    finalResults.setResults(results);
    
    if (start != null)
    {
        int cnt = finalResults.getPage().size();
        int skipCount = pagingRequest.getSkipCount();
        int maxItems = pagingRequest.getMaxItems();
        boolean hasMoreItems = finalResults.hasMoreItems();
        int pageNum = (skipCount / maxItems) + 1;
        
        logger.debug("getAuthoritiesByType: "+cnt+" items in "+(System.currentTimeMillis()-start)+" msecs [type="+type+",pageNum="+pageNum+",skip="+skipCount+",max="+maxItems+",hasMorePages="+hasMoreItems+",filter="+displayNameFilter+"]");
    }
    
    return finalResults;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:41,代码来源:AuthorityDAOImpl.java

示例4: getNodeLinksIds

import org.alfresco.query.CannedQuery; //导入方法依赖的package包/类
@Override
public List<Long> getNodeLinksIds(NodeRef nodeRef)
{
    /* Validate input */
    PropertyCheck.mandatory(this, "nodeRef", nodeRef);

    /* Get all links of the given nodeRef */
    PagingRequest pagingRequest = new PagingRequest(0, 100000);
    List<Long> nodeLinks = new ArrayList<Long>();

    Pair<Long, QName> nameQName = qnameDAO.getQName(ContentModel.PROP_LINK_DESTINATION);
    if (nameQName != null)
    {
        // Execute the canned query if there are links in the database
        GetDoclinkNodesCannedQueryParams parameterBean = new GetDoclinkNodesCannedQueryParams(nodeRef.toString(), 
                                                                                              nameQName.getFirst(), 
                                                                                              pagingRequest.getMaxItems());
        CannedQueryParameters params = new CannedQueryParameters(parameterBean, 
                                                                 null, 
                                                                 null, 
                                                                 pagingRequest.getRequestTotalCountMax(), 
                                                                 pagingRequest.getQueryExecutionId());
        CannedQuery<Long> query = new GetDoclinkNodesCannedQuery(cannedQueryDAO, 
                                                                 params);
        CannedQueryResults<Long> results = query.execute();

        for (Long nodeId : results.getPage())
        {
            nodeLinks.add(nodeId);
        }
    }

    return nodeLinks;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:35,代码来源:DocumentLinkServiceImpl.java

示例5: getCopies

import org.alfresco.query.CannedQuery; //导入方法依赖的package包/类
@Override
public PagingResults<CopyInfo> getCopies(NodeRef originalNodeRef, PagingRequest pagingRequest)
{
    CannedQueryFactory<CopyInfo> queryFactory = cannedQueryRegistry.getNamedObject(QUERY_FACTORY_GET_COPIES);
    CannedQueryParameters params = new CannedQueryParameters(
            new AbstractCopyCannedQueryFactory.CopyCannedQueryDetail(originalNodeRef),
            null,
            pagingRequest);
    CannedQuery<CopyInfo> query = queryFactory.getCannedQuery(params);
    return query.execute();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:CopyServiceImpl.java


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