Subversion Repositories SmartDukaan

Rev

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

Rev 1949 Rev 2170
Line 17... Line 17...
17
import in.shop2020.metamodel.jaxb.core.DefinitionType;
17
import in.shop2020.metamodel.jaxb.core.DefinitionType;
18
import in.shop2020.metamodel.jaxb.core.EditorialImportanceType;
18
import in.shop2020.metamodel.jaxb.core.EditorialImportanceType;
19
import in.shop2020.metamodel.jaxb.core.EnumDefinitionType;
19
import in.shop2020.metamodel.jaxb.core.EnumDefinitionType;
20
import in.shop2020.metamodel.jaxb.core.EnumValueType;
20
import in.shop2020.metamodel.jaxb.core.EnumValueType;
21
import in.shop2020.metamodel.jaxb.core.FeatureDefinitionType;
21
import in.shop2020.metamodel.jaxb.core.FeatureDefinitionType;
-
 
22
import in.shop2020.metamodel.jaxb.core.HelpDocDefinitionType;
22
import in.shop2020.metamodel.jaxb.core.SlideDefinitionType;
23
import in.shop2020.metamodel.jaxb.core.SlideDefinitionType;
23
import in.shop2020.metamodel.jaxb.core.SlideFeatureDefinitionType;
24
import in.shop2020.metamodel.jaxb.core.SlideFeatureDefinitionType;
24
import in.shop2020.metamodel.jaxb.core.UnitType;
25
import in.shop2020.metamodel.jaxb.core.UnitType;
25
import in.shop2020.metamodel.jaxb.facets.CategoryFacetDefinitionType;
26
import in.shop2020.metamodel.jaxb.facets.CategoryFacetDefinitionType;
26
import in.shop2020.metamodel.jaxb.facets.FacetDefinitionType;
27
import in.shop2020.metamodel.jaxb.facets.FacetDefinitionType;
Line 135... Line 136...
135
 
136
 
136
	/**
137
	/**
137
	 * Hashtable of feature definition ID to normalization rule definition ID
138
	 * Hashtable of feature definition ID to normalization rule definition ID
138
	 */
139
	 */
139
	private Map<Long, RuleDefinition> normalizationRuleDefinitions;
140
	private Map<Long, RuleDefinition> normalizationRuleDefinitions;
-
 
141
	
-
 
142
	/**
-
 
143
	 * Hashtable of help doc definition ID to help doc definition object
-
 
144
	 */
-
 
145
	private Map<Long, HelpDocDefinition> helpDocDefinitions;
140
 
146
 
141
	/**
147
	/**
142
	 * Hashtable of feature definition ID to normalization rule definition ID
148
	 * Hashtable of feature definition ID to normalization rule definition ID
143
	 */
149
	 */
144
	private Map<Long, List<Long>> categorySlideSequence;
150
	private Map<Long, List<Long>> categorySlideSequence;
Line 220... Line 226...
220
		//slide definitions
226
		//slide definitions
221
		srcFile = xmlDefinitionsPath+ "slidedefinitions.xml";
227
		srcFile = xmlDefinitionsPath+ "slidedefinitions.xml";
222
		oDefType = this.unmarshallSrcFile(srcFile, "core");
228
		oDefType = this.unmarshallSrcFile(srcFile, "core");
223
		defType = (DefinitionType)oDefType;
229
		defType = (DefinitionType)oDefType;
224
		this.slideDefinitions = this.convertSlideDefinitions(defType);
230
		this.slideDefinitions = this.convertSlideDefinitions(defType);
-
 
231
		
-
 
232
	    //help doc definition
-
 
233
        srcFile = xmlDefinitionsPath+ "helpdocdefinitions.xml";
-
 
234
        oDefType = this.unmarshallSrcFile(srcFile, "core");
-
 
235
        defType = (DefinitionType)oDefType;
-
 
236
        this.helpDocDefinitions = this.convertHelpDocDefinitions(defType);
225
 
237
 
226
	}
238
	}
227
	
239
	
228
	private void initializeFacetsDefinitionObjects() throws Exception{
240
	private void initializeFacetsDefinitionObjects() throws Exception{
229
		IRDefinitionType irDefType = null;
241
		IRDefinitionType irDefType = null;
Line 884... Line 896...
884
	 */
896
	 */
885
	private EnumValue convertEnumValueDefinition(EnumValueType jaxbEnumValue) {
897
	private EnumValue convertEnumValueDefinition(EnumValueType jaxbEnumValue) {
886
		
898
		
887
		EnumValue enumValue = new EnumValue(jaxbEnumValue.getID(), 
899
		EnumValue enumValue = new EnumValue(jaxbEnumValue.getID(), 
888
				jaxbEnumValue.getValue());
900
				jaxbEnumValue.getValue());
-
 
901
		if(jaxbEnumValue.getHelpDocDefinitionID() != null){
-
 
902
		    enumValue.setHelpDocDefinitionID(jaxbEnumValue.getHelpDocDefinitionID()); 
889
 
903
		}
890
		return enumValue;
904
		return enumValue;
891
	}
905
	}
892
	/**
906
	/**
893
	 * Returns EnumValue ID for datatype definition ID and enum value string 
907
	 * Returns EnumValue ID for datatype definition ID and enum value string 
894
	 * to match. Match is case insensitive
908
	 * to match. Match is case insensitive
Line 1168... Line 1182...
1168
		return defs;
1182
		return defs;
1169
	}
1183
	}
1170
 
1184
 
1171
	
1185
	
1172
	/**
1186
	/**
-
 
1187
     * 
-
 
1188
     * @return Map
-
 
1189
     */
-
 
1190
    private Map<Long, HelpDocDefinition> convertHelpDocDefinitions(DefinitionType defType) {
-
 
1191
        
-
 
1192
        Map<Long, HelpDocDefinition> defs = 
-
 
1193
            new HashMap<Long, HelpDocDefinition>();
-
 
1194
        
-
 
1195
        List<HelpDocDefinitionType> jaxbDefs = defType.getHelpDocDefinition();
-
 
1196
        Iterator<HelpDocDefinitionType> itjaxbDefs = jaxbDefs.iterator();
-
 
1197
        
-
 
1198
        // Help Doc definitions
-
 
1199
        while(itjaxbDefs.hasNext()) {
-
 
1200
            HelpDocDefinitionType jaxbDef = itjaxbDefs.next();
-
 
1201
            
-
 
1202
            Utils.info("Helo doc name is =" + jaxbDef.getName());
-
 
1203
            HelpDocDefinition def = new HelpDocDefinition(jaxbDef.getID(), jaxbDef.getName());
-
 
1204
            
-
 
1205
            Utils.info("def=" + def);
-
 
1206
            
-
 
1207
            defs.put(new Long(jaxbDef.getID()), def);
-
 
1208
        }
-
 
1209
            
-
 
1210
        return defs;
-
 
1211
    }
-
 
1212
	
-
 
1213
	
-
 
1214
	/**
1173
	 * 
1215
	 * 
1174
	 * @param jaxbDefs
1216
	 * @param jaxbDefs
1175
	 * @return List<SlideFeatureDefinition>
1217
	 * @return List<SlideFeatureDefinition>
1176
	 */
1218
	 */
1177
	private List<SlideFeatureDefinition> convertSlideFeatureDefinitions(
1219
	private List<SlideFeatureDefinition> convertSlideFeatureDefinitions(
Line 1365... Line 1407...
1365
			if(normRuleDefID != null) {
1407
			if(normRuleDefID != null) {
1366
				def.setNormalizationRuleDefinitionID(normRuleDefID.longValue());
1408
				def.setNormalizationRuleDefinitionID(normRuleDefID.longValue());
1367
			}
1409
			}
1368
			Utils.info("def=" + def);
1410
			Utils.info("def=" + def);
1369
			
1411
			
-
 
1412
			Long helpDocDefID = jaxbDef.getHelpDocDefinitionID();
-
 
1413
            if(helpDocDefID != null) {
-
 
1414
                def.setHelpDocDefinitionID(helpDocDefID.longValue());
-
 
1415
            }
-
 
1416
            Utils.info("def=" + def);
-
 
1417
            
1370
			defs.put(new Long(jaxbDef.getID()), def);
1418
			defs.put(new Long(jaxbDef.getID()), def);
1371
		}
1419
		}
1372
			
1420
			
1373
		return defs;
1421
		return defs;
1374
	}
1422
	}
Line 1517... Line 1565...
1517
	 * @throws Exception
1565
	 * @throws Exception
1518
	 */
1566
	 */
1519
	public EnumValue getEnumValue(long enumValueID) throws Exception {
1567
	public EnumValue getEnumValue(long enumValueID) throws Exception {
1520
		return this.enumValues.get(new Long(enumValueID));
1568
		return this.enumValues.get(new Long(enumValueID));
1521
	}
1569
	}
1522
	
1570
 
1523
	/**
1571
	/**
1524
	 * Returns all FacetDefinition objects in the database
1572
	 * Returns all FacetDefinition objects in the database
1525
	 * 
1573
	 * 
1526
	 * @return Map Null if facet definitions are not imported into definitions 
1574
	 * @return Map Null if facet definitions are not imported into definitions 
1527
	 * db (serialized java objects)
1575
	 * db (serialized java objects)
Line 1963... Line 2011...
1963
	 * @throws Exception 
2011
	 * @throws Exception 
1964
	 */
2012
	 */
1965
	public RuleDefinition getNormalizationRuleDefinition(long ruleDefinitionID){
2013
	public RuleDefinition getNormalizationRuleDefinition(long ruleDefinitionID){
1966
		return this.normalizationRuleDefinitions.get(new Long(ruleDefinitionID));
2014
		return this.normalizationRuleDefinitions.get(new Long(ruleDefinitionID));
1967
	}
2015
	}
-
 
2016
	
-
 
2017
	public HelpDocDefinition getHelpDocDefinition(long helpDocDefinitionID){
-
 
2018
	    return this.helpDocDefinitions.get(helpDocDefinitionID);
-
 
2019
	}
1968
}
2020
}