Subversion Repositories SmartDukaan

Rev

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

Rev 1044 Rev 1923
Line 50... Line 50...
50
	}
50
	}
51
    
51
    
52
    // GET /index
52
    // GET /index
53
    public HttpHeaders index() throws Exception {
53
    public HttpHeaders index() throws Exception {
54
    	long categoryId = Long.parseLong(request.getParameter("categoryid"));
54
    	long categoryId = Long.parseLong(request.getParameter("categoryid"));
-
 
55
    	String brandName = request.getParameter("brand");
-
 
56
    	//Right now if we have brand name, we can just send back for all categories
-
 
57
    	if(brandName!=null){
-
 
58
    	    categoryId = -1;
-
 
59
    	}
55
    	in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
60
    	in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
56
    	this.items = client.getLatestArrivalsCatalogIds(beginIndex, windowSize, categoryId);
61
    	this.items = client.getLatestArrivalsCatalogIds(beginIndex, windowSize, brandName, categoryId);
57
    	return new DefaultHttpHeaders("index");
62
    	return new DefaultHttpHeaders("index");
58
    }
63
    }
59
 
64
 
60
    // GET /show
65
    // GET /show
61
    public HttpHeaders show() {
66
    public HttpHeaders show() {
62
    	in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
67
    	in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
63
    	try {
68
    	try {
64
			this.setTotalItems(client.getLatestArrivalsCount());
69
			this.setTotalItems(client.getLatestArrivalsCount());
65
			this.items = client.getLatestArrivalsCatalogIds(beginIndex, windowSize, -1);
70
			this.items = client.getLatestArrivalsCatalogIds(beginIndex, windowSize, null, -1);
66
		} catch (InventoryServiceException e) {
71
		} catch (InventoryServiceException e) {
67
			log.error("Unable to get latest arrivals from inventory service.");
72
			log.error("Unable to get latest arrivals from inventory service.");
68
			log.error("Exception id is:"  + e.getId() + " Exception message is:" + e.getMessage());
73
			log.error("Exception id is:"  + e.getId() + " Exception message is:" + e.getMessage());
69
			e.printStackTrace();
74
			e.printStackTrace();
70
		} catch (TException e) {
75
		} catch (TException e) {