Subversion Repositories SmartDukaan

Rev

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

Rev 7279 Rev 7336
Line 344... Line 344...
344
            boolean sourceOnce = true;
344
            boolean sourceOnce = true;
345
            for(String domainPath : DOMAINPATHS){
345
            for(String domainPath : DOMAINPATHS){
346
            	String domainName = domainPath;
346
            	String domainName = domainPath;
347
            	String pathName = domainPath.split("\\.")[0].split(":")[0];
347
            	String pathName = domainPath.split("\\.")[0].split(":")[0];
348
            	//Special check for store.
348
            	//Special check for store.
349
            	if(!pathName.equals("store") || isStoreItem(items)){
-
 
350
	            	minPrice = priceInserter.insertPriceInHtml(items, entityId,
349
            	minPrice = priceInserter.insertPriceInHtml(items, entityId,
351
	            			domainName, Utils.EXPORT_PATH + "html/entities-" +  pathName + "/", null);
350
            			domainName, Utils.EXPORT_PATH + "html/entities-" +  pathName + "/", null);
352
	            	if(domainOnce){
351
            	if(domainOnce){
353
	            		priceString.append("<field name=\"F_50002\">" + minPrice + "</field>");
352
            		priceString.append("<field name=\"F_50002\">" + minPrice + "</field>");
354
	            		availabilityString.append("<field name=\"F_50028\">" + availability + "</field>");
353
            		availabilityString.append("<field name=\"F_50028\">" + availability + "</field>");
355
	            		if(entityTags.containsKey(entityId)) {
354
            		if(entityTags.containsKey(entityId)) {
356
	            			List<String> tags = entityTags.get(entityId);
355
            			List<String> tags = entityTags.get(entityId);
357
	            			for(String tag: tags){
356
            			for(String tag: tags){
358
	            				availabilityString.append("\n<field name=\"F_50029\">" + tag + "</field>");
357
            				availabilityString.append("\n<field name=\"F_50029\">" + tag + "</field>");
359
	            			}
358
            			}
360
	            		}
359
            		}
361
	            		if(popularityMap.containsKey(entityId)) {
360
            		if(popularityMap.containsKey(entityId)) {
362
	            			availabilityString.append("\n<field name=\"F_50030\">" + popularityMap.get(entityId) + "</field>");
361
            			availabilityString.append("\n<field name=\"F_50030\">" + popularityMap.get(entityId) + "</field>");
363
	            		}else {
362
            		}else {
364
	            			availabilityString.append("\n<field name=\"F_50030\">" + "0" + "</field>");
363
            			availabilityString.append("\n<field name=\"F_50030\">" + "0" + "</field>");
365
	            		}
364
            		}
366
	            		domainOnce = false;
365
            		domainOnce = false;
367
	            	}
366
            	}
368
	            	if(sources != null){
367
            	if(sources != null){
369
	            		for (Source source : sources) {
368
            		for (Source source : sources) {
370
	                        minPrice = priceInserter.insertPriceInHtml(items, entityId,
369
                        minPrice = priceInserter.insertPriceInHtml(items, entityId,
371
	                                domainName, Utils.EXPORT_PATH + "html/entities-" + pathName + "/",
370
                                domainName, Utils.EXPORT_PATH + "html/entities-" + pathName + "/",
372
	                                source);
371
                                source);
373
	                        if(sourceOnce){
372
                        if(sourceOnce){
374
	                        	priceString.append("<field name=\"F_50002_"
373
                        	priceString.append("<field name=\"F_50002_"
375
	                                + source.getId() + "\">" + minPrice + "</field>");
374
                                + source.getId() + "\">" + minPrice + "</field>");
376
	                        }
375
                        }
377
	            		}
376
            		}
378
	            		sourceOnce = false;
377
            		sourceOnce = false;
379
	            	}
-
 
380
            	}
378
            	}
381
            }
379
            }
382
 
380
 
383
            priceInserter.insertPriceInSolrData(entityId,
381
            priceInserter.insertPriceInSolrData(entityId,
384
                    priceString.toString(), availabilityString.toString());
382
                    priceString.toString(), availabilityString.toString());