Package org.dlese.dpc.schemedit.input
Class SchemEditErrors
java.lang.Object
org.dlese.dpc.schemedit.input.SchemEditErrors
Methods to create ActionErrors for the Metadata Editor. Most create two
error messages :
- At the top of the page with a hyperlink to the field in which the error occurs
- At the field itself
- Author:
- ostwald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAnyTypeError(SchemEditActionErrors errors, InputField field, String errorMsg) Adds a feature to the AnyTypeError attribute of the SchemEditErrors classstatic voidaddDuplicateUrlError(SchemEditActionErrors errors, String uniqueUrlPath, String msgKey) Create a duplicateURL error(s) and attach to provided errors lsitstatic voidaddDuplicateValueError(SchemEditActionErrors errors, InputField inputField, String dupRecId) Creates two ActionErrors signifying a duplicateValue error, one for the top of page message, and one for the error message that is attached to a specific field.static voidaddEntityError(SchemEditActionErrors errors, InputField field, String errorMsg) Creates two ActionErrors, one for the top of page message, and one for the error message that is attached to a specific field.static voidaddError(SchemEditActionErrors errors, String fieldProperty, String msgKey, String elementName, String pathArg) Creates two ActionErrors, one for the top of page message, and one for the error message that is attached to a specific field.static voidaddError(SchemEditActionErrors errors, InputField field, String msgKey) Creates two ActionErrors, one for the top of page message, and one for the error message that is attached to a specific field.static voidaddGenericError(SchemEditActionErrors errors, String xpath, String msg) Creates two ActionErrors signifying a Generic error, one for the top of page message, and one for the error message that is attached to a specific field.static voidaddInvalidUrlError(SchemEditActionErrors errors, String uniqueUrlPath, String msg) Creates two ActionErrors signifying an invalidUrlError error, one for the top of page message, and one for the error message that is attached to a specific field.static voidaddSimilarUrlError(SchemEditActionErrors errors, String uniqueUrlPath, String msgKey) Creates two ActionErrors signifying a similarURL, one for the top of page message, and one for the error message that is attached to a specific field.static voidaddUniqueUrlError(SchemEditActionErrors errors, String uniqueUrlPath, String msgKey, String msgProperty) Creates two ActionErrors for a "nonUniqueUrl", one for the top of page message, and one for the error message that is attached to a specific field.static voidaddXSDdatatypeError(SchemEditActionErrors errors, InputField field, String msgKey, String errorMsg) Adds errors in the case where an invalid value message has been supplied by the XSDDataType validator.
-
Constructor Details
-
SchemEditErrors
public SchemEditErrors()
-
-
Method Details
-
addError
public static void addError(SchemEditActionErrors errors, String fieldProperty, String msgKey, String elementName, String pathArg) Creates two ActionErrors, one for the top of page message, and one for the error message that is attached to a specific field. Used when no InputField is available, so fieldProperty and elementName must be passed explicitly.Example use: to notify of an element that could not be deleted. Here there is not a specific InputField involved, but rather an branch of the XML document (which is identified by xpath).
Note: both the pathArg and the path component of the fieldProperty contain xpaths that are encoded for jsp (e.g., the indexing notation is converted from "[1]" to "_1_".
- Parameters:
errors- ActionErrors object to which the new errors are addedfieldProperty- The property to which this error is attached (e.g., "valueOf(/itemRecord/general/description_1_)")msgKey- Reference to a message in the "ApplicationResources"elementName- The feature to be added to the Error attributepathArg- xpath (encoded for jsp) to the field in which the error occurs
-
addGenericError
Creates two ActionErrors signifying a Generic error, one for the top of page message, and one for the error message that is attached to a specific field.- Parameters:
errors- error list to which we addxpath- The feature to be added to the GenericError attributemsg- error msg content
-
addInvalidUrlError
public static void addInvalidUrlError(SchemEditActionErrors errors, String uniqueUrlPath, String msg) Creates two ActionErrors signifying an invalidUrlError error, one for the top of page message, and one for the error message that is attached to a specific field.- Parameters:
errors- error list to which we adduniqueUrlPath- path of field that should contain uniqueUrlmsg- error msg content
-
addSimilarUrlError
public static void addSimilarUrlError(SchemEditActionErrors errors, String uniqueUrlPath, String msgKey) Creates two ActionErrors signifying a similarURL, one for the top of page message, and one for the error message that is attached to a specific field.- Parameters:
errors- error list to which we adduniqueUrlPath- path of field that should contain uniqueUrlmsgKey- msgKey to select message from applicationResources
-
addDuplicateUrlError
public static void addDuplicateUrlError(SchemEditActionErrors errors, String uniqueUrlPath, String msgKey) Create a duplicateURL error(s) and attach to provided errors lsit- Parameters:
errors- error list to which we adduniqueUrlPath- path of field that should contain uniqueUrlmsgKey- msgKey to select message from applicationResources
-
addDuplicateValueError
public static void addDuplicateValueError(SchemEditActionErrors errors, InputField inputField, String dupRecId) Creates two ActionErrors signifying a duplicateValue error, one for the top of page message, and one for the error message that is attached to a specific field.- Parameters:
errors- the error list to which we addinputField- the input field containing a dup valuedupRecId- The Id of a record containing a dup value
-
addUniqueUrlError
public static void addUniqueUrlError(SchemEditActionErrors errors, String uniqueUrlPath, String msgKey, String msgProperty) Creates two ActionErrors for a "nonUniqueUrl", one for the top of page message, and one for the error message that is attached to a specific field.- Parameters:
errors- error list to which we adduniqueUrlPath- path of field that should contain uniqueUrlmsgKey- msgKey to select message from applicationResourcesmsgProperty- identifies the type of error and how it is displayed in UI
-
addError
Creates two ActionErrors, one for the top of page message, and one for the error message that is attached to a specific field.- Parameters:
errors- ActionErrors object to which the new errors are addedfield- The InputField containing an errormsgKey- Reference to a message in the "ApplicationResources"
-
addEntityError
Creates two ActionErrors, one for the top of page message, and one for the error message that is attached to a specific field.- Parameters:
errors- ActionErrors object to which the new errors are addedfield- The InputField containing an errorerrorMsg- The feature to be added to the EntityError attribute
-
addAnyTypeError
Adds a feature to the AnyTypeError attribute of the SchemEditErrors class- Parameters:
errors- error list to which we addfield- inputField that error message is attachederrorMsg- The text of the error message
-
addXSDdatatypeError
public static void addXSDdatatypeError(SchemEditActionErrors errors, InputField field, String msgKey, String errorMsg) Adds errors in the case where an invalid value message has been supplied by the XSDDataType validator.- Parameters:
errors- error list to which we addfield- inputField that error message is attachedmsgKey- msgKey to select message from applicationResourceserrorMsg- The text of the error message
-