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 Details

    • UNDIFINED_CONSTRAINT_VALUE

      public static final String UNDIFINED_CONSTRAINT_VALUE
      Constant UNDIFINED_CONSTRAINT_VALUE="-"
      See Also:
    • ERR_NO_VALUES

      private static final String ERR_NO_VALUES
      See Also:
    • ERR_NON_STRING

      private static final String ERR_NON_STRING
      See Also:
    • ERR_INVALID_VALUE

      private static final String ERR_INVALID_VALUE
      See Also:
    • logger

      private static final org.apache.commons.logging.Log logger
    • CLASSPATH_PREFIX

      private static final String CLASSPATH_PREFIX
      See Also:
    • REPO_PREFIX

      private static final String REPO_PREFIX
      See Also:
    • serviceRegistry

      private static org.alfresco.service.ServiceRegistry serviceRegistry
    • beCPGCacheService

      private static BeCPGCacheService beCPGCacheService
    • contentService

      private static org.alfresco.service.cmr.repository.ContentService contentService
    • pathRegistry

      private static final Set<String> pathRegistry
    • paths

      private List<String> paths
    • constraintType

      private String constraintType
    • constraintProp

      private String constraintProp
    • constraintFilterProp

      private String constraintFilterProp
    • constraintCode

      private String constraintCode
    • constraintFilter

      private String constraintFilter
    • level

      private String level
    • levelProp

      private String levelProp
    • addEmptyValue

      private Boolean addEmptyValue
    • allowedValuesSuffix

      private List<String> 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 - a ContentService object
    • setAllowedValuesSuffix

      public void setAllowedValuesSuffix(List<String> allowedValuesSuffix)

      Setter for the field allowedValuesSuffix.

      Parameters:
      allowedValuesSuffix - a List object
    • getPaths

      public List<String> getPaths()

      Getter for the field paths.

      Returns:
      a List object
    • setPath

      public void setPath(List<String> paths)

      setPath.

      Parameters:
      paths - a List object.
    • setServiceRegistry

      public static void setServiceRegistry(org.alfresco.service.ServiceRegistry serviceRegistry)

      Setter for the field serviceRegistry.

      Parameters:
      serviceRegistry - a ServiceRegistry object.
    • setBeCPGCacheService

      public static void setBeCPGCacheService(BeCPGCacheService beCPGCacheService)

      Setter for the field beCPGCacheService.

      Parameters:
      beCPGCacheService - a BeCPGCacheService object.
    • setConstraintType

      public void setConstraintType(String constraintType)

      Setter for the field constraintType.

      Parameters:
      constraintType - a String object.
    • setConstraintProp

      public void setConstraintProp(String constraintProp)

      Setter for the field constraintProp.

      Parameters:
      constraintProp - a String object.
    • setConstraintCode

      public void setConstraintCode(String constraintCode)

      Setter for the field constraintCode.

      Parameters:
      constraintCode - a String object.
    • setConstraintFilterProp

      public void setConstraintFilterProp(String constraintFilterProp)

      Setter for the field constraintFilterProp.

      Parameters:
      constraintFilterProp - a String object
    • setConstraintFilter

      public void setConstraintFilter(String constraintFilter)

      Setter for the field constraintFilter.

      Parameters:
      constraintFilter - a String object
    • setLevel

      public void setLevel(String level)

      Setter for the field level.

      Parameters:
      level - a String object.
    • setLevelProp

      public void setLevelProp(String levelProp)

      Setter for the field levelProp.

      Parameters:
      levelProp - a String object.
    • setAddEmptyValue

      public void setAddEmptyValue(Boolean addEmptyValue)

      Setter for the field addEmptyValue.

      Parameters:
      addEmptyValue - a Boolean object.
    • getPathRegistry

      public static Set<String> getPathRegistry()

      Getter for the field pathRegistry.

      Returns:
      a Set object
    • initialize

      public void initialize()
      Specified by:
      initialize in interface org.alfresco.service.cmr.dictionary.Constraint
      Overrides:
      initialize in class org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
    • getAllowedValues

      public List<String> getAllowedValues()
      Overrides:
      getAllowedValues in class org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
    • getAllowedValues

      public List<String> getAllowedValues(boolean filter)

      getAllowedValues.

      Parameters:
      filter - a boolean
      Returns:
      a List object
    • evaluateSingleValue

      protected void evaluateSingleValue(Object value)
      Overrides:
      evaluateSingleValue in class org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
    • getDisplayLabel

      public String getDisplayLabel(String constraintAllowableValue)

      getDisplayLabel.

      Parameters:
      constraintAllowableValue - a String object.
      Returns:
      a String object.
    • getMLDisplayLabel

      public org.alfresco.service.cmr.repository.MLText getMLDisplayLabel(String constraintAllowableValue)

      getMLDisplayLabel.

      Parameters:
      constraintAllowableValue - a String object
      Returns:
      a MLText object
    • getDisplayLabel

      public String getDisplayLabel(String constraintAllowableValue, Locale locale)

      getDisplayLabel.

      Parameters:
      constraintAllowableValue - a String object.
      locale - a Locale object.
      Returns:
      a String object.
    • getDisplayLabel

      public String getDisplayLabel(String constraintAllowableValue, org.alfresco.service.cmr.i18n.MessageLookup messageLookup)
      Overrides:
      getDisplayLabel in class org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
    • getDynListEntries

      private Map<String,DynListEntry> getDynListEntries()
    • processClasspathResource

      private void processClasspathResource(String path, Map<String,DynListEntry> allowedValues)
    • processRepoResource

      private void processRepoResource(String path, Map<String,DynListEntry> allowedValues)
    • processCsvInputStream

      private void processCsvInputStream(Map<String,DynListEntry> allowedValues, InputStream in)
    • processSystemList

      private void processSystemList(String path, Map<String,DynListEntry> allowedValues)
    • sortNodeRefs

      private void sortNodeRefs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)
    • getKeyFromRecord

      private String getKeyFromRecord(org.apache.commons.csv.CSVRecord csvRecord)
    • isValidEntry

      private boolean isValidEntry(String key, String filterPropValue)
    • createCacheKey

      private String createCacheKey()