Package org.dlese.dpc.schemedit.input
Class UniqueValueChecker
java.lang.Object
org.dlese.dpc.schemedit.input.UniqueValueChecker
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
ConstructorsConstructorDescriptionUniqueValueChecker(ServletContext servletContext) Constructor for the UniqueValueChecker object, requiring ServletContext. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringGets a formated date string for current time.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
-
Constructor Details
-
UniqueValueChecker
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
Returns a list of RecordIds in a that contain a value equal to provided referenceValue at the provided xpathNOTE: 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 dupsreferenceDocReader- docReader for the record containing referenceValuexpath- xpath at which value is found- Returns:
- List of DupSim instances
-
getDateString
Gets a formated date string for current time.- Returns:
- The dateString value
-