Subversion Repositories SmartDukaan

Rev

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

Rev 3206 Rev 3390
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.thrift.clients.CRMClient;
3
import in.shop2020.serving.auth.CRMAuthorizingRealm;
4
import in.shop2020.thrift.clients.TransactionClient;
-
 
5
import in.shop2020.thrift.clients.UserClient;
-
 
6
 
4
 
7
import java.text.SimpleDateFormat;
5
import java.text.SimpleDateFormat;
8
import java.util.Date;
6
import java.util.Date;
9
import java.util.Map;
7
import java.util.Map;
10
 
8
 
Line 51... Line 49...
51
    protected in.shop2020.model.v1.order.TransactionService.Client transactionServiceClient;
49
    protected in.shop2020.model.v1.order.TransactionService.Client transactionServiceClient;
52
    protected in.shop2020.crm.CRMService.Client crmServiceClient;
50
    protected in.shop2020.crm.CRMService.Client crmServiceClient;
53
 
51
 
54
    protected String currentAgentEmailId = (String) SecurityUtils.getSubject().getPrincipal();
52
    protected String currentAgentEmailId = (String) SecurityUtils.getSubject().getPrincipal();
55
 
53
 
56
    protected void createServiceClients()
-
 
57
    {
-
 
58
        try {
-
 
59
            userContextServiceClient = new UserClient().getClient();
-
 
60
            transactionServiceClient = new TransactionClient().getClient();
-
 
61
            crmServiceClient         = new CRMClient().getClient();
-
 
62
        }
-
 
63
        catch (Exception e) {
-
 
64
            log.error("Could not get client!", e);
-
 
65
        }
-
 
66
    }
-
 
67
 
-
 
68
    public void setServletResponse(HttpServletResponse response) {
54
    public void setServletResponse(HttpServletResponse response) {
69
        this.response = response;
55
        this.response = response;
70
    }
56
    }
71
 
57
 
72
    public void setServletRequest(HttpServletRequest request) {
58
    public void setServletRequest(HttpServletRequest request) {
Line 93... Line 79...
93
        return currentAgentEmailId;
79
        return currentAgentEmailId;
94
    }
80
    }
95
 
81
 
96
    public String getAgentName() throws TException
82
    public String getAgentName() throws TException
97
    {
83
    {
98
        return crmServiceClient.getAgentByEmailId(currentAgentEmailId).getName();
84
        return CRMAuthorizingRealm.getAgent(currentAgentEmailId).getName();
99
    }
85
    }
100
 
86
 
101
    public String editNew() {
87
    public String editNew() {
102
        return EDIT_NEW;
88
        return EDIT_NEW;
103
    }
89
    }