| 385 |
ashish |
1 |
package in.shop2020.serving.controllers;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.serving.pages.PageContentKeys;
|
|
|
4 |
import in.shop2020.serving.pages.PageEnum;
|
|
|
5 |
import in.shop2020.serving.pages.PageManager;
|
|
|
6 |
|
|
|
7 |
import java.util.HashMap;
|
|
|
8 |
import java.util.Map;
|
|
|
9 |
import java.util.StringTokenizer;
|
|
|
10 |
|
|
|
11 |
import org.apache.struts2.rest.DefaultHttpHeaders;
|
|
|
12 |
import org.apache.struts2.rest.HttpHeaders;
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
public class MyResearchController extends BaseController {
|
|
|
18 |
|
|
|
19 |
//id is in format xyz_zbc where xyz is customerid and abc is entityid
|
|
|
20 |
private String id;
|
|
|
21 |
|
|
|
22 |
private String customer_id;
|
|
|
23 |
|
|
|
24 |
private String entity_id;
|
|
|
25 |
|
|
|
26 |
//Handle /myresearch/{id}
|
|
|
27 |
public HttpHeaders show(){
|
|
|
28 |
getFields();
|
|
|
29 |
Map<PageContentKeys, String> params = new HashMap<PageContentKeys, String>();
|
|
|
30 |
params.put(PageContentKeys.ENTITY_ID, entity_id);
|
|
|
31 |
params.put(PageContentKeys.CUSTOMER_ID, customer_id);
|
|
|
32 |
PageManager.getPageManager().getPageContents(PageEnum.MY_RESEARCH_PAGE, params);
|
|
|
33 |
return new DefaultHttpHeaders("show");
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
private void getFields(){
|
|
|
37 |
StringTokenizer tokenizer = new StringTokenizer(id,"_");
|
|
|
38 |
customer_id = tokenizer.nextToken();
|
|
|
39 |
entity_id = tokenizer.nextToken();
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
}
|