Subversion Repositories SmartDukaan

Rev

Rev 3169 | Rev 3242 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3169 Rev 3185
Line 52... Line 52...
52
	@Action("/")
52
	@Action("/")
53
    public String index() throws SecurityException, IOException {
53
    public String index() throws SecurityException, IOException {
54
    	logger.debug("userinfo:" + userinfo.toString());
54
    	logger.debug("userinfo:" + userinfo.toString());
55
    	logger.info("Rendering the home page");
55
    	logger.info("Rendering the home page");
56
    	setSnippets();
56
    	setSnippets();
57
    	DataLogger.logData(EventType.HOME_PAGE, session.getId(), userinfo.getUserId(), userinfo.getEmail());
57
    	DataLogger.logData(EventType.HOME_PAGE, getSessionId(), userinfo.getUserId(), userinfo.getEmail());
58
    	return "index";
58
    	return "index";
59
    }
59
    }
60
 
60
 
61
    /**
61
    /**
62
     * Renders the home page but always loads the snippets for best deals, best
62
     * Renders the home page but always loads the snippets for best deals, best
Line 142... Line 142...
142
        }
142
        }
143
        
143
        
144
        bestDealSnippets = getSnippets(bestDealCatalogIds);
144
        bestDealSnippets = getSnippets(bestDealCatalogIds);
145
        bestSellerSnippets = getSnippets(bestSellerCatalogIds.subList(0, bestSellerCount));
145
        bestSellerSnippets = getSnippets(bestSellerCatalogIds.subList(0, bestSellerCount));
146
        latestArrivalSnippets = getSnippets(latestArrivalCatalogIds.subList(0, latestArrivalCount));
146
        latestArrivalSnippets = getSnippets(latestArrivalCatalogIds.subList(0, latestArrivalCount));
-
 
147
        if (!bestDealSnippets.isEmpty() && !bestSellerSnippets.isEmpty() && !latestArrivalSnippets.isEmpty()) {
147
        homeSnippetCache.put(BEST_DEALS_CACHE_KEY, bestDealSnippets);
148
            homeSnippetCache.put(BEST_DEALS_CACHE_KEY, bestDealSnippets);
148
        homeSnippetCache.put(BEST_SELLERS_CACHE_KEY, bestSellerSnippets);
149
            homeSnippetCache.put(BEST_SELLERS_CACHE_KEY, bestSellerSnippets);
149
        homeSnippetCache.put(LATEST_ARRIVALS_CACHE_KEY, latestArrivalSnippets);
150
            homeSnippetCache.put(LATEST_ARRIVALS_CACHE_KEY, latestArrivalSnippets);
-
 
151
        }
150
    }
152
    }
151
	
153
	
152
    /**
154
    /**
153
     * Returns a list of snippets to be used on the home page corresponding to
155
     * Returns a list of snippets to be used on the home page corresponding to
154
     * the given catalog ids. The snippets are in the same order as the ids in
156
     * the given catalog ids. The snippets are in the same order as the ids in