Class BaseController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.BaseController
-
- Direct Known Subclasses:
AnnouncementsController,LoginController,PipelineController,RemoteAPIAjaxController,RemoteAPIController
@Controller public class BaseController extends java.lang.ObjectBase class for controllers so that they all can have access to common functionality.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringMODEL_ERROR_ATTR
-
Constructor Summary
Constructors Constructor Description BaseController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,java.lang.String>getErrorsFromDataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException e, java.util.Map<java.lang.String,ExceptionPropertyAndMessage> messageNames, org.springframework.context.MessageSource messageSource, java.util.Locale locale)Converts a DataIntegrityViolationException to a usable map of strings for displaying in the UI.protected java.util.Map<java.lang.String,java.lang.String>getErrorsFromViolationException(javax.validation.ConstraintViolationException e)Changes aConstraintViolationExceptionto a usable map of strings for displaying in the UI.
-
-
-
Field Detail
-
MODEL_ERROR_ATTR
protected static final java.lang.String MODEL_ERROR_ATTR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getErrorsFromViolationException
protected java.util.Map<java.lang.String,java.lang.String> getErrorsFromViolationException(javax.validation.ConstraintViolationException e)
Changes aConstraintViolationExceptionto a usable map of strings for displaying in the UI.- Parameters:
e-ConstraintViolationExceptionfor the form submitted.- Returns:
- Map of string {fieldName, error}
-
getErrorsFromDataIntegrityViolationException
protected java.util.Map<java.lang.String,java.lang.String> getErrorsFromDataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException e, java.util.Map<java.lang.String,ExceptionPropertyAndMessage> messageNames, org.springframework.context.MessageSource messageSource, java.util.Locale locale)Converts a DataIntegrityViolationException to a usable map of strings for displaying in the UI.- Parameters:
e- The exception for the form submittedmessageNames- A map of the error message namesmessageSource- A message source to get the messages fromlocale- The locale of the request- Returns:
- A Map of strings with the property names and error messages
-
-