Subversion Repositories SmartDukaan

Rev

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

Rev 47 Rev 49
Line 55... Line 55...
55
 * 
55
 * 
56
 * @author naveen
56
 * @author naveen
57
 *
57
 *
58
 */
58
 */
59
public class MM {
59
public class MM {
-
 
60
	/**
-
 
61
	 * 
-
 
62
	 */
60
	public static final String DEFINITIONS_SRC_PATH = 
63
	public static final String DEFINITIONS_SRC_PATH = 
61
		"/home/naveen/workspace/eclipse/webapp/src/xml/model/";
64
		"/home/naveen/workspace/eclipse/webapp/src/xml/model/";
62
	
65
	
63
	// LOCAL
66
	// LOCAL
-
 
67
	/**
-
 
68
	 * 
-
 
69
	 */
64
	public static final String DEFINITIONS_DB_PATH = 
70
	public static final String DEFINITIONS_DB_PATH = 
65
		"/home/naveen/workspace/eclipse/db/definitions/";
71
		"/home/naveen/workspace/eclipse/db/definitions/";
-
 
72
	
-
 
73
	/**
-
 
74
	 * 
-
 
75
	 */
66
	public static final String ENTITIES_DB_PATH = 
76
	public static final String ENTITIES_DB_PATH = 
67
		"/home/naveen/workspace/eclipse/db/entities/";
77
		"/home/naveen/workspace/eclipse/db/entities/";
68
	
78
	
69
	/** WEB
79
	/** WEB
70
	public static final String DEFINITIONS_DB_PATH = 
80
	public static final String DEFINITIONS_DB_PATH = 
Line 78... Line 88...
78
		"./db/definitions/";
88
		"./db/definitions/";
79
	public static final String ENTITIES_DB_PATH = 
89
	public static final String ENTITIES_DB_PATH = 
80
		"./db/entities/";
90
		"./db/entities/";
81
	*/
91
	*/
82
	
92
	
-
 
93
	/**
-
 
94
	 * 
-
 
95
	 */
83
	private String definitionSetName;
96
	private String definitionSetName;
-
 
97
	
-
 
98
	/**
-
 
99
	 * 
-
 
100
	 */
84
	private String srcFile;
101
	private String srcFile;
-
 
102
	
-
 
103
	/**
-
 
104
	 * 
-
 
105
	 */
85
	private String dbFile;
106
	private String dbFile;
86
	
107
	
87
	/**
108
	/**
88
	 * @param args
109
	 * @param args
89
	 */
110
	 */
Line 347... Line 368...
347
		return defs;
368
		return defs;
348
	}
369
	}
349
	
370
	
350
	/**
371
	/**
351
	 * 
372
	 * 
-
 
373
	 * @param defType
352
	 * @return Map
374
	 * @return
353
	 */
375
	 */
354
	private Map<Long, FeatureDefinition> convertFeatureDefinitions(
376
	private Map<Long, FeatureDefinition> convertFeatureDefinitions(
355
			DefinitionType defType) {
377
			DefinitionType defType) {
356
		
378
		
357
		Map<Long, FeatureDefinition> defs = 
379
		Map<Long, FeatureDefinition> defs = 
Line 405... Line 427...
405
		def.setLearned(jaxbDef.isIsLearned());
427
		def.setLearned(jaxbDef.isIsLearned());
406
		def.setDescription(jaxbDef.getDescription());
428
		def.setDescription(jaxbDef.getDescription());
407
		
429
		
408
		return def;
430
		return def;
409
	}
431
	}
410
	
432
 
411
	/**
433
	/**
412
	 * 
434
	 * 
-
 
435
	 * @param defType
413
	 * @return Map
436
	 * @return
414
	 */
437
	 */
415
	private Map<Long, DatatypeDefinition> convertDatatypeDefinition(
438
	private Map<Long, DatatypeDefinition> convertDatatypeDefinition(
416
			DefinitionType defType) {
439
			DefinitionType defType) {
417
		
440
		
418
		Map<Long, DatatypeDefinition> defs = 
441
		Map<Long, DatatypeDefinition> defs = 
Line 519... Line 542...
519
		
542
		
520
		partDef.setDescription(jaxbPartDef.getDescription());
543
		partDef.setDescription(jaxbPartDef.getDescription());
521
		
544
		
522
		return partDef;
545
		return partDef;
523
	}
546
	}
524
	
547
 
525
	/**
548
	/**
526
	 * 
549
	 * 
-
 
550
	 * @param defType
-
 
551
	 * @param catMap
527
	 * @return Map
552
	 * @return
528
	 */
553
	 */
529
	private Category convertCategories(DefinitionType defType, 
554
	private Category convertCategories(DefinitionType defType, 
530
			Map<Long, Category> catMap) {
555
			Map<Long, Category> catMap) {
531
		
556
		
532
		List<CategoryType> jaxbCats = defType.getCategory();
557
		List<CategoryType> jaxbCats = defType.getCategory();
Line 546... Line 571...
546
	}
571
	}
547
	
572
	
548
	/**
573
	/**
549
	 * 
574
	 * 
550
	 * @param jaxbCat
575
	 * @param jaxbCat
-
 
576
	 * @param parentCat
-
 
577
	 * @param catMap
551
	 * @return Category
578
	 * @return
552
	 */
579
	 */
553
	@SuppressWarnings("unchecked")
580
	@SuppressWarnings("unchecked")
554
	private Category convertCategoryType(CategoryType jaxbCat, 
581
	private Category convertCategoryType(CategoryType jaxbCat, 
555
			Category parentCat, Map<Long, Category> catMap) {
582
			Category parentCat, Map<Long, Category> catMap) {
556
		
583
		
Line 609... Line 636...
609
		return cat;
636
		return cat;
610
	}
637
	}
611
	
638
	
612
	/**
639
	/**
613
	 * 
640
	 * 
-
 
641
	 * @param categoryID
614
	 * @param jaxbDef
642
	 * @param jaxbDef
615
	 * @return
643
	 * @return
616
	 */
644
	 */
617
	private CategorySlideDefinition convertCategorySlideDefinitionType(
645
	private CategorySlideDefinition convertCategorySlideDefinitionType(
618
			long categoryID, CategorySlideDefinitionType jaxbDef) {
646
			long categoryID, CategorySlideDefinitionType jaxbDef) {
Line 651... Line 679...
651
			allUnits.put(new Long(jaxbUnit.getID()), unit);
679
			allUnits.put(new Long(jaxbUnit.getID()), unit);
652
		}
680
		}
653
		
681
		
654
		return allUnits;
682
		return allUnits;
655
	}
683
	}
656
	
684
 
657
	/**
685
	/**
658
	 * 
686
	 * 
-
 
687
	 * @param srcFile
-
 
688
	 * @return
659
	 * @return DefinitionType
689
	 * @throws Exception
660
	 */
690
	 */
661
	private DefinitionType unmarshallSrcFile(String srcFile) throws Exception {
691
	private DefinitionType unmarshallSrcFile(String srcFile) throws Exception {
662
		
692
		
663
        JAXBContext jc = JAXBContext.newInstance("in.shop2020.metamodel.jaxb");
693
        JAXBContext jc = JAXBContext.newInstance("in.shop2020.metamodel.jaxb");
664
        
694