Subversion Repositories SmartDukaan

Rev

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

Rev 12138 Rev 12141
Line 347... Line 347...
347
    }
347
    }
348
 
348
 
349
    public Map<String, String> getSnippets(){
349
    public Map<String, String> getSnippets(){
350
        if(results != null){
350
        if(results != null){
351
    		snippets = new HashMap<String, String>();	
351
    		snippets = new HashMap<String, String>();	
352
	    	for(String docId: results){
352
    		if(userinfo.isPrivateDealUser()) {
353
	    		if(userinfo.isPrivateDealUser()) {
353
    			for(String docId: results){
354
	    			if(dealResults.contains(docId)) {
354
	    			if(dealResults.contains(docId)) {
355
	    				String snippet = (String) SnippetCacheWrapper.getSnippet(CacheKeys.PRIVATE_DEAL_SNIPPET_KEY, docId, sourceId);
355
	    				String snippet = (String) SnippetCacheWrapper.getSnippet(CacheKeys.PRIVATE_DEAL_SNIPPET_KEY, docId, sourceId);
356
	    				if (snippet != null) {
356
	    				if (snippet != null) {
357
	    					snippets.put(docId, snippet);
357
	    					snippets.put(docId, snippet);
358
	    					continue;
358
	    					continue;
359
	    				}
359
	    				}
360
	    			}
360
	    			}
-
 
361
	    			String snippet = (String) SnippetCacheWrapper.getSnippet(CacheKeys.CATEGORY_SNIPPET_CACHE_KEY, docId, sourceId);
-
 
362
	    			if (snippet != null) {
-
 
363
	    				snippets.put(docId, snippet);
-
 
364
	    			}
361
	    		}
365
	    		} 
-
 
366
			} else {
-
 
367
				for(String docId: results){
362
	    		String snippet = (String) SnippetCacheWrapper.getSnippet(CacheKeys.CATEGORY_SNIPPET_CACHE_KEY, docId, sourceId);
368
					String snippet = (String) SnippetCacheWrapper.getSnippet(CacheKeys.CATEGORY_SNIPPET_CACHE_KEY, docId, sourceId);
363
                if (snippet != null) {
369
					if (snippet != null) {
364
                    snippets.put(docId, snippet);
370
						snippets.put(docId, snippet);
-
 
371
					}
365
                }
372
				} 
-
 
373
				
366
			}
374
			}
367
    	}
375
    	}
368
		return snippets;
376
		return snippets;
369
    }
377
    }
370
    
378