Subversion Repositories SmartDukaan

Rev

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

Rev 7386 Rev 7747
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;
4
import in.shop2020.model.v1.order.HotspotStore;
-
 
5
import in.shop2020.thrift.clients.config.ConfigClient;
5
 
6
 
6
import java.text.SimpleDateFormat;
7
import java.text.SimpleDateFormat;
7
import java.util.Date;
8
import java.util.Date;
8
import java.util.HashMap;
9
import java.util.HashMap;
9
import java.util.Map;
10
import java.util.Map;
Line 21... Line 22...
21
import com.opensymphony.xwork2.ValidationAwareSupport;
22
import com.opensymphony.xwork2.ValidationAwareSupport;
22
 
23
 
23
/**
24
/**
24
 * Base class for all user action handlers i.e. controllers
25
 * Base class for all user action handlers i.e. controllers
25
 * 
26
 * 
26
 * @author Vikas
-
 
27
 */
27
 */
28
public abstract class BaseController extends ValidationAwareSupport implements
28
public abstract class BaseController extends ValidationAwareSupport implements
29
        ServletResponseAware, ServletRequestAware, SessionAware
29
        ServletResponseAware, ServletRequestAware, SessionAware
30
{
30
{
31
    private static final long serialVersionUID = 3339523094497219816L;
31
    private static final long serialVersionUID = 3339523094497219816L;
Line 48... Line 48...
48
    protected Map<String, Object> sessionMap;
48
    protected Map<String, Object> sessionMap;
49
    protected long sourceId = -1;
49
    protected long sourceId = -1;
50
    protected Map<String, String> htmlSnippets;
50
    protected Map<String, String> htmlSnippets;
51
    
51
    
52
    protected Long storeId;
52
    protected Long storeId;
-
 
53
    protected static boolean showTestMessage = false;
-
 
54
    
53
 
55
 
-
 
56
    static {
-
 
57
        try{
-
 
58
            setShowTestMessageField(Boolean.parseBoolean(ConfigClient.getClient().get("showTestMessageOnStoreWebsite")));
-
 
59
        } catch(Exception e){
-
 
60
            log.error("Unable to get value from config service", e);
-
 
61
        }
-
 
62
    }
-
 
63
    
54
    public BaseController() {
64
    public BaseController() {
55
		htmlSnippets = new HashMap<String, String>();
65
		htmlSnippets = new HashMap<String, String>();
56
	}
66
	}
57
 
67
 
58
    public void setServletResponse(HttpServletResponse response) {
68
    public void setServletResponse(HttpServletResponse response) {
Line 112... Line 122...
112
    }
122
    }
113
    
123
    
114
    public String getStoreCode(){
124
    public String getStoreCode(){
115
        return hotspotStores.get(storeId).getHotspotId();   
125
        return hotspotStores.get(storeId).getHotspotId();   
116
    }
126
    }
-
 
127
 
-
 
128
    public static void setShowTestMessageField(boolean showTestMessage) {
-
 
129
        BaseController.showTestMessage = showTestMessage;
-
 
130
    }
-
 
131
 
-
 
132
    public static boolean shouldShowTestMessage() {
-
 
133
        return showTestMessage;
-
 
134
    }
117
}
135
}