Subversion Repositories SmartDukaan

Rev

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

Rev 536 Rev 545
Line 276... Line 276...
276
		Client client = null;
276
		Client client = null;
277
		
277
		
278
		try {
278
		try {
279
			catalogServiceClient = new CatalogServiceClient();
279
			catalogServiceClient = new CatalogServiceClient();
280
			client = catalogServiceClient.getClient();
280
			client = catalogServiceClient.getClient();
281
			List<Long> items = client.getBestSellers();
281
			List<Long> items = client.getBestSellers(1, 20);
282
			List<String> itemList = new ArrayList<String>();
282
			List<String> itemList = new ArrayList<String>();
283
			for(Long item: items){
283
			for(Long item: items){
284
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
284
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
285
			}
285
			}
286
			context.put("itemList", itemList);
286
			context.put("itemList", itemList);
Line 304... Line 304...
304
		Client client = null;
304
		Client client = null;
305
		
305
		
306
		try {
306
		try {
307
			catalogServiceClient = new CatalogServiceClient();
307
			catalogServiceClient = new CatalogServiceClient();
308
			client = catalogServiceClient.getClient();
308
			client = catalogServiceClient.getClient();
309
			List<Long> items = client.getLatestArrivals();
309
			List<Long> items = client.getLatestArrivals(1,20);
310
			List<String> itemList = new ArrayList<String>();
310
			List<String> itemList = new ArrayList<String>();
311
			for(Long item: items){
311
			for(Long item: items){
312
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
312
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
313
			}
313
			}
314
			context.put("itemList", itemList);
314
			context.put("itemList", itemList);
Line 332... Line 332...
332
		Client client = null;
332
		Client client = null;
333
		
333
		
334
		try {
334
		try {
335
			catalogServiceClient = new CatalogServiceClient();
335
			catalogServiceClient = new CatalogServiceClient();
336
			client = catalogServiceClient.getClient();
336
			client = catalogServiceClient.getClient();
337
			List<Long> items = client.getBestDeals();
337
			List<Long> items = client.getBestDeals(1,20);
338
			List<String> itemList = new ArrayList<String>();
338
			List<String> itemList = new ArrayList<String>();
339
			for(Long item: items){
339
			for(Long item: items){
340
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
340
				itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
341
			}
341
			}
342
			context.put("itemList", itemList);
342
			context.put("itemList", itemList);
Line 591... Line 591...
591
		String htmlString = "";
591
		String htmlString = "";
592
		VelocityContext context = new VelocityContext();
592
		VelocityContext context = new VelocityContext();
593
		String templateFile = "templates/searchbar.vm";
593
		String templateFile = "templates/searchbar.vm";
594
		Map<String, String> params = new HashMap<String, String>();
594
		Map<String, String> params = new HashMap<String, String>();
595
		params.put("ITEM_COUNT", itemCounts+"");
595
		params.put("ITEM_COUNT", itemCounts+"");
-
 
596
		params.put("CATEGORY_ID", categoryId+"");
596
		context.put("params", params );
597
		context.put("params", params );
597
		htmlString = getHtmlFromVelocity(templateFile, context);
598
		htmlString = getHtmlFromVelocity(templateFile, context);
598
		return htmlString;
599
		return htmlString;
599
	}
600
	}
600
 
601