Package ch.tocco.nice2.userbase.impl
Class EmailTemplateLoadServiceImpl
java.lang.Object
ch.tocco.nice2.userbase.impl.EmailTemplateLoadServiceImpl
- All Implemented Interfaces:
EmailTemplateLoadService
@Component
public class EmailTemplateLoadServiceImpl
extends Object
implements EmailTemplateLoadService
-
Constructor Summary
ConstructorsConstructorDescriptionEmailTemplateLoadServiceImpl(Context context, BusinessUnitManager buManager, QueryBuilderFactory queryBuilderFactory, org.slf4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptiongetTemplate(String uniqueId) Load email template with givenuniqueIdfrom the user's currentBusinessUnit.Loads a email template.Load email template with givenuniqueIdfrom the user's currentBusinessUnit.Deprecated.Deprecated.
-
Constructor Details
-
EmailTemplateLoadServiceImpl
public EmailTemplateLoadServiceImpl(Context context, BusinessUnitManager buManager, QueryBuilderFactory queryBuilderFactory, org.slf4j.Logger logger)
-
-
Method Details
-
load
Deprecated.Description copied from interface:EmailTemplateLoadServiceLoads a email template for the specified business unit. Note: you probably need to load it in privileged mode to have read permission in another business unit.- Specified by:
loadin interfaceEmailTemplateLoadService- Parameters:
uniqueId- unique id of templatebusinessUnitUniqueId- unique id of business unit- Returns:
- the email template
-
load
Deprecated.- Specified by:
loadin interfaceEmailTemplateLoadService- Parameters:
uniqueId- unique id of templatebusinessUnitEntity- business unit entity- Returns:
- the email template
- See Also:
-
load
Description copied from interface:EmailTemplateLoadServiceLoads a email template.- Specified by:
loadin interfaceEmailTemplateLoadService- Parameters:
emailTemplateEntity- template entity- Returns:
- the email template
-
getTemplate
Description copied from interface:EmailTemplateLoadServiceLoad email template with givenuniqueIdfrom the user's currentBusinessUnit. ==== In case the current **user is in a business unit**, the template returned is selected as follows: 1. If in the currentBusinessUnita template with the correctuniqueIdexists, it is returned. 2. Otherwise, If a template with theuniqueIdand noBusinessUnitassociation exists, it is returned. 3. Otherwise,Optional.empty()is returned. In case the **user is not in a business unit** (e.g. he is in the {BusinessUnit.NULL_BUSINESS_UNIT}): 1. If a template with theuniqueIdand noBusinessUnitexists, it is returned. 2. Otherwise,Optional.empty()is returned. Use #load if you prefer an exception is thrown if the email template is missing.- Specified by:
getTemplatein interfaceEmailTemplateLoadService- Parameters:
uniqueId- Unique id of the template- Returns:
- The
EmailTemplate
-
load
Description copied from interface:EmailTemplateLoadServiceLoad email template with givenuniqueIdfrom the user's currentBusinessUnit. ==== In case the current **user is in a business unit**, the template returned is selected as follows: 1. If in the currentBusinessUnita template with the correctuniqueIdexists, it is returned. 2. Otherwise, If a template with theuniqueIdand noBusinessUnitassociation exists, it is returned. 3. Otherwise, aRuntimeExceptionis is thrown. In case the **user is not in a business unit** (e.g. he is in the {BusinessUnit.NULL_BUSINESS_UNIT}): 1. If a template with theuniqueIdand noBusinessUnitexists, it is returned. 2. Otherwise, aRuntimeExceptionis is thrown. Use #load if you prefer Optional.empty() is returned if the email template is missing.- Specified by:
loadin interfaceEmailTemplateLoadService- Parameters:
uniqueId- Unique id of the template- Returns:
- The
EmailTemplate
-