Properties

NameReturnsNotes
allRolesList<Map<String,String>>Returns a list of available roles for the current account
availableRolesMap<String,Role>Returns a map of Role objects, keyed on the role identifier. This returns Roles from all apps currently active for the account
currentLoginNonceLoginNonceBeanThe login nonce for the current request, or null if there is no current request / nonce. Lets templates and JS tell whether the current session is a (read-only) login-as session and who initiated it.
currentProfileProfile
dynamicGroupsList<Group>Returns all dynamic (ie rules based) groups
emailVerificationEnabledbooleanEmail verification is enabled or not in the UserApp setting.
emailVerificationTokenValiditylong
groupsList<Group>All groups in this account
loginAsImpersonatedProfileProfileFor a login-as session, the participant being impersonated, otherwise null.
loginAsInitiatingProfileProfileFor a login-as session, the manager/admin who initiated the login-as, otherwise null.
matchMethodsList<DuplicateProfileMatchMethod>
openGroupsList<Group>Returns all groups in this account which are open (but not the "public" group)
pendingApplicationsList<GroupMembershipApplication>Return the list of membership applications which the current user is permitted to process, limited to max of 100
phoneUniqueEnabledbooleanReturns true if the account has unique phone number enabled
readOnlyLoginAsbooleanConvenience for controllers: true if the current session is a read-only login-as session. The platform already strips WRITE/ACL priviledges for such sessions; controllers should call this to also block mutating actions that are gated at READ_CONTENT (eg placing orders, spending points, editing profile) and so are not covered by the WRITE strip.
userOrgsList<Organisation>

Methods

SignatureReturnsNotes
streamEventBuilder()StreamEventBeanBuilderUsed to create a StreamEventBean object
checkValidPassword(String password, Profile profile)booleanChecks to see if the password is valid, ie complies with all password complexity policies attached to the profile
checkValidPassword(String password, Profile profile, Narrative narrative)booleanChecks to see if the password is valid, ie complies with all password complexity policies attached to the profile
isSecondFactorAuthentificationEnabled(Profile profile)Boolean
temp2FACode(Profile profile)Temp2FAData
save2FACode(Profile profile, String secretKey, String userCode2FA)void
disable2FA(Profile profile)void
blockEntity(BaseEntity blockedEntity, Date blockUntilDate)AccessBlock
findActiveBlocksForEntity(BaseEntity block)List<AccessBlock>
findBlocksForEntity(BaseEntity block)List<AccessBlock>
findBlockById(long id)AccessBlock
deleteBlock(AccessBlock ab)void
findRole(String role)Role
addRoleToGroupForOrg(Role foundRole, Group group, Organisation org)GroupRole
addRoleToGroupForOwnOrg(Role foundRole, Group group)GroupRole
newProfileBuilder()ProfileBuilderCreates an instance of a ProfileBuilder which is a convenient way to create new Profiles <p> Set properties on the ProfileBuilder and then call its build() method to create the profile
removeLoginIds(Profile forUser, List<String> nonces)int
deleteMembership(GroupMembership membership)void
getMembership(Long id)GroupMembership
isInHomeOrg(Profile profile)booleanCheck to see if the given profile has the current account as its home admin org, or if its home admin org is within the current account
verifyPassword(Profile user, String password)booleanVerify that the provided password matches that saved. <br> Use this with login(Profile) to implement a custom login process
login(Profile loginAsProfile)voidSets login cookies for the current request to login the given user
loginToken(Website website, Branch branch, Profile loginAsProfile, String path)WebUtils.ExtUrlReturns a ExtUrl, where object1 is the URL including login tokens for the given website and branch, and object2 is the domain name used in the URL and which the login tokens are valid for
loginToken(Profile profile)String
getCurrentLoginNonce()LoginNonceBeanThe login nonce for the current request, or null if there is no current request / nonce. Lets templates and JS tell whether the current session is a (read-only) login-as session and who initiated it.
isReadOnlyLoginAs()booleanConvenience for controllers: true if the current session is a read-only login-as session. The platform already strips WRITE/ACL priviledges for such sessions; controllers should call this to also block mutating actions that are gated at READ_CONTENT (eg placing orders, spending points, editing profile) and so are not covered by the WRITE strip.
getLoginAsImpersonatedProfile()ProfileFor a login-as session, the participant being impersonated, otherwise null.
getLoginAsInitiatingProfile()ProfileFor a login-as session, the manager/admin who initiated the login-as, otherwise null.
findEntityById(Long id)BaseEntity
membershipListForOrg(Organisation orgPart)MembershipList
membershipList(List<ProfileBean> profileBeans)MembershipList
membershipListForProfiles(List<Profile> profiles)MembershipList
members(List<Profile> profiles)List<GroupMembership>Load the list of GroupMembership for the given profiles efficiently
membershipList(Profile p)MembershipListReturn a MembershipList with memberships for the given profile. This provides methods to allow filtering by group, organisation, etc <br> This excludes expired memberships
findProfileOrgsWithRoles(Profile p, String roles)List<Organisation>Return a list of organisations which the profile has specific roles on
membershipListForGroup(Group group)MembershipListGet MembershipList from a group
membershipListForGroup(String groupName)MembershipListGet MembershipList from a group code
findAddresses(BaseEntity entity)List<EntityAddress>Find all addressess associated with the given entity (user or organisation)
findAddressByType(BaseEntity entity, String addressType)EntityAddressFind all address associated with the given entity (user or organisation) and given address type
findAllAddresses(BaseEntity entity)Map<String,IReadableAddress>Returns all addresses which are applicable for the given entity. This is broader then findAddresses because for users it will include the addresses of their orgs, and it will include the address on the org itself plus any EntityAddress records associated with it
findAllAddresses(BaseEntity entity, boolean includeRelated)Map<String,IReadableAddress>Returns all addresses which are applicable for the given entity. This is broader then findAddresses because for users it will include the addresses of their orgs, and it will include the address on the org itself plus any EntityAddress records associated with it
findAddress(Profile profile, Long entityAddressId)EntityAddressFind an address specified by the ID of the entity address (not the Address itself) for a given entity <p> Returns null if the EntityAddress does not exist, or is not associated with the given entity
updateAddress(Profile profile, FormContext rc)EntityAddressUpdate or create profile address
updateAddress(Profile profile, Long entityAddressId, FormContext rc, String type)EntityAddress
findAllMembershipApplications(Profile profile)List<GroupMembershipApplication>
findPendingMembershipApplications(Profile profile)List<GroupMembershipApplication>
createUser(String email, String nickName)Profile
removeMember(Profile profile)voidRemove a profile
extraFields(Profile p)Map<ExtraField,String>Returns a map where the key is ExtraField (so with meta data) and the value is the value of the extra field, for primary memberships only
extraFields(Profile p, boolean primaryOnly)Map<ExtraField,String>Returns a map where the key is ExtraField (so with meta data) and the value is the value of the extra field
updateProfile(Profile p, FormContext context)Profileupdate given profile with given form context
updateProfileStatus(Profile profile, Boolean enable)void
extraFieldValues(Profile p)Map<String,String>
extraFields(MembershipBean bean)Map<ExtraField,String>
extraFieldValue(MembershipBean bean, String fieldName)String
updateUser(Profile p)voidJust saves any updates to the profile object, and triggers a reindex of it
addExtraField(Group group, String name, String value)voidAdd a new extra field definition to a given group
removeExtraField(Group group, String name)voidRemove a new extra field definition to a given group
updateExtraFieldOrdering(Group group, String fieldName, int ordering)voidUpdate extra fields ordering for a given group
storeExtraFields(GroupMembership gm, Map<String,String> parameters)voidSaves custom fields for a single membership.Assumes fields are in the params map with the same field as defined on the membership group
storeExtraFields(GroupMembership gm, FormContext form)voidSaves custom fields for a single membership.Assumes fields are in the parameters map or files map of the form context object with the same
storeExtraFields(Profile p, Map<String,String> parameters)voidStore profile extra fields from a map of parameters
extraFieldDefinitions(Group group)List<ExtraField>Get the list of custom/extra field defiitions for the given group
saveToFieldSet(List<ExtraField> extraFields, Map<String,String> parameters, Map<String,FileItem> files)NvSetSave the given values to a Name/Value field set. <p> Use extraFieldDefinitions(group) to get the list of field definitions
uploadExtraFieldFile(FileItem fileItem, List<String> allowedMimeTypes)StringUpload a file to ExtraField_Files folder
group(String groupName)Group
group(long id)Group
getGroups()List<Group>All groups in this account
findGroupPasswordPolicies(Group group)List<PasswordPolicyBean>
findPasswordPolicyDescription(PasswordPolicyBean passwordPolicy)String
findOrg(String orgId)Organisation
findOrg(Long id)Organisation
findOrgTypeByName(String sOrgType)OrgType
findOrgTypeById(long id)OrgType
findBaseEntity(Long id)BaseEntity
findOrCreateMembership(Profile profile, Group group, Organisation org)GroupMembershipFind a membership which matches the profile, org and group, and if none exist create it. Return either the found or created membership. <p> When this creates a membership it will also create a SignupLog and will fire events
findOrCreateMembership(Profile profile, Group group, Organisation org, BiConsumer<GroupMembership,SignupLog> membershipCreatedCallback)GroupMembershipThis overload allows passing in a callback, which gets called with the GroupMembership and SignupLog. This is called prior to event processing, so is a good place to store extra fields etc which might be used by event processing, eg sending emails etc
updateMembership(GroupMembership membership, Group newGroup, Organisation newOrg)voidUpdate membership
newMembershipApplication(Profile profile, Group group, Organisation org, FormContext form)GroupMembershipApplication
createOptinLog(Profile profile, Group group)OptInLog
findByName(String name)Profile
findByEmail(String email)Profile
findByUsernameOrEmail(String userNameOrEmail)ProfileFind a profile by username or email
findById(Long id)ProfileLookup a Profile by its internal ID (not username). This will only return profiles which are enabled, and have the current org as their home account
findMatchingProfiles(UserDao.ProfileMatchRequest request)List<Profile>
findMatching(UserDao.ProfileMatchRequest request)List<ExtProfileBean>Find any enabled profiles with either phone or email
findMatching(UserDao.ProfileMatchRequest included, UserDao.ProfileMatchRequest excluded)List<ExtProfileBean>
newProfileMatchRequest()UserDao.ProfileMatchRequestCreate a new match request object. You can then set search values on that object, and use it to call the findMatching method
numProfiles(String q, Organisation org, Group searchGroup)Long
processOptIns(Profile profile, Group group, Map<String,String> parameters)void
findOptins(Group group)List<OptIn>Get the list of configured list of OptIn for the given group
findChildMembershipByField(String groupName, String fieldName, Object ovalue, boolean contains)MembershipBean
mergeProfiles(ProfileBean mergeDestination, List<ProfileBean> mergeSources)void
mergeProfiles(Profile mergeDest, List<Long> mergeSources)int
groups()List<Group>Find all groups (not soft deleted) for the current admin domain
orgTypes()List<OrgType>Return all org types for the current admin domain
toProfileBean(Profile p)ExtProfileBean
toOrgData(Organisation org)OrgData
toOrg(OrgData od)Organisation
toOrgList(List<OrgData> orgDatas)List<Organisation>
findHighest(List<Organisation> orgs)OrganisationFind the organisation highest in the org hierarchy, ie the one with the fewest parent orgs
members(Group group, Organisation org)List<Profile>Find users (profiles) within a given gruop for a given organisation (ie team) <p> DEPRECATED: this doesnt evaluate dyamic groups, use findMembers
findMembers(Group group)List<Profile>Uses GroupManager, so dynamic and normal groups are handled correctly
numMembers(Group group)LongFind the number of members in the given group. This may be physical or a dynamic group
members(Group group, SearchProperties props)List<Profile>
memberships(Organisation org)List<GroupMembership>Find all members for given org
memberships(Group group, Organisation org)List<GroupMembership>
memberships(Profile profile, Organisation org)List<GroupMembership>
memberships(Profile profile, Group group)List<GroupMembership>
memberships(Profile profile, OrgType teamOrgType)List<GroupMembership>
setMembershipField(MembershipBean membershipBean, String fieldName, String fieldValue)void
findDuplicates(DuplicateProfileMatchMethod matchMethod, MergeDestMode mode)List<DuplicateProfilesList>
findGroupByName(String groupName)Group
findGroupById(Long id)Group
findByOrg(Organisation team)List<Profile>
findByOrgType(OrgType ot)List<Profile>
hasAdminUserRole(Organisation memberOrg)booleanHelper method to determine if the current user has admin role
processPending(GroupMembershipApplication gma, Boolean b)voidAccept or reject a GroupMembershipApplication The latest related email verification request will be processed, if found.
processPending(GroupMembershipApplication gma, EmailValidationRequest emailValidationRequest, Boolean b)voidAccept or reject a GroupMembershipApplication if emailValidationRequest is provided, it will be marked as verified
setPassword(Profile user, String newPassword)void
generatePasswordReset(Profile user, Website website)PasswordResetGenerate passwordReset object for generating password reset token
findPasswordReset(String token, Website website)PasswordReset
findPasswordReset(Profile profile, String token, Website website)PasswordReset
updateProfilesForOrg(Organisation org)voidUpdate profiles index for all profiles with memberships to the given org
isPhoneUniqueEnabled()booleanReturns true if the account has unique phone number enabled
getAllRoles()List<Map<String,String>>Returns a list of available roles for the current account
isEmailVerificationEnabled()booleanEmail verification is enabled or not in the UserApp setting.
findEmailVerificationSubject(WebsiteRootFolder websiteRootFolder)StringGet subject for email verification message UserApp setting.
findLatestActiveRequest(Profile profile)EmailValidationRequestFind the latest {@code EmailValidationRequest} by the provided profile
sendEmailVerification(GroupMembershipApplication groupMembershipApplication)EmailValidationRequestCreate a {@code EmailValidationRequest} for a {@code GroupMembershipApplication} and send the email
sendEmailVerification(Profile profile, String email, Website website)EmailValidationRequestCreate a {@code EmailValidationRequest} for a profile and send the email
findValidEmailVerificationRequestByToken(String token, Date currentDate, Narrative narrative)EmailValidationRequestReturns a {@code EmailValidationRequest} if the provided token exists and is not expired. The error detail will be passed to the narrative parameter
approveEmailVerificationRequest(EmailValidationRequest emailValidationRequest, Date approvedDate, boolean fireUserUpdateEvent)EmailValidationRequestReturns a approve a email verification request
submitMembershipApplicationRequest(MembershipApplicationRequest mar)GroupMembershipApplication
membershipOrgProperties(GroupMembershipApplication gma)Map<String,Object>
findUnsubs(Profile p)List<Unsubscribe>Returns unsubscribes linked to the given profile OR its email address
findUnsubs(String groupName, SearchProperties searchProperties)List<Unsubscribe>Returns unsubscribes within current tenant
findUnsubs(SearchProperties searchProperties)List<Unsubscribe>Returns unsubscribes within current tenant
countUnsubs()longcount all unsubs of current tenant org
countUnsubs(String groupName)longcount all unsubs of current tenant org
findUnsubGroupSummary()List<GroupSignupStat>find unsub group summary
findUnsubProfileIdsByOrg()List<Long>Return a list of unsubscribed profile IDs associated with the current account from the cache
findUnsubEmailsByOrg()List<String>Return a list of unsubscribed emails associated with the current account from the cache
hasOrgType(Organisation org, OrgType expectedOrgType)boolean
createRulesGroup(String name, String title, String json)Group
createGroup(String name, String title, String groupType, String regoMode)GroupCreate a Group with the given name and properties <p> Throws an exception if a group with the given name already exists
deleteGroup(Group group)void
newConfigMessage(String level, String message)ConfigMessage
findNonces(Profile profile, Date start, Date finish)List<LoginNonce>
findAuditStats(Profile p)Map<Date,Integer>Returns the number of changes to the given item by Date
findAuditItems(Profile p, Integer max)List<AuditItem>
hasCredentials(Profile p)booleanReturns true if the user has a password or other credential
isValidUserName(String value)boolean
findPasswordReset(Profile profile, Website website, String shortCode)PasswordReset
generatePasswordReset(Profile user, Website website, String shortCode)PasswordReset
subscriptionAction(String action)SubscriptionEvent.SubscriptionActionGet enum SubscriptionAction from string value
homeAdminOrgInfo(Profile p)HomeOrgInfo
findPrimaryMemberships(Profile p)MembershipList
findPrimaryMembershipsOrgs(Profile p)OrgDataList
findPrimaryMembershipsOrgs(Profile p, boolean nonRoot)OrgDataList
unsubscribe(Profile profile, Website website)voidunsubscribe a profile
invalidateNonce(String nonce)voidinvalidate login nonce
addToGroupWithoutEvent(Profile profile, Group groupToJoin, Organisation orgToJoin)GroupMembershipCreate user membership without firing any events or re-indexing <br> You MUST call updateUser(p) after this to ensure the profile index is updated
addToGroup(Profile profile, Group groupToJoin, Organisation orgToJoin)GroupMembershipCreate user membership with firing any events and re-indexing <br> If you are making multiple group modifications per profile it may be more efficient to use addToGroupWithoutEvent and then call updateUser once all changes to a profile are done
newLoginNonceSearchBuilder()LoginNonceSearchBuilderCreate a new LoginNonceSearchBuilder to search for login nonces
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.