Class UniqueValueChecker

java.lang.Object
org.dlese.dpc.schemedit.input.UniqueValueChecker

public class UniqueValueChecker extends Object
Checks for duplicate values in the same record as a "reference" record at a specified path.

Used to enforce SchemaPaths that are configured in the framework configuration as "uniqueValue" paths.

Author:
ostwald
  • Constructor Details

    • UniqueValueChecker

      public UniqueValueChecker(ServletContext servletContext) throws Exception
      Constructor for the UniqueValueChecker object, requiring ServletContext.
      Parameters:
      servletContext -
      Throws:
      Exception - if required helper objects cannot be found in the servlet context initialized.
  • Method Details

    • getDupValues

      public List getDupValues(String referenceValue, XMLDocReader referenceDocReader, String xpath)
      Returns a list of RecordIds in a that contain a value equal to provided referenceValue at the provided xpath

      NOTE: This check is only performed if the framework configuration defines a schemaPath with valueType of "uniqueValue".

      Parameters:
      referenceValue - The value for which we try to find dups
      referenceDocReader - docReader for the record containing referenceValue
      xpath - xpath at which value is found
      Returns:
      List of DupSim instances
    • getDateString

      public static String getDateString()
      Gets a formated date string for current time.
      Returns:
      The dateString value