Subversion Repositories SmartDukaan

Rev

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

Rev 3872 Rev 3907
Line 6... Line 6...
6
import in.shop2020.catalog.dashboard.shared.ItemsComparator;
6
import in.shop2020.catalog.dashboard.shared.ItemsComparator;
7
import in.shop2020.catalog.dashboard.shared.SourcePricings;
7
import in.shop2020.catalog.dashboard.shared.SourcePricings;
8
import in.shop2020.catalog.dashboard.shared.VendorItemMapping;
8
import in.shop2020.catalog.dashboard.shared.VendorItemMapping;
9
import in.shop2020.catalog.dashboard.shared.VendorPricings;
9
import in.shop2020.catalog.dashboard.shared.VendorPricings;
10
import in.shop2020.config.ConfigException;
10
import in.shop2020.config.ConfigException;
-
 
11
import in.shop2020.content.ContentService;
-
 
12
import in.shop2020.content.ContentServiceException;
11
import in.shop2020.model.v1.catalog.InventoryService;
13
import in.shop2020.model.v1.catalog.InventoryService;
12
import in.shop2020.model.v1.catalog.status;
14
import in.shop2020.model.v1.catalog.status;
13
import in.shop2020.thrift.clients.CatalogClient;
15
import in.shop2020.thrift.clients.CatalogClient;
-
 
16
import in.shop2020.thrift.clients.ContentClient;
14
import in.shop2020.thrift.clients.config.ConfigClient;
17
import in.shop2020.thrift.clients.config.ConfigClient;
15
import in.shop2020.utils.CategoryManager;
18
import in.shop2020.utils.CategoryManager;
16
import in.shop2020.utils.ConfigClientKeys;
19
import in.shop2020.utils.ConfigClientKeys;
17
 
20
 
18
import java.io.BufferedReader;
21
import java.io.BufferedReader;
Line 28... Line 31...
28
import java.util.List;
31
import java.util.List;
29
import java.util.Map;
32
import java.util.Map;
30
import java.util.Map.Entry;
33
import java.util.Map.Entry;
31
 
34
 
32
import org.apache.log4j.Logger;
35
import org.apache.log4j.Logger;
-
 
36
import org.apache.thrift.TException;
-
 
37
import org.apache.thrift.transport.TTransportException;
33
 
38
 
34
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
39
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
35
 
40
 
36
@SuppressWarnings("serial")
41
@SuppressWarnings("serial")
37
public class CatalogServiceImpl extends RemoteServiceServlet implements CatalogService {
42
public class CatalogServiceImpl extends RemoteServiceServlet implements CatalogService {
Line 619... Line 624...
619
        } catch (Exception e) {
624
        } catch (Exception e) {
620
            logger.error("Error while updating prices on production", e);
625
            logger.error("Error while updating prices on production", e);
621
            return "Error while updating all prices on production. Some of the prices may have been  updated";
626
            return "Error while updating all prices on production. Some of the prices may have been  updated";
622
        }
627
        }
623
        
628
        
624
        /*
629
        try {
625
        // Push the content of one item to production 
630
            ContentClient contentServiceClient = new ContentClient();
-
 
631
            ContentService.Client contentClient = contentServiceClient.getClient();
626
        Process p;
632
            
627
		try {
-
 
628
		    String scriptPath = ConfigClient.getClient().get(ConfigClientKeys.PUSH_PRICES_TO_PROD_SCRIPT_PATH.toString());
-
 
629
			p = Runtime.getRuntime().exec(scriptPath + " " + item.getCatalogItemId());
633
            contentClient.pushContentToProduction(item.getCatalogItemId());
630
			p.waitFor();
-
 
631
		} catch (IOException e) {
634
        } catch (TTransportException e) {
632
			GWT.log("Not able to update content on production");
635
            logger.error("Error while establishing connection to the content server", e);
633
			e.printStackTrace();
-
 
634
			return "Error generating content. Prices updated successfully.";
636
            return "Error generating content. Prices updated successfully.";
635
		} catch (InterruptedException e) {
637
        } catch (TException e) {
636
			GWT.log("Not able to update content on production");
638
            logger.error("Error while pushing content to production", e);
637
			e.printStackTrace();
-
 
638
			return "Error generating content. Prices updated successfully.";
639
            return "Error generating content. Prices updated successfully.";
639
		} catch (ConfigException e) {
640
        } catch (ContentServiceException e) {
640
            e.printStackTrace();
641
            logger.error("Error while pushing content to production", e);
641
            return "Error getting content script path";
642
            return "Error generating content. Prices updated successfully.";
642
        }*/
643
        }
-
 
644
        
643
        return "Prices updated and content generated successfully";
645
        return "Prices updated and content generated successfully";
644
    }
646
    }
645
    
647
    
646
    /**
648
    /**
647
     * Returns list of items with a particular status.
649
     * Returns list of items with a particular status.