Subversion Repositories SmartDukaan

Rev

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

Rev 462 Rev 507
Line 27... Line 27...
27
 
27
 
28
/**
28
/**
29
 * @author rajveer
29
 * @author rajveer
30
 *
30
 *
31
 */
31
 */
32
@Results({
-
 
33
    @Result(name="success", type="redirectAction", 
-
 
34
    		params = {"actionName" , "myaccount"})
-
 
35
})
-
 
36
 
32
 
37
public class MyaccountController extends BaseController 
33
public class MyaccountController extends BaseController 
38
	implements ParameterAware {
34
	implements ParameterAware {
39
 
35
 
40
	
36
	
Line 53... Line 49...
53
	
49
	
54
	private String id;
50
	private String id;
55
	
51
	
56
	private int action;
52
	private int action;
57
	
53
	
58
	enum actionType{
-
 
59
		LOGIN_PASSWORD,
-
 
60
		ADDRESS,
-
 
61
		LOGIN_PASSWORD_ADDRESS
-
 
62
	}
-
 
63
	
54
	
64
	public MyaccountController() {
55
	public MyaccountController() {
65
		// TODO Auto-generated constructor stub
-
 
66
		super();
56
		super();
67
		
-
 
68
	}
57
	}
69
	
58
	
70
    // POST /myaccount
59
    // POST /myaccount
71
    public String create() {
60
    public String create() {
72
    	log.info("MyAccountController.create");
61
    	log.info("MyAccountController.create");
Line 89... Line 78...
89
    }
78
    }
90
 
79
 
91
    
80
    
92
    // GET /test
81
    // GET /test
93
    public HttpHeaders index() throws UnsupportedEncodingException {
82
    public HttpHeaders index() throws UnsupportedEncodingException {
94
    	//log.info("this.request=" + this.request);
83
    	log.info("this.request=" + this.request);
95
    	
-
 
96
    	
84
    	
97
    	String userId = "";
85
    	String userId = "";
98
    	
86
    	
99
    
-
 
100
    	if(this.userinfo.isLoggedIn()){
87
    	if(this.userinfo.isLoggedIn()){
101
    		userId = (new Long(this.userinfo.getUserId())).toString();
88
    		userId = (new Long(this.userinfo.getUserId())).toString();
102
 
-
 
103
			Map<PageContentKeys, String> params = new HashMap<PageContentKeys, String>();
89
			Map<PageContentKeys, String> params = new HashMap<PageContentKeys, String>();
104
			params.put(PageContentKeys.CUSTOMER_ID, userId);
90
			params.put(PageContentKeys.CUSTOMER_ID, userId);
-
 
91
			params.put(PageContentKeys.ITEM_COUNT, userinfo.getTotalItems()+"");
105
			htmlSnippets = PageManager.getPageManager().getPageContents(PageEnum.MY_ACCOUNT_PAGE, params);
92
			htmlSnippets = PageManager.getPageManager().getPageContents(PageEnum.MY_ACCOUNT_PAGE, params);
106
			
93
			
107
			return new DefaultHttpHeaders("index").disableCaching();
94
			return new DefaultHttpHeaders("index").disableCaching();
108
    	
95
    	
109
    	}else{
96
    	}else{
Line 112... Line 99...
112
    	
99
    	
113
    }
100
    }
114
    
101
    
115
    public HttpHeaders show(){
102
    public HttpHeaders show(){
116
    	log.info("this.id=" + this.id);
103
    	log.info("this.id=" + this.id);
117
 
-
 
-
 
104
    	log.info("this.id=" + userinfo.getTotalItems());
118
		Map<PageContentKeys, String> params = new HashMap<PageContentKeys, String>();
105
		Map<PageContentKeys, String> params = new HashMap<PageContentKeys, String>();
119
		params.put(PageContentKeys.CUSTOMER_ID, id);
106
		params.put(PageContentKeys.CUSTOMER_ID, id);
-
 
107
		params.put(PageContentKeys.ITEM_COUNT, userinfo.getTotalItems()+"");
120
		htmlSnippets = PageManager.getPageManager().getPageContents(PageEnum.MY_ACCOUNT_PAGE, params);
108
		htmlSnippets = PageManager.getPageManager().getPageContents(PageEnum.MY_ACCOUNT_PAGE, params);
121
		
109
		
122
        return new DefaultHttpHeaders("index").disableCaching();
110
        return new DefaultHttpHeaders("index").disableCaching();
123
    }
111
    }
124
    
112
    
-
 
113
    public String getHeaderSnippet(){
-
 
114
		return htmlSnippets.get("HEADER");
-
 
115
	}
-
 
116
	
-
 
117
	public String getMainMenuSnippet(){
-
 
118
		return htmlSnippets.get("MAIN_MENU");
-
 
119
	}
-
 
120
	
-
 
121
	public String getSearchBarSnippet(){
-
 
122
		return htmlSnippets.get("SEARCH_BAR");
-
 
123
	}
-
 
124
			
-
 
125
	
-
 
126
	public String getCustomerServiceSnippet(){
-
 
127
		return htmlSnippets.get("CUSTOMER_SERVICE");
-
 
128
	}
-
 
129
	
-
 
130
	public String getMyaccountHeaderSnippet(){
-
 
131
		return htmlSnippets.get("MYACCOUNT_HEADER");
-
 
132
	}
-
 
133
	
-
 
134
	public String getMyaccountDetailsSnippet(){
-
 
135
		return htmlSnippets.get("MYACCOUNT_DETAILS");
-
 
136
	}
-
 
137
	
-
 
138
	public String getMyResearchSnippet(){
-
 
139
		return htmlSnippets.get("MY_RESEARCH");
-
 
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
	
125
    /**
154
    /**
126
     * 
155
     * 
127
     * @param id
156
     * @param id
128
     */
157
     */
129
    public void setId(String id) {
158
    public void setId(String id) {