Represents a single user account as a node in the WebDAV resource tree, served under a users folder such as /users/{userId}/. Exposes the user's profile fields, group memberships, roles, owned repositories, calendars and address books, and mail inbox, and backs the CalDAV, CardDAV and WebDAV principal behaviour for that account. A GET on this resource renders the user's dashboard page; child resources include the user's repositories and any browseable pages registered by installed applications.

Group: Resources

Extends: AbstractCollectionResource

Implements: CollectionResource, UserAdminResource, MakeCollectionableResource, PropFindableResource, GetableResource, PrincipalResource, Mailbox, CalDavPrincipal, CardDavPrincipal, ProfileResource, RepositoriesHome


Properties

PropertyReturnsDescription
accessControlListMap<Principal,List<Priviledge>>The WebDAV access control list for this resource. Note that the underlying privilege population is currently disabled, so the returned map always contains a single entry for this resource mapped to an empty privilege list.
activeMenuIdsString[]The IDs of admin menu items that should be shown as active when this resource is being viewed. Always returns an empty array.
addressStringThe href of this user's address books folder, used as this principal's CardDAV address.
addressBookHomeSetHrefListThe CardDAV address book home set for this user: a single-entry list containing the href of this user's address books folder.
allFieldsMap<String,String>A map of all custom fields stored against this profile across all of its group memberships, keyed on field name. Where more than one membership has a field with the same name, only one of the values is kept. The result is computed on first access and cached on this resource instance.
calendarHomeSetHrefListThe CalDAV calendar home set for this user: a single-entry list containing the href of this user's Calendars folder.
calendarUserAddressSetHrefListThe CalDAV calendar user address set for this user: a single-entry list containing this resource's own href.
calendarUserTypeStringThe CalDAV calendar user type for this principal. Always returns "INDIVIDUAL".
childrenResourceList<CommonResource>The child resources of this user: a branch folder for each repository the user owns, plus any browseable pages contributed by installed applications. The list is built once and cached for the lifetime of this resource instance.
createDateDateThe date and time this user's profile was first created.
currentUserRolesSet<Role>All roles currently granted to this user within the current organisation. Computed on first access and cached on this resource instance.
directoryTemplateStringThe template used to render this user's directory listing view in the admin file manager.
emailStringThe user's email address.
emailDisabledbooleanWhether incoming mail delivery is disabled for this user. Always returns false.
extProfileBeanExtProfileBeanAn extended bean representation of this user's profile, with additional fields beyond getProfile, built on first access and cached on this resource instance.
firstNameStringThe user's first (given) name.
formattedNameStringDisplay name for this user: their first and last name combined (whichever parts are set), falling back to their nickname, and finally to their account name if neither is set.
hasPasswordbooleanWhether this account has at least one password credential set.
idenitiferPrincipleIdThe principal identifier for this user, which is the href (URL path) to this resource.
inboxMessageFolderThis user's inbox folder, resolved as the "inbox" child of this resource. Returns null if there is no inbox child, or if the child exists but is not a message folder.
lastVisitDateThe date of this user's most recent access to the current website. Resolved by querying the access log service on first access and cached on this resource instance.
membershipsMembershipListAll of this user's group memberships within the current organisation and its descendants. The result is cached against this resource instance and read from a shared cache on first access.
modifiedDateDateThe date and time this user's profile was last updated. Set automatically on save, so effectively never null for a persisted profile.
nameStringThe user name, which is this account's unique login identifier and also the path segment used to address this resource in the WebDAV tree.
nickNameStringThe user's nickname, falling back to their first name, and then to their account name, if no nickname is set. There is no uniqueness constraint on this value.
parentCommonCollectionResourceThe collection resource this user is a child of - the users folder for the current organisation.
phoneStringThe user's phone number.
primaryMembershipMembershipBeanThe first of this user's primary group memberships. Returns null if the user has no primary group membership.
primaryMembershipsMembershipListAll of this user's memberships that are flagged as a primary group membership.
profileProfileBeanA bean representation of this user's profile, built on first access and cached on this resource instance.
profilePicHrefStringThe href to this user's profile picture: a hash-addressed file URL if a photo has been uploaded, otherwise the default profile picture theme asset.
repositoriesList<BranchFolder>The repositories (source code / content branches) owned by this user, filtered from the resource's child list. Building the list does the same work as reading the children, since it walks them looking for branch folders.
signatureCredentialsMap<String,SignatureCredentialBean>This user's stored signature credentials for the current website, keyed on credential source. Computed on first access and cached on this resource instance.
supportedComponentSetsSupportedCalendarComponentListsSetThe set of supported CalDAV calendar component types for this principal. Always returns null.
surNameStringThe user's surname (family name).
thisEntityBaseEntityThe base entity this resource represents, which is the same profile as getThisProfile.
thisProfileProfileThe profile entity this resource represents, same as getThisUser.
thisUserProfileThe profile entity this resource represents.
titleStringDisplay title for this resource, used as the page title. This is the user's first and last name combined (whichever parts are set), falling back to their nickname, and finally to their user name if neither is set.
userIdLongThe numeric database ID of this user's profile. Always unique.

Methods

getTitle() · getRepositories() · getChildren() · getName() · createCollectionNoTx(String newName) · getCreateDate() · getModifiedDate() · getParent() · getIdenitifer() · getCalendarHomeSet() · getCalendarUserAddressSet() · getAddressBookHomeSet() · getAddress() · getAccessControlList() · getThisUser() · getInbox() · isEmailDisabled() · getNickName() · getUserId() · getThisProfile() · getThisEntity() · getFormattedName() · getSupportedComponentSets() · isInGroup(String groupName) · isInGroup(String groupName, String orgId) · isInGroup(Group group) · getPrimaryMembership() · getPrimaryMemberships() · is(String type) · getMemberships() · memberships(String groupName) · getCalendarUserType() · getProfile() · getExtProfileBean() · getCurrentUserRoles() · hasRole(Role role) · hasRole(String roleName) · getAllFields() · getSurName() · getFirstName() · getEmail() · getProfilePicHref() · getLastVisit() · dailyVisits(Date from, Date to) · dailyVisits(Website website) · dailyVisits(Date from, Date to, Website website) · searchWebHits() · searchWebHits(Date from, Date to) · getSignatureCredentials() · isHasPassword() · getPhone() · setFirstName(String s) · setSurname(String s) · setEmail(String s) · setPhone(String s) · setPhotoHash(String s) · setNickName(String s) · save() · getDirectoryTemplate() · getActiveMenuIds()

getTitle()

Returns: String

Display title for this resource, used as the page title. This is the user's first and last name combined (whichever parts are set), falling back to their nickname, and finally to their user name if neither is set.

getRepositories()

Returns: List<BranchFolder>

The repositories (source code / content branches) owned by this user, filtered from the resource's child list. Building the list does the same work as reading the children, since it walks them looking for branch folders.

getChildren()

Returns: ResourceList<CommonResource>

The child resources of this user: a branch folder for each repository the user owns, plus any browseable pages contributed by installed applications. The list is built once and cached for the lifetime of this resource instance.

getName()

Returns: String

The user name, which is this account's unique login identifier and also the path segment used to address this resource in the WebDAV tree.

createCollectionNoTx(String newName)

Returns: CollectionResource

Creates a new repository owned by this user without opening a database transaction, so the caller must already have one active. Used internally to provision repositories such as a user's certificates branch.

ParameterDescription
newNamethe name of the new repository to create

getCreateDate()

Returns: Date

The date and time this user's profile was first created.

getModifiedDate()

Returns: Date

The date and time this user's profile was last updated. Set automatically on save, so effectively never null for a persisted profile.

getParent()

Returns: CommonCollectionResource

The collection resource this user is a child of - the users folder for the current organisation.

getIdenitifer()

Returns: PrincipleId

The principal identifier for this user, which is the href (URL path) to this resource.

getCalendarHomeSet()

Returns: HrefList

The CalDAV calendar home set for this user: a single-entry list containing the href of this user's Calendars folder.

getCalendarUserAddressSet()

Returns: HrefList

The CalDAV calendar user address set for this user: a single-entry list containing this resource's own href.

getAddressBookHomeSet()

Returns: HrefList

The CardDAV address book home set for this user: a single-entry list containing the href of this user's address books folder.

getAddress()

Returns: String

The href of this user's address books folder, used as this principal's CardDAV address.

getAccessControlList()

Returns: Map<Principal,List<Priviledge>>

The WebDAV access control list for this resource. Note that the underlying privilege population is currently disabled, so the returned map always contains a single entry for this resource mapped to an empty privilege list.

getThisUser()

Returns: Profile

The profile entity this resource represents.

getInbox()

Returns: MessageFolder

This user's inbox folder, resolved as the "inbox" child of this resource. Returns null if there is no inbox child, or if the child exists but is not a message folder.

isEmailDisabled()

Returns: boolean

Whether incoming mail delivery is disabled for this user. Always returns false.

getNickName()

Returns: String

The user's nickname, falling back to their first name, and then to their account name, if no nickname is set. There is no uniqueness constraint on this value.

getUserId()

Returns: Long

The numeric database ID of this user's profile. Always unique.

getThisProfile()

Returns: Profile

The profile entity this resource represents, same as getThisUser.

getThisEntity()

Returns: BaseEntity

The base entity this resource represents, which is the same profile as getThisProfile.

getFormattedName()

Returns: String

Display name for this user: their first and last name combined (whichever parts are set), falling back to their nickname, and finally to their account name if neither is set.

getSupportedComponentSets()

Returns: SupportedCalendarComponentListsSet

The set of supported CalDAV calendar component types for this principal. Always returns null.

isInGroup(String groupName)

Returns: boolean

Checks whether the user has a membership, in the organisation currently being accessed or one of its children, to the group with the given name.

ParameterDescription
groupNamethe name of the group to check membership of

isInGroup(String groupName, String orgId)

Returns: boolean

Checks whether the user has a membership to the group with the given name, within the organisation identified by the given organisation ID.

ParameterDescription
groupNamethe name of the group to check membership of
orgIdthe ID of the organisation to check membership within

isInGroup(Group group)

Returns: boolean

Checks whether the user has a membership to the given group.

ParameterDescription
groupthe group to check membership of

getPrimaryMembership()

Returns: MembershipBean

The first of this user's primary group memberships. Returns null if the user has no primary group membership.

getPrimaryMemberships()

Returns: MembershipList

All of this user's memberships that are flagged as a primary group membership.

is(String type)

Returns: boolean

Checks the resource type of this resource. Returns true for the type name "user", and otherwise delegates to the superclass check.

ParameterDescription
typethe resource type name to check

getMemberships()

Returns: MembershipList

All of this user's group memberships within the current organisation and its descendants. The result is cached against this resource instance and read from a shared cache on first access.

memberships(String groupName)

Returns: MembershipList

This user's memberships filtered down to those in the group with the given name.

ParameterDescription
groupNamethe name of the group to filter memberships by

getCalendarUserType()

Returns: String

The CalDAV calendar user type for this principal. Always returns "INDIVIDUAL".

getProfile()

Returns: ProfileBean

A bean representation of this user's profile, built on first access and cached on this resource instance.

getExtProfileBean()

Returns: ExtProfileBean

An extended bean representation of this user's profile, with additional fields beyond getProfile, built on first access and cached on this resource instance.

getCurrentUserRoles()

Returns: Set<Role>

All roles currently granted to this user within the current organisation. Computed on first access and cached on this resource instance.

hasRole(Role role)

Returns: boolean

Checks whether this user holds the given role within the current organisation.

ParameterDescription
rolethe role to check, may be null

hasRole(String roleName)

Returns: boolean

Checks whether this user holds a role with the given name within the current organisation.

ParameterDescription
roleNamethe name of the role to check, may be null or blank

getAllFields()

Returns: Map<String,String>

A map of all custom fields stored against this profile across all of its group memberships, keyed on field name. Where more than one membership has a field with the same name, only one of the values is kept. The result is computed on first access and cached on this resource instance.

getSurName()

Returns: String

The user's surname (family name).

getFirstName()

Returns: String

The user's first (given) name.

getEmail()

Returns: String

The user's email address.

getProfilePicHref()

Returns: String

The href to this user's profile picture: a hash-addressed file URL if a photo has been uploaded, otherwise the default profile picture theme asset.

getLastVisit()

Returns: Date

The date of this user's most recent access to the current website. Resolved by querying the access log service on first access and cached on this resource instance.

dailyVisits(Date from, Date to)

Returns: List<DayStat>

The number of hits for each day this user visited the current website, within the given date range.

ParameterDescription
fromthe start of the date range to count visits for
tothe end of the date range to count visits for

dailyVisits(Website website)

Returns: List<DayStat>

The number of hits for each day this user visited the given website, over the common reporting date range currently in effect.

ParameterDescription
websitethe website to count visits for

dailyVisits(Date from, Date to, Website website)

Returns: List<DayStat>

The number of hits for each day this user visited the given website, within the given date range. This is the implementation used by the other dailyVisits overloads.

ParameterDescription
fromthe start of the date range to count visits for
tothe end of the date range to count visits for
websitethe website to count visits for

searchWebHits()

Returns: KSearchResponse

Searches for this user's web hits over the common reporting date range currently in effect, returning up to 10000 results.

searchWebHits(Date from, Date to)

Returns: KSearchResponse

Searches for this user's web hits within the given date range, returning up to 10000 results.

ParameterDescription
fromthe start of the date range to search
tothe end of the date range to search

getSignatureCredentials()

Returns: Map<String,SignatureCredentialBean>

This user's stored signature credentials for the current website, keyed on credential source. Computed on first access and cached on this resource instance.

isHasPassword()

Returns: boolean

Whether this account has at least one password credential set.

getPhone()

Returns: String

The user's phone number.

setFirstName(String s)

Returns: void

Sets the user's first (given) name. Call save to persist the change.

ParameterDescription
sthe new first name

setSurname(String s)

Returns: void

Sets the user's surname (family name). Call save to persist the change.

ParameterDescription
sthe new surname

setEmail(String s)

Returns: void

Sets the user's email address. Call save to persist the change.

ParameterDescription
sthe new email address

setPhone(String s)

Returns: void

Sets the user's phone number. Call save to persist the change.

ParameterDescription
sthe new phone number

setPhotoHash(String s)

Returns: void

Sets the hash identifying this user's uploaded profile picture file. Call save to persist the change.

ParameterDescription
sthe new photo hash

setNickName(String s)

Returns: void

Sets the user's nickname. Call save to persist the change.

ParameterDescription
sthe new nickname

save()

Returns: void

Apply any changes to persistence. Does not use a transaction, so you must have started a transaction already. This will update the search index so should be done last to ensure the transaction is not rolled back

getDirectoryTemplate()

Returns: String

The template used to render this user's directory listing view in the admin file manager.

getActiveMenuIds()

Returns: String[]

The IDs of admin menu items that should be shown as active when this resource is being viewed. Always returns an empty array.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.