| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| 3 |
import java.io.ByteArrayInputStream;
|
3 |
import java.io.ByteArrayInputStream;
|
| 4 |
import java.io.ByteArrayOutputStream;
|
4 |
import java.io.ByteArrayOutputStream;
|
| 5 |
import java.io.ObjectInputStream;
|
5 |
import java.io.ObjectInputStream;
|
| 6 |
import java.io.ObjectOutputStream;
|
6 |
import java.io.ObjectOutputStream;
|
| 7 |
import java.util.List;
|
- |
|
| 8 |
|
7 |
|
| 9 |
import in.shop2020.config.ConfigException;
|
8 |
import in.shop2020.config.ConfigException;
|
| 10 |
import in.shop2020.model.v1.catalog.Item;
|
9 |
import in.shop2020.model.v1.catalog.Item;
|
| 11 |
import in.shop2020.model.v1.catalog.InventoryService.Client;
|
10 |
import in.shop2020.model.v1.catalog.InventoryService.Client;
|
| 12 |
import in.shop2020.model.v1.order.LineItem;
|
- |
|
| 13 |
import in.shop2020.model.v1.order.Order;
|
- |
|
| 14 |
import in.shop2020.model.v1.order.Transaction;
|
- |
|
| 15 |
import in.shop2020.model.v1.user.Cart;
|
- |
|
| 16 |
|
- |
|
| 17 |
import in.shop2020.model.v1.user.Line;
|
- |
|
| 18 |
import in.shop2020.model.v1.user.Sex;
|
- |
|
| 19 |
import in.shop2020.model.v1.user.ShoppingCartException;
|
- |
|
| 20 |
import in.shop2020.model.v1.user.User;
|
- |
|
| 21 |
import in.shop2020.model.v1.user.UserContextException;
|
- |
|
| 22 |
import in.shop2020.model.v1.user.WidgetException;
|
- |
|
| 23 |
import in.shop2020.thrift.clients.CatalogServiceClient;
|
11 |
import in.shop2020.thrift.clients.CatalogServiceClient;
|
| 24 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
- |
|
| 25 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
- |
|
| 26 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
12 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
| 27 |
|
13 |
|
| 28 |
import org.apache.log4j.Logger;
|
- |
|
| 29 |
import org.apache.thrift.TException;
|
- |
|
| 30 |
|
- |
|
| 31 |
public class Utils {
|
14 |
public class Utils {
|
| 32 |
private static Logger log = Logger.getLogger(Class.class);
|
- |
|
| 33 |
|
- |
|
| 34 |
public static final String EXPORT_ENTITIES_PATH = getExportPath();
|
15 |
public static final String EXPORT_ENTITIES_PATH = getExportPath();
|
| 35 |
|
16 |
|
| 36 |
private static String getExportPath(){
|
17 |
private static String getExportPath(){
|
| 37 |
String exportPath=null;
|
18 |
String exportPath=null;
|
| 38 |
ConfigClient client = ConfigClient.getClient();
|
19 |
ConfigClient client = ConfigClient.getClient();
|
| 39 |
try{
|
20 |
try{
|
| 40 |
exportPath = client.get("export_entities_path");
|
21 |
exportPath = client.get("export_entities_path");
|
| 41 |
}catch(ConfigException ce){
|
22 |
}catch(ConfigException ce){
|
| 42 |
ce.printStackTrace();
|
23 |
ce.printStackTrace();
|
| 43 |
//exportPath = "/var/lib/tomcat6/webapps/export/html/entities/";
|
24 |
exportPath = "/var/lib/tomcat6/webapps/export/html/entities/";
|
| 44 |
}
|
25 |
}
|
| 45 |
log.error("######################################################################");
|
- |
|
| 46 |
log.error("######################################################################");
|
- |
|
| 47 |
log.error("Export path is : " + exportPath);
|
- |
|
| 48 |
log.error("######################################################################");
|
- |
|
| 49 |
log.error("######################################################################");
|
- |
|
| 50 |
return exportPath;
|
26 |
return exportPath;
|
| 51 |
}
|
27 |
}
|
| 52 |
|
28 |
|
| 53 |
public static double getItemPrice(long itemId){
|
29 |
public static double getItemPrice(long itemId){
|
| 54 |
CatalogServiceClient catalogServiceClient = null;
|
30 |
CatalogServiceClient catalogServiceClient = null;
|