public boolean validate(final Object value) { if (value instanceof String) { ResearchStaffQuery researchStaffQuery = new ResearchStaffQuery(); researchStaffQuery.filterByEmailAddress((String) value); List<PersonUser> researchStaffList = personUserDao.searchResearchStaff(researchStaffQuery); return (researchStaffList == null || researchStaffList.isEmpty()) ? true : false; } return true; }
@Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { binder.setAutoGrowNestedPaths(Boolean.FALSE); super.initBinder(request, binder); binder.registerCustomEditor(Date.class, ControllerTools.getDateEditor(false)); binder.registerCustomEditor( healthcareSiteDao.domainClass(), new CustomDaoEditor(healthcareSiteDao)); binder.registerCustomEditor( healthcareSiteInvestigatorDao.domainClass(), new NullIdDaoBasedEditor(healthcareSiteInvestigatorDao)); binder.registerCustomEditor( personUserDao.domainClass(), new NullIdDaoBasedEditor(personUserDao)); binder.registerCustomEditor(studyDao.domainClass(), new CustomDaoEditor(studyDao)); binder.registerCustomEditor(Integer.class, new CustomNumberEditor(Integer.class, true)); binder.registerCustomEditor(String.class, "file", new StringMultipartFileEditor()); binder.registerCustomEditor( byte[].class, "study.criteriaFile", new ByteArrayMultipartFileEditor()); binder.registerCustomEditor(StudyPart.class, new EnumByNameEditor(StudyPart.class)); binder.registerCustomEditor(ConsentRequired.class, new EnumByNameEditor(ConsentRequired.class)); binder.registerCustomEditor( OrganizationIdentifierTypeEnum.class, new EnumByNameEditor(OrganizationIdentifierTypeEnum.class)); binder.registerCustomEditor( RandomizationType.class, new EnumByNameEditor(RandomizationType.class)); binder.registerCustomEditor( CoordinatingCenterStudyStatus.class, new EnumByNameEditor(CoordinatingCenterStudyStatus.class)); binder.registerCustomEditor( InvestigatorStatusCodeEnum.class, new EnumByNameEditor(InvestigatorStatusCodeEnum.class)); binder.registerCustomEditor(SiteStudyStatus.class, new EnumByNameEditor(SiteStudyStatus.class)); binder.registerCustomEditor(EpochType.class, new EnumByNameEditor(EpochType.class)); binder.registerCustomEditor( ConsentingMethod.class, new EnumByNameEditor(ConsentingMethod.class)); binder.registerCustomEditor( StudySponsorType.class, new EnumByNameEditor(StudySponsorType.class)); binder.registerCustomEditor(StudyCategory.class, new EnumByNameEditor(StudyCategory.class)); binder.registerCustomEditor( NCIRecognizedProgramName.class, new EnumByNameEditor(NCIRecognizedProgramName.class)); }