本文整理汇总了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;
}
});
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}