Package org.cyclos.impl.users
Class RecordFieldHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseNetworkedHandlerImpl
-
- org.cyclos.impl.users.RecordFieldHandlerImpl
-
- All Implemented Interfaces:
RecordFieldHandler
@Component public class RecordFieldHandlerImpl extends BaseNetworkedHandlerImpl implements RecordFieldHandler
Implementation forRecordFieldHandler.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classRecordFieldHandlerImpl.RecordTypeOperation
-
Field Summary
-
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 RecordFieldHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignAllPermissionsToRecordField(RecordType recordType, RecordCustomField field, AdminProduct adminProduct)Assigns all the user records permissions (view, edit, create and remove) to the admin product, for the given record fieldRecordCustomFieldfindField(RecordType recordType, CustomFieldVO vo)Finds the field corresponding to the given field value vo in the given type, or throwsEntityNotFoundExceptionif not foundList<RecordCustomField>getAllFields(RecordType type)Returns a sorted list according to the order given to fields of the record typeList<RecordCustomField>getAllVisibleCustomFieldsForQuery(RecordQuery query)Returns all visible custom fields for the given querySet<RecordFieldAction>getFieldActions(RecordType recordType, User user, RecordCustomField field)Returns the actions the logged user can perform for the given type, user (null if type is a system record type) and fieldList<RecordCustomField>getFieldsByAction(UserRecordType recordType, BasicUser user, RecordFieldAction action)Returns the enabled fields of the record type for the given user (and visible to the logged user) and the actions that the logged user can perform over them.List<ProductRecordFieldDTO>getProductRecordFields(Product product, Class<? extends ProductRecordType> relationship)Returns the list of dtos for the given product and relationship determined by the relationship parameterList<ProductRecordFieldDTO>getProductRecordFields(ProductsAccessor accessor, Class<? extends ProductRecordType> relationship)Returns the list of dtos for the given product accessor and relationship determined by the relationship parameterBooleanPropertiesHolder<RecordCustomField>getProductRecordFieldsPropertiesHolder(RecordType recordType, Collection<? extends Product> products, Class<? extends ProductRecordType> relationship)Builds and returns a boolean properties holder for the given record type, list of products and relationship determined by the relationship parameter.List<RecordCustomField>getSystemFieldsByAction(SystemRecordType recordType, RecordFieldAction action)Returns the fields of the given record type that matches with the admin permissions according to the given actionvoidsortFieldValues(RecordType type, List<RecordCustomFieldValue> values)Sort the given list according to the order of the fields in the record type (taking into account shared and local fields).<PRT extends ProductRecordType>
voidtoEntityProductRecordTypes(Product product, Collection<PRT> prdRecordTypes, Collection<? extends ProductRecordFieldDTO> dtos, Class<PRT> relationship)Performs the conversion from the dtos to the prdRecordTypes collection of the relationship determined by the relationship parameter.-
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
-
-
-
-
Method Detail
-
assignAllPermissionsToRecordField
public void assignAllPermissionsToRecordField(RecordType recordType, RecordCustomField field, AdminProduct adminProduct)
Description copied from interface:RecordFieldHandlerAssigns all the user records permissions (view, edit, create and remove) to the admin product, for the given record field- Specified by:
assignAllPermissionsToRecordFieldin interfaceRecordFieldHandler
-
findField
public RecordCustomField findField(RecordType recordType, CustomFieldVO vo)
Description copied from interface:RecordFieldHandlerFinds the field corresponding to the given field value vo in the given type, or throwsEntityNotFoundExceptionif not found- Specified by:
findFieldin interfaceRecordFieldHandler
-
getAllFields
public List<RecordCustomField> getAllFields(RecordType type)
Description copied from interface:RecordFieldHandlerReturns a sorted list according to the order given to fields of the record type- Specified by:
getAllFieldsin interfaceRecordFieldHandler
-
getAllVisibleCustomFieldsForQuery
public List<RecordCustomField> getAllVisibleCustomFieldsForQuery(RecordQuery query)
Description copied from interface:RecordFieldHandlerReturns all visible custom fields for the given query- Specified by:
getAllVisibleCustomFieldsForQueryin interfaceRecordFieldHandler
-
getFieldActions
public Set<RecordFieldAction> getFieldActions(RecordType recordType, User user, RecordCustomField field)
Description copied from interface:RecordFieldHandlerReturns the actions the logged user can perform for the given type, user (null if type is a system record type) and field- Specified by:
getFieldActionsin interfaceRecordFieldHandler
-
getFieldsByAction
public List<RecordCustomField> getFieldsByAction(UserRecordType recordType, BasicUser user, RecordFieldAction action)
Description copied from interface:RecordFieldHandlerReturns the enabled fields of the record type for the given user (and visible to the logged user) and the actions that the logged user can perform over them.- Specified by:
getFieldsByActionin interfaceRecordFieldHandler
-
getProductRecordFields
public List<ProductRecordFieldDTO> getProductRecordFields(Product product, Class<? extends ProductRecordType> relationship)
Description copied from interface:RecordFieldHandlerReturns the list of dtos for the given product and relationship determined by the relationship parameter- Specified by:
getProductRecordFieldsin interfaceRecordFieldHandler
-
getProductRecordFields
public List<ProductRecordFieldDTO> getProductRecordFields(ProductsAccessor accessor, Class<? extends ProductRecordType> relationship)
Description copied from interface:RecordFieldHandlerReturns the list of dtos for the given product accessor and relationship determined by the relationship parameter- Specified by:
getProductRecordFieldsin interfaceRecordFieldHandler
-
getProductRecordFieldsPropertiesHolder
public BooleanPropertiesHolder<RecordCustomField> getProductRecordFieldsPropertiesHolder(RecordType recordType, Collection<? extends Product> products, Class<? extends ProductRecordType> relationship)
Description copied from interface:RecordFieldHandlerBuilds and returns a boolean properties holder for the given record type, list of products and relationship determined by the relationship parameter.- Specified by:
getProductRecordFieldsPropertiesHolderin interfaceRecordFieldHandler
-
getSystemFieldsByAction
public List<RecordCustomField> getSystemFieldsByAction(SystemRecordType recordType, RecordFieldAction action)
Description copied from interface:RecordFieldHandlerReturns the fields of the given record type that matches with the admin permissions according to the given action- Specified by:
getSystemFieldsByActionin interfaceRecordFieldHandler
-
sortFieldValues
public void sortFieldValues(RecordType type, List<RecordCustomFieldValue> values)
Description copied from interface:RecordFieldHandlerSort the given list according to the order of the fields in the record type (taking into account shared and local fields).- Specified by:
sortFieldValuesin interfaceRecordFieldHandler
-
toEntityProductRecordTypes
public <PRT extends ProductRecordType> void toEntityProductRecordTypes(Product product, Collection<PRT> prdRecordTypes, Collection<? extends ProductRecordFieldDTO> dtos, Class<PRT> relationship)
Description copied from interface:RecordFieldHandlerPerforms the conversion from the dtos to the prdRecordTypes collection of the relationship determined by the relationship parameter.- Specified by:
toEntityProductRecordTypesin interfaceRecordFieldHandler
-
-