Package org.cyclos.services.users
Interface UserService
-
- All Superinterfaces:
CRUDService<UserDTO,UserData,UserDataParams>,CRUDWithConfirmationPasswordService<UserDTO,UserData,UserDataParams>,Service
- All Known Subinterfaces:
UserServiceLocal
public interface UserService extends CRUDWithConfirmationPasswordService<UserDTO,UserData,UserDataParams>
Service interface for user operations
-
-
Field Summary
Fields Modifier and Type Field Description static StringANY_PRINCIPAL_TYPEString that can be used to locate users by any possible principal type, even if there is a default.static StringPIN_PRINCIPAL_TYPEString that can be used to locate users by PIN.static StringSELFIdentifier to locate the authenticated user
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileInfoexportUsers(@NotNull ExportFormatVO format, @NotNull UserQuery params)Exports the user search results to a fileActiveConfigurationDatagetActiveConfiguration(@NotNull UserLocatorVO locator)Returns theActiveConfigurationData, containing all the actual configuration for the user matching the given locatorUserWithRolesVOgetCurrentUser()Returns the current user logged inPublicRegistrationDatagetPublicRegistrationData(@NotNull InitialGroupVO group, String inviteToken, String externalPaymentToken)Returns data for registering a user from the public registrationList<InitialGroupVO>getPublicRegistrationGroups()Return the list of groups guests user can registerUserSearchDatagetSearchData(UserSearchContext context, UserLocatorVO broker)Gets data used on the search page, according to the given search typeList<InitialGroupVO>getUserRegistrationGroups(boolean asMember)Return the list of groups the logged user can register new users.ViewProfileDatagetViewProfileData(@NotNull UserLocatorVO locator)Return aViewProfileDatafor the user matching the given locatorUserVOlocate(@NotNull UserLocatorVO locator)Locates a user by a customizable key.UserRegistrationResultpublicRegister(@NotNull PublicRegistrationDTO user)Registers a user from a public registrationUserRegistrationResultregister(@NotNull UserRegistrationDTO user)Registers a userUserRegistrationResultregisterByMember(@NotNull UserRegistrationByMemberDTO user)Registers a user by a regular member.Page<UserWithFieldsVO>search(@NotNull UserQuery query)Search users according to the specified query parameters.StringvalidateRegistrationField(@NotNull ValidateRegistrationFieldParams params)Validates a field for user registration.-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.services.CRUDWithConfirmationPasswordService
getConfirmationPasswordInputForRemove, removeAllWithConfirmationPassword, removeWithConfirmationPassword, saveWithConfirmationPassword
-
-
-
-
Field Detail
-
SELF
static final String SELF
Identifier to locate the authenticated user- See Also:
- Constant Field Values
-
ANY_PRINCIPAL_TYPE
static final String ANY_PRINCIPAL_TYPE
String that can be used to locate users by any possible principal type, even if there is a default. Otherwise, if none is specified and there is a default, the default is used.- See Also:
- Constant Field Values
-
PIN_PRINCIPAL_TYPE
static final String PIN_PRINCIPAL_TYPE
String that can be used to locate users by PIN.- See Also:
- Constant Field Values
-
-
Method Detail
-
exportUsers
FileInfo exportUsers(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull UserQuery params) throws FrameworkException
Exports the user search results to a file- Throws:
FrameworkException
-
getActiveConfiguration
ActiveConfigurationData getActiveConfiguration(@NotNull @NotNull UserLocatorVO locator) throws FrameworkException
Returns theActiveConfigurationData, containing all the actual configuration for the user matching the given locator- Throws:
FrameworkException
-
getCurrentUser
UserWithRolesVO getCurrentUser() throws FrameworkException
Returns the current user logged in- Throws:
FrameworkException
-
getPublicRegistrationData
PublicRegistrationData getPublicRegistrationData(@NotNull @NotNull InitialGroupVO group, String inviteToken, String externalPaymentToken) throws FrameworkException
Returns data for registering a user from the public registration- Throws:
FrameworkException
-
getPublicRegistrationGroups
List<InitialGroupVO> getPublicRegistrationGroups() throws FrameworkException
Return the list of groups guests user can register- Throws:
FrameworkException
-
getSearchData
UserSearchData getSearchData(UserSearchContext context, UserLocatorVO broker) throws FrameworkException
Gets data used on the search page, according to the given search type- Throws:
FrameworkException
-
getUserRegistrationGroups
List<InitialGroupVO> getUserRegistrationGroups(boolean asMember) throws FrameworkException
Return the list of groups the logged user can register new users.- Parameters:
asMember- flag used only in case the logged user is a broker to distinguish between registering as member/broker.- Throws:
FrameworkException
-
getViewProfileData
ViewProfileData getViewProfileData(@NotNull @NotNull UserLocatorVO locator) throws FrameworkException
Return aViewProfileDatafor the user matching the given locator- Throws:
FrameworkException
-
locate
UserVO locate(@NotNull @NotNull UserLocatorVO locator) throws FrameworkException, ValidationException, EntityNotFoundException
Locates a user by a customizable key. Fields are attempted in the following order (only the first non-blank field will be used for the search):- Id
- Username
- Field value with field's id
- Field value with field's internal name
- Mobile phone
- Throws:
ValidationException- if the locator is invalid (there is no fields non null).EntityNotFoundException- if the user was not found or more than one user was found with the specified locator.FrameworkException
-
publicRegister
UserRegistrationResult publicRegister(@NotNull @NotNull PublicRegistrationDTO user) throws FrameworkException
Registers a user from a public registration- Throws:
FrameworkException
-
register
UserRegistrationResult register(@NotNull @NotNull UserRegistrationDTO user) throws FrameworkException
Registers a user- Throws:
FrameworkException
-
registerByMember
UserRegistrationResult registerByMember(@NotNull @NotNull UserRegistrationByMemberDTO user) throws FrameworkException
Registers a user by a regular member.- Throws:
FrameworkException
-
search
Page<UserWithFieldsVO> search(@NotNull @NotNull UserQuery query) throws FrameworkException, QueryParseException
Search users according to the specified query parameters. The returned objects will either contain the display property or specific profile fields, depending on the products (permissions) of the viewing user. If there are profile fields marked to be returned, display and short display are not returned, as in most cases it would mean repeated information.
-
validateRegistrationField
String validateRegistrationField(@NotNull @NotNull ValidateRegistrationFieldParams params) throws FrameworkException
Validates a field for user registration. The group must be a group allowed for registration. The field should be either an alias of aBasicProfileField.getByAlias(String)or the internal name of a custom field, and must be valid for the given group. The value should be a valid reference value, just as accepted byCustomFieldValueDTO.setReferenceValue(String)- Throws:
FrameworkException
-
-