Package org.cyclos.impl.banking
Class VoucherConfigurationServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<VoucherConfiguration,QVoucherConfiguration,VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO>
-
- org.cyclos.impl.banking.VoucherConfigurationServiceImpl
-
- All Implemented Interfaces:
VoucherConfigurationServiceLocal,CRUDServiceLocal<VoucherConfiguration,VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO>,VoucherConfigurationService,CRUDService<VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO>,CRUDWithConfirmationPasswordService<VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO>,Service
@Service public class VoucherConfigurationServiceImpl extends CRUDServiceImpl<VoucherConfiguration,QVoucherConfiguration,VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO> implements VoucherConfigurationServiceLocal
Implementation forVoucherConfigurationService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, cacheHandler, dtoClass, entityClass, extensionPointService, idPath, internalNamePath, namePath, ownerEntityIdPath, ownerEntityPath, ownerEntityPropertyName, passwordHandler, richTextHandler, withConfirmationPassword
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description VoucherConfigurationServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected VoucherConfigurationDatagetData(VoucherConfiguration configuration)Returns details data for the given entityVoucherConfigurationListDatagetListData()Returns data for listing voucher configurations, plus the currencies the logged administrator can create new configurationsList<VoucherConfigurationDetailedVO>list()Returns a list with all voucher configurationsList<VoucherConfiguration>listAll()Returns a list with all voucher configurationsList<VoucherConfiguration>listEnabled(User user)Returns the voucher configurations which are enabled for the given userList<VoucherConfiguration>listVisible(User user)Returns the voucher configurations the logged user can view or redeem according to the relationship with the given user.List<VoucherConfiguration>listVisible(User user, boolean includeViewTransactions, boolean includeViewVouchers)Returns the voucher configurations visible to the logged according to the relationship with the given user.VoucherConfigurationnewEntity(CurrencyVO currencyVO)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterSave(VoucherConfiguration entity, VoucherConfiguration currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected ObjectonBeforeSave(VoucherConfiguration voucherConfiguration, VoucherConfiguration currentCopy)May be overridden in order to perform custom logic before saving an entity.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected ValidatorresolveValidator(VoucherConfigurationDTO dto)BooleanPropertiesHolder<VoucherConfiguration>resolveVoucherConfigurationPermissions(User user)Returns the voucher configuration permissions according to the relationship between the logged user and the given user: If the given user is null or the logged user is the same as the given one then it returns the permissions for admin / member (myPermissions) according to the logged user If the logged user is a manager of the given user then it returns the permissions for admin / broker according to the logged user Otherwise it returns an empty permissions.-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomInternalNameValidations, addCustomNameValidations, checkConfirmationPassword, doRemove, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getDeviceConfirmationParams, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getExcludedPropertiesToEntity, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isEntityInternalNameRequired, isNameRequired, load, logEntity, onAfterRemove, onBeforeRemove, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, subClassMappings, toDTO, toEntity, validate
-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, remove, removeAll, saveEntity, saveSkippingEntityLog, toDTO, toEntity, validate
-
-
-
-
Method Detail
-
getListData
public VoucherConfigurationListData getListData() throws FrameworkException
Description copied from interface:VoucherConfigurationServiceReturns data for listing voucher configurations, plus the currencies the logged administrator can create new configurations- Specified by:
getListDatain interfaceVoucherConfigurationService- Throws:
FrameworkException
-
list
public List<VoucherConfigurationDetailedVO> list() throws FrameworkException
Description copied from interface:VoucherConfigurationServiceReturns a list with all voucher configurations- Specified by:
listin interfaceVoucherConfigurationService- Throws:
FrameworkException
-
listAll
public List<VoucherConfiguration> listAll() throws FrameworkException
Description copied from interface:VoucherConfigurationServiceLocalReturns a list with all voucher configurations- Specified by:
listAllin interfaceVoucherConfigurationServiceLocal- Throws:
FrameworkException
-
listEnabled
public List<VoucherConfiguration> listEnabled(User user)
Description copied from interface:VoucherConfigurationServiceLocalReturns the voucher configurations which are enabled for the given user- Specified by:
listEnabledin interfaceVoucherConfigurationServiceLocal
-
listVisible
public List<VoucherConfiguration> listVisible(User user)
Description copied from interface:VoucherConfigurationServiceLocalReturns the voucher configurations the logged user can view or redeem according to the relationship with the given user. If the given user is null then it returns the configurations as follow: If logged is an administrator then those defined in the admin product. If logged is a member/broker then those defined in the member products.- Specified by:
listVisiblein interfaceVoucherConfigurationServiceLocal
-
listVisible
public List<VoucherConfiguration> listVisible(User user, boolean includeViewTransactions, boolean includeViewVouchers)
Description copied from interface:VoucherConfigurationServiceLocalReturns the voucher configurations visible to the logged according to the relationship with the given user.- Specified by:
listVisiblein interfaceVoucherConfigurationServiceLocal
-
newEntity
public VoucherConfiguration newEntity(CurrencyVO currencyVO)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<VoucherConfiguration,VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO>- Specified by:
newEntityin classCRUDServiceImpl<VoucherConfiguration,QVoucherConfiguration,VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO>
-
resolveVoucherConfigurationPermissions
public BooleanPropertiesHolder<VoucherConfiguration> resolveVoucherConfigurationPermissions(User user)
Description copied from interface:VoucherConfigurationServiceLocalReturns the voucher configuration permissions according to the relationship between the logged user and the given user:- If the given user is null or the logged user is the same as the given one then it returns the permissions for admin / member (myPermissions) according to the logged user
- If the logged user is a manager of the given user then it returns the permissions for admin / broker according to the logged user
- Otherwise it returns an empty permissions.
- Specified by:
resolveVoucherConfigurationPermissionsin interfaceVoucherConfigurationServiceLocal
-
getData
protected VoucherConfigurationData getData(VoucherConfiguration configuration)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<VoucherConfiguration,QVoucherConfiguration,VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO>
-
onAfterSave
protected void onAfterSave(VoucherConfiguration entity, VoucherConfiguration currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<VoucherConfiguration,QVoucherConfiguration,VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO>
-
onBeforeSave
protected Object onBeforeSave(VoucherConfiguration voucherConfiguration, VoucherConfiguration currentCopy)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before saving an entity. Any returned value will be passed to theCRUDServiceImpl.onAfterSave(BaseEntity, BaseEntity, Object)method
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
resolveValidator
protected Validator resolveValidator(VoucherConfigurationDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<VoucherConfiguration,QVoucherConfiguration,VoucherConfigurationDTO,VoucherConfigurationData,CurrencyVO>
-
-