Subversion Repositories SmartDukaan

Rev

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

Rev 545 Rev 550
Line 589... Line 589...
589
	
589
	
590
	public String getSearchBarHtml(long itemCounts, long categoryId) {
590
	public String getSearchBarHtml(long itemCounts, long categoryId) {
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
		
595
		params.put("ITEM_COUNT", itemCounts+"");
595
		context.put("itemCount", itemCounts+"");
596
		params.put("CATEGORY_ID", categoryId+"");
596
		context.put("categoryId", categoryId+"");
597
		context.put("params", params );
597
		
598
		htmlString = getHtmlFromVelocity(templateFile, context);
598
		htmlString = getHtmlFromVelocity(templateFile, context);
599
		return htmlString;
599
		return htmlString;
600
	}
600
	}
601
 
601
 
602
 
602
 
603
 
603
 
604
	public String getHeaderHtml(long userId, boolean isSessionId, String  userName) {
604
	public String getHeaderHtml(long userId, boolean isSessionId, String  userName) {
605
		String htmlString = "";
605
		String htmlString = "";
606
		Map<String,String> params = new HashMap<String, String>();
606
		Map<String,String> params = new HashMap<String, String>();
-
 
607
		VelocityContext context = new VelocityContext();
607
		if(isSessionId){
608
		if(isSessionId){
608
			params.put("LOGGED_IN", "FALSE");
609
			context.put("LOGGED_IN", "FALSE");
609
			params.put("WELCOME_MESSAGE", "Hi, Welcome to Shop2020");
610
			context.put("WELCOME_MESSAGE", "Hi, Welcome to Shop2020");
610
		}else
611
		}else
611
		{
612
		{
612
			params.put("LOGGED_IN", "TRUE");
613
			context.put("LOGGED_IN", "TRUE");
613
			params.put("WELCOME_MESSAGE", "Hi " + userName);
614
			context.put("WELCOME_MESSAGE", "Hi, userName");
614
		}
615
		}
615
		
616
		
616
		VelocityContext context = new VelocityContext();
-
 
-
 
617
		
617
		String templateFile = "templates/header.vm";
618
		String templateFile = "templates/header.vm";
618
		context.put("params", params);
619
		
619
		htmlString = getHtmlFromVelocity(templateFile, context);
620
		htmlString = getHtmlFromVelocity(templateFile, context);
620
		return htmlString;
621
		return htmlString;
621
	}
622
	}
622
 
623
 
623
 
624