event.getDescription().equals("")) {
errors.rejectValue("description", null, null, "Description required");
}
if (!locationErrors) {
Point point = mapsService.getCoordinates(event.getStreetAddress(),
event.getCity(), event.getState(), event.getCountry());
if (point == null) {
errors.rejectValue("streetAddress", null, null, "Geocoding failed: given address may be invalid or geocoding service may be offline");
errors.rejectValue("city", null, null, "Geocoding failed: given address may be invalid or geocoding service may be offline");
errors.rejectValue("state", null, null, "Geocoding failed: given address may be invalid or geocoding service may be offline");
errors.rejectValue("country", null, null, "Geocoding failed: given address may be invalid or geocoding service may be offline");
} else {
event.setLatitude(point.getLatitude());
event.setLongitude(point.getLongitude());
}
}
}
}