public interface ProfileFieldHandler
| Modifier and Type | Method and Description |
|---|---|
boolean |
canViewHidden(BasicUser user)
Returns whether the logged user can view hidden fields of the given user
|
void |
fill(DataWithBasicProfileFields data)
Fills properties in search data with basic profile fields
|
void |
filterEnabledForUser(BasicUser user,
org.cyclos.impl.utils.BooleanPropertiesHolder<ProfileField> holder)
Removes from the given BooleanPropertiesHolder all profile fields which are not enabled for the given user
|
java.util.List<AddressQueryField> |
getAddressQueryFields()
Returns the enabled address fields according to the current configuration
|
java.util.List<ProfileField> |
getAllProfileFields()
|
java.util.List<ProfileField> |
getAllProfileFieldsForOperators()
Returns all profile fields that apply for operators
|
java.util.List<UserCustomField> |
getCustomFields(java.util.Collection<? extends ProfileField> profileFields)
Returns a list containing only the custom fields from the list of profile fields
|
java.util.List<ProfileField> |
getEnabledProfileFields(BasicUser user)
Returns the list of profile fields that are enabled in the given user
|
java.util.List<UserProfileFieldActions> |
getFieldActions(BasicUser user)
Returns the enabled fields for the given user (and visible to the logged user) and the actions that the logged
user can perform over them
The contexts which can be used are:
- Internal or public registration: the given user should be transient
- The logged user is viewing other user's profile.
|
java.util.Set<ProfileFieldAction> |
getFieldActions(BasicUser user,
ProfileField profileField)
Returns the possible actions over the given user's profile field
|
java.util.Map<ProfileField,java.util.Set<ProfileFieldAction>> |
getFieldActionsMap(BasicUser user)
Returns, per profile field, the actions over fields of the given user by the logged user
|
java.util.List<ProfileField> |
getFieldsByAction(BasicUser user,
ProfileFieldAction action)
Returns the profile fields which are enabled for the given action by the logged user over the given user
|
org.cyclos.impl.users.FieldsContext |
getFieldsContext(BasicUser user)
Returns the context (or functionality) where the fields are being displayed
|
java.lang.Object |
getFieldValue(BasicUser user,
ProfileField profileField)
Returns the value of the given profle field for the given user.
|
java.util.List<ProfileField> |
getMatchingFields(org.cyclos.impl.utils.BooleanPropertiesHolder<ProfileField> holder,
com.querydsl.core.types.dsl.BooleanPath path)
Like
getMatchingFields(BooleanPropertiesHolder, Map), but using a single property which must be true |
java.util.List<ProfileField> |
getMatchingFields(org.cyclos.impl.utils.BooleanPropertiesHolder<ProfileField> holder,
com.querydsl.core.types.dsl.BooleanPath path,
java.lang.Boolean filter)
Like
getMatchingFields(BooleanPropertiesHolder, Map), but using a single property |
java.util.List<ProfileField> |
getMatchingFields(org.cyclos.impl.utils.BooleanPropertiesHolder<ProfileField> holder,
java.util.Map<com.querydsl.core.types.dsl.BooleanPath,java.lang.Boolean> filter)
Returns a list of the enabled profile fields that matches all the given filters in the map: for each map key,
retains only fields whose that
boolean flag is the same as the map value.
|
java.lang.String |
getPrincipal(BasicUser basicUser,
ChannelConfiguration channelConfiguration)
Returns the value of a principal the given user can use to access a channel with the given configuration
|
java.lang.String |
getPrincipal(BasicUser basicUser,
PrincipalType principalType)
Returns the value of the given principal type for the given user, making sure it applies to the user.
|
ProfileField |
getProfileFieldFor(PrincipalType principalType)
Returns the profile field corresponding to the given principal type, or null if not applicable
|
java.util.List<ProfileField> |
getProfileFieldsInOperatorsList(User user)
Returns the profile fields which are marked to be returned on the operator list.
|
java.util.Map<java.lang.String,java.lang.String> |
getProfileFieldVariables(BasicUser user)
Returns a map with each profile field identifier and value:
If it's a basic profile field (e.g: name, username, etc..) the identifier will be the alias
If it's a custom profile field the identifier will be the internal name.
|
java.util.List<ProfileField> |
getSearchFilters(org.cyclos.impl.users.ProfileFieldSearchContext context,
boolean searchOverBrokeredUsers)
Returns the profile fields that can be used as filters in a search, according to the given context
|
java.util.Set<SendMedium> |
getSendMediums(BasicUser user)
Returns the send mediums with corresponding profile fields enabled (and valid) for the given user
|
java.util.List<ProductUserProfileFieldDTO> |
getUserProfileFields(org.cyclos.impl.users.ProductAccessor products)
Returns the aggregate user profile fields for the given products accessor.
|
boolean |
isAllowed(BasicUser user,
ProfileField profileField,
ProfileFieldAction action)
Returns whether the given action is allowed for the given field / user
|
boolean |
isAllowedForOperator(ProfileField profileField)
Returns whether the given profile field can be used for operators
|
boolean |
isDefaultHidden(Group group,
ProfileField profileField)
Returns whether the given field is marked as hidden for the given group configuration.
|
boolean |
isEnabled(BasicUser user,
ProfileField profileField)
Returns whether the given profile field is enabled for the given products accessor
|
boolean |
isHidden(BasicUser user,
ProfileField profileField,
java.lang.Object value)
Returns whether the given field is marked as hidden for the given user.
|
void |
prepareNew(User user)
Sets all default profile field visibilities, as well as creates an empty
UserCustomFieldValue with the
default value set |
PrincipalType |
principalTypeFor(ProfileField profileField)
Returns the principal type associated with the given profile field, or null if none matches
|
void |
purgeDisabled(BasicUser user)
Purges any existing profile field values that are no longer enabled for this user
|
java.util.List<ProfileField> |
toEntities(java.util.Collection<ProfileField> profileFields)
Converts a list of profile fields to entities.
|
ProfileField |
toEntity(ProfileField field)
Returns a profile field compatible to storing as an entity, converting
UserCustomFieldVOs to
UserCustomFields. |
ProfileField |
toVO(ProfileField field)
Returns a profile field compatible to send to client, converting
UserCustomFields to
CustomFieldDetailedVOs. |
java.util.List<ProfileField> |
toVOs(java.util.Collection<ProfileField> profileFields)
Converts a list of profile fields to VOs.
|
boolean canViewHidden(BasicUser user)
void fill(DataWithBasicProfileFields data)
void filterEnabledForUser(BasicUser user, org.cyclos.impl.utils.BooleanPropertiesHolder<ProfileField> holder)
java.util.List<AddressQueryField> getAddressQueryFields()
java.util.List<ProfileField> getAllProfileFields()
java.util.List<ProfileField> getAllProfileFieldsForOperators()
java.util.List<UserCustomField> getCustomFields(java.util.Collection<? extends ProfileField> profileFields)
java.util.List<ProfileField> getEnabledProfileFields(BasicUser user)
java.util.List<UserProfileFieldActions> getFieldActions(BasicUser user)
java.util.Set<ProfileFieldAction> getFieldActions(BasicUser user, ProfileField profileField)
#getFieldActions(User)java.util.Map<ProfileField,java.util.Set<ProfileFieldAction>> getFieldActionsMap(BasicUser user)
#getFieldActions(User)java.util.List<ProfileField> getFieldsByAction(BasicUser user, ProfileFieldAction action)
org.cyclos.impl.users.FieldsContext getFieldsContext(BasicUser user)
java.lang.Object getFieldValue(BasicUser user, ProfileField profileField) throws FrameworkException
BasicProfileField.LOGIN_NAME, BasicProfileField.FULL_NAME, BasicProfileField.EMAIL:
Returns a string with the value
BasicProfileField.PHONE, BasicProfileField.ADDRESS, BasicProfileField.IMAGE: Returns
a collection with the entities
BasicProfileField.ACCOUNT_NUMBER: Returns a collection with the unmasked strings for all active
accountsCustomFieldHelper.getValue(Long, Collection)
FrameworkExceptionjava.util.List<ProfileField> getMatchingFields(org.cyclos.impl.utils.BooleanPropertiesHolder<ProfileField> holder, com.querydsl.core.types.dsl.BooleanPath path)
getMatchingFields(BooleanPropertiesHolder, Map), but using a single property which must be truejava.util.List<ProfileField> getMatchingFields(org.cyclos.impl.utils.BooleanPropertiesHolder<ProfileField> holder, com.querydsl.core.types.dsl.BooleanPath path, java.lang.Boolean filter)
getMatchingFields(BooleanPropertiesHolder, Map), but using a single propertyjava.util.List<ProfileField> getMatchingFields(org.cyclos.impl.utils.BooleanPropertiesHolder<ProfileField> holder, java.util.Map<com.querydsl.core.types.dsl.BooleanPath,java.lang.Boolean> filter)
java.lang.String getPrincipal(BasicUser basicUser, ChannelConfiguration channelConfiguration)
java.lang.String getPrincipal(BasicUser basicUser, PrincipalType principalType)
ProfileField getProfileFieldFor(PrincipalType principalType)
java.util.List<ProfileField> getProfileFieldsInOperatorsList(User user)
java.util.Map<java.lang.String,java.lang.String> getProfileFieldVariables(BasicUser user)
java.util.List<ProfileField> getSearchFilters(org.cyclos.impl.users.ProfileFieldSearchContext context, boolean searchOverBrokeredUsers)
java.util.Set<SendMedium> getSendMediums(BasicUser user)
java.util.List<ProductUserProfileFieldDTO> getUserProfileFields(org.cyclos.impl.users.ProductAccessor products)
boolean isAllowed(BasicUser user, ProfileField profileField, ProfileFieldAction action)
boolean isAllowedForOperator(ProfileField profileField)
boolean isDefaultHidden(Group group, ProfileField profileField) throws FrameworkException
FrameworkExceptionboolean isEnabled(BasicUser user, ProfileField profileField)
boolean isHidden(BasicUser user, ProfileField profileField, java.lang.Object value) throws FrameworkException
java.lang.IllegalArgumentException - if an inconsistent value is passed in. For example, if the profile field is
phone, the value must either be null or a phone belonging to the same userFrameworkExceptionvoid prepareNew(User user) throws FrameworkException
UserCustomFieldValue with the
default value setFrameworkExceptionPrincipalType principalTypeFor(ProfileField profileField)
void purgeDisabled(BasicUser user)
java.util.List<ProfileField> toEntities(java.util.Collection<ProfileField> profileFields)
toEntity(ProfileField)ProfileField toEntity(ProfileField field)
UserCustomFieldVOs to
UserCustomFields.ProfileField toVO(ProfileField field)
UserCustomFields to
CustomFieldDetailedVOs.java.util.List<ProfileField> toVOs(java.util.Collection<ProfileField> profileFields)
toVO(ProfileField)