Subversion Repositories SmartDukaan

Rev

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

Rev 317 Rev 375
Line 1... Line 1...
1
/**
1
/**
2
 * 
2
 * 
3
 */
3
 */
4
package in.shop2020.serving.controllers;
4
package in.shop2020.serving.controllers;
5
 
5
 
-
 
6
import in.shop2020.serving.pages.PageContentKeys;
-
 
7
import in.shop2020.serving.pages.PageEnum;
-
 
8
import in.shop2020.serving.pages.PageManager;
-
 
9
 
6
import java.io.IOException;
10
import java.io.IOException;
-
 
11
import java.util.HashMap;
-
 
12
import java.util.Map;
7
 
13
 
8
import javax.servlet.ServletContext;
14
import javax.servlet.ServletContext;
9
 
15
 
10
import org.apache.juli.logging.Log;
16
import org.apache.juli.logging.Log;
11
import org.apache.juli.logging.LogFactory;
17
import org.apache.juli.logging.LogFactory;
Line 27... Line 33...
27
    		"entity"})
33
    		"entity"})
28
})
34
})
29
public class EntityController extends BaseController 
35
public class EntityController extends BaseController 
30
	implements  ModelDriven<Object>, ServletContextAware  {
36
	implements  ModelDriven<Object>, ServletContextAware  {
31
	
37
	
-
 
38
	private PageManager pageManager = null;
-
 
39
	
32
	/**
40
	/**
33
	 * 
41
	 * 
34
	 */
42
	 */
35
	private static Log log = LogFactory.getLog(EntityController.class);
43
	private static Log log = LogFactory.getLog(EntityController.class);
36
	
44
	
Line 42... Line 50...
42
	
50
	
43
	/**
51
	/**
44
	 * 
52
	 * 
45
	 */
53
	 */
46
	private String id;
54
	private String id;
-
 
55
	
-
 
56
	private String sample;
-
 
57
	
-
 
58
	
-
 
59
	public EntityController(){
-
 
60
		super();
-
 
61
		pageManager = PageManager.getPageManager();
47
		
62
	}
48
    // GET /entity/1000001
63
    // GET /entity/1000001
49
    public HttpHeaders show() throws SecurityException, IOException {
64
    public HttpHeaders show() throws SecurityException, IOException {
50
    	log.info("id=" + id);
65
    	log.info("id=" + id);
-
 
66
    	Map<PageContentKeys, String> params = new HashMap<PageContentKeys, String>();
-
 
67
    	params.put(PageContentKeys.ENTITY_ID, id);
-
 
68
    	Map<String,String> contents = pageManager.getPageContents(PageEnum.PRODUCT_PAGE, params);
-
 
69
    	sample = contents.get("SLIDE_GUIDE");
-
 
70
    	System.out.println(sample);
51
    	/*
71
    	/*
52
    	String contextPath = this.servletContext.getContextPath();
72
    	String contextPath = this.servletContext.getContextPath();
53
    	log.info("contextPath=" + contextPath);
73
    	log.info("contextPath=" + contextPath);
54
    	
74
    	
55
    	String realPath = this.servletContext.getRealPath("/");
75
    	String realPath = this.servletContext.getRealPath("/");
Line 90... Line 110...
90
	 */
110
	 */
91
	@Override
111
	@Override
92
	public void setServletContext(ServletContext servletContext) {
112
	public void setServletContext(ServletContext servletContext) {
93
		this.servletContext = servletContext;
113
		this.servletContext = servletContext;
94
	}
114
	}
-
 
115
	
-
 
116
	public String getSample(){
-
 
117
		return sample;
-
 
118
	}
95
 
119
 
96
}
120
}