Package io.goobi.viewer.faces.validators
Class RelatedPIValidator
java.lang.Object
io.goobi.viewer.faces.validators.PIValidator
io.goobi.viewer.faces.validators.RelatedPIValidator
- All Implemented Interfaces:
Validator<String>,EventListener
Validates the entered PI belonging to a record for which the current user may create CMS content.
-
Field Summary
Fields inherited from class io.goobi.viewer.faces.validators.PIValidator
ILLEGAL_CHARS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidate(FacesContext context, UIComponent component, String value) static StringvalidatePi(String pi, User user) validatePi.Methods inherited from class io.goobi.viewer.faces.validators.PIValidator
validatePi
-
Constructor Details
-
RelatedPIValidator
public RelatedPIValidator()
-
-
Method Details
-
validate
public void validate(FacesContext context, UIComponent component, String value) throws ValidatorException - Specified by:
validatein interfaceValidator<String>- Overrides:
validatein classPIValidator- Throws:
ValidatorException
-
validatePi
public static String validatePi(String pi, User user) throws PresentationException, IndexUnreachableException validatePi.- Parameters:
pi- persistent identifier to validateuser- currently logged-in user; must be a CMS admin- Returns:
- null if the PI is valid, or a message key string describing the validation failure
- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-