Subversion Repositories SmartDukaan

Rev

Rev 3390 | Rev 4241 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3090 mandeep.dh 1
/**
2
 * 
3
 */
4
package in.shop2020.serving.controllers;
5
 
6
import in.shop2020.crm.Activity;
7
import in.shop2020.crm.Agent;
3390 mandeep.dh 8
import in.shop2020.crm.SearchFilter;
3090 mandeep.dh 9
import in.shop2020.crm.Ticket;
3390 mandeep.dh 10
import in.shop2020.serving.auth.CRMAuthorizingRealm;
11
import in.shop2020.thrift.clients.CRMClient;
3090 mandeep.dh 12
 
13
import org.apache.thrift.TException;
14
 
15
/**
16
 * Action class to display activity details.
17
 * @author mandeep
18
 */
3405 mandeep.dh 19
public class ActivityInfoController extends BaseController {
3090 mandeep.dh 20
    /**
21
     * 
22
     */
23
    private static final long serialVersionUID = 1L;
24
    private long activityId;
25
    private Ticket ticket;
26
    private Activity activity;
27
 
28
    public String index() throws TException
29
    {
3390 mandeep.dh 30
        SearchFilter searchFilter = new SearchFilter();
31
        searchFilter.setActivityId(activityId);
32
        crmServiceClient         = new CRMClient().getClient();
33
        activity = crmServiceClient.getActivities(searchFilter).get(0);
3090 mandeep.dh 34
 
3339 mandeep.dh 35
        if (activity != null && activity.isSetTicketId()) {
3390 mandeep.dh 36
            searchFilter.setTicketId(activity.getTicketId());
37
            ticket = crmServiceClient.getTickets(searchFilter).get(0);
3090 mandeep.dh 38
        }
39
 
40
        return INDEX;
41
    }
42
 
43
    public Ticket getTicket() {
44
        return ticket;
45
    }
46
 
47
    public Activity getActivity() {
48
        return activity;
49
    }
50
 
51
    public void setActivityId(long activityId) {
52
        this.activityId = activityId;
53
    }
54
 
55
    public Agent getAgent(long agentId) throws TException {
3390 mandeep.dh 56
        return CRMAuthorizingRealm.getAgent(agentId);
3090 mandeep.dh 57
    }
58
}