本文整理汇总了Java中org.alfresco.service.cmr.invitation.InvitationExceptionUserError类的典型用法代码示例。如果您正苦于以下问题:Java InvitationExceptionUserError类的具体用法?Java InvitationExceptionUserError怎么用?Java InvitationExceptionUserError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InvitationExceptionUserError类属于org.alfresco.service.cmr.invitation包,在下文中一共展示了InvitationExceptionUserError类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endInvitation
import org.alfresco.service.cmr.invitation.InvitationExceptionUserError; //导入依赖的package包/类
private void endInvitation(WorkflowTask startTask, String transition, Map<QName, Serializable> properties, QName... taskTypes )
{
// Deleting a person can cancel their invitations. Cancelling invitations can delete inactive persons! So prevent infinite looping here
if (TransactionalResourceHelper.getSet(getClass().getName()).add(startTask.getPath().getInstance().getId()))
{
List<WorkflowTask> tasks = workflowService.getTasksForWorkflowPath(startTask.getPath().getId());
if(tasks.size()==1)
{
WorkflowTask task = tasks.get(0);
if(taskTypeMatches(task, taskTypes))
{
if(properties != null)
{
workflowService.updateTask(task.getId(), properties, null, null);
}
workflowService.endTask(task.getId(), transition);
return;
}
}
// Throw exception if the task not found.
Object objs[] = { startTask.getPath().getInstance().getId() };
throw new InvitationExceptionUserError("invitation.invite.already_finished", objs);
}
}
示例2: startModeratedInvite
import org.alfresco.service.cmr.invitation.InvitationExceptionUserError; //导入依赖的package包/类
/**
* Moderated invitation implementation
*
* @return the new moderated invitation
*/
private ModeratedInvitation startModeratedInvite(String inviteeComments, String inviteeUserName,
Invitation.ResourceType resourceType, String resourceName, String inviteeRole)
{
SiteInfo siteInfo = siteService.getSite(resourceName);
if (siteService.isMember(resourceName, inviteeUserName))
{
if (logger.isDebugEnabled())
logger.debug("Failed - invitee user is already a member of the site.");
Object objs[] = { inviteeUserName, "", resourceName };
throw new InvitationExceptionUserError("invitation.invite.already_member", objs);
}
String roleGroup = siteService.getSiteRoleGroup(resourceName, SiteModel.SITE_MANAGER);
// get the workflow description
String workflowDescription = generateWorkflowDescription(siteInfo, "invitation.moderated.workflow.description");
Map<QName, Serializable> workflowProps = new HashMap<QName, Serializable>(16);
workflowProps.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, workflowDescription);
workflowProps.put(WorkflowModelModeratedInvitation.ASSOC_GROUP_ASSIGNEE, roleGroup);
workflowProps.put(WorkflowModelModeratedInvitation.WF_PROP_INVITEE_COMMENTS, inviteeComments);
workflowProps.put(WorkflowModelModeratedInvitation.WF_PROP_INVITEE_ROLE, inviteeRole);
workflowProps.put(WorkflowModelModeratedInvitation.WF_PROP_INVITEE_USER_NAME, inviteeUserName);
workflowProps.put(WorkflowModelModeratedInvitation.WF_PROP_RESOURCE_NAME, resourceName);
workflowProps.put(WorkflowModelModeratedInvitation.WF_PROP_RESOURCE_TYPE, resourceType.toString());
// get the moderated workflow
WorkflowDefinition wfDefinition = getWorkflowDefinition(InvitationWorkflowType.MODERATED);
return (ModeratedInvitation) startWorkflow(wfDefinition, workflowProps);
}
示例3: validateInvitationId
import org.alfresco.service.cmr.invitation.InvitationExceptionUserError; //导入依赖的package包/类
/**
* Validator for invitationId
*
* @param invitationId String
*/
private void validateInvitationId(String invitationId)
{
final String ID_SEPERATOR_REGEX = "\\$";
String[] parts = invitationId.split(ID_SEPERATOR_REGEX);
if (parts.length != 2)
{
Object objs[] = { invitationId };
throw new InvitationExceptionUserError("invitation.error.invalid_inviteId_format", objs);
}
}
示例4: testInternalUserNotDeletedAfterInviteCancelled
import org.alfresco.service.cmr.invitation.InvitationExceptionUserError; //导入依赖的package包/类
/**
* MNT-9101 An internal user account (disabled) should not be deleted if an
* associated nominated invitation is cancelled.
*
* @throws Exception
*/
public void testInternalUserNotDeletedAfterInviteCancelled() throws Exception
{
// Disable our existing User
boolean enabled = authenticationService.getAuthenticationEnabled(USER_ONE);
assertTrue("User One authentication disabled", enabled);
authenticationService.setAuthenticationEnabled(USER_ONE, false);
enabled = authenticationService.getAuthenticationEnabled(USER_ONE);
assertTrue("User One authentication enabled", !enabled);
String inviteeUserName = USER_ONE;
Invitation.ResourceType resourceType = Invitation.ResourceType.WEB_SITE;
String resourceName = SITE_SHORT_NAME_INVITE;
String inviteeRole = SiteModel.SITE_COLLABORATOR;
String acceptUrl = "froob";
String rejectUrl = "marshmallow";
this.authenticationComponent.setCurrentUser(USER_MANAGER);
// Invite our existing user
try
{
invitationService.inviteNominated(inviteeUserName, resourceType, resourceName, inviteeRole, acceptUrl, rejectUrl);
fail("An exception of type " + InvitationExceptionUserError.class.getName() + " should be thrown");
}
catch (Exception ex)
{
assertTrue("Incorrect exception was thrown", ex instanceof InvitationExceptionUserError);
}
// Our User and associated Authentication still exists
assertNotNull("User Exists", personService.getPersonOrNull(USER_ONE));
assertTrue("Authentication Exists", authenticationService.authenticationExists(USER_ONE));
}