Interface DocumentDefinitionService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void checkForMandatoryConstraintViolations​(DDC definition, java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> properties, boolean isCreation)
      For a given definition this method checks a given map of properties for mandatory constraint violations.
      void checkForSystemFields​(DDC definition, java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> indexData)
      For a given definition and a map of properties this method checks whether it contains system fields.
      com.lexmark.saperion.remote.common.query.QueryExpression<java.lang.Boolean> createUniqueConstraintViolationCheck​(DDC definition, java.lang.String id, java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> properties)
      For a given map of fields this method checks a definition and a database row id, this method creates a query expression that filters a corresponding datbase table so that the result contains exactly the existing entries that would collide with the given database row.
      com.lexmark.saperion.remote.common.query.QueryExpression<java.lang.Boolean> createUniqueConstraintViolationCheck​(SaFieldDescription fieldDescription, com.lexmark.saperion.PropertyType newValue, boolean ignoreCounters)
      For a given SaFieldDescription and a given value this method creates a QueryExpression that checks whether the given value would violate a unique constraint.
      java.util.List<java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType>> filterSystemFields​(DDC definition, java.util.List<java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType>> resultMaps)
      This method the system fields from a given list of result map.
      java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> filterSystemFields​(DDC definition, java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> resultMap)
      This method filters the system fields from a given result map.
      DDC getDefinition​(java.lang.String definitionName)
      This method returns the document definition object identified by the given name
    • Method Detail

      • getDefinition

        DDC getDefinition​(java.lang.String definitionName)
                   throws com.lexmark.saperion.exceptions.system.SystemException
        This method returns the document definition object identified by the given name
        Parameters:
        definitionName - tha name of the definition wanted
        Returns:
        the document definition object identified by the given name
        Throws:
        com.lexmark.saperion.exceptions.system.SystemException
      • filterSystemFields

        java.util.List<java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType>> filterSystemFields​(DDC definition,
                                                                                                                   java.util.List<java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType>> resultMaps)
        This method the system fields from a given list of result map. Will return a list of maps containing exactly the entries from the given result maps whose key is a non-system field in the given definition.
        Parameters:
        definition - the definition from which the maps resulted
        resultMaps - the result map“s to filter
        Returns:
        a list of maps containing exactly the entries from the given result maps whose key is a non-system field in the given definition
      • filterSystemFields

        java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> filterSystemFields​(DDC definition,
                                                                                                   java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> resultMap)
        This method filters the system fields from a given result map. Will return a map containing exactly the entries from the given result map whose key is a non-system field in the given definition.
        Parameters:
        definition - the definition from which the map resulted
        resultMap - the result map to filter
        Returns:
        a map containing exactly the entries from the given result map whose key is a non-system field in the given definition
      • createUniqueConstraintViolationCheck

        com.lexmark.saperion.remote.common.query.QueryExpression<java.lang.Boolean> createUniqueConstraintViolationCheck​(DDC definition,
                                                                                                                         java.lang.String id,
                                                                                                                         java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> properties)
        For a given map of fields this method checks a definition and a database row id, this method creates a query expression that filters a corresponding datbase table so that the result contains exactly the existing entries that would collide with the given database row.
        Parameters:
        definition - the definition to check for field data
        id - the id of the row given or null if the row represents a new entry
        properties - the properties to check for conformance
      • createUniqueConstraintViolationCheck

        com.lexmark.saperion.remote.common.query.QueryExpression<java.lang.Boolean> createUniqueConstraintViolationCheck​(SaFieldDescription fieldDescription,
                                                                                                                         com.lexmark.saperion.PropertyType newValue,
                                                                                                                         boolean ignoreCounters)
        For a given SaFieldDescription and a given value this method creates a QueryExpression that checks whether the given value would violate a unique constraint. If the field does not define such an constraint or the given value and field do not qualify for checking by other reasons null is returned.
        Parameters:
        fieldDescription - the field to check for constraint violation
        newValue - the value to check for constraint violation
        ignoreCounters - whether counters should be ignored
        Returns:
        a QueryExpression that checks whether the given value would violate an unique constraint or null if no suh constraint applies
      • checkForMandatoryConstraintViolations

        void checkForMandatoryConstraintViolations​(DDC definition,
                                                   java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> properties,
                                                   boolean isCreation)
                                            throws com.lexmark.saperion.exceptions.runtime.MandatoryConstraintViolationException
        For a given definition this method checks a given map of properties for mandatory constraint violations. If such a constraint is violated it will throw an MandatoryConstraintViolationException.
        Parameters:
        definition - the definition that holds the constraints to check against
        properties - the properties to check for validations
        isCreation - whether the properties represent a new entry or an old one
        Throws:
        com.lexmark.saperion.exceptions.runtime.MandatoryConstraintViolationException
      • checkForSystemFields

        void checkForSystemFields​(DDC definition,
                                  java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> indexData)
                           throws com.lexmark.saperion.exceptions.runtime.SystemFieldWriteException
        For a given definition and a map of properties this method checks whether it contains system fields. If so it throws an Exception. In this context a counter field is considered a system field.
        Parameters:
        definition - the definition defining the data
        indexData - the properties to check
        Throws:
        com.lexmark.saperion.exceptions.runtime.SystemFieldWriteException