org.alfresco.web.bean.repository
Class User

java.lang.Object
  extended by org.alfresco.web.bean.repository.User
All Implemented Interfaces:
java.io.Serializable, org.alfresco.repo.SessionUser

public final class User
extends java.lang.Object
implements org.alfresco.repo.SessionUser

Bean that represents the currently logged in user

See Also:
Serialized Form

Constructor Summary
User(java.lang.String userName, java.lang.String ticket, org.alfresco.service.cmr.repository.NodeRef person)
          Constructor
 
Method Summary
 java.lang.String getCompanyRootId()
           
 java.lang.String getFullName(org.alfresco.service.cmr.repository.NodeService service)
          Return the full name of the Person this User represents
static java.lang.String getFullName(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef user)
          Returns the full name of the user represented by the given NodeRef
static java.lang.String getFullNameAndUserId(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef user)
          Returns the full name of the user plus their userid in the form [id]
 java.lang.String getHomeSpaceId()
           
 org.alfresco.service.cmr.repository.NodeRef getPerson()
           
 java.lang.String getTicket()
           
 java.lang.String getUserName()
           
 boolean isAdmin()
           
 void reset()
          Forces a clear of any cached or calcluated values
 void setCompanyRootId(java.lang.String companyRootId)
           
 void setHomeSpaceId(java.lang.String homeSpaceId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

User

public User(java.lang.String userName,
            java.lang.String ticket,
            org.alfresco.service.cmr.repository.NodeRef person)
Constructor

Parameters:
userName - constructor for the user
Method Detail

reset

public void reset()
Forces a clear of any cached or calcluated values


getUserName

public java.lang.String getUserName()
Specified by:
getUserName in interface org.alfresco.repo.SessionUser
Returns:
The user name

getFullName

public java.lang.String getFullName(org.alfresco.service.cmr.repository.NodeService service)
Return the full name of the Person this User represents

Parameters:
service - NodeService to use
Returns:
The full name

getHomeSpaceId

public java.lang.String getHomeSpaceId()
Returns:
Retrieves the user's home space (this may be the id of the company home space)

setHomeSpaceId

public void setHomeSpaceId(java.lang.String homeSpaceId)
Parameters:
homeSpaceId - Sets the id of the users home space

getCompanyRootId

public java.lang.String getCompanyRootId()
Returns:
Retrieves the company home space

setCompanyRootId

public void setCompanyRootId(java.lang.String companyRootId)
Parameters:
companyRootId - Sets the id of the company home space

getTicket

public java.lang.String getTicket()
Specified by:
getTicket in interface org.alfresco.repo.SessionUser
Returns:
Returns the ticket.

getPerson

public org.alfresco.service.cmr.repository.NodeRef getPerson()
Returns:
Returns the person NodeRef

isAdmin

public boolean isAdmin()
Returns:
If the current user has Admin Authority

getFullName

public static java.lang.String getFullName(org.alfresco.service.cmr.repository.NodeService nodeService,
                                           org.alfresco.service.cmr.repository.NodeRef user)
Returns the full name of the user represented by the given NodeRef

Parameters:
nodeService - The node service instance
user - The user to get the full name for
Returns:
The full name

getFullNameAndUserId

public static java.lang.String getFullNameAndUserId(org.alfresco.service.cmr.repository.NodeService nodeService,
                                                    org.alfresco.service.cmr.repository.NodeRef user)
Returns the full name of the user plus their userid in the form [id]

Parameters:
nodeService - The node service instance
user - The user to get the full name for
Returns:
The full name and userid


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.