org.springframework.extensions.webscripts
Class ScriptUser
java.lang.Object
org.springframework.extensions.webscripts.ScriptBase
org.springframework.extensions.webscripts.ScriptUser
- All Implemented Interfaces:
- Serializable
public final class ScriptUser
- extends ScriptBase
Read-only root-scoped script object wrapping the current user for
the current thread of execution.
The following is equivalent:
var organization = user.organization;
var organization = user.properties.organization;
var organization = user.properties["organization"];
- Author:
- muzquiano, kevinr
- See Also:
- Serialized Form
Constructor Summary |
ScriptUser(RequestContext context,
User user)
Instantiates a new ScriptUser object which wraps a given request
context and framework user object. |
ScriptUser
public ScriptUser(RequestContext context,
User user)
- Instantiates a new ScriptUser object which wraps a given request
context and framework user object.
- Parameters:
context
- the render contextuser
- the user
buildProperties
protected ScriptableMap buildProperties()
- Provides an associative array of properties that can be accessed via
scripting by using the .properties accessor.
- Specified by:
buildProperties
in class ScriptBase
- Returns:
- the properties
getId
public String getId()
- Gets the id.
- Returns:
- the id
getName
public String getName()
- Gets the name (generally this is the username - i.e. same as id)
- Returns:
- the name
getFullName
public String getFullName()
getFirstName
public String getFirstName()
setFirstName
public void setFirstName(String value)
getLastName
public String getLastName()
setLastName
public void setLastName(String value)
getMiddleName
public String getMiddleName()
setMiddleName
public void setMiddleName(String value)
getEmail
public String getEmail()
setEmail
public void setEmail(String value)
getOrganization
public String getOrganization()
setOrganization
public void setOrganization(String value)
getJobTitle
public String getJobTitle()
setJobTitle
public void setJobTitle(String value)
getLocation
public String getLocation()
setLocation
public void setLocation(String value)
getBiography
public String getBiography()
setBiography
public void setBiography(String value)
getTelephone
public String getTelephone()
setTelephone
public void setTelephone(String value)
getMobilePhone
public String getMobilePhone()
setMobilePhone
public void setMobilePhone(String value)
getSkype
public String getSkype()
setSkype
public void setSkype(String value)
getInstantMsg
public String getInstantMsg()
setInstantMsg
public void setInstantMsg(String value)
getCompanyPostcode
public String getCompanyPostcode()
setCompanyPostcode
public void setCompanyPostcode(String value)
getCompanyTelephone
public String getCompanyTelephone()
setCompanyTelephone
public void setCompanyTelephone(String value)
getCompanyFax
public String getCompanyFax()
setCompanyFax
public void setCompanyFax(String value)
getCompanyEmail
public String getCompanyEmail()
setCompanyEmail
public void setCompanyEmail(String value)
getCompanyAddress1
public String getCompanyAddress1()
setCompanyAddress1
public void setCompanyAddress1(String value)
getCompanyAddress2
public String getCompanyAddress2()
setCompanyAddress2
public void setCompanyAddress2(String value)
getCompanyAddress3
public String getCompanyAddress3()
setCompanyAddress3
public void setCompanyAddress3(String value)
getIsAdmin
public boolean getIsAdmin()
getIsGuest
public boolean getIsGuest()
save
public void save()
- Persist user changes
getUser
public ScriptUser getUser(String userId)
- Retrieve a user object with populated details for the given user Id
- Parameters:
userId
-
- Returns:
- ScriptUser
toString
public String toString()
- Overrides:
toString
in class ScriptBase
Copyright © 2009 SpringSource, Inc. All Rights Reserved.