Subversion Repositories SmartDukaan

Rev

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

Rev 968 Rev 974
Line 346... Line 346...
346
		String templateFile = "templates/socialutils.vm";
346
		String templateFile = "templates/socialutils.vm";
347
		context.put("params", params);
347
		context.put("params", params);
348
		htmlString = getHtmlFromVelocity(templateFile, context);
348
		htmlString = getHtmlFromVelocity(templateFile, context);
349
		return htmlString;
349
		return htmlString;
350
	}
350
	}
-
 
351
	
-
 
352
	public String getPageTitleHtml(long productId) {
-
 
353
		StringBuilder htmlString = new StringBuilder();
-
 
354
		String filename = Utils.EXPORT_ENTITIES_PATH + productId + File.separator + "CategoryTitleSnippet.html";
-
 
355
		File f = new File(filename);
-
 
356
		
-
 
357
		
-
 
358
		FileInputStream fis = null;
-
 
359
		try {
-
 
360
			fis = new FileInputStream(f);
-
 
361
			BufferedReader br = new BufferedReader(new InputStreamReader(fis));
-
 
362
			String line;
-
 
363
			while((line = br.readLine()) != null){
-
 
364
				htmlString.append(line+"\n");
-
 
365
			}
-
 
366
		} catch (FileNotFoundException e) {
-
 
367
			// TODO Auto-generated catch block
-
 
368
			e.printStackTrace();
-
 
369
		} catch (IOException e) {
-
 
370
			// TODO Auto-generated catch block
-
 
371
			e.printStackTrace();
-
 
372
		}
-
 
373
		finally {
-
 
374
			if(fis != null) {
-
 
375
				try {
-
 
376
					fis.close();
-
 
377
				} catch (IOException e) {
-
 
378
					// TODO Auto-generated catch block
-
 
379
					e.printStackTrace();
-
 
380
				}
-
 
381
			}
-
 
382
		}
-
 
383
		
-
 
384
		return htmlString.toString();
-
 
385
	}
-
 
386
	
-
 
387
	public String getPageMetaDescriptionHtml(long productId) {
-
 
388
		StringBuilder htmlString = new StringBuilder();
-
 
389
		String filename = Utils.EXPORT_ENTITIES_PATH + productId + File.separator + "CategoryMetaDescriptionSnippet.html";
-
 
390
		File f = new File(filename);
-
 
391
		
-
 
392
		
-
 
393
		FileInputStream fis = null;
-
 
394
		try {
-
 
395
			fis = new FileInputStream(f);
-
 
396
			BufferedReader br = new BufferedReader(new InputStreamReader(fis));
-
 
397
			String line;
-
 
398
			while((line = br.readLine()) != null){
-
 
399
				htmlString.append(line+"\n");
-
 
400
			}
-
 
401
		} catch (FileNotFoundException e) {
-
 
402
			// TODO Auto-generated catch block
-
 
403
			e.printStackTrace();
-
 
404
		} catch (IOException e) {
-
 
405
			// TODO Auto-generated catch block
-
 
406
			e.printStackTrace();
-
 
407
		}
-
 
408
		finally {
-
 
409
			if(fis != null) {
-
 
410
				try {
-
 
411
					fis.close();
-
 
412
				} catch (IOException e) {
-
 
413
					// TODO Auto-generated catch block
-
 
414
					e.printStackTrace();
-
 
415
				}
-
 
416
			}
-
 
417
		}
-
 
418
		
-
 
419
		return htmlString.toString();
-
 
420
	}
351
 
421
	
-
 
422
	public String getPageMetaKeywordsHtml(long productId) {
-
 
423
		StringBuilder htmlString = new StringBuilder();
-
 
424
		String filename = Utils.EXPORT_ENTITIES_PATH + productId + File.separator + "CategoryMetaKeywordsSnippet.html";
-
 
425
		File f = new File(filename);
-
 
426
		
-
 
427
		
-
 
428
		FileInputStream fis = null;
-
 
429
		try {
-
 
430
			fis = new FileInputStream(f);
-
 
431
			BufferedReader br = new BufferedReader(new InputStreamReader(fis));
-
 
432
			String line;
-
 
433
			while((line = br.readLine()) != null){
-
 
434
				htmlString.append(line+"\n");
-
 
435
			}
-
 
436
		} catch (FileNotFoundException e) {
-
 
437
			// TODO Auto-generated catch block
-
 
438
			e.printStackTrace();
-
 
439
		} catch (IOException e) {
-
 
440
			// TODO Auto-generated catch block
-
 
441
			e.printStackTrace();
-
 
442
		}
-
 
443
		finally {
-
 
444
			if(fis != null) {
-
 
445
				try {
-
 
446
					fis.close();
-
 
447
				} catch (IOException e) {
-
 
448
					// TODO Auto-generated catch block
-
 
449
					e.printStackTrace();
-
 
450
				}
-
 
451
			}
-
 
452
		}
-
 
453
		
-
 
454
		return htmlString.toString();
-
 
455
	}
352
 
456
 
353
	public String getMainMenuHtml() {
457
	public String getMainMenuHtml() {
354
		String htmlString = "";
458
		String htmlString = "";
355
		VelocityContext context = new VelocityContext();
459
		VelocityContext context = new VelocityContext();
356
		String templateFile = "templates/mainmenu.vm";
460
		String templateFile = "templates/mainmenu.vm";