Project

General

Profile

Revision 853106aa

ID853106aac34dc50ed4f2bcc5b3a06d108ef09c84
Parent 4b241d73
Child 8ef74e91

Added by Andreas Müller 11 months ago

ref #7440 add common name marker to common name references

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelReferenceImport.java
111 111
		return;
112 112
	}
113 113

  
114
	private Set<Integer> commonNameRefSet = null;
115
	private void initializeCommonNameRefMap(BerlinModelImportState state) throws SQLException{
116
	    if (state.getConfig().isEuroMed()){
117
	        commonNameRefSet = new HashSet<>();
118
	        String queryStr = "SELECT DISTINCT RefFk "
119
	                + " FROM emCommonName ";
120
	        ResultSet rs = state.getConfig().getSource().getResultSet(queryStr);
121
	        while (rs.next()){
122
	            commonNameRefSet.add(rs.getInt("RefFk"));
123
	        }
124
	    }
125
	}
126

  
114 127
	protected static CdmAttributeMapperBase[] classMappers = new CdmAttributeMapperBase[]{
115 128
		new CdmStringMapper("edition", "edition"),
116 129
		new CdmStringMapper("volume", "volume"),
......
169 182

  
170 183
		boolean success = true;
171 184
		initializeMappers(state);
185
		try {
186
            initializeCommonNameRefMap(state);
187
        } catch (SQLException e1) {
188
            e1.printStackTrace();
189
            logger.error("Error in initializeCommonNameRefMap in BerlinModelReferenceimport");
190
        }
172 191
		BerlinModelImportConfigurator config = state.getConfig();
173 192
		Source source = config.getSource();
174 193

  
......
566 585
		//refId
567 586
		ImportHelper.setOriginalSource(ref, sourceReference, refId, REFERENCE_NAMESPACE);
568 587

  
588
		if (commonNameRefSet != null && commonNameRefSet.contains(refId)){
589
            ref.addMarker(Marker.NewInstance(MarkerType.COMMON_NAME_REFERENCE(), true));
590
        }
591

  
592

  
569 593
		return true;
570 594
	}
571 595

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)