Project

General

Profile

« Previous | Next » 

Revision 5fa8e0f0

Added by Andreas Müller about 10 years ago

Handle partof references in BerlinModel import better

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelReferenceImport.java
514 514
		}
515 515

  
516 516
		//title/abbrevTitle
517
		if (StringUtils.isNotBlank(nomTitleAbbrev)){
517
		if (isNotBlank(nomTitleAbbrev)){
518 518
			ref.setAbbrevTitle(nomTitleAbbrev);
519 519
		}
520
		if (StringUtils.isNotBlank(title)){
520
		if (isNotBlank(title)){
521 521
			ref.setTitle(title);
522 522
		}
523 523

  
......
568 568
			logger.warn ("Article has no inreference: " + refId);
569 569
		}
570 570
		makeStandardMapper(valueMap, (Reference)article); //url, pages, series, volume
571
		return (Reference)article;
571
		return (Reference<?>)article;
572 572
	}
573 573
	
574 574
	private Reference<?> makePartOfOtherTitle (Map<String, Object> valueMap, 
575
			Map<Integer, Reference> refToSave, 
576
			Map<String, Reference> relatedReferences){
575
			Map<Integer, Reference> refToSave, Map<String, Reference> relatedReferences){
577 576
		
578 577
		Reference<?> result;
579 578
		Object inRefFk = valueMap.get("inRefFk".toLowerCase());
......
586 585
			result = makeUnknown(valueMap);
587 586
		}else if (inRefFk == null){
588 587
			//TODO is this correct ??
589
			logger.warn("Part-Of-Other-Title has in in reference: " + refId);
588
			logger.warn("Part-Of-Other-Title has no in reference: " + refId);
590 589
			result = makeUnknown(valueMap);
591 590
		}else if (inRefCategoryFk == REF_BOOK){
592 591
			//BookSection
......
594 593
			result = (Reference<?>)bookSection;
595 594
		}else if (inRefCategoryFk == REF_ARTICLE){
596 595
			//Article
597
			//TODO 
598 596
			logger.info("Reference (refId = " + refId + ") of type 'part_of_other_title' is part of 'article'." +
599 597
					" We use the section reference type for such in references now.") ;
600 598
			result = ReferenceFactory.newSection();
......
604 602
					" This is not allowed! Generic reference created instead") ;
605 603
			result = ReferenceFactory.newGeneric();
606 604
			result.addMarker(Marker.NewInstance(MarkerType.TO_BE_CHECKED(), true));
605
		}else if (inRefCategoryFk == REF_PART_OF_OTHER_TITLE){
606
			logger.info("Reference (refId = " + refId + ") of type 'part_of_other_title' has inReference 'part of other title'." +
607
					" This is allowed, but may be true only for specific cases (e.g. parts of book chapters). You may want to check if this is correct") ;
608
			result = ReferenceFactory.newSection();
607 609
		}else{
608 610
			logger.warn("InReference type (catFk = " + inRefCategoryFk + ") of part-of-reference not recognized for refId " + refId + "." +
609 611
				" Create 'Generic' reference instead");
......
653 655
//		informal.setSeries(series);
654 656
		makeStandardMapper(valueMap, generic);//editor, pages, placePublished, publisher, series, volume
655 657
		String informal = (String)valueMap.get("InformalRefCategory".toLowerCase());
656
		if (CdmUtils.isNotEmpty(informal) ){
658
		if (isNotBlank(informal) ){
657 659
			generic.addExtension(informal, ExtensionType.INFORMAL_CATEGORY());
658 660
		}
659 661
		return generic;
......
661 663
	
662 664
	private Reference<?> makeDatabase(Map<String, Object> valueMap){
663 665
		if (logger.isDebugEnabled()){logger.debug("RefType 'Database'");}
664
		Reference database =  ReferenceFactory.newDatabase();
666
		Reference<?> database =  ReferenceFactory.newDatabase();
665 667
		makeStandardMapper(valueMap, database); //?
666 668
		return database;
667 669
	}
668 670
	
669 671
	private Reference<?> makeJournal(Map<String, Object> valueMap){
670 672
		if (logger.isDebugEnabled()){logger.debug("RefType 'Journal'");}
671
		Reference journal = ReferenceFactory.newJournal();
673
		Reference<?> journal = ReferenceFactory.newJournal();
672 674
		
673 675
		Set<String> omitAttributes = new HashSet<String>();
674 676
		String series = "series";

Also available in: Unified diff