Package org.cyclos.impl.marketplace
Class AdCustomFieldServiceImpl
- 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<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue,QAdCustomField,AdCustomFieldDTO,AdCustomFieldData,Void>
-
- org.cyclos.impl.marketplace.AdCustomFieldServiceImpl
-
- All Implemented Interfaces:
CRUDServiceLocal<AdCustomField,AdCustomFieldDTO,AdCustomFieldData,Void>,AdCustomFieldServiceLocal,CRUDService<AdCustomFieldDTO,AdCustomFieldData,Void>,CRUDWithConfirmationPasswordService<AdCustomFieldDTO,AdCustomFieldData,Void>,AdCustomFieldService,Service,BaseCustomFieldService<AdCustomFieldDTO,AdCustomFieldData,Void>
@Service public class AdCustomFieldServiceImpl extends BaseCustomFieldServiceImpl<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue,QAdCustomField,AdCustomFieldDTO,AdCustomFieldData,Void> implements AdCustomFieldServiceLocal
Implementation for ad custom field service
-
-
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, cacheHandler, 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 AdCustomFieldServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCustomValidations(Validator validator, AdCustomFieldDTO dto)It may be overridden to add specific validations for the custom field.protected AdCustomFieldDatagetData(AdCustomField field)Returns details data for the given entityprotected IntegergetMaxOrder(AdCustomField field)Should be implemented in order to return the maximum order number for fields like the given oneViewManageOperationgetOperation(AdCustomField field, User owner)Returns whether the given field can be viewed or managed over the given ownerprotected BaseCustomFieldPossibleValueCategoryServiceLocal<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue>getPossibleValueCategoryService()Must be implemented in order to return the corresponding category serviceprotected AdCustomFieldPossibleValueServiceLocalgetPossibleValueService()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()Returns a list of all fields, as CustomFieldVOList<AdCustomField>listAll()Lists all advertisement custom fieldsList<AdCustomField>listEnabled(User owner)Lists visible advertisement custom fields for the given ad ownerList<AdCustomField>listManagedFieldEnabledToOwner(User owner)Returns a list with all enabled custom fields for the given owner and managed by the logged user.List<AdCustomField>listVisible(User owner, boolean userManager)Returns a list of the custom fields that meets with the following conditions: If userManager is true, then it returns the visible custom fields to the logged user manager.List<AdCustomFieldActions>listVisibleActionsEnabledToOwner(User owner)Returns a list of all the enabled custom fields and the possible actions over each custom fieldList<AdCustomField>listVisibleFieldEnabledToOwner(User owner)Returns a list with all enabled custom fields for the given owner and visible for the logged user.AdCustomFieldnewEntity(Void params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonBeforeRemove(AdCustomField field)May be overridden in order to perform custom logic before removing an entityprotected ObjectonBeforeSave(AdCustomField field, AdCustomField 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 network-
Methods inherited from class org.cyclos.impl.system.BaseCustomFieldServiceImpl
addCustomInternalNameValidations, 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, onAfterRemove, onAfterSave, 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
-
getOperation
public ViewManageOperation getOperation(AdCustomField field, User owner)
Description copied from interface:AdCustomFieldServiceLocalReturns whether the given field can be viewed or managed over the given owner- Specified by:
getOperationin interfaceAdCustomFieldServiceLocal
-
list
public List<CustomFieldVO> list()
Description copied from interface:AdCustomFieldServiceReturns a list of all fields, as CustomFieldVO- Specified by:
listin interfaceAdCustomFieldService
-
listAll
public List<AdCustomField> listAll() throws FrameworkException
Description copied from interface:AdCustomFieldServiceLocalLists all advertisement custom fields- Specified by:
listAllin interfaceAdCustomFieldServiceLocal- Throws:
FrameworkException
-
listEnabled
public List<AdCustomField> listEnabled(User owner)
Description copied from interface:AdCustomFieldServiceLocalLists visible advertisement custom fields for the given ad owner- Specified by:
listEnabledin interfaceAdCustomFieldServiceLocal
-
listManagedFieldEnabledToOwner
public List<AdCustomField> listManagedFieldEnabledToOwner(User owner)
Description copied from interface:AdCustomFieldServiceLocalReturns a list with all enabled custom fields for the given owner and managed by the logged user.- Specified by:
listManagedFieldEnabledToOwnerin interfaceAdCustomFieldServiceLocal
-
listVisible
public List<AdCustomField> listVisible(User owner, boolean userManager)
Description copied from interface:AdCustomFieldServiceLocalReturns a list of the custom fields that meets with the following conditions: If userManager is true, then it returns the visible custom fields to the logged user manager. If an owner is also specified, the result will only include the enabled ones to the owner. If userManager is false, then it returns the visible custom fields to the logged member.- Specified by:
listVisiblein interfaceAdCustomFieldServiceLocal
-
listVisibleActionsEnabledToOwner
public List<AdCustomFieldActions> listVisibleActionsEnabledToOwner(User owner)
Description copied from interface:AdCustomFieldServiceLocalReturns a list of all the enabled custom fields and the possible actions over each custom field- Specified by:
listVisibleActionsEnabledToOwnerin interfaceAdCustomFieldServiceLocal
-
listVisibleFieldEnabledToOwner
public List<AdCustomField> listVisibleFieldEnabledToOwner(User owner)
Description copied from interface:AdCustomFieldServiceLocalReturns a list with all enabled custom fields for the given owner and visible for the logged user.- Specified by:
listVisibleFieldEnabledToOwnerin interfaceAdCustomFieldServiceLocal
-
newEntity
public AdCustomField 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<AdCustomField,AdCustomFieldDTO,AdCustomFieldData,Void>- Specified by:
newEntityin classCRUDServiceImpl<AdCustomField,QAdCustomField,AdCustomFieldDTO,AdCustomFieldData,Void>
-
addCustomValidations
protected void addCustomValidations(Validator validator, AdCustomFieldDTO 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<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue,QAdCustomField,AdCustomFieldDTO,AdCustomFieldData,Void>dto- the DTO to be validated
-
getData
protected AdCustomFieldData getData(AdCustomField field)
Description copied from class:CRUDServiceImplReturns details data for the given entity
-
getMaxOrder
protected Integer getMaxOrder(AdCustomField 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<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue> getPossibleValueCategoryService()
Description copied from class:BaseCustomFieldServiceImplMust be implemented in order to return the corresponding category service
-
getPossibleValueService
protected AdCustomFieldPossibleValueServiceLocal 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
-
onBeforeRemove
protected void onBeforeRemove(AdCustomField field)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before removing an entity- Overrides:
onBeforeRemovein classCRUDServiceImpl<AdCustomField,QAdCustomField,AdCustomFieldDTO,AdCustomFieldData,Void>
-
onBeforeSave
protected Object onBeforeSave(AdCustomField field, AdCustomField 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
-
-