|| StringUtils.isBlank(u.getEmail())
|| StringUtils.isBlank(u.getFirstName())
|| StringUtils.isBlank(u.getLastName())
|| StringUtils.isBlank(u.getCountry())
) {
r = new RegistrationError();
((RegistrationError)r).setCause(new RegistrationException("missing required fields or fields contain only spaces"));
} else if (!EmailHelper.doEmailSeemsValid(u.getEmail())) {
r = new RegistrationError();
((RegistrationError)r).setCause(new RegistrationException("your email seems to be invalid"));
} else {
User registeredUser = ServiceFactory.getRegistrationService().registerTrialUser(u, hostId);
ServiceFactory.getRegistrationService().sendEmailVerification(registeredUser);
r = new RegistrationSuccessfull();
}
} catch (RegistrationException e) {
r = new RegistrationError();
((RegistrationError)r).setCause(e);
} catch (Exception e) {
r = new RegistrationError();
}
XMLResponseHelper.writeXMLResponse(response, r);
return null;
}