Class AddressDataProviderUser
java.lang.Object
ch.tocco.nice2.optional.address.impl.AddressDataProviderUser
- All Implemented Interfaces:
AddressDataProvider
,SalutationConstants
@Component
public class AddressDataProviderUser
extends Object
implements AddressDataProvider, SalutationConstants
Data provider to enable address generation for User entity.
Please note, that this provider also returns some data, if the current principal has
no read permissions on the User entity. The fields of the User entity are fetched
in privileged mode.
However, if the current principal is not allowed to read the related address, it is
not returned.
-
Field Summary
Fields inherited from interface ch.tocco.nice2.optional.address.api.SalutationConstants
ACADEMIC_TITLE, DATA_OBJECT, ENTITY_APPLICATION, ENTITY_SALUTATION, ENTITY_USER, FORMAL_SALUTATION_UNIQUE_ID, GENDER, INFORMAL_SALUTATION_UNIQUE_ID, LABEL, NEUTRAL_SALUTATION_UNIQUE_ID, OTHER_TITLE, REL_ACADEMIC_TITLE, REL_ADDRESS_OUTPUT, REL_GENDER, REL_SALUTATION, REL_USER_OUTPUT, SALUTATION, SALUTATION_TITLE_PLACEHOLDER, TEMPLATE, UNIQUE_ID
-
Constructor Summary
ConstructorDescriptionAddressDataProviderUser
(QueryBuilderFactory queryBuilderFactory, SecurityManager securityManager) -
Method Summary
Modifier and TypeMethodDescriptiongetData
(AddressData data, Entity entity, AddressService.AddressType type, AddressService.AddressLook look) Write data required for address generation to a map to be provided to generic address service.getData
(Entity entity, AddressService.AddressType type, AddressService.AddressLook look) Write data required for address generation to a map to be provided to generic address service.Name of the entity model for which this AddressDataProvider may be used.void
setAddressDataProviders
(List<AddressDataProvider> addressDataProviders)
-
Constructor Details
-
AddressDataProviderUser
public AddressDataProviderUser(QueryBuilderFactory queryBuilderFactory, SecurityManager securityManager)
-
-
Method Details
-
getEntityName
Description copied from interface:AddressDataProvider
Name of the entity model for which this AddressDataProvider may be used.- Specified by:
getEntityName
in interfaceAddressDataProvider
-
getData
public AddressData getData(Entity entity, AddressService.AddressType type, AddressService.AddressLook look) Description copied from interface:AddressDataProvider
Write data required for address generation to a map to be provided to generic address service. New modules requiring address generation for an entity implement this method. The implementing class needs to be contributed providing the name of the entity it handles.- Specified by:
getData
in interfaceAddressDataProvider
- Returns:
- a map containing required information to generate address
-
getData
public AddressData getData(AddressData data, Entity entity, AddressService.AddressType type, AddressService.AddressLook look) Description copied from interface:AddressDataProvider
Write data required for address generation to a map to be provided to generic address service. New modules requiring address generation for an entity implement this method. The implementing class needs to be contributed providing the name of the entity it handles.- Specified by:
getData
in interfaceAddressDataProvider
- Parameters:
data
- AddressData object with predefined values. Values may be overwritten by values from the entity- Returns:
- a map containing required information to generate address
-
getData
- Specified by:
getData
in interfaceAddressDataProvider
-
setAddressDataProviders
-