本文整理汇总了Java中org.alfresco.service.cmr.security.PersonService.getPerson方法的典型用法代码示例。如果您正苦于以下问题:Java PersonService.getPerson方法的具体用法?Java PersonService.getPerson怎么用?Java PersonService.getPerson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.security.PersonService
的用法示例。
在下文中一共展示了PersonService.getPerson方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unsubscribe
import org.alfresco.service.cmr.security.PersonService; //导入方法依赖的package包/类
public void unsubscribe(AlfrescoImapUser user, String mailbox)
{
if (logger.isDebugEnabled())
{
logger.debug("Unsubscribing: " + user + ", " + mailbox);
}
AlfrescoImapFolder mailFolder = getOrCreateMailbox(user, mailbox, true, false);
if(mailFolder.getFolderInfo() != null)
{
PersonService personService = serviceRegistry.getPersonService();
NodeRef userRef = personService.getPerson(user.getLogin());
nodeService.createAssociation(userRef, mailFolder.getFolderInfo().getNodeRef(), ImapModel.ASSOC_IMAP_UNSUBSCRIBED);
}
else
{
// perhaps the folder has been deleted by another async process?
logger.debug("Unable to find folder to unsubscribe");
}
}
示例2: getPersonNode
import org.alfresco.service.cmr.security.PersonService; //导入方法依赖的package包/类
protected ActivitiScriptNode getPersonNode(String runAsUser)
{
String userName = null;
if (runAsUser != null)
{
userName = runAsUser;
}
else
{
userName = AuthenticationUtil.getFullyAuthenticatedUser();
}
// The "System" user is a special case, which has no person object associated with it.
if(userName != null && !AuthenticationUtil.SYSTEM_USER_NAME.equals(userName))
{
ServiceRegistry services = getServiceRegistry();
PersonService personService = services.getPersonService();
if (personService.personExists(userName))
{
NodeRef person = personService.getPerson(userName);
return new ActivitiScriptNode(person, services);
}
}
return null;
}
示例3: subscribe
import org.alfresco.service.cmr.security.PersonService; //导入方法依赖的package包/类
public void subscribe(AlfrescoImapUser user, String mailbox)
{
if (logger.isDebugEnabled())
{
logger.debug("Subscribing: " + user + ", " + mailbox);
}
AlfrescoImapFolder mailFolder = getOrCreateMailbox(user, mailbox, true, false);
PersonService personService = serviceRegistry.getPersonService();
NodeRef userRef = personService.getPerson(user.getLogin());
nodeService.removeAssociation(userRef, mailFolder.getFolderInfo().getNodeRef(), ImapModel.ASSOC_IMAP_UNSUBSCRIBED);
}
示例4: getUnsubscribedFolders
import org.alfresco.service.cmr.security.PersonService; //导入方法依赖的package包/类
private Set<NodeRef> getUnsubscribedFolders(String userName)
{
Set<NodeRef> result = new HashSet<NodeRef>();
PersonService personService = serviceRegistry.getPersonService();
NodeRef userRef = personService.getPerson(userName);
List<AssociationRef> unsubscribedFodlers = nodeService.getTargetAssocs(userRef, ImapModel.ASSOC_IMAP_UNSUBSCRIBED);
for (AssociationRef asocRef : unsubscribedFodlers)
{
result.add(asocRef.getTargetRef());
}
return result;
}
示例5: create
import org.alfresco.service.cmr.security.PersonService; //导入方法依赖的package包/类
public static ArchivedNodeState create(NodeRef archivedNode, ServiceRegistry serviceRegistry)
{
ArchivedNodeState result = new ArchivedNodeState();
NodeService nodeService = serviceRegistry.getNodeService();
Map<QName, Serializable> properties = nodeService.getProperties(archivedNode);
result.archivedNodeRef = archivedNode;
result.archivedBy = (String) properties.get(ContentModel.PROP_ARCHIVED_BY);
result.archivedDate = (Date) properties.get(ContentModel.PROP_ARCHIVED_DATE);
result.name = (String) properties.get(ContentModel.PROP_NAME);
result.title = (String) properties.get(ContentModel.PROP_TITLE);
result.description = (String) properties.get(ContentModel.PROP_DESCRIPTION);
QName type = nodeService.getType(archivedNode);
result.isContentType = (type.equals(ContentModel.TYPE_CONTENT) || serviceRegistry.getDictionaryService().isSubClass(type, ContentModel.TYPE_CONTENT));
result.nodeType = type.toPrefixString(serviceRegistry.getNamespaceService());
PersonService personService = serviceRegistry.getPersonService();
if (result.archivedBy != null && personService.personExists(result.archivedBy))
{
NodeRef personNodeRef = personService.getPerson(result.archivedBy, false);
Map<QName, Serializable> personProps = nodeService.getProperties(personNodeRef);
result.firstName = (String) personProps.get(ContentModel.PROP_FIRSTNAME);
result.lastName = (String) personProps.get(ContentModel.PROP_LASTNAME);
}
ChildAssociationRef originalParentAssoc = (ChildAssociationRef) properties.get(ContentModel.PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC);
if (serviceRegistry.getPermissionService().hasPermission(originalParentAssoc.getParentRef(), PermissionService.READ).equals(AccessStatus.ALLOWED)
&& nodeService.exists(originalParentAssoc.getParentRef()))
{
result.displayPath = PathUtil.getDisplayPath(nodeService.getPath(originalParentAssoc.getParentRef()), true);
}
else
{
result.displayPath = "";
}
return result;
}
示例6: lookupUserInfo
import org.alfresco.service.cmr.security.PersonService; //导入方法依赖的package包/类
public static UserInfo lookupUserInfo(String userName, Map<String, UserInfo> mapUserInfo, PersonService personService, boolean displayNameOnly)
{
UserInfo userInfo = mapUserInfo.get(userName);
if ((userInfo == null) && (userName != null))
{
String sysUserName = AuthenticationUtil.getSystemUserName();
if (userName.equals(sysUserName) || (AuthenticationUtil.isMtEnabled() && userName.startsWith(sysUserName + "@")))
{
userInfo = new UserInfo((displayNameOnly ? null : userName), userName, "");
}
else
{
PersonService.PersonInfo pInfo = null;
try
{
NodeRef pNodeRef = personService.getPerson(userName, false);
if (pNodeRef != null)
{
pInfo = personService.getPerson(pNodeRef);
}
}
catch (NoSuchPersonException nspe)
{
// drop-through
}
catch (AccessDeniedException ade)
{
// SFS-610
// drop-through
}
if (pInfo != null)
{
userInfo = new UserInfo((displayNameOnly ? null : userName), pInfo.getFirstName(), pInfo.getLastName());
}
else
{
logger.warn("Unknown person: "+userName);
userInfo = new UserInfo((displayNameOnly ? null : userName), userName, "");
}
}
mapUserInfo.put(userName, userInfo);
}
return userInfo;
}