DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.input
Class UniqueValueChecker

java.lang.Object
  extended by 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 Summary
UniqueValueChecker(ServletContext servletContext)
          Constructor for the UniqueValueChecker object, requiring ServletContext.
 
Method Summary
static String getDateString()
          Gets a formated date string for current time.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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

DLESE Tools
v1.6.0