Subversion Repositories SmartDukaan

Rev

Rev 90 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 90 Rev 91
Line 24... Line 24...
24
import in.shop2020.metamodel.util.ExpandedFeature;
24
import in.shop2020.metamodel.util.ExpandedFeature;
25
import in.shop2020.metamodel.util.ExpandedFeatureDefinition;
25
import in.shop2020.metamodel.util.ExpandedFeatureDefinition;
26
import in.shop2020.metamodel.util.ExpandedSlide;
26
import in.shop2020.metamodel.util.ExpandedSlide;
27
 
27
 
28
import java.util.ArrayList;
28
import java.util.ArrayList;
-
 
29
import java.util.HashMap;
29
import java.util.List;
30
import java.util.List;
30
import java.util.Map;
31
import java.util.Map;
31
 
32
 
32
import org.apache.commons.lang.ArrayUtils;
33
import org.apache.commons.lang.ArrayUtils;
33
import org.apache.commons.lang.StringEscapeUtils;
34
import org.apache.commons.lang.StringEscapeUtils;
Line 54... Line 55...
54
	private String[] xmlIndentation = {"", "    ", "        ", "            ", 
55
	private String[] xmlIndentation = {"", "    ", "        ", "            ", 
55
			"                "};
56
			"                "};
56
 
57
 
57
	private String[] xmlTabIndentation = {"", "\t", "\t\t", "\t\t\t", 
58
	private String[] xmlTabIndentation = {"", "\t", "\t\t", "\t\t\t", 
58
			"\t\t\t\t", "\t\t\t\t\t", "\t\t\t\t\t\t"};
59
			"\t\t\t\t", "\t\t\t\t\t", "\t\t\t\t\t\t"};
-
 
60
 
-
 
61
	private Map<Long, List<String>> facetIDFacetValues = 
-
 
62
		new HashMap<Long, List<String>>();
59
	
63
	
60
	/**
64
	/**
61
	 * @param args
65
	 * @param args
62
	 * @throws Exception 
66
	 * @throws Exception 
63
	 */
67
	 */
Line 420... Line 424...
420
		Utils.info(irDataXML);
424
		Utils.info(irDataXML);
421
		
425
		
422
		// Write it to file
426
		// Write it to file
423
		String irDataFilename = Utils.EXPORT_IR_PATH + "irdata.xml";
427
		String irDataFilename = Utils.EXPORT_IR_PATH + "irdata.xml";
424
		DBUtils.store(irDataXML, irDataFilename);
428
		DBUtils.store(irDataXML, irDataFilename);
-
 
429
		
-
 
430
		// Store facet values
-
 
431
		String facetValuesFilename = Utils.ENTITIES_DB_PATH + "facetvalues.ser";
-
 
432
		
-
 
433
		Utils.info("this.facetIDFacetValues=" + this.facetIDFacetValues);
-
 
434
		DBUtils.store(this.facetIDFacetValues, facetValuesFilename);
425
	}
435
	}
426
	
436
	
427
	/**
437
	/**
428
	 * 
438
	 * 
429
	 * @param borrowedSlides
439
	 * @param borrowedSlides
Line 704... Line 714...
704
			// Execute Python script
714
			// Execute Python script
705
			jw.executeRule();
715
			jw.executeRule();
706
		}
716
		}
707
		
717
		
708
		
718
		
709
		// Parse returned Python list
-
 
710
		List<Object> values = (List<Object>)jw.getValues();
719
		List<Object> values = (List<Object>)jw.getValues();
711
		Utils.info("values=" + values);
720
		Utils.info("values=" + values);
712
		
721
		
-
 
722
		// Append to facet values
-
 
723
		long facetDefID = expFacetRuleDef.getFacetDefinitionID();
-
 
724
		Utils.info("facetDefID=" + facetDefID);
-
 
725
		
-
 
726
		List<String> facetValues = this.facetIDFacetValues.get(
-
 
727
				new Long(facetDefID));
-
 
728
		
-
 
729
		if(facetValues == null) {
-
 
730
			facetValues = new ArrayList<String>();
-
 
731
			this.facetIDFacetValues.put(new Long(facetDefID), facetValues);
-
 
732
		}
-
 
733
		
-
 
734
		if(values != null) {
-
 
735
			for(Object value : values) {
-
 
736
				String strValue = value.toString();
-
 
737
				
-
 
738
				if(!facetValues.contains(strValue)) {
-
 
739
					facetValues.add(strValue);
-
 
740
				}
-
 
741
			}
-
 
742
		}
-
 
743
 
-
 
744
		// Parse returned Python list
713
		String facetXMLSnip = null;
745
		String facetXMLSnip = null;
714
		if(values != null) {
746
		if(values != null) {
715
			
747
			
716
			// Get IR Data XML snippet for this entity and facet
748
			// Get IR Data XML snippet for this entity and facet
717
			facetXMLSnip = this.getFacetXMLSnippet(expFacetRuleDef, values, 2);
749
			facetXMLSnip = this.getFacetXMLSnippet(expFacetRuleDef, values, 2);