Subversion Repositories SmartDukaan

Rev

Rev 624 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 624 Rev 627
Line 5... Line 5...
5
import java.io.FileInputStream;
5
import java.io.FileInputStream;
6
import java.io.FileNotFoundException;
6
import java.io.FileNotFoundException;
7
import java.io.IOException;
7
import java.io.IOException;
8
import java.io.InputStreamReader;
8
import java.io.InputStreamReader;
9
import java.io.StringWriter;
9
import java.io.StringWriter;
10
import java.text.DateFormat;
-
 
11
import java.text.SimpleDateFormat;
10
import java.text.SimpleDateFormat;
12
import java.util.ArrayList;
11
import java.util.ArrayList;
13
import java.util.Calendar;
-
 
14
import java.util.Date;
12
import java.util.Date;
15
import java.util.HashMap;
13
import java.util.HashMap;
16
import java.util.List;
14
import java.util.List;
17
import java.util.Map;
15
import java.util.Map;
18
import java.util.Properties;
16
import java.util.Properties;
19
import java.util.Set;
-
 
20
 
-
 
21
 
17
 
22
import in.shop2020.util.Utils;
18
import in.shop2020.util.Utils;
23
 
19
 
24
import org.apache.thrift.TException;
20
import org.apache.thrift.TException;
25
import org.apache.velocity.Template;
21
import org.apache.velocity.Template;
Line 262... Line 258...
262
		Client client = null;
258
		Client client = null;
263
		
259
		
264
		try {
260
		try {
265
			catalogServiceClient = new CatalogServiceClient();
261
			catalogServiceClient = new CatalogServiceClient();
266
			client = catalogServiceClient.getClient();
262
			client = catalogServiceClient.getClient();
267
			List<Long> items = client.getBestSellersCatalogIds(1, 20, -1);
263
			List<Long> items = client.getBestSellersCatalogIds(1, 4, -1);
268
			List<String> itemList = new ArrayList<String>();
264
			List<String> itemList = new ArrayList<String>();
269
			for(Long item: items){
265
			for(Long item: items){
270
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
266
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
271
			}
267
			}
272
			context.put("itemList", itemList);
268
			context.put("itemList", itemList);
Line 290... Line 286...
290
		Client client = null;
286
		Client client = null;
291
		
287
		
292
		try {
288
		try {
293
			catalogServiceClient = new CatalogServiceClient();
289
			catalogServiceClient = new CatalogServiceClient();
294
			client = catalogServiceClient.getClient();
290
			client = catalogServiceClient.getClient();
295
			List<Long> items = client.getLatestArrivalsCatalogIds(1, 20, -1);
291
			List<Long> items = client.getLatestArrivalsCatalogIds(1,4,-1);
296
			List<String> itemList = new ArrayList<String>();
292
			List<String> itemList = new ArrayList<String>();
297
			for(Long item: items){
293
			for(Long item: items){
298
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
294
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
299
			}
295
			}
300
			context.put("itemList", itemList);
296
			context.put("itemList", itemList);
Line 318... Line 314...
318
		Client client = null;
314
		Client client = null;
319
		
315
		
320
		try {
316
		try {
321
			catalogServiceClient = new CatalogServiceClient();
317
			catalogServiceClient = new CatalogServiceClient();
322
			client = catalogServiceClient.getClient();
318
			client = catalogServiceClient.getClient();
323
			List<Long> items = client.getBestDealsCatalogIds(1, 20, -1);
319
			List<Long> items = client.getBestDealsCatalogIds(1,4,-1);
324
			List<String> itemList = new ArrayList<String>();
320
			List<String> itemList = new ArrayList<String>();
325
			for(Long item: items){
321
			for(Long item: items){
326
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
322
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
327
			}
323
			}
328
			context.put("itemList", itemList);
324
			context.put("itemList", itemList);
Line 597... Line 593...
597
		VelocityContext context = new VelocityContext();
593
		VelocityContext context = new VelocityContext();
598
		if (isLoggedIn) {
594
		if (isLoggedIn) {
599
			context.put("LOGGED_IN", "TRUE");
595
			context.put("LOGGED_IN", "TRUE");
600
			context.put("WELCOME_MESSAGE", "Hi, " + userName);
596
			context.put("WELCOME_MESSAGE", "Hi, " + userName);
601
		} else {
597
		} else {
602
			context.put("LOGGED_IN", "FALSE");
-
 
603
			context.put("WELCOME_MESSAGE", "Hi, Welcome to Shop2020");
598
			context.put("WELCOME_MESSAGE", "Hi, Welcome to Shop2020");
604
		}		
599
		}		
605
		
600
		
606
		String templateFile = "templates/header.vm";
601
		String templateFile = "templates/header.vm";
607
		
602
		
Line 686... Line 681...
686
		}
681
		}
687
		
682
		
688
		return category;
683
		return category;
689
	}
684
	}
690
 
685
 
691
	private	String getPriceDiv(long productId){
-
 
692
		CatalogServiceClient catalogServiceClient = null;
-
 
693
		Client client = null;
-
 
694
 
-
 
695
		UserContextServiceClient userServiceClient = null;
-
 
696
		in.shop2020.model.v1.user.UserContextService.Client userClient = null;
-
 
697
		try {
-
 
698
			catalogServiceClient = new CatalogServiceClient();
-
 
699
			client = catalogServiceClient.getClient();
-
 
700
 
-
 
701
			userServiceClient = new UserContextServiceClient();
-
 
702
			userClient = userServiceClient.getClient();
-
 
703
			
-
 
704
			RatingsWidget ratingsWidget = userClient.getRatings(productId, 0);
-
 
705
			Map<RatingType,Double> ratings = ratingsWidget.getRatings();
-
 
706
			//double rating_amazon = ratings.get(RatingType.AMAZON);
-
 
707
			double rating_all  = 0.0;
-
 
708
			if(ratings != null){
-
 
709
				if( ratings.get(RatingType.USER_ALL) != null){
-
 
710
					rating_all = ratings.get(RatingType.USER_ALL);
-
 
711
				}
-
 
712
			}
-
 
713
			
-
 
714
			rating_all = Math.round(rating_all);
-
 
715
			
-
 
716
			
-
 
717
			Item item = client.getItemByCatalogId(productId);
-
 
718
			Double itemPrice = item.getSellingPrice();
-
 
719
			
-
 
720
			//set velocity properties
-
 
721
			Velocity.init("velocity/velocity.properties");
-
 
722
			VelocityContext context = new VelocityContext();
-
 
723
 
-
 
724
			String templateFile = "velocity/pricediv.vm";
-
 
725
			
-
 
726
			Template template = null;
-
 
727
 
-
 
728
			// For an entity
-
 
729
			EntityContainer entContainer = 	Catalog.getInstance().getEntityContainer();
-
 
730
			
-
 
731
			ExpandedEntity expEntity = entContainer.getExpandedEntity(productId);
-
 
732
			
-
 
733
			//Utils.logger.info("expEntity=" + expEntity);
-
 
734
			
-
 
735
			String title = expEntity.getBrand() + "" + expEntity.getModelName();
-
 
736
			String categoryName = expEntity.getCategory().getLabel();
-
 
737
			
-
 
738
			Map<String,String> params = new HashMap<String, String>();
-
 
739
			params.put("TITLE", title);
-
 
740
			params.put("CATEGORY", categoryName);
-
 
741
			params.put("PRICE", itemPrice.toString());
-
 
742
			params.put("RATING_ALL", rating_all+"");
-
 
743
			params.put("PRODUCT_ID", productId+"");
-
 
744
			
-
 
745
			context.put("params", params);
-
 
746
			template = Velocity.getTemplate(templateFile);
-
 
747
			
-
 
748
			if(template != null) {
-
 
749
				StringWriter writer = new StringWriter();
-
 
750
 
-
 
751
				template.merge(context, writer);
-
 
752
				writer.flush();
-
 
753
				writer.close();
-
 
754
				
-
 
755
				System.out.println("PRICE DIV Snippet generated");
-
 
756
				
-
 
757
				return writer.toString();
-
 
758
				
-
 
759
			}
-
 
760
		} catch (ResourceNotFoundException e) {
-
 
761
			// TODO Auto-generated catch block
-
 
762
			e.printStackTrace();
-
 
763
		} catch (ParseErrorException e) {
-
 
764
			// TODO Auto-generated catch block
-
 
765
			e.printStackTrace();
-
 
766
		} catch (MethodInvocationException e) {
-
 
767
			// TODO Auto-generated catch block
-
 
768
			e.printStackTrace();
-
 
769
		} catch (InventoryServiceException e) {
-
 
770
			// TODO Auto-generated catch block
-
 
771
			e.printStackTrace();
-
 
772
		} catch (TException e) {
-
 
773
			// TODO Auto-generated catch block
-
 
774
			e.printStackTrace();
-
 
775
		} catch (IOException e) {
-
 
776
			// TODO Auto-generated catch block
-
 
777
			e.printStackTrace();
-
 
778
		} catch (Exception e) {
-
 
779
			// TODO Auto-generated catch block
-
 
780
			e.printStackTrace();
-
 
781
		}
-
 
782
	
-
 
783
		return "Price";
-
 
784
	}
-
 
785
	
-
 
786
	private	String getWidgetDiv(long productId, String userId, WidgetType widgetType, String velocityFileName, Boolean tobeusedLater){
-
 
787
		UserContextServiceClient userServiceClient = null;
-
 
788
		in.shop2020.model.v1.user.UserContextService.Client client = null;
-
 
789
		
-
 
790
		try {
-
 
791
			userServiceClient = new UserContextServiceClient();
-
 
792
			client = userServiceClient.getClient();
-
 
793
			long userID;
-
 
794
			if(userId.compareTo("") == 0){
-
 
795
				userID = 0;
-
 
796
			}else{
-
 
797
				userID = Long.parseLong(userId);
-
 
798
			}
-
 
799
			Widget widget = client.getWidget(widgetType, userID, true);
-
 
800
			
-
 
801
			Utils.logger.info("widget" + widget);
-
 
802
			
-
 
803
			List<WidgetItem> items = widget.getItems();
-
 
804
			
-
 
805
			List<Map<String, String>> itemDetails = new ArrayList<Map<String, String>>();
-
 
806
			
-
 
807
			for(WidgetItem item: items){
-
 
808
				Map<String, String> itemDetail = new HashMap<String, String>();
-
 
809
				itemDetail.put("ITEM_ID", item.getItem_id()+"");
-
 
810
				itemDetail.put("ITEM_SNIPPET", getItemSnippet(item.getItem_id()));
-
 
811
				itemDetails.add(itemDetail);
-
 
812
			}
-
 
813
			
-
 
814
			
-
 
815
			Velocity.init("velocity/velocity.properties");
-
 
816
			VelocityContext context = new VelocityContext();
-
 
817
			String templateFile = "velocity/"+velocityFileName.trim();
-
 
818
			Template template = null;
-
 
819
				
-
 
820
			
-
 
821
				
-
 
822
			context.put("itemDetails", itemDetails);
-
 
823
			template = Velocity.getTemplate(templateFile);
-
 
824
 
-
 
825
			if(template != null) {
-
 
826
				StringWriter writer = new StringWriter();
-
 
827
				template.merge(context, writer);
-
 
828
				writer.flush();
-
 
829
				writer.close();
-
 
830
				
-
 
831
				System.out.println("WIDGET DIV Snippet generated");
-
 
832
				return writer.toString();
-
 
833
				}
-
 
834
		} catch (ResourceNotFoundException e) {
-
 
835
			// TODO Auto-generated catch block
-
 
836
			e.printStackTrace();
-
 
837
		} catch (ParseErrorException e) {
-
 
838
			// TODO Auto-generated catch block
-
 
839
			e.printStackTrace();
-
 
840
		} catch (MethodInvocationException e) {
-
 
841
			// TODO Auto-generated catch block
-
 
842
			e.printStackTrace();
-
 
843
		} catch (IOException e) {
-
 
844
			// TODO Auto-generated catch block
-
 
845
			e.printStackTrace();
-
 
846
		} catch (Exception e) {
-
 
847
			// TODO Auto-generated catch block
-
 
848
			e.printStackTrace();
-
 
849
		}
-
 
850
		return "Widget";
-
 
851
	}
-
 
852
	
-
 
853
	private String getItemSnippet(long productId){
-
 
854
			String filename = Utils.EXPORT_ENTITIES_PATH + productId + File.separator + "WidgetSnippet.html";
-
 
855
			try {
-
 
856
				return FileUtils.read(filename);
-
 
857
			} catch (Exception e) {
-
 
858
				// TODO Auto-generated catch block
-
 
859
				e.printStackTrace();
-
 
860
			}
-
 
861
			return "";
-
 
862
		}
-
 
863
 
-
 
864
 
-
 
865
 
-
 
866
	private	String getWidgetDiv(long userId, WidgetType widgetType, String templateFile){
686
	private	String getWidgetDiv(long userId, WidgetType widgetType, String templateFile){
867
 
687
 
868
		UserContextServiceClient userServiceClient = null;
688
		UserContextServiceClient userServiceClient = null;
869
		in.shop2020.model.v1.user.UserContextService.Client client = null;
689
		in.shop2020.model.v1.user.UserContextService.Client client = null;
870
		Widget widget = null;
690
		Widget widget = null;
Line 1228... Line 1048...
1228
	private String getLoginDetailsHtml(long userId) {
1048
	private String getLoginDetailsHtml(long userId) {
1229
		String htmlString = "";
1049
		String htmlString = "";
1230
		VelocityContext context = new VelocityContext();
1050
		VelocityContext context = new VelocityContext();
1231
		String templateFile = "templates/logindetails.vm";
1051
		String templateFile = "templates/logindetails.vm";
1232
		String email = "";
1052
		String email = "";
1233
		UserContextServiceClient userContextServiceClient = null;
-
 
1234
		in.shop2020.model.v1.user.UserContextService.Client userClient = null;
-
 
1235
		
-
 
1236
		try{
1053
		try{
1237
			userContextServiceClient = new UserContextServiceClient();
-
 
1238
			userClient = userContextServiceClient.getClient();
-
 
1239
			email = in.shop2020.serving.utils.Utils.getEmailId(userId);
1054
			email = in.shop2020.serving.utils.Utils.getEmailId(userId);
1240
		}catch (Exception e){
1055
		}catch (Exception e){
1241
			
1056
			
1242
		}
1057
		}
1243
		context.put("email", email);
1058
		context.put("email", email);
Line 1586... Line 1401...
1586
		htmlString = getHtmlFromVelocity(templateFile, context);
1401
		htmlString = getHtmlFromVelocity(templateFile, context);
1587
		return htmlString;
1402
		return htmlString;
1588
	}
1403
	}
1589
 
1404
 
1590
 
1405
 
1591
	public Map<String, String> getShoppingCartPage_Old(long userId, boolean isSessionId, Map<String, String> params)
-
 
1592
	{
-
 
1593
		UserContextServiceClient userServiceClient = null;
-
 
1594
		in.shop2020.model.v1.user.UserContextService.Client userClient = null;
-
 
1595
		
-
 
1596
		try {
-
 
1597
			userServiceClient = new UserContextServiceClient();
-
 
1598
			userClient = userServiceClient.getClient();
-
 
1599
		
-
 
1600
			Cart cart = userClient.getCurrentCart(userId);
-
 
1601
		
-
 
1602
			List<Line> lineItems = cart.getLines();
-
 
1603
			List<Map<String,String>> items = new ArrayList<Map<String,String>>(); 
-
 
1604
		
-
 
1605
			for (Line line : lineItems) {
-
 
1606
//				long productId = getCatalogIdByItemId(line.getItemId());
-
 
1607
				long productId = line.getItemId();
-
 
1608
				Map<String, String> productDetails = getProductDetails(productId);
-
 
1609
				double mrp = getItemMrpByCatalogId(productId);
-
 
1610
				double sellingPrice = getItemSellingPriceByCatalogId(productId);
-
 
1611
				double saving = (mrp - sellingPrice)/mrp*100; 
-
 
1612
				saving = Math.round(saving);
-
 
1613
				Map<String, String> item = new HashMap<String, String>();
-
 
1614
				item.put("BRAND_NAME", productDetails.get("BRAND_NAME"));
-
 
1615
				item.put("MODEL_NAME", productDetails.get("MODEL_NAME"));
-
 
1616
				item.put("MODEL_NUMBER", productDetails.get("MODEL_NUMBER"));
-
 
1617
				item.put("ITEM_ID", line.getItemId()+"");
-
 
1618
				item.put("ITEM_QUANTITY", line.getQuantity()+"");
-
 
1619
				item.put("MRP", mrp+"");
-
 
1620
				item.put("SELLING_PRICE", sellingPrice+"");
-
 
1621
				item.put("SAVING", sellingPrice+"");
-
 
1622
				items.add(item);
-
 
1623
			}
-
 
1624
			
-
 
1625
			String templateFile = "templates/shoppingcart.vm";
-
 
1626
			VelocityContext context = new VelocityContext();	
-
 
1627
			context.put("items", items);
-
 
1628
			
-
 
1629
			String htmlString = getHtmlFromVelocity(templateFile, context);
-
 
1630
			System.out.println("My Cart Snippet generated" + htmlString);
-
 
1631
 
-
 
1632
			Map<String,String> htmlSnippet = new HashMap<String, String>();
-
 
1633
			htmlSnippet.put("SHOPPING_CART", htmlString);
-
 
1634
 
-
 
1635
			return htmlSnippet;
-
 
1636
 
-
 
1637
		} catch (ShoppingCartException e) {
-
 
1638
			// TODO Auto-generated catch block
-
 
1639
			e.printStackTrace();
-
 
1640
		}catch (Exception e) {
-
 
1641
			// TODO Auto-generated catch block
-
 
1642
			e.printStackTrace();
-
 
1643
		}
-
 
1644
 
-
 
1645
		return null;
-
 
1646
	}
-
 
1647
	
-
 
1648
	
-
 
1649
	public long getCatalogIdByItemId(long itemId){
1406
	public long getCatalogIdByItemId(long itemId){
1650
		CatalogServiceClient catalogServiceClient = null;
1407
		CatalogServiceClient catalogServiceClient = null;
1651
		Client client = null;
1408
		Client client = null;
1652
		
1409
		
1653
		try {
1410
		try {
Line 1665... Line 1422...
1665
			// TODO Auto-generated catch block
1422
			// TODO Auto-generated catch block
1666
			e.printStackTrace();
1423
			e.printStackTrace();
1667
		}
1424
		}
1668
		return -1;
1425
		return -1;
1669
	}
1426
	}
1670
	
-
 
1671
//	private	void addItemToCart(long catalogItemId, long userId) throws Exception{
-
 
1672
//		UserContextServiceClient userContextServiceClient = null;
-
 
1673
//		in.shop2020.model.v1.user.UserContextService.Client userClient = null;
-
 
1674
//		userContextServiceClient = new UserContextServiceClient();
-
 
1675
//		userClient = userContextServiceClient.getClient();
-
 
1676
//
-
 
1677
//		ShoppingCartClient shoppingCartClient = null;
-
 
1678
//		in.shop2020.model.v1.shoppingcart.ShoppingCartService.Client cartClient = null;
-
 
1679
//		shoppingCartClient = new ShoppingCartClient();
-
 
1680
//		cartClient = shoppingCartClient.getClient();
-
 
1681
//		
-
 
1682
//		Cart cart = cartClient.getCurrentCart(userId);
-
 
1683
//		//if user is logged in create  new cart
-
 
1684
//		//if( userClient.getState(userId, false).isIsLoggedIn()){
-
 
1685
//		if(cart == null){
-
 
1686
//			cartClient.createCart(userId);
-
 
1687
//			cart = cartClient.getCurrentCart(userId);
-
 
1688
//		}
-
 
1689
//		cartClient.addItemToCart(cart.getId(), catalogItemId, 1);
-
 
1690
//	}
-
 
1691
 
-
 
1692
		//userClient.getState(userId, isSessionId);
-
 
1693
		
1427
		
1694
//		TransactionServiceClient transactionServiceClient = null;
-
 
1695
//		in.shop2020.model.v1.order.TransactionService.Client client = null;
-
 
1696
//		
-
 
1697
//		Cart cart = cartClient.getCurrentCart(userId);
-
 
1698
//		List<LineItem> lineItems = cart.getLines();
-
 
1699
//		
-
 
1700
//		LineItem ln = lineItems.get(0);
-
 
1701
//		ln.getItemId();
-
 
1702
//		ln.getId();
-
 
1703
//		ln.getQuantity();
-
 
1704
//		ln.getStatusMessage();
-
 
1705
//		long productId = 10;
-
 
1706
//		
-
 
1707
//		Cart cart = cartClient.getCurrentCart(0);
-
 
1708
//		List<LineItem> lineItems = cart.getLines();
-
 
1709
//		LineItem ln = lineItems.get(0);
-
 
1710
//		ln.getItemId();
-
 
1711
//		ln.getId();
-
 
1712
//		
-
 
1713
//		ln.getStatusMessage();
-
 
1714
//		
-
 
1715
	
-
 
1716
	private	Map<String,String> getProductDetails(long productId){
-
 
1717
		Map<String, String> productDetails = new HashMap<String, String>();
-
 
1718
		
-
 
1719
		EntityContainer entContainer = 	Catalog.getInstance().getEntityContainer();
-
 
1720
		ExpandedEntity expEntity;
-
 
1721
		try {
-
 
1722
			expEntity = entContainer.getExpandedEntity(productId);
-
 
1723
			
-
 
1724
			productDetails.put("BRAND_NAME", expEntity.getBrand());
-
 
1725
			productDetails.put("MODEL_NUMBER", expEntity.getModelNumber());
-
 
1726
			productDetails.put("MODEL_NAME", expEntity.getModelName());
-
 
1727
			productDetails.put("CATEGORY_ID", expEntity.getCategoryID() + "");
-
 
1728
			productDetails.put("CATEGORY_NAME", expEntity.getCategory().getLabel());
-
 
1729
			productDetails.put("INTRODUCTION_TEXT", expEntity.getSlide(130001).getFreeformContent().getFreeformText());
-
 
1730
			return productDetails;
-
 
1731
//			expEntity.getBrand();
-
 
1732
//			expEntity.getModelNumber();
-
 
1733
//			expEntity.getModelName();
-
 
1734
//			expEntity.getCategoryID();
-
 
1735
//			expEntity.getCategory().getLabel();
-
 
1736
//			expEntity.getSlide(130001).getFreeformContent().getFreeformText();
-
 
1737
		} catch (Exception e) {
-
 
1738
			// TODO Auto-generated catch block
-
 
1739
			e.printStackTrace();
-
 
1740
		}
-
 
1741
		
-
 
1742
		return null;
-
 
1743
	}
-
 
1744
 
-
 
1745
	
-
 
1746
	private	String getMyOrdersDiv(long userId){
-
 
1747
		TransactionServiceClient transactionServiceClient = null;
-
 
1748
		in.shop2020.model.v1.order.TransactionService.Client client = null;
-
 
1749
		String htmlString = new String();
-
 
1750
			try {
-
 
1751
				transactionServiceClient = new TransactionServiceClient();
-
 
1752
				client = transactionServiceClient.getClient();
-
 
1753
				List<Transaction> transactions = client.getTransactionsForCustomer(userId, 0, 0, null);
-
 
1754
				
-
 
1755
				String templateFile = "templates/myorders.vm";
-
 
1756
				VelocityContext context = new VelocityContext();	
-
 
1757
				context.put("transactions", transactions);
-
 
1758
				if(!transactions.isEmpty()){
-
 
1759
					Transaction tn = transactions.get(0);
-
 
1760
					java.sql.Date d = new java.sql.Date(tn.getCreatedOn());
-
 
1761
					System.out.println("Date is" + d.toString());
-
 
1762
				}
-
 
1763
				htmlString = getHtmlFromVelocity(templateFile, context);
-
 
1764
				System.out.println("Orders Info Snippet generated" + htmlString);
-
 
1765
				return htmlString;
-
 
1766
 
-
 
1767
			} catch (UserContextException e) {
-
 
1768
				// TODO Auto-generated catch block
-
 
1769
				e.printStackTrace();
-
 
1770
			} catch (Exception e) {
-
 
1771
				// TODO Auto-generated catch block
-
 
1772
				e.printStackTrace();
-
 
1773
			}
-
 
1774
			return "MY_ORDERS";
-
 
1775
	}
-
 
1776
	
-
 
1777
	public String getHtmlFromVelocity(String templateFile, VelocityContext context){
1428
	public String getHtmlFromVelocity(String templateFile, VelocityContext context){
1778
		Properties p = new Properties();
1429
		Properties p = new Properties();
1779
		p.setProperty("resource.loader", "class");
1430
		p.setProperty("resource.loader", "class");
1780
		p.setProperty("class.resource.loader.class",
1431
		p.setProperty("class.resource.loader.class",
1781
		"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
1432
		"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");