Subversion Repositories SmartDukaan

Rev

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

Rev 11686 Rev 11687
Line 93... Line 93...
93
				EhcacheWrapper<String, Object> showcasePageSnippetsCache = new EhcacheWrapper<String, Object>(
93
				EhcacheWrapper<String, Object> showcasePageSnippetsCache = new EhcacheWrapper<String, Object>(
94
						EhcacheWrapper.SHOWCASE_PAGE_SNIPPET_CACHE_NAME, CacheManager.create());
94
						EhcacheWrapper.SHOWCASE_PAGE_SNIPPET_CACHE_NAME, CacheManager.create());
95
				if(sourceId == -1){
95
				if(sourceId == -1){
96
					this.snippets = (List<String>)showcasePageSnippetsCache.get(SHOWCASE_PRIVATE_DEALS_CACHE_KEY + beginIndex);
96
					this.snippets = (List<String>)showcasePageSnippetsCache.get(SHOWCASE_PRIVATE_DEALS_CACHE_KEY + beginIndex);
97
					this.totalItems = (Long)showcasePageSnippetsCache.get(SHOWCASE_PRIVATE_DEALS_COUNT_CACHE_KEY);
97
					this.totalItems = (Long)showcasePageSnippetsCache.get(SHOWCASE_PRIVATE_DEALS_COUNT_CACHE_KEY);
98
					if(getCurrentPage() > getTotalPages()){
-
 
99
						log.info("Redirecting.");
-
 
100
						redirectUrl = "/private-deals/1";
-
 
101
						return new DefaultHttpHeaders("redirect");
-
 
102
					}
-
 
103
					if(this.snippets != null && !this.snippets.isEmpty() && this.totalItems > 0) {
98
					if(this.snippets != null && !this.snippets.isEmpty() && this.totalItems > 0) {
-
 
99
						if(getCurrentPage() > getTotalPages()){
-
 
100
							log.info("Redirecting.");
-
 
101
							redirectUrl = "/private-deals/1";
-
 
102
							return new DefaultHttpHeaders("redirect");
-
 
103
						}
104
						log.info("Using Cache.");
104
						log.info("Using Cache.");
105
						return new DefaultHttpHeaders("show");
105
						return new DefaultHttpHeaders("show");
106
					}
106
					}
107
				}
107
				}
108
				log.info("Getting private deals from snippets.");
108
				log.info("Getting private deals from snippets.");