Class DynListConstraint
java.lang.Object
org.alfresco.repo.dictionary.constraint.AbstractConstraint
org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
fr.becpg.repo.dictionary.constraint.DynListConstraint
- All Implemented Interfaces:
org.alfresco.service.cmr.dictionary.Constraint
public class DynListConstraint
extends org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
Class used to load the dynamic constraints.
- Version:
- $Id: $Id
- Author:
- querephi, matthieu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Booleanprivate static BeCPGCacheServiceprivate static final Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate static org.alfresco.service.cmr.repository.ContentServiceprivate static final Stringprivate static final Stringprivate static final Stringprivate Stringprivate Stringprivate static final org.apache.commons.logging.Logprivate static final Stringprivate static org.alfresco.service.ServiceRegistrystatic final StringConstantUNDIFINED_CONSTRAINT_VALUE="-"Fields inherited from class org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
ALLOWED_VALUES_PARAM, CASE_SENSITIVE_PARAM, caseSensitive, CONSTRAINT_TYPE, sorted, SORTED_PARAMFields inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
ERR_EVALUATE_EXCEPTION, ERR_PROP_NOT_SET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Stringprotected voidevaluateSingleValue(Object value) getAllowedValues(boolean filter) getAllowedValues.getDisplayLabel(String constraintAllowableValue) getDisplayLabel.getDisplayLabel(String constraintAllowableValue, Locale locale) getDisplayLabel.getDisplayLabel(String constraintAllowableValue, org.alfresco.service.cmr.i18n.MessageLookup messageLookup) private Map<String,DynListEntry> private StringgetKeyFromRecord(org.apache.commons.csv.CSVRecord csvRecord) org.alfresco.service.cmr.repository.MLTextgetMLDisplayLabel(String constraintAllowableValue) getMLDisplayLabel.Getter for the fieldpathRegistry.getPaths()Getter for the fieldpaths.voidprivate booleanisValidEntry(String key, String filterPropValue) private voidprocessClasspathResource(String path, Map<String, DynListEntry> allowedValues) private voidprocessCsvInputStream(Map<String, DynListEntry> allowedValues, InputStream in) private voidprocessRepoResource(String path, Map<String, DynListEntry> allowedValues) private voidprocessSystemList(String path, Map<String, DynListEntry> allowedValues) voidsetAddEmptyValue(Boolean addEmptyValue) Setter for the fieldaddEmptyValue.voidsetAllowedValuesSuffix(List<String> allowedValuesSuffix) Setter for the fieldallowedValuesSuffix.static voidsetBeCPGCacheService(BeCPGCacheService beCPGCacheService) Setter for the fieldbeCPGCacheService.voidsetConstraintCode(String constraintCode) Setter for the fieldconstraintCode.voidsetConstraintFilter(String constraintFilter) Setter for the fieldconstraintFilter.voidsetConstraintFilterProp(String constraintFilterProp) Setter for the fieldconstraintFilterProp.voidsetConstraintProp(String constraintProp) Setter for the fieldconstraintProp.voidsetConstraintType(String constraintType) Setter for the fieldconstraintType.static voidsetContentService(org.alfresco.service.cmr.repository.ContentService contentService) Setter for the fieldcontentService.voidSetter for the fieldlevel.voidsetLevelProp(String levelProp) Setter for the fieldlevelProp.voidsetPath.static voidsetServiceRegistry(org.alfresco.service.ServiceRegistry serviceRegistry) Setter for the fieldserviceRegistry.private voidsortNodeRefs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs) Methods inherited from class org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
getParameters, getRawAllowedValues, getType, isCaseSensitive, isSorted, setAllowedValues, setCaseSensitive, setSorted, toStringMethods inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
checkPropertyNotNull, evaluate, evaluateCollection, getShortName, getTitle, set_shortName, setRegistry, setShortName, setTitle
-
Field Details
-
UNDIFINED_CONSTRAINT_VALUE
ConstantUNDIFINED_CONSTRAINT_VALUE="-"- See Also:
-
ERR_NO_VALUES
- See Also:
-
ERR_NON_STRING
- See Also:
-
ERR_INVALID_VALUE
- See Also:
-
logger
private static final org.apache.commons.logging.Log logger -
CLASSPATH_PREFIX
- See Also:
-
REPO_PREFIX
- See Also:
-
serviceRegistry
private static org.alfresco.service.ServiceRegistry serviceRegistry -
beCPGCacheService
-
contentService
private static org.alfresco.service.cmr.repository.ContentService contentService -
pathRegistry
-
paths
-
constraintType
-
constraintProp
-
constraintFilterProp
-
constraintCode
-
constraintFilter
-
level
-
levelProp
-
addEmptyValue
-
allowedValuesSuffix
-
-
Constructor Details
-
DynListConstraint
public DynListConstraint()
-
-
Method Details
-
setContentService
public static void setContentService(org.alfresco.service.cmr.repository.ContentService contentService) Setter for the field
contentService.- Parameters:
contentService- aContentServiceobject
-
setAllowedValuesSuffix
Setter for the field
allowedValuesSuffix.- Parameters:
allowedValuesSuffix- aListobject
-
getPaths
Getter for the field
paths.- Returns:
- a
Listobject
-
setPath
setPath.
- Parameters:
paths- aListobject.
-
setServiceRegistry
public static void setServiceRegistry(org.alfresco.service.ServiceRegistry serviceRegistry) Setter for the field
serviceRegistry.- Parameters:
serviceRegistry- aServiceRegistryobject.
-
setBeCPGCacheService
Setter for the field
beCPGCacheService.- Parameters:
beCPGCacheService- aBeCPGCacheServiceobject.
-
setConstraintType
Setter for the field
constraintType.- Parameters:
constraintType- aStringobject.
-
setConstraintProp
Setter for the field
constraintProp.- Parameters:
constraintProp- aStringobject.
-
setConstraintCode
Setter for the field
constraintCode.- Parameters:
constraintCode- aStringobject.
-
setConstraintFilterProp
Setter for the field
constraintFilterProp.- Parameters:
constraintFilterProp- aStringobject
-
setConstraintFilter
Setter for the field
constraintFilter.- Parameters:
constraintFilter- aStringobject
-
setLevel
Setter for the field
level.- Parameters:
level- aStringobject.
-
setLevelProp
Setter for the field
levelProp.- Parameters:
levelProp- aStringobject.
-
setAddEmptyValue
Setter for the field
addEmptyValue.- Parameters:
addEmptyValue- aBooleanobject.
-
getPathRegistry
Getter for the field
pathRegistry.- Returns:
- a
Setobject
-
initialize
public void initialize()- Specified by:
initializein interfaceorg.alfresco.service.cmr.dictionary.Constraint- Overrides:
initializein classorg.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
-
getAllowedValues
- Overrides:
getAllowedValuesin classorg.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
-
getAllowedValues
getAllowedValues.
- Parameters:
filter- a boolean- Returns:
- a
Listobject
-
evaluateSingleValue
- Overrides:
evaluateSingleValuein classorg.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
-
getDisplayLabel
getDisplayLabel.
-
getMLDisplayLabel
public org.alfresco.service.cmr.repository.MLText getMLDisplayLabel(String constraintAllowableValue) getMLDisplayLabel.
- Parameters:
constraintAllowableValue- aStringobject- Returns:
- a
MLTextobject
-
getDisplayLabel
getDisplayLabel.
-
getDisplayLabel
public String getDisplayLabel(String constraintAllowableValue, org.alfresco.service.cmr.i18n.MessageLookup messageLookup) - Overrides:
getDisplayLabelin classorg.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
-
getDynListEntries
-
processClasspathResource
-
processRepoResource
-
processCsvInputStream
-
processSystemList
-
sortNodeRefs
-
getKeyFromRecord
-
isValidEntry
-
createCacheKey
-