Search in sources :

Example 16 with UserRequest

use of org.jaffa.applications.jaffa.modules.user.domain.UserRequest in project jaffa-framework by jaffa-projects.

the class UserMaintenanceComponent method display.

public FormKey display() throws ApplicationExceptions, FrameworkException {
    if (this.getSecurityQuestion() == null) {
        this.setSecurityQuestion(new Long("1"));
    } else {
        this.setSecurityQuestion1("" + this.getSecurityQuestion());
    }
    if (getRequestId() != null && getRequestId().length() > 0) {
        UOW uow = new UOW();
        UserRequest userRequest = new UserRequest();
        Criteria criteria = new Criteria();
        criteria.setTable(UserRequestMeta.getName());
        criteria.addCriteria(UserRequestMeta.REQUEST_ID, getRequestId());
        Iterator itr = uow.query(criteria).iterator();
        if (itr.hasNext())
            userRequest = (UserRequest) itr.next();
        this.setFirstName(userRequest.getFirstName());
        this.setPassword1(userRequest.getPassword());
        this.setPassword2(userRequest.getPassword());
        this.setLastName(userRequest.getLastName());
        this.setEMailAddress(userRequest.getEMailAddress());
        this.setSecurityQuestion(userRequest.getSecurityQuestion());
        this.setSecurityQuestion1("" + userRequest.getSecurityQuestion());
        this.setSecurityAnswer(userRequest.getSecurityAnswer());
        this.setUserName(userRequest.getUserName());
        uow.rollback();
    }
    return super.display();
}
Also used : Iterator(java.util.Iterator) Criteria(org.jaffa.persistence.Criteria) UOW(org.jaffa.persistence.UOW) UserRequest(org.jaffa.applications.jaffa.modules.user.domain.UserRequest)

Aggregations

UserRequest (org.jaffa.applications.jaffa.modules.user.domain.UserRequest)16 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)10 UOW (org.jaffa.persistence.UOW)6 ApplicationException (org.jaffa.exceptions.ApplicationException)5 FrameworkException (org.jaffa.exceptions.FrameworkException)5 Criteria (org.jaffa.persistence.Criteria)5 DomainObjectNotFoundException (org.jaffa.exceptions.DomainObjectNotFoundException)3 ValidationException (org.jaffa.datatypes.ValidationException)2 EmailerBean (org.jaffa.util.EmailerBean)2 Iterator (java.util.Iterator)1 MessagingException (javax.mail.MessagingException)1 UserRole (org.jaffa.applications.jaffa.modules.admin.domain.UserRole)1 UserRequestFinderOutDto (org.jaffa.applications.jaffa.modules.user.components.userrequestfinder.dto.UserRequestFinderOutDto)1 UserRequestFinderOutRowDto (org.jaffa.applications.jaffa.modules.user.components.userrequestfinder.dto.UserRequestFinderOutRowDto)1 UserRequestLookupOutDto (org.jaffa.applications.jaffa.modules.user.components.userrequestlookup.dto.UserRequestLookupOutDto)1 UserRequestLookupOutRowDto (org.jaffa.applications.jaffa.modules.user.components.userrequestlookup.dto.UserRequestLookupOutRowDto)1 UserRequestViewerOutDto (org.jaffa.applications.jaffa.modules.user.components.userrequestviewer.dto.UserRequestViewerOutDto)1