Subversion Repositories SmartDukaan

Rev

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

Rev 595 Rev 650
Line 31... Line 31...
31
 *
31
 *
32
 */
32
 */
33
 
33
 
34
@Results({
34
@Results({
35
    @Result(name="success", type="redirectAction", 
35
    @Result(name="success", type="redirectAction", 
36
    		params = {"actionName" , "login-details"})
36
    		params = {"actionName" , "login-details"}),
-
 
37
    @Result(name="redirect", type="redirectAction", 
-
 
38
    	    params = {"actionName" , "login"})
37
})
39
})
38
public class LoginDetailsController extends BaseController 
40
public class LoginDetailsController extends BaseController {
39
	implements ParameterAware {
-
 
40
 
41
 
41
	
-
 
42
	/**
-
 
43
	 * 
-
 
44
	 */
-
 
45
	private static final long serialVersionUID = 1L;
42
	private static final long serialVersionUID = 1L;
46
 
43
 
47
	/**
-
 
48
	 * 
-
 
49
	 */
-
 
50
	private static Log log = LogFactory.getLog(LoginDetailsController.class);
44
	private static Log log = LogFactory.getLog(LoginDetailsController.class);
51
	
45
	
52
	private Map<String,String> htmlSnippets = new HashMap<String, String>();
-
 
53
	/**
-
 
54
	 * 
-
 
55
	 */
-
 
56
	
-
 
57
	private Map<String, String[]> reqparams;
-
 
58
	
46
	
59
	public LoginDetailsController() {
47
	public LoginDetailsController() {
60
		super();
48
		super();
61
	}
49
	}
62
	
50
	
Line 80... Line 68...
80
		return "success";
68
		return "success";
81
    }
69
    }
82
 
70
 
83
    
71
    
84
    // GET /test
72
    // GET /test
85
    public HttpHeaders index() throws UnsupportedEncodingException {
73
    public String index() throws UnsupportedEncodingException {
86
    	log.info("this.request=" + this.request);
74
    	log.info("this.request=" + this.request);
87
    	
75
    	
88
    	if(this.userinfo.isLoggedIn()){
76
		if(!userinfo.isLoggedIn()){
89
    		PageLoaderHandler pageLoader = new PageLoaderHandler();
-
 
90
    		
-
 
91
    		htmlSnippets.put("HEADER", pageLoader.getHeaderHtml(this.userinfo.isLoggedIn(), this.userinfo.getNameOfUser()));
-
 
92
    		htmlSnippets.put("MAIN_MENU", pageLoader.getMainMenuHtml());
-
 
93
    		htmlSnippets.put("SEARCH_BAR", pageLoader.getSearchBarHtml(userinfo.getTotalItems(), 0));
-
 
94
    		htmlSnippets.put("MYACCOUNT_HEADER", pageLoader.getMyaccountHeaderHtml());
-
 
95
    		
-
 
96
    		htmlSnippets.put("CUSTOMER_SERVICE", pageLoader.getCustomerServiceHtml());
-
 
97
    		htmlSnippets.put("MY_RESEARCH", pageLoader.getMyResearchHtml(userinfo.getUserId(), true));
-
 
98
    		htmlSnippets.put("BROWSE_HISTORY", pageLoader.getBrowseHistoryHtml(userinfo.getUserId(), userinfo.isLoggedIn()));
-
 
99
    		htmlSnippets.put("FOOTER", pageLoader.getFooterHtml());
77
			setRedirectUrl();
100
		
-
 
101
    		return new DefaultHttpHeaders("index").disableCaching();
78
			return "redirect";
102
    	
-
 
103
    	}else{
79
    	}else{
-
 
80
    		htmlSnippets.put("MYACCOUNT_HEADER", pageLoader.getMyaccountHeaderHtml());
104
    		return new DefaultHttpHeaders("login").disableCaching();
81
    		htmlSnippets.put("LOGIN_DETAILS", pageLoader.getLoginDetailsHtml(userinfo.getUserId()));
-
 
82
    		return "index";
105
    	}
83
    	}
106
    	
84
    	
107
    }
85
    }
108
    
86
    
109
    public String getHeaderSnippet(){
-
 
110
		return htmlSnippets.get("HEADER");
-
 
111
	}
-
 
112
	
-
 
113
	public String getMainMenuSnippet(){
-
 
114
		return htmlSnippets.get("MAIN_MENU");
-
 
115
	}
-
 
116
	
-
 
117
	public String getSearchBarSnippet(){
-
 
118
		return htmlSnippets.get("SEARCH_BAR");
-
 
119
	}
-
 
120
			
-
 
121
	
-
 
122
	public String getCustomerServiceSnippet(){
-
 
123
		return htmlSnippets.get("CUSTOMER_SERVICE");
-
 
124
	}
-
 
125
	
-
 
126
	public String getMyaccountHeaderSnippet(){
87
	public String getMyaccountHeaderSnippet(){
127
		return htmlSnippets.get("MYACCOUNT_HEADER");
88
		return htmlSnippets.get("MYACCOUNT_HEADER");
128
	}
89
	}
129
	
90
	
130
	public String getLoginDetailsSnippet(){
91
	public String getLoginDetailsSnippet(){
131
		return htmlSnippets.get("LOGIN_DETAILS");
92
		return htmlSnippets.get("LOGIN_DETAILS");
132
	}
93
	}
133
	
94
	
134
	public String getMyResearchSnippet(){
-
 
135
		return htmlSnippets.get("MY_RESEARCH");
-
 
136
	}
-
 
137
 
-
 
138
	public String getBrowseHistorySnippet(){
-
 
139
		return htmlSnippets.get("BROWSE_HISTORY");
-
 
140
	}
-
 
141
	
-
 
142
	public String getFooterSnippet(){
-
 
143
		return htmlSnippets.get("FOOTER");
-
 
144
	}
-
 
145
	
-
 
146
	public String getJsFileSnippet(){
-
 
147
		return htmlSnippets.get("JS_FILES");
-
 
148
	}
-
 
149
	
-
 
150
	public String getCssFileSnippet(){
-
 
151
		return htmlSnippets.get("CSS_FILES");
-
 
152
	}
-
 
153
	
-
 
154
    public String getEmail(){
95
	public String getEmail(){
155
    	return userinfo.getEmail();
96
    	return userinfo.getEmail();
156
    }
97
    }
157
    
98
    
158
	@Override
-
 
159
	public void setParameters(Map<String, String[]> reqmap) {
-
 
160
		log.info("setParameters:" + reqmap);
-
 
161
		
-
 
162
		this.reqparams = reqmap;
-
 
163
	}
-
 
164
 
-
 
165
}
99
}