Package org.cyclos.impl.banking
Class VoucherCustomFieldServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<CF,A,DTO,D,DP>
-
- org.cyclos.impl.system.BaseCustomFieldServiceImpl<VoucherCustomField,VoucherCustomFieldPossibleValueCategory,VoucherCustomFieldPossibleValue,QVoucherCustomField,VoucherCustomFieldDTO,VoucherCustomFieldData,Void>
-
- org.cyclos.impl.banking.VoucherCustomFieldServiceImpl
-
- All Implemented Interfaces:
VoucherCustomFieldServiceLocal,CRUDServiceLocal<VoucherCustomField,VoucherCustomFieldDTO,VoucherCustomFieldData,Void>,VoucherCustomFieldService,CRUDService<VoucherCustomFieldDTO,VoucherCustomFieldData,Void>,CRUDWithConfirmationPasswordService<VoucherCustomFieldDTO,VoucherCustomFieldData,Void>,Service,BaseCustomFieldService<VoucherCustomFieldDTO,VoucherCustomFieldData,Void>
@Service public class VoucherCustomFieldServiceImpl extends BaseCustomFieldServiceImpl<VoucherCustomField,VoucherCustomFieldPossibleValueCategory,VoucherCustomFieldPossibleValue,QVoucherCustomField,VoucherCustomFieldDTO,VoucherCustomFieldData,Void> implements VoucherCustomFieldServiceLocal
Service implementation for voucher custom fields
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.system.BaseCustomFieldServiceImpl
customFieldValueHandler, customScriptService, dataClass
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, dtoClass, entityClass, extensionPointService, idPath, internalNamePath, namePath, ownerEntityIdPath, ownerEntityPath, ownerEntityPropertyName, passwordHandler, richTextHandler, withConfirmationPassword
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, 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 VoucherCustomFieldServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCustomValidations(Validator validator, VoucherCustomFieldDTO dto)It may be overridden to add specific validations for the custom field.voidaddRelation(VoucherTypeVO voucherTypeVO, CustomFieldVO customFieldVO)Relates the given voucher type with the given custom fieldprotected IntegergetMaxOrder(VoucherCustomField field)Should be implemented in order to return the maximum order number for fields like the given oneprotected BaseCustomFieldPossibleValueCategoryServiceLocal<VoucherCustomField,VoucherCustomFieldPossibleValueCategory,VoucherCustomFieldPossibleValue>getPossibleValueCategoryService()Must be implemented in order to return the corresponding category serviceprotected VoucherCustomFieldPossibleValueServiceLocalgetPossibleValueService()Must be implemented in order to return the corresponding possible value serviceprotected List<Class<?>>getPropertyClasses()May be overridden in order to return a list of classes to apply internal name property validationsprotected booleanisBinaryTypesAllowed()Indicates whether this custom field nature allows binary typesList<CustomFieldVO>list()Lists all voucher custom fields with detailed informationList<VoucherCustomField>listAll()Returns all custom fieldsList<CustomFieldVO>listAllRelated(VoucherTypeVO voucherTypeVO)Returns all the custom fields which are related to the given voucher typeList<VoucherCustomField>listRelated(VoucherType voucherType, User user)Returns the custom fields which are related to the given voucher type and visible by the logged user over the given one.List<CustomFieldVO>listRelated(VoucherTypeVO voucherTypeVO, UserVO userVO)Returns the custom fields which are visible (according to the products) and related to the given voucher typeList<VoucherCustomField>listVisible(User user)Returns the custom fields which are visible by the logged user over the given oneVoucherCustomFieldnewEntity(Void params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterRemove(VoucherCustomField entity)May be overridden in order to perform custom logic after removing an entityprotected voidonAfterSave(VoucherCustomField entity, VoucherCustomField currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected ObjectonBeforeSave(VoucherCustomField field, VoucherCustomField 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 networkvoidremoveRelation(VoucherTypeVO voucherTypeVO, CustomFieldVO customFieldVO)Removes the given voucher type with the given custom field-
Methods inherited from class org.cyclos.impl.system.BaseCustomFieldServiceImpl
addCustomInternalNameValidations, getData, isEntityInternalNameRequired, resolveValidator, supportsValues, toDetailedVOs, toDTO
-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomNameValidations, checkConfirmationPassword, doRemove, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getDeviceConfirmationParams, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getExcludedPropertiesToEntity, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isNameRequired, load, logEntity, onBeforeRemove, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, subClassMappings, 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.system.BaseCustomFieldService
saveOrder
-
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
-
addRelation
public void addRelation(VoucherTypeVO voucherTypeVO, CustomFieldVO customFieldVO) throws EntityNotFoundException
Description copied from interface:VoucherCustomFieldServiceRelates the given voucher type with the given custom field- Specified by:
addRelationin interfaceVoucherCustomFieldService- Throws:
EntityNotFoundException
-
list
public List<CustomFieldVO> list()
Description copied from interface:VoucherCustomFieldServiceLists all voucher custom fields with detailed information- Specified by:
listin interfaceVoucherCustomFieldService
-
listAll
public List<VoucherCustomField> listAll()
Description copied from interface:VoucherCustomFieldServiceLocalReturns all custom fields- Specified by:
listAllin interfaceVoucherCustomFieldServiceLocal
-
listAllRelated
public List<CustomFieldVO> listAllRelated(VoucherTypeVO voucherTypeVO) throws EntityNotFoundException
Description copied from interface:VoucherCustomFieldServiceReturns all the custom fields which are related to the given voucher type- Specified by:
listAllRelatedin interfaceVoucherCustomFieldService- Throws:
EntityNotFoundException
-
listRelated
public List<VoucherCustomField> listRelated(VoucherType voucherType, User user)
Description copied from interface:VoucherCustomFieldServiceLocalReturns the custom fields which are related to the given voucher type and visible by the logged user over the given one.- Specified by:
listRelatedin interfaceVoucherCustomFieldServiceLocal
-
listRelated
public List<CustomFieldVO> listRelated(VoucherTypeVO voucherTypeVO, UserVO userVO) throws EntityNotFoundException
Description copied from interface:VoucherCustomFieldServiceReturns the custom fields which are visible (according to the products) and related to the given voucher type- Specified by:
listRelatedin interfaceVoucherCustomFieldService- Throws:
EntityNotFoundException
-
listVisible
public List<VoucherCustomField> listVisible(User user) throws FrameworkException
Description copied from interface:VoucherCustomFieldServiceLocalReturns the custom fields which are visible by the logged user over the given one- Specified by:
listVisiblein interfaceVoucherCustomFieldServiceLocal- Throws:
FrameworkException
-
newEntity
public VoucherCustomField newEntity(Void params)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<VoucherCustomField,VoucherCustomFieldDTO,VoucherCustomFieldData,Void>- Specified by:
newEntityin classCRUDServiceImpl<VoucherCustomField,QVoucherCustomField,VoucherCustomFieldDTO,VoucherCustomFieldData,Void>
-
removeRelation
public void removeRelation(VoucherTypeVO voucherTypeVO, CustomFieldVO customFieldVO) throws EntityNotFoundException
Description copied from interface:VoucherCustomFieldServiceRemoves the given voucher type with the given custom field- Specified by:
removeRelationin interfaceVoucherCustomFieldService- Throws:
EntityNotFoundException
-
addCustomValidations
protected void addCustomValidations(Validator validator, VoucherCustomFieldDTO dto)
Description copied from class:BaseCustomFieldServiceImplIt may be overridden to add specific validations for the custom field. NOTE: You musn't add validations for the followings properties: 'internal_name' and 'name'.
UseCRUDServiceImpl.addCustomInternalNameValidations(Property, org.cyclos.model.EntityDTO)orCRUDServiceImpl.addCustomNameValidations(Property, org.cyclos.model.EntityDTO)instead.- Overrides:
addCustomValidationsin classBaseCustomFieldServiceImpl<VoucherCustomField,VoucherCustomFieldPossibleValueCategory,VoucherCustomFieldPossibleValue,QVoucherCustomField,VoucherCustomFieldDTO,VoucherCustomFieldData,Void>dto- the DTO to be validated
-
getMaxOrder
protected Integer getMaxOrder(VoucherCustomField field)
Description copied from class:BaseCustomFieldServiceImplShould be implemented in order to return the maximum order number for fields like the given one
-
getPossibleValueCategoryService
protected BaseCustomFieldPossibleValueCategoryServiceLocal<VoucherCustomField,VoucherCustomFieldPossibleValueCategory,VoucherCustomFieldPossibleValue> getPossibleValueCategoryService()
Description copied from class:BaseCustomFieldServiceImplMust be implemented in order to return the corresponding category service
-
getPossibleValueService
protected VoucherCustomFieldPossibleValueServiceLocal getPossibleValueService()
Description copied from class:BaseCustomFieldServiceImplMust be implemented in order to return the corresponding possible value service
-
getPropertyClasses
protected List<Class<?>> getPropertyClasses()
Description copied from class:BaseCustomFieldServiceImplMay be overridden in order to return a list of classes to apply internal name property validations
-
isBinaryTypesAllowed
protected boolean isBinaryTypesAllowed()
Description copied from class:BaseCustomFieldServiceImplIndicates whether this custom field nature allows binary types
-
onAfterRemove
protected void onAfterRemove(VoucherCustomField entity)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after removing an entity- Overrides:
onAfterRemovein classCRUDServiceImpl<VoucherCustomField,QVoucherCustomField,VoucherCustomFieldDTO,VoucherCustomFieldData,Void>
-
onAfterSave
protected void onAfterSave(VoucherCustomField entity, VoucherCustomField currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<VoucherCustomField,QVoucherCustomField,VoucherCustomFieldDTO,VoucherCustomFieldData,Void>
-
onBeforeSave
protected Object onBeforeSave(VoucherCustomField field, VoucherCustomField 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
-
-