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


Java InvitationSearchCriteria类代码示例

本文整理汇总了Java中org.alfresco.service.cmr.invitation.InvitationSearchCriteria的典型用法代码示例。如果您正苦于以下问题:Java InvitationSearchCriteria类的具体用法?Java InvitationSearchCriteria怎么用?Java InvitationSearchCriteria使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InvitationSearchCriteria类属于org.alfresco.service.cmr.invitation包,在下文中一共展示了InvitationSearchCriteria类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: searchInvitation

import org.alfresco.service.cmr.invitation.InvitationSearchCriteria; //导入依赖的package包/类
private List<Invitation> searchInvitation(final InvitationSearchCriteria criteria, List<String> invitationIds)
{
    final Map<String, WorkflowTask> taskCache = getInvitationTasks(invitationIds);
    return CollectionUtils.transform(invitationIds, new Function<String, Invitation>()
    {
        public Invitation apply(String invitationId)
        {
            WorkflowTask startTask = taskCache.get(invitationId);
            if (startTask == null)
            {
                return null;
            }
            Invitation invitation = getInvitation(startTask);
            return invitationMatches(invitation, criteria) ? invitation : null;
        }
    });
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:InvitationServiceImpl.java

示例2: listPendingInvitationsForInvitee

import org.alfresco.service.cmr.invitation.InvitationSearchCriteria; //导入依赖的package包/类
/**
 * list Invitations for a specific person/invitee
 * 
 * @param invitee alfresco user id of person being invited
 */
public List<Invitation> listPendingInvitationsForInvitee(String invitee)
{
    InvitationSearchCriteriaImpl crit = new InvitationSearchCriteriaImpl();
    crit.setInvitationType(InvitationSearchCriteria.InvitationType.ALL);
    crit.setInvitee(invitee);
    return searchInvitation(crit);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:InvitationServiceImpl.java

示例3: getPendingInvitationCriteriaForResource

import org.alfresco.service.cmr.invitation.InvitationSearchCriteria; //导入依赖的package包/类
/**
 * Returns search criteria to find pending invitations
 * @param resourceType Invitation.ResourceType
 * @param resourceName String
 * @return search criteria
 */
private InvitationSearchCriteriaImpl getPendingInvitationCriteriaForResource(
        Invitation.ResourceType resourceType, String resourceName)
{
    InvitationSearchCriteriaImpl criteria = new InvitationSearchCriteriaImpl();
    criteria.setInvitationType(InvitationSearchCriteria.InvitationType.ALL);
    criteria.setResourceType(resourceType);
    criteria.setResourceName(resourceName);
    return criteria;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:16,代码来源:InvitationServiceImpl.java

示例4: invitationMatches

import org.alfresco.service.cmr.invitation.InvitationSearchCriteria; //导入依赖的package包/类
/**
 * Fix for ALF-2598
 * @param invitation Invitation
 * @param criteria InvitationSearchCriteria
 * @return boolean
 */
private boolean invitationMatches(Invitation invitation, InvitationSearchCriteria criteria)
{
    String invitee = criteria.getInvitee();
    if (invitation == null || (invitee!= null && false == invitee.equals(invitation.getInviteeUserName())))
    {
        return false;
    }
    String inviter = criteria.getInviter();
    if(inviter!= null)
    {
        if (invitation instanceof NominatedInvitation)
        {
            NominatedInvitation modInvite = (NominatedInvitation) invitation;
            if(false == inviter.equals(modInvite.getInviterUserName()))
            {
                return false;
            }
        }
        else
        {
            return false;
        }
    }
    String resourceName= criteria.getResourceName();
    if (resourceName!= null && false == resourceName.equals(invitation.getResourceName()))
    {
        return false;
    }
    return true;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:37,代码来源:InvitationServiceImpl.java

示例5: searchModeratedInvitations

import org.alfresco.service.cmr.invitation.InvitationSearchCriteria; //导入依赖的package包/类
/**
     * 
     * @param criteria criteria to search by
     * @param limit maximum number of IDs to return. If less than 1, there is no limit.
     * @return list of WorkflowTask representing moderated invitations
     */
    private List<WorkflowTask> searchModeratedInvitations(InvitationSearchCriteria criteria, int limit)
    {
        long start = (logger.isDebugEnabled()) ? System.currentTimeMillis() : 0;

        WorkflowTaskQuery query = new WorkflowTaskQuery();
        query.setTaskState(WorkflowTaskState.IN_PROGRESS);
        if (limit > 0)
        {
            query.setLimit(limit);
        }
        Map<QName, Object> properties = new HashMap<QName, Object>();
        String invitee = criteria.getInvitee();
        if (invitee != null)
        {
            properties.put(WorkflowModelModeratedInvitation.WF_PROP_INVITEE_USER_NAME, invitee);
        }
        //TODO Uncomment if more than one ResourceType added.
//        ResourceType resourceType = criteria.getResourceType();
//        if (resourceType != null)
//        {
//            properties.put(WorkflowModelModeratedInvitation.WF_PROP_RESOURCE_TYPE, resourceType.toString());
//        }
        String resourceName = criteria.getResourceName();
        if (resourceName != null)
        {
            properties.put(WorkflowModelModeratedInvitation.WF_PROP_RESOURCE_NAME, resourceName);
        }
        query.setProcessCustomProps(properties);

        query.setTaskName(WorkflowModelModeratedInvitation.WF_ACTIVITI_REVIEW_TASK);

        // query for invite workflow tasks
        List<WorkflowTask> results = new ArrayList<WorkflowTask>();
        if(workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
        {
            query.setTaskName(WorkflowModelModeratedInvitation.WF_ACTIVITI_REVIEW_TASK);
            List<WorkflowTask> activitiTasks = this.workflowService.queryTasks(query, true);
            if(activitiTasks !=null)
            {
                results.addAll(activitiTasks);
                
                if (logger.isTraceEnabled()) { logger.trace("Found " + activitiTasks.size() + " Activiti moderated invitation tasks."); }
            }
        }
        if (logger.isDebugEnabled())
        {
            logger.debug("  searchModeratedInvitations in "+ (System.currentTimeMillis()-start) + " ms");
        }
        return results;
    }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:57,代码来源:InvitationServiceImpl.java

示例6: searchNominatedInvitations

import org.alfresco.service.cmr.invitation.InvitationSearchCriteria; //导入依赖的package包/类
/**
     * 
     * @param criteria
     * @param limit maximum number of IDs to return. If less than 1, there is no limit.
     * @return list of WorkflowTask representing nominated invitations
     */
    private List<WorkflowTask> searchNominatedInvitations(InvitationSearchCriteria criteria, int limit)
    {
        long start = (logger.isDebugEnabled()) ? System.currentTimeMillis() : 0;

        WorkflowTaskQuery query = new WorkflowTaskQuery();
        query.setTaskState(WorkflowTaskState.IN_PROGRESS);
        if (limit > 0)
        {
            query.setLimit(limit);
        }
        String invitee = criteria.getInvitee();
        if(invitee != null)
        {
            query.setActorId(invitee);
        }
        
        Map<QName, Object> queryProps = new HashMap<QName, Object>();
        String inviter = criteria.getInviter();
        if (inviter != null)
        {
            queryProps.put(WorkflowModelNominatedInvitation.WF_PROP_INVITER_USER_NAME, inviter);
        }
        String resourceName = criteria.getResourceName();
        if (resourceName != null)
        {
            queryProps.put(WorkflowModelNominatedInvitation.WF_PROP_RESOURCE_NAME, resourceName);
        }
        
        //TODO uncomment if more ResourceTypes are created.
//      ResourceType resourceType = criteria.getResourceType();
//      if (resourceType != null)
//      {
//          wfNominatedQueryProps.put(WorkflowModelNominatedInvitation.WF_PROP_RESOURCE_TYPE,
//                  resourceType.name());
//      }
        // set workflow task query parameters
        query.setProcessCustomProps(queryProps);

        List<WorkflowTask> results = new ArrayList<WorkflowTask>();
        if(workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
        {
            query.setTaskName(WorkflowModelNominatedInvitation.WF_TASK_ACTIVIT_INVITE_PENDING);
            List<WorkflowTask> activitiTasks = this.workflowService.queryTasks(query, true);
            if(activitiTasks !=null)
            {
                results.addAll(activitiTasks);
                
                if (logger.isTraceEnabled()) { logger.trace("Found " + activitiTasks.size() + " Activiti nominated invitation tasks."); }
            }
        }
        if (logger.isDebugEnabled())
        {
            logger.debug("  searchNominatedInvitations in "+ (System.currentTimeMillis()-start) + " ms");
        }
        return results;
    }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:63,代码来源:InvitationServiceImpl.java

示例7: searchModeratedInvitations

import org.alfresco.service.cmr.invitation.InvitationSearchCriteria; //导入依赖的package包/类
/**
     * 
     * @param criteria criteria to search by
     * @param limit maximum number of IDs to return. If less than 1, there is no limit.
     * @return list of WorkflowTask representing moderated invitations
     */
    private List<WorkflowTask> searchModeratedInvitations(InvitationSearchCriteria criteria, int limit)
    {
        long start = (logger.isDebugEnabled()) ? System.currentTimeMillis() : 0;

        WorkflowTaskQuery query = new WorkflowTaskQuery();
        query.setTaskState(WorkflowTaskState.IN_PROGRESS);
        if (limit > 0)
        {
            query.setLimit(limit);
        }
        Map<QName, Object> properties = new HashMap<QName, Object>();
        String invitee = criteria.getInvitee();
        if (invitee != null)
        {
            properties.put(WorkflowModelModeratedInvitation.WF_PROP_INVITEE_USER_NAME, invitee);
        }
        //TODO Uncomment if more than one ResourceType added.
//        ResourceType resourceType = criteria.getResourceType();
//        if (resourceType != null)
//        {
//            properties.put(WorkflowModelModeratedInvitation.WF_PROP_RESOURCE_TYPE, resourceType.toString());
//        }
        String resourceName = criteria.getResourceName();
        if (resourceName != null)
        {
            properties.put(WorkflowModelModeratedInvitation.WF_PROP_RESOURCE_NAME, resourceName);
        }
        query.setProcessCustomProps(properties);

        query.setTaskName(WorkflowModelModeratedInvitation.WF_REVIEW_TASK);

        // query for invite workflow tasks
        List<WorkflowTask> results = new ArrayList<WorkflowTask>();
        if(workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
        {
            query.setTaskName(WorkflowModelModeratedInvitation.WF_REVIEW_TASK);
            List<WorkflowTask> jbpmTasks = this.workflowService.queryTasks(query, true);

            if(jbpmTasks !=null)
            {
                results.addAll(jbpmTasks);
                
                if (logger.isTraceEnabled()) { logger.trace("Found " + jbpmTasks.size() + " jBPM moderated invitation tasks."); }
           }
        }
        if(workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
        {
            query.setTaskName(WorkflowModelModeratedInvitation.WF_ACTIVITI_REVIEW_TASK);
            List<WorkflowTask> activitiTasks = this.workflowService.queryTasks(query, true);
            if(activitiTasks !=null)
            {
                results.addAll(activitiTasks);
                
                if (logger.isTraceEnabled()) { logger.trace("Found " + activitiTasks.size() + " Activiti moderated invitation tasks."); }
            }
        }
        if (logger.isDebugEnabled())
        {
            logger.debug("  searchModeratedInvitations in "+ (System.currentTimeMillis()-start) + " ms");
        }
        return results;
    }
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:69,代码来源:InvitationServiceImpl.java

示例8: searchNominatedInvitations

import org.alfresco.service.cmr.invitation.InvitationSearchCriteria; //导入依赖的package包/类
/**
     * 
     * @param criteria
     * @param limit maximum number of IDs to return. If less than 1, there is no limit.
     * @return list of WorkflowTask representing nominated invitations
     */
    private List<WorkflowTask> searchNominatedInvitations(InvitationSearchCriteria criteria, int limit)
    {
        long start = (logger.isDebugEnabled()) ? System.currentTimeMillis() : 0;

        WorkflowTaskQuery query = new WorkflowTaskQuery();
        query.setTaskState(WorkflowTaskState.IN_PROGRESS);
        if (limit > 0)
        {
            query.setLimit(limit);
        }
        String invitee = criteria.getInvitee();
        if(invitee != null)
        {
            query.setActorId(invitee);
        }
        
        Map<QName, Object> queryProps = new HashMap<QName, Object>();
        String inviter = criteria.getInviter();
        if (inviter != null)
        {
            queryProps.put(WorkflowModelNominatedInvitation.WF_PROP_INVITER_USER_NAME, inviter);
        }
        String resourceName = criteria.getResourceName();
        if (resourceName != null)
        {
            queryProps.put(WorkflowModelNominatedInvitation.WF_PROP_RESOURCE_NAME, resourceName);
        }
        
        //TODO uncomment if more ResourceTypes are created.
//      ResourceType resourceType = criteria.getResourceType();
//      if (resourceType != null)
//      {
//          wfNominatedQueryProps.put(WorkflowModelNominatedInvitation.WF_PROP_RESOURCE_TYPE,
//                  resourceType.name());
//      }
        // set workflow task query parameters
        query.setProcessCustomProps(queryProps);

        List<WorkflowTask> results = new ArrayList<WorkflowTask>();
        if(workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
        {
            query.setTaskName(WorkflowModelNominatedInvitation.WF_TASK_INVITE_PENDING);
            List<WorkflowTask> jbpmTasks = this.workflowService.queryTasks(query, true);
            if(jbpmTasks !=null)
            {
                results.addAll(jbpmTasks);
                
                if (logger.isTraceEnabled()) { logger.trace("Found " + jbpmTasks.size() + " jBPM nominated invitation tasks."); }
            }
        }
        if(workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
        {
            query.setTaskName(WorkflowModelNominatedInvitation.WF_TASK_ACTIVIT_INVITE_PENDING);
            List<WorkflowTask> activitiTasks = this.workflowService.queryTasks(query, true);
            if(activitiTasks !=null)
            {
                results.addAll(activitiTasks);
                
                if (logger.isTraceEnabled()) { logger.trace("Found " + activitiTasks.size() + " Activiti nominated invitation tasks."); }
            }
        }
        if (logger.isDebugEnabled())
        {
            logger.debug("  searchNominatedInvitations in "+ (System.currentTimeMillis()-start) + " ms");
        }
        return results;
    }
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:74,代码来源:InvitationServiceImpl.java


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