Subversion Repositories SmartDukaan

Rev

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

Rev 18 Rev 20
Line 132... Line 132...
132
		
132
		
133
		// Categories
133
		// Categories
134
		else if(this.definitionSetName.equals("categories")) {
134
		else if(this.definitionSetName.equals("categories")) {
135
			Map<Long, Category> categoriesMap = new HashMap<Long, Category>();
135
			Map<Long, Category> categoriesMap = new HashMap<Long, Category>();
136
			Category root = this.convertCategories(defType, categoriesMap);
136
			Category root = this.convertCategories(defType, categoriesMap);
137
			//System.out.println(categoriesMap);
137
			//Utils.logger.info(categoriesMap);
138
			//System.out.println(root);
138
			//Utils.logger.info(root);
139
			//System.exit(0);
139
			//System.exit(0);
140
			
140
			
141
			// Tree
141
			// Tree
142
			String categoryTreeDBFile = DEFINITIONS_DB_PATH + "categorytree" + 
142
			String categoryTreeDBFile = DEFINITIONS_DB_PATH + "categorytree" + 
143
				".ser";
143
				".ser";
Line 209... Line 209...
209
		
209
		
210
		// Slide definitions
210
		// Slide definitions
211
		while(itjaxbDefs.hasNext()) {
211
		while(itjaxbDefs.hasNext()) {
212
			SlideDefinitionType jaxbDef = itjaxbDefs.next();
212
			SlideDefinitionType jaxbDef = itjaxbDefs.next();
213
			
213
			
214
			System.out.println("Slide label=" + jaxbDef.getLabel());
214
			Utils.logger.info("Slide label=" + jaxbDef.getLabel());
215
			SlideDefinition def = new SlideDefinition(jaxbDef.getID(),
215
			SlideDefinition def = new SlideDefinition(jaxbDef.getID(),
216
					jaxbDef.getLabel());
216
					jaxbDef.getLabel());
217
			def.setDescription(jaxbDef.getDescription());
217
			def.setDescription(jaxbDef.getDescription());
218
			
218
			
219
			// Slide Feature Definition
219
			// Slide Feature Definition
Line 223... Line 223...
223
			if(jaxbSlideFeatureDefs != null) {
223
			if(jaxbSlideFeatureDefs != null) {
224
				def.setSlideFeatureDefinitions((
224
				def.setSlideFeatureDefinitions((
225
						this.convertSlideFeatureDefinitions(
225
						this.convertSlideFeatureDefinitions(
226
								jaxbSlideFeatureDefs)));
226
								jaxbSlideFeatureDefs)));
227
			}
227
			}
228
			System.out.println(def);
228
			Utils.logger.info("def=" + def);
229
			
229
			
230
			defs.put(new Long(jaxbDef.getID()), def);
230
			defs.put(new Long(jaxbDef.getID()), def);
231
		}
231
		}
232
			
232
			
233
		return defs;
233
		return defs;
Line 278... Line 278...
278
		
278
		
279
		// Feature definitions
279
		// Feature definitions
280
		while(itjaxbDefs.hasNext()) {
280
		while(itjaxbDefs.hasNext()) {
281
			FeatureDefinitionType jaxbDef = itjaxbDefs.next();
281
			FeatureDefinitionType jaxbDef = itjaxbDefs.next();
282
			
282
			
283
			//System.out.println("Feature label=" + jaxbDef.getLabel());
283
			//Utils.logger.info("Feature label=" + jaxbDef.getLabel());
284
			FeatureDefinition def = new FeatureDefinition(jaxbDef.getID(),
284
			FeatureDefinition def = new FeatureDefinition(jaxbDef.getID(),
285
					jaxbDef.getLabel());
285
					jaxbDef.getLabel());
286
			def.setAllowsBlank(jaxbDef.isCanbeBlank());
286
			def.setAllowsBlank(jaxbDef.isCanbeBlank());
287
			def.setDescription(jaxbDef.getDescription());
287
			def.setDescription(jaxbDef.getDescription());
288
			
288
			
Line 290... Line 290...
290
			BulletDefinitionType jaxbBulletDef = jaxbDef.getBulletDefinition();
290
			BulletDefinitionType jaxbBulletDef = jaxbDef.getBulletDefinition();
291
			if(jaxbBulletDef != null) {
291
			if(jaxbBulletDef != null) {
292
				def.setBulletDefinition(this.convertBulletDefinition(
292
				def.setBulletDefinition(this.convertBulletDefinition(
293
						jaxbBulletDef));
293
						jaxbBulletDef));
294
			}
294
			}
295
			System.out.println(def);
295
			Utils.logger.info("def=" + def);
296
			
296
			
297
			defs.put(new Long(jaxbDef.getID()), def);
297
			defs.put(new Long(jaxbDef.getID()), def);
298
		}
298
		}
299
			
299
			
300
		return defs;
300
		return defs;
Line 346... Line 346...
346
				jaxbDef.getEnumDefinition();
346
				jaxbDef.getEnumDefinition();
347
			
347
			
348
			// Composite data type
348
			// Composite data type
349
			if(compositeDefType != null) {
349
			if(compositeDefType != null) {
350
				CompositeDefinition compDef = new CompositeDefinition(
350
				CompositeDefinition compDef = new CompositeDefinition(
351
						jaxbDef.getID(), jaxbDef.getName());
351
						jaxbDef.getID(), jaxbDef.getName(), 
-
 
352
						compositeDefType.getSeparator());
352
				
353
				
353
				List<CompositePartDefinitionType> jaxbPartDefs = 
354
				List<CompositePartDefinitionType> jaxbPartDefs = 
354
					compositeDefType.getCompositePartDefinition();
355
					compositeDefType.getCompositePartDefinition();
355
				
356
				
356
				Iterator<CompositePartDefinitionType> itPartDefs = 
357
				Iterator<CompositePartDefinitionType> itPartDefs = 
Line 396... Line 397...
396
				def = new DatatypeDefinition(jaxbDef.getID(), 
397
				def = new DatatypeDefinition(jaxbDef.getID(), 
397
						jaxbDef.getName());
398
						jaxbDef.getName());
398
			}
399
			}
399
			
400
			
400
			def.setDescription(jaxbDef.getDescription());
401
			def.setDescription(jaxbDef.getDescription());
401
			System.out.println(def);
402
			Utils.logger.info("def=" + def);
402
			
403
			
403
			defs.put(new Long(jaxbDef.getID()), def);
404
			defs.put(new Long(jaxbDef.getID()), def);
404
		}
405
		}
405
		
406
		
406
		return defs;
407
		return defs;
Line 446... Line 447...
446
		Iterator<CategoryType> it = jaxbCats.iterator();
447
		Iterator<CategoryType> it = jaxbCats.iterator();
447
		
448
		
448
		// Get root category
449
		// Get root category
449
		CategoryType jaxbCat = it.next();
450
		CategoryType jaxbCat = it.next();
450
		if(jaxbCat == null) {
451
		if(jaxbCat == null) {
451
			System.out.println("Invalid file: " + this.srcFile);
452
			Utils.logger.info("Invalid file: " + this.srcFile);
452
			return null;
453
			return null;
453
		}
454
		}
454
		
455
		
455
		Category root = this.convertCategoryType(jaxbCat, null, catMap);
456
		Category root = this.convertCategoryType(jaxbCat, null, catMap);
456
		return root;
457
		return root;
Line 480... Line 481...
480
			cat.addCategorySlideDefintion(catSlideDef);
481
			cat.addCategorySlideDefintion(catSlideDef);
481
		}
482
		}
482
		
483
		
483
		// Children
484
		// Children
484
		List<CategoryType> jaxbChildren = jaxbCat.getChildCategory();
485
		List<CategoryType> jaxbChildren = jaxbCat.getChildCategory();
485
		//System.out.println("jaxbChildren.size: " + jaxbChildren.size());
486
		//Utils.logger.info("jaxbChildren.size: " + jaxbChildren.size());
486
		
487
		
487
		Iterator<CategoryType> itChildren = jaxbChildren.iterator();
488
		Iterator<CategoryType> itChildren = jaxbChildren.iterator();
488
		while(itChildren.hasNext()) {
489
		while(itChildren.hasNext()) {
489
			CategoryType jaxbChildCat = itChildren.next();
490
			CategoryType jaxbChildCat = itChildren.next();
490
			Category childCat = this.convertCategoryType(jaxbChildCat, cat, catMap);
491
			Category childCat = this.convertCategoryType(jaxbChildCat, cat, catMap);
491
			cat.addChild(childCat);
492
			cat.addChild(childCat);
492
		}
493
		}
493
		//System.out.println("Parent cat: " + cat);
494
		//Utils.logger.info("Parent cat: " + cat);
494
		catMap.put(new Long(jaxbCat.getID()), cat);
495
		catMap.put(new Long(jaxbCat.getID()), cat);
495
		return cat;
496
		return cat;
496
	}
497
	}
497
	
498
	
498
	/**
499
	/**
Line 530... Line 531...
530
			
531
			
531
			Unit unit = new Unit(jaxbUnit.getID());
532
			Unit unit = new Unit(jaxbUnit.getID());
532
			unit.setDescription(jaxbUnit.getDescription());
533
			unit.setDescription(jaxbUnit.getDescription());
533
			unit.setFullForm(jaxbUnit.getFullform());
534
			unit.setFullForm(jaxbUnit.getFullform());
534
			unit.setShortForm(jaxbUnit.getShortform());
535
			unit.setShortForm(jaxbUnit.getShortform());
535
			System.out.println(unit);
536
			Utils.logger.info("unit=" + unit);
536
			
537
			
537
			allUnits.put(new Long(jaxbUnit.getID()), unit);
538
			allUnits.put(new Long(jaxbUnit.getID()), unit);
538
		}
539
		}
539
		
540
		
540
		return allUnits;
541
		return allUnits;