public interface CustomFieldValueHandler
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_FIELD
Script attribute: the custom field being validated
|
static java.lang.String |
ATTR_OBJECT
Script attribute: the object being validated
|
static java.lang.String |
ATTR_VALUE
Script attribute: the current value being validated
|
static java.lang.String |
VALUE_SEPARATOR
Separator used when multiple values are parsed from a String
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLengthValidation(org.cyclos.impl.utils.validation.Property property,
IntegerRange length)
Adds a length range validation on the given
Property for the given IntegerRange. |
void |
addPatternValidation(org.cyclos.impl.utils.validation.Property property,
java.lang.String pattern)
Adds an input with pattern validation on the given
Property for the given pattern. |
void |
addSearchTitleParameters(org.cyclos.impl.utils.reports.ReportParameters reportParameters,
java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.Collection<? extends BaseValueForSearchDTO> fieldValues)
Adds as report title parameters all custom field values for search in the given collection
|
void |
addTitleParameters(org.cyclos.impl.utils.reports.ReportParameters reportParameters,
java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.Collection<? extends CustomFieldValueDTO> fieldValues)
Adds as report title parameters all custom field values in the given collection
|
void |
addValueValidation(org.cyclos.impl.utils.validation.Validator validator,
CustomField<?,?,?> field,
com.querydsl.core.types.dsl.EntityPathBase<? extends CustomFieldValue<?,?,?,?>> fv,
java.util.Map<java.lang.String,?> dynamicValueBindings)
Adds a validation on the given
Validator for the given CustomField |
void |
addValueValidation(org.cyclos.impl.utils.validation.Validator validator,
CustomField<?,?,?> field,
com.querydsl.core.types.dsl.EntityPathBase<? extends CustomFieldValue<?,?,?,?>> fv,
java.util.Map<java.lang.String,?> dynamicValueBindings,
java.lang.String valuesProperty)
Adds a validation on the given
Validator for the given CustomField, using a custom values
collection |
void |
addWordSizeValidation(org.cyclos.impl.utils.validation.Property property,
CustomField<?,?,?> field)
Adds a word size validation on the given
Property.A larger default size will be applied for TEXT and URL. |
<CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,V extends CustomFieldValue<CF,C,PV,O>,O extends SimpleEntity & EntityWithCustomValues<CF,C,PV,V>> |
buildFieldValue(CF field,
java.lang.Class<V> valueType,
org.cyclos.entities.system.QCustomFieldValue fv,
com.querydsl.core.Tuple tuple)
Builds a field value from a projected custom field.
|
<DTO extends CustomFieldValueDTO,CF extends CustomField<?,?,?>> |
fillCustomFieldValueDTOFromString(CF field,
DTO dto,
java.lang.String value,
FormatterImpl formatter)
Fills a custom field a
|
java.lang.String |
format(FormatterImpl formatter,
CustomField<?,?,?> field,
java.lang.Object value)
Formats the given value according to the custom field definitions, returning an empty string for null value
|
java.util.Set<com.querydsl.core.types.Path<?>> |
getProjectionPaths(CustomField<?,?,?> field,
org.cyclos.entities.system.QCustomFieldValue fv)
Returns the paths that should be projected for the given custom field
|
java.lang.Object |
getValue(CustomField<?,?,?> field,
ICustomFieldValue<?,?> fieldValue)
Returns the value (as entities when possible) for the given custom field value
|
org.cyclos.impl.system.DynamicFieldValuesAccessor |
newDynamicValuesAccessor(CustomField<?,?,?> field)
Returns a
DynamicFieldValuesAccessor which can be used to generate the possible values for a given custom
field |
void |
processAfterSave(EntityWithCustomValues<?,?,?,?> entity)
Process actions over custom fields that require the entity to be saved first.
|
com.querydsl.core.types.Predicate |
queryFilter(com.querydsl.core.types.EntityPath<? extends CustomFieldValue<?,?,?,?>> valuePath,
CustomField<?,?,?> customField,
CustomFieldValueForSearchDTO valueForSearch)
Returns a predicate which represents the condition for the given custom field and value path for the given custom
field search value, or null
if no query criteria specified
|
void |
removeAll(boolean binaryOnly,
EntityWithCustomValues<?,?,?,?> owner)
Removes either all custom fields of the given owner (if the flag is false) or only the binaries,
taking care to properly remove any stored files for binary fields
|
java.lang.Object |
resolveReference(CustomField<?,?,?> customField,
java.lang.String referenceValue)
Returns the entity value corresponding to the given reference
|
<CF extends CustomField<?,?,?>> |
resolveReferences(java.lang.Class<CF> customFieldType,
java.util.List<CustomFieldValueDTO> valueDTOs)
Resolves the references for all the given field values, given the custom field type
|
void |
setCustomValues(BasicUser user,
java.util.Collection<UserCustomField> enabledFields,
java.util.Collection<UserCustomField> editable,
java.util.Collection<UserCustomField> managePrivacy,
java.util.Collection<UserCustomFieldValueDTO> fieldValueDTOs)
Saves the custom values from DTOs to the given user
|
<CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,V extends CustomFieldValue<CF,C,PV,E>,E extends SimpleEntity & EntityWithCustomValues<CF,C,PV,V>> |
setCustomValues(E entity,
java.util.Collection<CF> enabledFields,
java.util.Collection<CF> editable,
java.util.Collection<CustomFieldValueDTO> fieldValueDTOs)
Saves the custom values from DTOs to the given entity
|
void |
setDefaultValue(CustomFieldDetailedVO vo,
java.lang.Object defaultValue)
Sets the default field value to the given value
|
<CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,V extends CustomFieldValue<CF,C,PV,O>,O extends SimpleEntity & EntityWithCustomValues<CF,C,PV,V>> |
setDefaultValues(O entity,
java.util.List<CF> fields)
Adds an empty field value for each field, and fill in the default values
|
void |
sortAndRemoveMissing(java.util.List<? extends CustomFieldValueDTO> customValues,
java.util.List<? extends IEntity> allowedFields)
Sorts the given list of
CustomFieldValueDTO and remove a value if it's for a field not present in the
given list of allowed fields (i.e. |
void |
sortAndRemoveMissingFromVO(java.util.List<? extends CustomFieldValueVO> customValues,
java.util.List<? extends IEntity> allowedFields)
Same as
sortAndRemoveMissing(List, List) but for a list of VOs |
java.util.List<? extends CustomFieldPossibleValue<?,?,?>> |
toCustomFieldPossibleValues(CustomField<?,?,?> customField,
java.util.Collection<?> values)
Converts each of the given input value to a custom field possible value of the given field
|
java.util.List<SimpleEntity> |
toLinkedEntityValues(CustomField<?,?,?> customField,
java.util.Collection<?> values)
Convert each of the given input value to a linked entity suited for the given custom field
|
java.util.Map<java.lang.String,java.lang.Object> |
toMap(java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.List<? extends ICustomFieldValue<?,?>> customValues)
Returns a Map, keyed by the custom field internal names, whose values are "server side" (example,
Date,
not DateTime,
CustomFieldPossibleValue, not CustomFieldPossibleValueVO, etc) |
java.lang.String |
toReference(CustomField<?,?,?> field,
java.lang.Object value)
Converts the given field value to a valid reference value
|
static final java.lang.String ATTR_OBJECT
static final java.lang.String ATTR_FIELD
static final java.lang.String ATTR_VALUE
static final java.lang.String VALUE_SEPARATOR
void addLengthValidation(org.cyclos.impl.utils.validation.Property property,
IntegerRange length)
Property for the given IntegerRange.
If the length parameter is null then it returns without changes.void addPatternValidation(org.cyclos.impl.utils.validation.Property property,
java.lang.String pattern)
Property for the given pattern.
If the pattern parameter is empty (or null) then it returns without changes.void addSearchTitleParameters(org.cyclos.impl.utils.reports.ReportParameters reportParameters,
java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.Collection<? extends BaseValueForSearchDTO> fieldValues)
void addTitleParameters(org.cyclos.impl.utils.reports.ReportParameters reportParameters,
java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.Collection<? extends CustomFieldValueDTO> fieldValues)
void addValueValidation(org.cyclos.impl.utils.validation.Validator validator,
CustomField<?,?,?> field,
com.querydsl.core.types.dsl.EntityPathBase<? extends CustomFieldValue<?,?,?,?>> fv,
java.util.Map<java.lang.String,?> dynamicValueBindings)
Validator for the given CustomFieldvoid addValueValidation(org.cyclos.impl.utils.validation.Validator validator,
CustomField<?,?,?> field,
com.querydsl.core.types.dsl.EntityPathBase<? extends CustomFieldValue<?,?,?,?>> fv,
java.util.Map<java.lang.String,?> dynamicValueBindings,
java.lang.String valuesProperty)
Validator for the given CustomField, using a custom values
collectionvoid addWordSizeValidation(org.cyclos.impl.utils.validation.Property property,
CustomField<?,?,?> field)
Property.<CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,V extends CustomFieldValue<CF,C,PV,O>,O extends SimpleEntity & EntityWithCustomValues<CF,C,PV,V>> V buildFieldValue(CF field, java.lang.Class<V> valueType, org.cyclos.entities.system.QCustomFieldValue fv, com.querydsl.core.Tuple tuple)
<DTO extends CustomFieldValueDTO,CF extends CustomField<?,?,?>> void fillCustomFieldValueDTOFromString(CF field, DTO dto, java.lang.String value, FormatterImpl formatter) throws java.text.ParseException
java.text.ParseExceptionjava.lang.String format(FormatterImpl formatter, CustomField<?,?,?> field, java.lang.Object value)
java.util.Set<com.querydsl.core.types.Path<?>> getProjectionPaths(CustomField<?,?,?> field, org.cyclos.entities.system.QCustomFieldValue fv)
java.lang.Object getValue(CustomField<?,?,?> field, ICustomFieldValue<?,?> fieldValue)
org.cyclos.impl.system.DynamicFieldValuesAccessor newDynamicValuesAccessor(CustomField<?,?,?> field)
DynamicFieldValuesAccessor which can be used to generate the possible values for a given custom
fieldvoid processAfterSave(EntityWithCustomValues<?,?,?,?> entity)
com.querydsl.core.types.Predicate queryFilter(com.querydsl.core.types.EntityPath<? extends CustomFieldValue<?,?,?,?>> valuePath, CustomField<?,?,?> customField, CustomFieldValueForSearchDTO valueForSearch)
void removeAll(boolean binaryOnly,
EntityWithCustomValues<?,?,?,?> owner)
java.lang.Object resolveReference(CustomField<?,?,?> customField, java.lang.String referenceValue)
<CF extends CustomField<?,?,?>> void resolveReferences(java.lang.Class<CF> customFieldType, java.util.List<CustomFieldValueDTO> valueDTOs)
void setCustomValues(BasicUser user, java.util.Collection<UserCustomField> enabledFields, java.util.Collection<UserCustomField> editable, java.util.Collection<UserCustomField> managePrivacy, java.util.Collection<UserCustomFieldValueDTO> fieldValueDTOs)
<CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,V extends CustomFieldValue<CF,C,PV,E>,E extends SimpleEntity & EntityWithCustomValues<CF,C,PV,V>> void setCustomValues(E entity, java.util.Collection<CF> enabledFields, java.util.Collection<CF> editable, java.util.Collection<CustomFieldValueDTO> fieldValueDTOs)
void setDefaultValue(CustomFieldDetailedVO vo, java.lang.Object defaultValue)
<CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,V extends CustomFieldValue<CF,C,PV,O>,O extends SimpleEntity & EntityWithCustomValues<CF,C,PV,V>> void setDefaultValues(O entity, java.util.List<CF> fields)
void sortAndRemoveMissing(java.util.List<? extends CustomFieldValueDTO> customValues, java.util.List<? extends IEntity> allowedFields)
CustomFieldValueDTO and remove a value if it's for a field not present in the
given list of allowed fields (i.e. the catalog).customValues - the list of values to sort.allowedFields - the ordered list of allowed fields.void sortAndRemoveMissingFromVO(java.util.List<? extends CustomFieldValueVO> customValues, java.util.List<? extends IEntity> allowedFields)
sortAndRemoveMissing(List, List) but for a list of VOssortAndRemoveMissing(List, List)java.util.List<? extends CustomFieldPossibleValue<?,?,?>> toCustomFieldPossibleValues(CustomField<?,?,?> customField, java.util.Collection<?> values)
java.util.List<SimpleEntity> toLinkedEntityValues(CustomField<?,?,?> customField, java.util.Collection<?> values)
java.util.Map<java.lang.String,java.lang.Object> toMap(java.lang.Class<? extends CustomField<?,?,?>> customFieldType, java.util.List<? extends ICustomFieldValue<?,?>> customValues)
Date,
not DateTime,
CustomFieldPossibleValue, not CustomFieldPossibleValueVO, etc)java.lang.String toReference(CustomField<?,?,?> field, java.lang.Object value)