Subversion Repositories SmartDukaan

Rev

Rev 650 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 650 Rev 741
Line 23... Line 23...
23
 *
23
 *
24
 */
24
 */
25
 
25
 
26
@Results({
26
@Results({
27
    @Result(name="success", type="redirectAction", 
27
    @Result(name="success", type="redirectAction", 
28
    		params = {"actionName" , "home"})
28
    		params = {"actionName" , "home"}),
-
 
29
    @Result(name="failure", type="redirectAction", 
-
 
30
    		params = {"actionName" , "register"})
-
 
31
   		
29
})
32
})
30
public class RegisterController extends BaseController{
33
public class RegisterController extends BaseController{
31
		
34
		
32
	private static final long serialVersionUID = 1L;
35
	private static final long serialVersionUID = 1L;
33
	private static Log log = LogFactory.getLog(RegisterController.class);
36
	private static Log log = LogFactory.getLog(RegisterController.class);
Line 51... Line 54...
51
    		return "failure";
54
    		return "failure";
52
    }
55
    }
53
    
56
    
54
    public boolean registerUser() throws Exception{
57
    public boolean registerUser() throws Exception{
55
    	String email, password, userName, mobileNumber, communicationEmail, sex, dateOfBirth;
58
    	String email, password, userName, mobileNumber, communicationEmail, sex, dateOfBirth;
56
    	
59
    	boolean isValid = true;
57
    	userName =  this.request.getParameter("nameOfUser");
60
    	userName =  this.request.getParameter("nameOfUser");
58
    	email = this.request.getParameter("email"); 
61
    	email = this.request.getParameter("email"); 
59
    	password = this.request.getParameter("password");
62
    	password = this.request.getParameter("password");
60
    	
63
    	
61
    	mobileNumber = this.request.getParameter("mobileNumber");
64
    	mobileNumber = this.request.getParameter("mobileNumber");
62
    	communicationEmail = this.request.getParameter("communicationEmail");
65
    	communicationEmail = this.request.getParameter("communicationEmail");
63
    	
66
    	
64
    	dateOfBirth = this.request.getParameter("dateOfBirth");
67
    	dateOfBirth = this.request.getParameter("dateOfBirth");
65
    	sex =  this.request.getParameter("sex");
68
    	sex =  this.request.getParameter("sex");
-
 
69
        
-
 
70
    	if(userName == null ){
-
 
71
    		addActionError("Please enter name of user.");
-
 
72
    		isValid = false;
-
 
73
        }
-
 
74
    	if(email == null ){
-
 
75
    		addActionError("Please enter valid email.");
-
 
76
    		isValid = false;
-
 
77
        }
-
 
78
    	if(password == null ){
-
 
79
    		addActionError("Please enter password.");
-
 
80
    		isValid = false;
-
 
81
        }
-
 
82
    	if(communicationEmail == null ){
-
 
83
    		addActionError("Please enter Communication email.");
-
 
84
    		isValid = false;
-
 
85
        }
-
 
86
    	
-
 
87
    	if(!isValid){
-
 
88
    		return isValid;
-
 
89
    	}
66
    	
90
    	
67
		UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
91
		UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
68
		in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
92
		in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
69
 
93
 
70
		if(userClient.userExists(email)){
94
		if(userClient.userExists(email)){