Subversion Repositories SmartDukaan

Rev

Rev 7272 | Rev 7386 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7272 Rev 7343
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
 
3
 
-
 
4
import in.shop2020.model.v1.order.HotspotStore;
-
 
5
 
4
import java.text.SimpleDateFormat;
6
import java.text.SimpleDateFormat;
5
import java.util.Date;
7
import java.util.Date;
6
import java.util.HashMap;
8
import java.util.HashMap;
7
import java.util.Map;
9
import java.util.Map;
8
 
10
 
Line 35... Line 37...
35
    protected static final String EDIT = "edit";
37
    protected static final String EDIT = "edit";
36
    protected static final String SHOW = "show";
38
    protected static final String SHOW = "show";
37
    protected static final String EXCEPTION = "exception";
39
    protected static final String EXCEPTION = "exception";
38
 
40
 
39
    protected final SimpleDateFormat SDF = new SimpleDateFormat("dd MMM, yyyy hh:mm a");
41
    protected final SimpleDateFormat SDF = new SimpleDateFormat("dd MMM, yyyy hh:mm a");
-
 
42
    
-
 
43
    public static Map<Long, HotspotStore> hotspotStores = new HashMap<Long, HotspotStore>();
40
 
44
 
41
    protected HttpServletResponse response;
45
    protected HttpServletResponse response;
42
    protected HttpServletRequest request;
46
    protected HttpServletRequest request;
43
    protected HttpSession session;
47
    protected HttpSession session;
44
    protected Map<String, Object> sessionMap;
48
    protected Map<String, Object> sessionMap;
45
    protected long sourceId = -1;
49
    protected long sourceId = -1;
46
    protected Map<String, String> htmlSnippets;
50
    protected Map<String, String> htmlSnippets;
-
 
51
    
-
 
52
    protected Long storeId;
47
 
53
 
48
    public BaseController() {
54
    public BaseController() {
49
		htmlSnippets = new HashMap<String, String>();
55
		htmlSnippets = new HashMap<String, String>();
50
	}
56
	}
51
 
57
 
Line 53... Line 59...
53
        this.response = response;
59
        this.response = response;
54
    }
60
    }
55
 
61
 
56
    public void setServletRequest(HttpServletRequest request) {
62
    public void setServletRequest(HttpServletRequest request) {
57
        this.request = request;
63
        this.request = request;
-
 
64
        this.session = request.getSession();
58
    }
65
    }
59
    
66
    
60
    public void setSession(Map<String, Object> sessionMap) {
67
    public void setSession(Map<String, Object> sessionMap) {
61
        this.session = request.getSession();
-
 
62
        this.sessionMap = sessionMap;
68
        this.sessionMap = sessionMap;
63
    }
69
    }
64
    
70
    
65
    /**
71
    /**
66
     * Utility method to convert a date to a readable format 
72
     * Utility method to convert a date to a readable format 
Line 90... Line 96...
90
    }
96
    }
91
 
97
 
92
    public boolean isPermitted(String permission) {
98
    public boolean isPermitted(String permission) {
93
        return SecurityUtils.getSubject().isPermitted(permission);
99
        return SecurityUtils.getSubject().isPermitted(permission);
94
    }
100
    }
-
 
101
 
-
 
102
    public Long getStoreId() {
-
 
103
        return storeId;
-
 
104
    }
-
 
105
 
-
 
106
    public void setStoreId(Long storeId) {
-
 
107
        this.storeId = storeId;
-
 
108
    }
95
}
109
}