Subversion Repositories SmartDukaan

Rev

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

Rev 6848 Rev 6856
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.datalogger.EventType;
3
import in.shop2020.datalogger.EventType;
4
import in.shop2020.model.v1.catalog.CatalogService.Client;
4
import in.shop2020.model.v1.catalog.CatalogService.Client;
5
import in.shop2020.model.v1.catalog.Banner;
-
 
6
import in.shop2020.model.v1.catalog.BannerMap;
-
 
7
import in.shop2020.model.v1.catalog.CatalogServiceException;
5
import in.shop2020.model.v1.catalog.CatalogServiceException;
8
import in.shop2020.serving.cache.EhcacheWrapper;
6
import in.shop2020.serving.cache.EhcacheWrapper;
9
import in.shop2020.serving.services.ContentServingService;
7
import in.shop2020.serving.services.ContentServingService;
10
import in.shop2020.serving.utils.SnippetType;
8
import in.shop2020.serving.utils.SnippetType;
11
import in.shop2020.thrift.clients.CatalogClient;
9
import in.shop2020.thrift.clients.CatalogClient;
Line 173... Line 171...
173
        	snippets.add(ContentServingService.getSnippet(SnippetType.HOME_SNIPPET, item+"", sourceId));
171
        	snippets.add(ContentServingService.getSnippet(SnippetType.HOME_SNIPPET, item+"", sourceId));
174
        }
172
        }
175
        return snippets;
173
        return snippets;
176
    }
174
    }
177
    
175
    
178
    public List<Banner> getActiveBanners() {
-
 
179
		try {
-
 
180
			Client catalogClient = new CatalogClient().getClient();
-
 
181
    	    return catalogClient.getActiveBanners();
-
 
182
		}
-
 
183
		catch(TException e) {
-
 
184
			return null;
-
 
185
		}
-
 
186
    }
-
 
187
    
-
 
188
    public List<BannerMap> getbannermapdetails(String bannerName) {
-
 
189
    	try {
-
 
190
    	Client catalogClient = new CatalogClient().getClient();
-
 
191
    	return catalogClient.getBannerMapDetails(bannerName);
-
 
192
    	}
-
 
193
    	catch(TException e) {
-
 
194
			return null;
-
 
195
		}
-
 
196
    }
-
 
197
    
-
 
198
    public int activeBannerCount() {
-
 
199
    	try {
-
 
200
    	Client catalogClient = new CatalogClient().getClient();
-
 
201
    	return catalogClient.getActiveBanners().size();
-
 
202
    	}
-
 
203
    	catch (TException e) {
-
 
204
    		return 0;
-
 
205
    	}
-
 
206
    }
-
 
207
    
-
 
208
    @Override
176
    @Override
209
	public String getHeaderSnippet() {
177
	public String getHeaderSnippet() {
210
		String url = request.getQueryString();
178
		String url = request.getQueryString();
211
		if (url == null) {
179
		if (url == null) {
212
			url = "";
180
			url = "";