| 507 |
rajveer |
1 |
/**
|
|
|
2 |
*
|
|
|
3 |
*/
|
|
|
4 |
package in.shop2020.serving.controllers;
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
import in.shop2020.model.v1.widgets.WidgetService.Client;
|
|
|
8 |
import in.shop2020.serving.pages.PageContentKeys;
|
|
|
9 |
import in.shop2020.serving.pages.PageEnum;
|
|
|
10 |
import in.shop2020.serving.pages.PageManager;
|
|
|
11 |
import in.shop2020.thrift.clients.WidgetServiceClient;
|
|
|
12 |
|
|
|
13 |
import java.io.IOException;
|
|
|
14 |
import java.util.HashMap;
|
|
|
15 |
import java.util.Map;
|
|
|
16 |
import java.util.StringTokenizer;
|
|
|
17 |
|
|
|
18 |
import javax.servlet.ServletContext;
|
|
|
19 |
|
|
|
20 |
import org.apache.juli.logging.Log;
|
|
|
21 |
import org.apache.juli.logging.LogFactory;
|
|
|
22 |
import org.apache.struts2.convention.annotation.Action;
|
|
|
23 |
import org.apache.struts2.convention.annotation.Actions;
|
|
|
24 |
import org.apache.struts2.convention.annotation.Result;
|
|
|
25 |
import org.apache.struts2.convention.annotation.Results;
|
|
|
26 |
import org.apache.struts2.rest.DefaultHttpHeaders;
|
|
|
27 |
import org.apache.struts2.rest.HttpHeaders;
|
|
|
28 |
import org.apache.struts2.util.ServletContextAware;
|
|
|
29 |
|
|
|
30 |
import com.opensymphony.xwork2.ModelDriven;
|
|
|
31 |
|
|
|
32 |
/**
|
|
|
33 |
*
|
|
|
34 |
* @author rajveer
|
|
|
35 |
*
|
|
|
36 |
*/
|
| 650 |
rajveer |
37 |
|
|
|
38 |
public class HomeController extends BaseController {
|
| 507 |
rajveer |
39 |
|
|
|
40 |
/**
|
|
|
41 |
*
|
|
|
42 |
*/
|
| 650 |
rajveer |
43 |
private static final long serialVersionUID = 1L;
|
|
|
44 |
|
| 507 |
rajveer |
45 |
/**
|
|
|
46 |
*
|
|
|
47 |
*/
|
| 650 |
rajveer |
48 |
private static Log log = LogFactory.getLog(HomeController.class);
|
| 507 |
rajveer |
49 |
|
|
|
50 |
public HomeController(){
|
|
|
51 |
super();
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
|
| 650 |
rajveer |
55 |
public String index() throws SecurityException, IOException {
|
| 555 |
chandransh |
56 |
log.info("userinfo:" + userinfo.toString());
|
| 507 |
rajveer |
57 |
|
| 650 |
rajveer |
58 |
htmlSnippets.put("MAIN_BANNER", pageLoader.getMainBannerHtml());
|
|
|
59 |
htmlSnippets.put("BEST_DEALS", pageLoader.getBestDealsHtml());
|
|
|
60 |
htmlSnippets.put("BEST_SELLERS", pageLoader.getBestSellersHtml());
|
|
|
61 |
htmlSnippets.put("LATEST_ARRIVALS", pageLoader.getLatestArrivalsHtml());
|
|
|
62 |
return "index";
|
| 507 |
rajveer |
63 |
}
|
|
|
64 |
|
|
|
65 |
public String getMainBannerSnippet(){
|
|
|
66 |
return htmlSnippets.get("MAIN_BANNER");
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
public String getBestDealsSnippet(){
|
|
|
70 |
return htmlSnippets.get("BEST_DEALS");
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
public String getLatestArrivalsSnippet(){
|
|
|
74 |
return htmlSnippets.get("LATEST_ARRIVALS");
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
public String getBestSellersSnippet(){
|
|
|
78 |
return htmlSnippets.get("BEST_SELLERS");
|
|
|
79 |
}
|
|
|
80 |
}
|