Subversion Repositories SmartDukaan

Rev

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

Rev 6856 Rev 6885
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;
5
import in.shop2020.model.v1.catalog.CatalogServiceException;
7
import in.shop2020.model.v1.catalog.CatalogServiceException;
6
import in.shop2020.serving.cache.EhcacheWrapper;
8
import in.shop2020.serving.cache.EhcacheWrapper;
7
import in.shop2020.serving.services.ContentServingService;
9
import in.shop2020.serving.services.ContentServingService;
8
import in.shop2020.serving.utils.SnippetType;
10
import in.shop2020.serving.utils.SnippetType;
9
import in.shop2020.thrift.clients.CatalogClient;
11
import in.shop2020.thrift.clients.CatalogClient;
Line 171... Line 173...
171
        	snippets.add(ContentServingService.getSnippet(SnippetType.HOME_SNIPPET, item+"", sourceId));
173
        	snippets.add(ContentServingService.getSnippet(SnippetType.HOME_SNIPPET, item+"", sourceId));
172
        }
174
        }
173
        return snippets;
175
        return snippets;
174
    }
176
    }
175
    
177
    
-
 
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
    
176
    @Override
208
    @Override
177
	public String getHeaderSnippet() {
209
	public String getHeaderSnippet() {
178
		String url = request.getQueryString();
210
		String url = request.getQueryString();
179
		if (url == null) {
211
		if (url == null) {
180
			url = "";
212
			url = "";