Subversion Repositories SmartDukaan

Rev

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

Rev 6241 Rev 6602
Line 56... Line 56...
56
		source = Utils.EXPORT_PATH + "xml/final/irmetadata_catchall.xml";
56
		source = Utils.EXPORT_PATH + "xml/final/irmetadata_catchall.xml";
57
		destination = Utils.EXPORT_PATH + "solr/irmetadata_catchall.xml";
57
		destination = Utils.EXPORT_PATH + "solr/irmetadata_catchall.xml";
58
		FileUtils.copyFile(new File(source), new File(destination));
58
		FileUtils.copyFile(new File(source), new File(destination));
59
	}
59
	}
60
	
60
	
61
	public void insertPriceInSolrData(long catalogId, String priceString) throws IOException{
61
	public void insertPriceInSolrData(long catalogId, String priceString, String availabilityString) throws IOException{
62
		String irSolrFilename = Utils.EXPORT_PATH + "xml/final/" + catalogId + "_irdata_solr.xml";
62
		String irSolrFilename = Utils.EXPORT_PATH + "xml/final/" + catalogId + "_irdata_solr.xml";
63
		String finalFile = Utils.EXPORT_PATH + "solr/" + catalogId + "_irdata_solr.xml";
63
		String finalFile = Utils.EXPORT_PATH + "solr/" + catalogId + "_irdata_solr.xml";
64
		File f = new File(irSolrFilename);
64
		File f = new File(irSolrFilename);
65
		String s = FileUtils.readFileToString(f);
65
		String s = FileUtils.readFileToString(f);
66
		s = s.replaceAll("<field name=\"F_50002\">.*</field>", priceString);
66
		s = s.replaceAll("<field name=\"F_50002\">.*</field>", priceString);
-
 
67
		s = s.replaceAll("<field name=\"F_50028\">.*</field>", availabilityString);
67
		File f1 = new File(finalFile);
68
		File f1 = new File(finalFile);
68
		FileUtils.writeStringToFile(f1, s);
69
		FileUtils.writeStringToFile(f1, s);
69
	}
70
	}
70
	
71
	
71
	/**
72
	/**