Project

General

Profile

Revision bc416076

IDbc416076df7e31846efdeface25ccb1c37d84dd6
Parent 2eee7850
Child 34743ac7

Added by Andreas Müller 11 months ago

ref #1447 cleanup FaunaEuErmsFindIdenticalNamesActivator

View differences:

cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/merging/FaunaEuErmsFindIdenticalNamesActivator.java
13 13

  
14 14
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
15 15
import eu.etaxonomy.cdm.app.common.CdmDestinations;
16
import eu.etaxonomy.cdm.app.pesi.ErmsImportActivator;
17 16
import eu.etaxonomy.cdm.database.DbSchemaValidation;
18 17
import eu.etaxonomy.cdm.database.ICdmDataSource;
19 18
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
20 19
import eu.etaxonomy.cdm.io.api.application.CdmIoApplicationController;
21
import eu.etaxonomy.cdm.io.pesi.merging.FaunaEuErmsMerging;
20
import eu.etaxonomy.cdm.io.pesi.merging.PesiMergeObject;
22 21
import eu.etaxonomy.cdm.model.common.CdmBase;
23 22
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
24 23
import eu.etaxonomy.cdm.model.name.IZoologicalName;
......
33 32
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
34 33

  
35 34
public class FaunaEuErmsFindIdenticalNamesActivator {
36
	private static final Logger logger = Logger.getLogger(FaunaEuErmsFindIdenticalNamesActivator.class);
37
	//static final ICdmDataSource faunaEuropaeaSource = CdmDestinations.localH2();
38
	static final ICdmDataSource faunaEuropaeaSource = CdmDestinations.cdm_test_local_faunaEu_mysql();
39
	static Reference faunaSec;
40
	static Reference ermsSec;
41 35

  
42
	//TODO hole aus beiden DB alle TaxonNameBases
43

  
44
	private CdmApplicationController initDb(ICdmDataSource db) {
45

  
46
		// Init source DB
47
		//CdmApplicationController appCtrInit = null;
48
		CdmApplicationController appCtrInit = CdmIoApplicationController.NewInstance(db, DbSchemaValidation.VALIDATE, false);
49

  
50
		
51
		//appCtrInit = TestDatabase.initDb(db, DbSchemaValidation.VALIDATE, false);
52

  
53
		return appCtrInit;
36
    private static final Logger logger = Logger.getLogger(FaunaEuErmsFindIdenticalNamesActivator.class);
37

  
38
    //static final ICdmDataSource faunaEuropaeaSource = CdmDestinations.localH2();
39
	static final ICdmDataSource pesiSource = CdmDestinations.cdm_test_local_faunaEu_mysql();
40

  
41
	static final String path = "C:\\Users\\k.luther\\test";
42

  
43
	private static UUID faunaEuSecUuid = UUID.fromString("6786d863-75d4-4796-b916-c1c3dff4cb70");
44
	private static UUID ermsSecUuid = UUID.fromString("7744bc26-f914-42c4-b54a-dd2a030a8bb7");
45
	private static UUID ifSecUuid;
46
	private static UUID emSecUuid;
47

  
48
	private void invoke(ICdmDataSource source){
49

  
50
        CdmApplicationController app = CdmIoApplicationController.NewInstance(source, DbSchemaValidation.VALIDATE, false);
51

  
52
        List<String> propertyPaths = new ArrayList<>();
53
        propertyPaths.add("sources.*");
54
        propertyPaths.add("sources.idInSource");
55
        propertyPaths.add("sources.idNamespace");
56
        propertyPaths.add("taxonBases.*");
57
        propertyPaths.add("taxonBases.relationsFromThisTaxon");
58
        propertyPaths.add("taxonBases.taxonNodes.*");
59
        propertyPaths.add("taxonBases.taxonNodes.parent.*");
60
        propertyPaths.add("taxonBases.taxonNodes.childNodes.*");
61
        propertyPaths.add("taxonBases.taxonNodes.childNodes.classification.rootNode.childNodes.*");
62
        propertyPaths.add("taxonBases.taxonNodes.parent.taxon.name.*");
63
        propertyPaths.add("taxonBases.acceptedTaxon.taxonNodes.*");
64
        propertyPaths.add("taxonBases.acceptedTaxon.taxonNodes.childNodes.*");
65
        propertyPaths.add("taxonBases.acceptedTaxon.taxonNodes.childNodes.classification.rootNode.childNodes.*");
66
        System.out.println("Start getIdenticalNames...");
67

  
68
        Reference faunaEuSec = app.getReferenceService().load(faunaEuSecUuid);
69
        Reference ermsSec = app.getReferenceService().load(ermsSecUuid);
70
        Map<String, List<TaxonName>> namesOfIdenticalTaxa = app.getTaxonService().findIdenticalTaxonNameIds(ermsSec, faunaEuSec, propertyPaths);
71

  
72
        System.out.println("Start creating merging objects");
73
        List<PesiMergeObject> mergingObjects= createMergeObjects(namesOfIdenticalTaxa, app);
74
        boolean resultOK = true;
75
        System.out.println("Start creating csv files");
76
        resultOK &= writeSameNamesDifferentAuthorToCsv(mergingObjects, path + "_authors.csv");
77
        resultOK &= writeSameNamesDifferentStatusToCsv(mergingObjects, path + "_status.csv");
78
        resultOK &= writeSameNamesToCsvFile(mergingObjects, path + "_names.csv");
79
        resultOK &= writeSameNamesDifferentPhylumToCsv(mergingObjects, path + "_phylum.csv");
80
        resultOK &= writeSameNamesDifferentParentToCsv(mergingObjects, path + "parent.csv");
81

  
82
        System.out.println("End merging Fauna Europaea and Erms: " + resultOK);
54 83
	}
55 84

  
85
	private boolean writeSameNamesToCsvFile(
86
			List<PesiMergeObject> mergingObjects, String string) {
56 87

  
57
	/**
58
	 * @param args
59
	 */
60
	public static void main(String[] args) {
61

  
62
		FaunaEuErmsFindIdenticalNamesActivator sc = new FaunaEuErmsFindIdenticalNamesActivator();
63

  
64
		CdmApplicationController appCtrFaunaEu = sc.initDb(faunaEuropaeaSource);
65
		String sFileName = "C:\\Users\\k.luther\\test";
66
		//CdmApplicationController appCtrErms = sc.initDb(ermsSource);
67
		List<String> propertyPaths = new ArrayList<>();
68
		propertyPaths.add("sources.*");
69
		propertyPaths.add("sources.idInSource");
70
		propertyPaths.add("sources.idNamespace");
71
		propertyPaths.add("taxonBases.*");
72
		propertyPaths.add("taxonBases.relationsFromThisTaxon");
73
		propertyPaths.add("taxonBases.taxonNodes.*");
74
		propertyPaths.add("taxonBases.taxonNodes.parent.*");
75
		propertyPaths.add("taxonBases.taxonNodes.childNodes.*");
76
		propertyPaths.add("taxonBases.taxonNodes.childNodes.classification.rootNode.childNodes.*");
77
		propertyPaths.add("taxonBases.taxonNodes.parent.taxon.name.*");
78
		propertyPaths.add("taxonBases.acceptedTaxon.taxonNodes.*");
79
		propertyPaths.add("taxonBases.acceptedTaxon.taxonNodes.childNodes.*");
80
		propertyPaths.add("taxonBases.acceptedTaxon.taxonNodes.childNodes.classification.rootNode.childNodes.*");
81
		System.err.println("Start getIdenticalNames...");
82
		
83
		faunaSec = appCtrFaunaEu.getReferenceService().load(UUID.fromString("6786d863-75d4-4796-b916-c1c3dff4cb70"));
84
		ermsSec = appCtrFaunaEu.getReferenceService().load(UUID.fromString("7744bc26-f914-42c4-b54a-dd2a030a8bb7"));
85
		Map<String, List<TaxonName>> namesOfIdenticalTaxa = appCtrFaunaEu.getTaxonService().findIdenticalTaxonNameIds(ermsSec, faunaSec, propertyPaths);
86
			
87
		List<FaunaEuErmsMerging> mergingObjects = new ArrayList<>();
88
		FaunaEuErmsMerging mergeObject;
89
		TaxonName faunaEuTaxName;
90
		TaxonName ermsTaxName;
91
		System.err.println("Start creating merging objects");
92
		mergingObjects= sc.createMergeObjects(namesOfIdenticalTaxa, appCtrFaunaEu);
93
		boolean resultOK = true;
94
		System.err.println("Start creating csv files");
95
		resultOK = resultOK && sc.writeSameNamesdifferentAuthorToCsv(mergingObjects, sFileName + "_authors.csv");
96
		resultOK = resultOK &&sc.writeSameNamesdifferentStatusToCsv(mergingObjects, sFileName + "_status.csv");
97
		resultOK = resultOK &&sc.writeSameNamesToCsVFile(mergingObjects, sFileName + "_names.csv");
98
		resultOK = resultOK &&sc.writeSameNamesdifferentPhylumToCsv(mergingObjects, sFileName + "_phylum.csv");
99
		resultOK = resultOK &&sc.writeSameNamesDifferentParentToCsv(mergingObjects, sFileName + "parent.csv");
100

  
101
		System.err.println("End merging Fauna Europaea and Erms" + resultOK);
102
		System.exit(0);
103

  
104
	}
105

  
106
	private boolean writeSameNamesToCsVFile(
107
			List<FaunaEuErmsMerging> mergingObjects, String string) {
108 88
	    try{
109 89
    		FileWriter writer = new FileWriter(string);
110 90

  
111 91
    	    //create Header
112 92
    	    String firstLine = "same names";
113 93
    	    createHeader(writer, firstLine);
114
    		for (FaunaEuErmsMerging merging : mergingObjects){
94
    		for (PesiMergeObject merging : mergingObjects){
115 95
    	    	writeCsvLine(writer, merging) ;
116 96
    		}
117 97
    		writer.flush();
118 98
    		writer.close();
99
    		return true;
119 100
    	}catch(IOException e){
101
    	    logger.error(e.getMessage());
120 102
    	    return false;
121 103
    	}
122
    	return true;
123 104
	}
124 105

  
125
	private boolean writeSameNamesdifferentPhylumToCsv(List<FaunaEuErmsMerging> mergingObjects, String sfileName){
126
		try
127
		{
106
	private boolean writeSameNamesDifferentPhylumToCsv(
107
	        List<PesiMergeObject> mergingObjects, String sfileName){
108

  
109
	    try{
128 110
		    FileWriter writer = new FileWriter(sfileName);
129 111

  
130 112
		    //create Header
......
132 114
		   createHeader(writer, firstLine);
133 115

  
134 116
			//write data
135
			for (FaunaEuErmsMerging merging : mergingObjects){
117
			for (PesiMergeObject merging : mergingObjects){
136 118
		    	//TODO
137 119
				if ((merging.getPhylumInErms()== null )^ (merging.getPhylumInFaunaEu()== null)){
138 120
					writeCsvLine(writer, merging) ;
......
144 126
			}
145 127
			writer.flush();
146 128
			writer.close();
129
			return true;
130
		}catch(IOException e){
131
		    logger.error(e.getMessage());
132
            return false;
147 133
		}
148
		catch(IOException e)
149
		{
150
		 return false;
151
		}
152
		return true;
153 134
	}
154
	
155
	private boolean writeSameNamesDifferentParentToCsv(List<FaunaEuErmsMerging> mergingObjects, String sfileName){
156
		try
157
		{
135

  
136
	private boolean writeSameNamesDifferentParentToCsv(
137
	        List<PesiMergeObject> mergingObjects, String sfileName){
138

  
139
	    try{
158 140
		    FileWriter writer = new FileWriter(sfileName);
159 141

  
160 142
		    //create Header
......
162 144
		   createHeader(writer, firstLine);
163 145

  
164 146
			//write data
165
			for (FaunaEuErmsMerging merging : mergingObjects){
147
			for (PesiMergeObject merging : mergingObjects){
166 148
		    	//TODO
167 149
				if ((merging.getParentStringInErms()== null )^ (merging.getParentStringInFaunaEu()== null)){
168 150
					writeCsvLine(writer, merging) ;
......
174 156
			}
175 157
			writer.flush();
176 158
			writer.close();
159
			return true;
160
		}catch(IOException e){
161
		    return false;
177 162
		}
178
		catch(IOException e)
179
		{
180
		 return false;
181
		}
182
		return true;
183 163
	}
184 164

  
185
	private boolean writeSameNamesdifferentRankToCsv(List<FaunaEuErmsMerging> mergingObjects, String sfileName){
186
		try
187
		{
165
	private boolean writeSameNamesdifferentRankToCsv(
166
	        List<PesiMergeObject> mergingObjects, String sfileName){
167

  
168
	    try{
188 169
		    FileWriter writer = new FileWriter(sfileName);
189 170
		    String firstLine = "same names but different rank";
190 171
		    //create Header
191 172
		    createHeader(writer, firstLine);
192 173

  
193 174
			//write data
194
			for (FaunaEuErmsMerging merging : mergingObjects){
175
			for (PesiMergeObject merging : mergingObjects){
195 176

  
196 177
				if (!merging.getRankInErms().equals(merging.getRankInFaunaEu())){
197 178
					writeCsvLine(writer, merging);
......
199 180
			}
200 181
			writer.flush();
201 182
			writer.close();
183
			return true;
184
		}catch(IOException e){
185
		    return false;
202 186
		}
203
		catch(IOException e)
204
		{
205
		 return false;
206
		}
207
		return true;
208 187
	}
209 188

  
210 189
	private void createHeader(FileWriter writer, String firstLine) throws IOException{
......
249 228
			writer.append('\n');
250 229
	}
251 230

  
252
	private boolean writeSameNamesdifferentStatusToCsv(List<FaunaEuErmsMerging> mergingObjects, String sfileName){
253
		try
254
		{
231
	private boolean writeSameNamesDifferentStatusToCsv(
232
	        List<PesiMergeObject> mergingObjects, String sfileName){
233

  
234
	    try{
255 235
		    FileWriter writer = new FileWriter(sfileName);
256 236

  
257 237
		    //create Header
......
259 239
		    createHeader(writer, firstLine);
260 240

  
261 241
			//write data
262
			for (FaunaEuErmsMerging merging : mergingObjects){
263

  
242
			for (PesiMergeObject merging : mergingObjects){
264 243
				if (merging.isStatInErms()^merging.isStatInFaunaEu()){
265 244
					 writeCsvLine(writer, merging);
266 245
				}
......
268 247

  
269 248
			writer.flush();
270 249
			writer.close();
250
			return true;
251
		}catch(IOException e){
252
		    return false;
271 253
		}
272
		catch(IOException e)
273
		{
274
		 return false;
275
		}
276
		return true;
277 254
	}
278 255

  
279
	private boolean writeSameNamesdifferentAuthorToCsv(List<FaunaEuErmsMerging> mergingObjects, String sfileName){
280
		try
281
		{
256
	private boolean writeSameNamesDifferentAuthorToCsv(
257
	        List<PesiMergeObject> mergingObjects, String sfileName){
258

  
259
	    try{
282 260
		    FileWriter writer = new FileWriter(sfileName);
283 261

  
284 262
		    //create Header
285
		   String firstLine = "same names but different authors";
286
		   createHeader(writer, firstLine);
263
		    String firstLine = "same names but different authors";
264
		    createHeader(writer, firstLine);
287 265

  
288 266
			//write data
289
			for (FaunaEuErmsMerging merging : mergingObjects){
267
			for (PesiMergeObject merging : mergingObjects){
290 268

  
291 269
				if (merging.getAuthorInErms() != null && merging.getAuthorInFaunaEu() != null && !merging.getAuthorInErms().equals(merging.getAuthorInFaunaEu())){
292 270
					 writeCsvLine(writer, merging);
......
295 273
				}
296 274
			}
297 275

  
298

  
299 276
			writer.flush();
300 277
			writer.close();
278
			return true;
279
		}catch(IOException e){
280
		    return false;
301 281
		}
302
		catch(IOException e)
303
		{
304
		 return false;
305
		}
306
		return true;
307 282
	}
308 283

  
309
	private void writeCsvLine(FileWriter writer, FaunaEuErmsMerging merging) throws IOException{
284
	private void writeCsvLine(FileWriter writer, PesiMergeObject merging) throws IOException{
310 285

  
311 286
		writer.append(merging.getUuidFaunaEu());
312 287
		writer.append(';');
......
356 331
		writer.append('\n');
357 332
	}
358 333

  
334
	private List<PesiMergeObject> createMergeObjects(Map<String,List<TaxonName>> names,
335
	        CdmApplicationController appCtr){
359 336

  
360
	private List<FaunaEuErmsMerging> createMergeObjects(Map<String,List<TaxonName>> names, CdmApplicationController appCtr){
361
		Classification faunaEuClassification = appCtr.getClassificationService().load(UUID.fromString("44d8605e-a7ce-41e1-bee9-99edfec01e7c"));
362
		Classification ermsClassification = appCtr.getClassificationService().load(UUID.fromString("6fa988a9-10b7-48b0-a370-2586fbc066eb"));
363
		List<FaunaEuErmsMerging> merge = new ArrayList<>();
364
		
365
		FaunaEuErmsMerging mergeObject;
366
		String idInSource1;
367
		List<TaxonName> identicalNames;
368
		
369
		for (String nameCache: names.keySet()){
370
			identicalNames = names.get(nameCache);
371
			
372
			mergeObject = new FaunaEuErmsMerging();
373
			
374
			
375
			//getPhylum
376
			TaxonNodeDto phylum1 = null;
377
			TaxonName faunaEuName = null;
378
			TaxonName ermsName = null;
379
			TaxonBase tempName = null;
380
			if (identicalNames.size() == 2) {
381
				Set<TaxonBase> taxonBases = identicalNames.get(0).getTaxonBases();
382
				if (taxonBases.size()==1) {
383
					Iterator<TaxonBase> it = taxonBases.iterator();
384
					tempName = it.next();
385
					if (tempName.getSec().equals(faunaSec)) {
386
						faunaEuName = identicalNames.get(0);
387
						ermsName = identicalNames.get(1);
388
					}else {
389
						faunaEuName = identicalNames.get(1);
390
						ermsName = identicalNames.get(0);
391
					}
392
				}else {
393
					//TODO: find the two correct names
394
				}
395
			}else {
396
				logger.debug(nameCache + " has more than two identical namecaches");
397
				continue;
398
			}
399
			phylum1 = null;
400
			if (faunaEuName.getRank().equals(Rank.PHYLUM())) {
401
				Taxon taxon = null;
402
				taxon = getAcceptedTaxon(faunaEuName);
403
				if (taxon != null) {
404
					phylum1 = new TaxonNodeDto(taxon.getTaxonNode(faunaEuClassification));
405
				}
406
				
407
			}
408
			if (phylum1 == null && faunaEuName != null && !faunaEuName.getRank().isHigher(Rank.PHYLUM())){
409
					phylum1 =appCtr.getTaxonNodeService().taxonNodeDtoParentRank(faunaEuClassification, Rank.PHYLUM(), faunaEuName);
410
			}
411

  
412
			TaxonNodeDto phylum2 = null;
413
			if (ermsName.getRank().equals(Rank.PHYLUM())) {
414
				Taxon taxon = null;
415
				taxon = getAcceptedTaxon(ermsName);
416
				if (taxon != null) {
417
					phylum2 = new TaxonNodeDto(taxon.getTaxonNode(ermsClassification));
418
				}
419
				
420
			}
421
			if (phylum2 == null && ermsName != null && !ermsName.getRank().isHigher(Rank.PHYLUM())){
422
				phylum2 = appCtr.getTaxonNodeService().taxonNodeDtoParentRank(ermsClassification, Rank.PHYLUM(), ermsName);
423
			}
424
			mergeObject.setPhylumInErms(phylum1);
425
			mergeObject.setPhylumInFaunaEu(phylum2);
426

  
427
			//getUuids
428
			mergeObject.setUuidErms(ermsName.getUuid().toString());
429
			mergeObject.setUuidFaunaEu(faunaEuName.getUuid().toString());
430

  
431
			Iterator<IdentifiableSource> sources = ermsName.getSources().iterator();
432
			if (sources.hasNext()){
433
				IdentifiableSource source = sources.next();
434
				idInSource1 = source.getIdInSource();
435
				mergeObject.setIdInErms(idInSource1);
436
			}
437
			sources = faunaEuName.getSources().iterator();
438
			if (sources.hasNext()){
439
				IdentifiableSource source = sources.next();
440
				idInSource1 = source.getIdInSource();
441
				mergeObject.setIdInFaunaEu(idInSource1);
442
			}
443

  
444
			mergeObject.setNameCacheInErms(ermsName.getNameCache());
445
			mergeObject.setNameCacheInFaunaEu(faunaEuName.getNameCache());
446

  
447
			mergeObject.setAuthorInErms(ermsName.getAuthorshipCache());
448
			mergeObject.setAuthorInFaunaEu(faunaEuName.getAuthorshipCache());
449
			Set<Taxon> taxa = ermsName.getTaxa();
450
			if (!taxa.isEmpty()){
451
				mergeObject.setStatInErms(true);
452
				Iterator<Taxon> taxaIterator = taxa.iterator();
453
				Taxon taxon = null;
454
				while (taxaIterator.hasNext()){
455
					taxon = taxaIterator.next();
456
					if (!taxon.isMisapplication()){
457
						break;
458
					}
459
				}
460
				Set<TaxonNode> nodes = taxon.getTaxonNodes();
461
				Iterator<TaxonNode> taxonNodeIterator = nodes.iterator();
462
				TaxonNode node, parentNode = null;
463
				while (taxonNodeIterator.hasNext()){
464
					node = taxonNodeIterator.next();
465
					if (!node.isTopmostNode()){
466
						parentNode = node.getParent();
467
					}
468
				}
469
				//TODO: ändern mit erweitertem Initializer..
470
				if (parentNode != null){
471
				    TaxonName parentName = HibernateProxyHelper.deproxy(parentNode.getTaxon().getName());
472
					String parentNameCache = parentName.getNameCache();
473
					mergeObject.setParentStringInErms(parentNameCache);
474
					mergeObject.setParentRankStringInErms(parentName.getRank().getLabel());
475
					
476
				}
477
			}else{
478
				mergeObject.setStatInErms(false);
479
				TaxonNode parentNode = getAcceptedNode(ermsName);
480
				//TODO: ändern mit erweitertem Initializer..
481
				if (parentNode != null){
482
				    TaxonName parentName = HibernateProxyHelper.deproxy(parentNode.getTaxon().getName());
483
					String parentNameCache = parentName.getNameCache();
484
					mergeObject.setParentStringInErms(parentNameCache);
485
					mergeObject.setParentRankStringInErms(parentName.getRank().getLabel());
486
					
487
				}
488
			}
489
			taxa = faunaEuName.getTaxa();
490
			if (!taxa.isEmpty()){
491
				mergeObject.setStatInFaunaEu(true);
492
				Iterator<Taxon> taxaIterator = taxa.iterator();
493
				Taxon taxon = null;
494
				while (taxaIterator.hasNext()){
495
					taxon = taxaIterator.next();
496
					if (!taxon.isMisapplication()){
497
						break;
498
					}
499
				}
500
				Set<TaxonNode> nodes = taxon.getTaxonNodes();
501
				Iterator<TaxonNode> taxonNodeIterator = nodes.iterator();
502
				TaxonNode node, parentNode = null;
503
				while (taxonNodeIterator.hasNext()){
504
					node = taxonNodeIterator.next();
505
					if (!node.isTopmostNode()){
506
						parentNode = node.getParent();
507
					}
508
				}
509
				//TODO: ändern mit erweitertem Initializer..
510
				if (parentNode != null){
511
					if (parentNode.getTaxon().getName().isZoological()){
512

  
513
    					IZoologicalName parentName = CdmBase.deproxy(parentNode.getTaxon().getName());
514
    					String parentNameCache = parentName.getNameCache();
515
    					mergeObject.setParentStringInFaunaEu(parentNameCache);
516
    					mergeObject.setParentRankStringInFaunaEu(parentName.getRank().getLabel());
517
    					
518
					}else{
519
						logger.debug("no zoologicalName: " + parentNode.getTaxon().getName().getTitleCache() +" . "+parentNode.getTaxon().getName().getUuid());
520
					}
337
	    UUID uuidClassification1 = UUID.fromString("44d8605e-a7ce-41e1-bee9-99edfec01e7c");
338
	    UUID uuidClassification2 = UUID.fromString("6fa988a9-10b7-48b0-a370-2586fbc066eb");
339
	    Classification classification1 = appCtr.getClassificationService().load(uuidClassification1);
340
		Classification classification2 = appCtr.getClassificationService().load(uuidClassification2);
521 341

  
522
				}
523
			}else{
524
				mergeObject.setStatInFaunaEu(false);
525
				TaxonNode parentNode = getAcceptedNode(faunaEuName);
526
				//TODO: ändern mit erweitertem Initializer..
527
				if (parentNode != null){
528
				    TaxonName parentName = HibernateProxyHelper.deproxy(parentNode.getTaxon().getName());
529
					String parentNameCache = parentName.getNameCache();
530
					mergeObject.setParentStringInFaunaEu(parentNameCache);
531
					mergeObject.setParentRankStringInFaunaEu(parentName.getRank().getLabel());
532
					
533
				}
534
			}
535
			
536

  
537
			mergeObject.setRankInErms(ermsName.getRank().getLabel());
538
			mergeObject.setRankInFaunaEu(faunaEuName.getRank().getLabel());
539

  
540
			//set parent informations
541

  
542

  
543
			/*
544
			Set<HybridRelationship> parentRelations = zooName.getParentRelationships();
545
			Iterator parentIterator = parentRelations.iterator();
546
			HybridRelationship parentRel;
547
			ZoologicalName parentName;
548
			while (parentIterator.hasNext()){
549
				parentRel = (HybridRelationship)parentIterator.next();
550
				parentName = (ZoologicalName)parentRel.getParentName();
551
				mergeObject.setParentRankStringInErms(parentName.getRank().getLabel());
552
				mergeObject.setParentStringInErms(parentName.getNameCache());
553
			}
554

  
555
			parentRelations = zooName2.getParentRelationships();
556
			parentIterator = parentRelations.iterator();
342
		List<PesiMergeObject> merge = new ArrayList<>();
557 343

  
558
			while (parentIterator.hasNext()){
559
				parentRel = (HybridRelationship)parentIterator.next();
560
				parentName = (ZoologicalName)parentRel.getParentName();
561
				mergeObject.setParentRankStringInFaunaEu(parentName.getRank().getLabel());
562
				mergeObject.setParentStringInFaunaEu(parentName.getNameCache());
563
			}*/
564
			merge.add(mergeObject);
344
		for (String nameCache: names.keySet()){
345
		    createSingleMergeObject(appCtr, merge, nameCache, names.get(nameCache),classification1, classification2);
565 346
		}
566
//		}
567 347

  
568 348
		return merge;
569

  
570 349
	}
571 350

  
572 351

  
573
	/**
574
	 * @param ermsName
575
	 * @return
576
	 */
352
    private void createSingleMergeObject(CdmApplicationController appCtr, List<PesiMergeObject> merge, String nameCache,
353
            List<TaxonName> identicalNames,
354
            Classification classification1, Classification classification2) {
355

  
356
        PesiMergeObject mergeObject = new PesiMergeObject();
357

  
358
        if(identicalNames.size()!= 2) {
359
            logger.warn(nameCache + " has more than 2 names with identical name cache from different sources. This is not yet handled.");
360
            return;
361
        }
362
        //getPhylum
363
        TaxonNodeDto phylum1 = null;
364
        TaxonName faunaEuName = null;
365
        TaxonName ermsName = null;
366

  
367
        Set<TaxonBase> taxonBases = identicalNames.get(0).getTaxonBases();
368
        if (taxonBases.size()==1) {
369
            Iterator<TaxonBase> it = taxonBases.iterator();
370
            TaxonBase<?> tempName = it.next();
371
            if (tempName.getSec().getUuid().equals(faunaEuSecUuid)) {
372
                faunaEuName = identicalNames.get(0);
373
                ermsName = identicalNames.get(1);
374
            }else {
375
                faunaEuName = identicalNames.get(1);
376
                ermsName = identicalNames.get(0);
377
            }
378
        }else {
379
            //TODO: find the two correct names
380
            logger.warn("Name has not exact 1 but " + taxonBases.size() + " taxon base attached. This is not yet handled");
381
            return;
382
        }
383
        if (faunaEuName.getRank().equals(Rank.PHYLUM())) {
384
            Taxon taxon = null;
385
            taxon = getAcceptedTaxon(faunaEuName);
386
            if (taxon != null) {
387
                phylum1 = new TaxonNodeDto(taxon.getTaxonNode(classification1));
388
            }
389

  
390
        }
391
        if (phylum1 == null && !faunaEuName.getRank().isHigher(Rank.PHYLUM())){
392
                phylum1 = appCtr.getTaxonNodeService().taxonNodeDtoParentRank(classification1, Rank.PHYLUM(), faunaEuName);
393
        }
394

  
395
        TaxonNodeDto phylum2 = null;
396
        if (ermsName.getRank().equals(Rank.PHYLUM())) {
397
            Taxon taxon = null;
398
            taxon = getAcceptedTaxon(ermsName);
399
            if (taxon != null) {
400
                phylum2 = new TaxonNodeDto(taxon.getTaxonNode(classification2));
401
            }
402

  
403
        }
404
        if (phylum2 == null && !ermsName.getRank().isHigher(Rank.PHYLUM())){
405
            phylum2 = appCtr.getTaxonNodeService().taxonNodeDtoParentRank(classification2, Rank.PHYLUM(), ermsName);
406
        }
407
        mergeObject.setPhylumInErms(phylum1);
408
        mergeObject.setPhylumInFaunaEu(phylum2);
409

  
410
        //getUuids
411
        mergeObject.setUuidErms(ermsName.getUuid().toString());
412
        mergeObject.setUuidFaunaEu(faunaEuName.getUuid().toString());
413

  
414
        Iterator<IdentifiableSource> sources = ermsName.getSources().iterator();
415
        if (sources.hasNext()){
416
            IdentifiableSource source = sources.next();
417
            String idInSource1 = source.getIdInSource();
418
            mergeObject.setIdInErms(idInSource1);
419
        }
420
        sources = faunaEuName.getSources().iterator();
421
        if (sources.hasNext()){
422
            IdentifiableSource source = sources.next();
423
            String idInSource1 = source.getIdInSource();
424
            mergeObject.setIdInFaunaEu(idInSource1);
425
        }
426

  
427
        mergeObject.setNameCacheInErms(ermsName.getNameCache());
428
        mergeObject.setNameCacheInFaunaEu(faunaEuName.getNameCache());
429

  
430
        mergeObject.setAuthorInErms(ermsName.getAuthorshipCache());
431
        mergeObject.setAuthorInFaunaEu(faunaEuName.getAuthorshipCache());
432
        Set<Taxon> taxa = ermsName.getTaxa();
433
        if (!taxa.isEmpty()){
434
            mergeObject.setStatInErms(true);
435
            Iterator<Taxon> taxaIterator = taxa.iterator();
436
            Taxon taxon = null;
437
            while (taxaIterator.hasNext()){
438
                taxon = taxaIterator.next();
439
                if (!taxon.isMisapplication()){
440
                    break;
441
                }
442
            }
443
            Set<TaxonNode> nodes = taxon.getTaxonNodes();
444
            Iterator<TaxonNode> taxonNodeIterator = nodes.iterator();
445
            TaxonNode node, parentNode = null;
446
            while (taxonNodeIterator.hasNext()){
447
                node = taxonNodeIterator.next();
448
                if (!node.isTopmostNode()){
449
                    parentNode = node.getParent();
450
                }
451
            }
452
            //TODO: ändern mit erweitertem Initializer..
453
            if (parentNode != null){
454
                TaxonName parentName = CdmBase.deproxy(parentNode.getTaxon().getName());
455
                String parentNameCache = parentName.getNameCache();
456
                mergeObject.setParentStringInErms(parentNameCache);
457
                mergeObject.setParentRankStringInErms(parentName.getRank().getLabel());
458
            }
459
        }else{
460
            mergeObject.setStatInErms(false);
461
            TaxonNode parentNode = getAcceptedNode(ermsName);
462
            //TODO: ändern mit erweitertem Initializer..
463
            if (parentNode != null){
464
                TaxonName parentName = HibernateProxyHelper.deproxy(parentNode.getTaxon().getName());
465
                String parentNameCache = parentName.getNameCache();
466
                mergeObject.setParentStringInErms(parentNameCache);
467
                mergeObject.setParentRankStringInErms(parentName.getRank().getLabel());
468
            }
469
        }
470
        taxa = faunaEuName.getTaxa();
471
        if (!taxa.isEmpty()){
472
            mergeObject.setStatInFaunaEu(true);
473
            Iterator<Taxon> taxaIterator = taxa.iterator();
474
            Taxon taxon = null;
475
            while (taxaIterator.hasNext()){
476
                taxon = taxaIterator.next();
477
                if (!taxon.isMisapplication()){
478
                    break;
479
                }
480
            }
481
            Set<TaxonNode> nodes = taxon.getTaxonNodes();
482
            Iterator<TaxonNode> taxonNodeIterator = nodes.iterator();
483
            TaxonNode node, parentNode = null;
484
            while (taxonNodeIterator.hasNext()){
485
                node = taxonNodeIterator.next();
486
                if (!node.isTopmostNode()){
487
                    parentNode = node.getParent();
488
                }
489
            }
490
            //TODO: ändern mit erweitertem Initializer..
491
            if (parentNode != null){
492
                if (parentNode.getTaxon().getName().isZoological()){
493

  
494
                    IZoologicalName parentName = CdmBase.deproxy(parentNode.getTaxon().getName());
495
                    String parentNameCache = parentName.getNameCache();
496
                    mergeObject.setParentStringInFaunaEu(parentNameCache);
497
                    mergeObject.setParentRankStringInFaunaEu(parentName.getRank().getLabel());
498

  
499
                }else{
500
                    logger.debug("no zoologicalName: " + parentNode.getTaxon().getName().getTitleCache() +" . "+parentNode.getTaxon().getName().getUuid());
501
                }
502
            }
503
        }else{
504
            mergeObject.setStatInFaunaEu(false);
505
            TaxonNode parentNode = getAcceptedNode(faunaEuName);
506
            //TODO: ändern mit erweitertem Initializer..
507
            if (parentNode != null){
508
                TaxonName parentName = HibernateProxyHelper.deproxy(parentNode.getTaxon().getName());
509
                String parentNameCache = parentName.getNameCache();
510
                mergeObject.setParentStringInFaunaEu(parentNameCache);
511
                mergeObject.setParentRankStringInFaunaEu(parentName.getRank().getLabel());
512

  
513
            }
514
        }
515

  
516
        mergeObject.setRankInErms(ermsName.getRank().getLabel());
517
        mergeObject.setRankInFaunaEu(faunaEuName.getRank().getLabel());
518

  
519
        //set parent informations
520

  
521
        /*
522
        Set<HybridRelationship> parentRelations = zooName.getParentRelationships();
523
        Iterator parentIterator = parentRelations.iterator();
524
        HybridRelationship parentRel;
525
        ZoologicalName parentName;
526
        while (parentIterator.hasNext()){
527
            parentRel = (HybridRelationship)parentIterator.next();
528
            parentName = (ZoologicalName)parentRel.getParentName();
529
            mergeObject.setParentRankStringInErms(parentName.getRank().getLabel());
530
            mergeObject.setParentStringInErms(parentName.getNameCache());
531
        }
532

  
533
        parentRelations = zooName2.getParentRelationships();
534
        parentIterator = parentRelations.iterator();
535

  
536
        while (parentIterator.hasNext()){
537
            parentRel = (HybridRelationship)parentIterator.next();
538
            parentName = (ZoologicalName)parentRel.getParentName();
539
            mergeObject.setParentRankStringInFaunaEu(parentName.getRank().getLabel());
540
            mergeObject.setParentStringInFaunaEu(parentName.getNameCache());
541
        }*/
542
        merge.add(mergeObject);
543
    }
544

  
577 545
	private TaxonNode getAcceptedNode(TaxonName ermsName) {
578 546
		Set<TaxonBase> taxonBases = ermsName.getTaxonBases();
579 547
		Taxon taxon = null;
580 548
		if (taxonBases != null && !taxonBases.isEmpty()) {
581
			TaxonBase taxonBase = taxonBases.iterator().next();
549
			TaxonBase<?> taxonBase = taxonBases.iterator().next();
582 550
			if (taxonBase instanceof Synonym) {
583 551
				taxon = ((Synonym)taxonBase).getAcceptedTaxon();
584 552
			}
585 553
		}
586
		
587
		
554

  
588 555
		Set<TaxonNode> nodes = taxon.getTaxonNodes();
589
		
590
		TaxonNode node, parentNode = null;
556

  
557
		TaxonNode parentNode = null;
591 558
		if (nodes != null && !nodes.isEmpty()) {
592 559
			parentNode = nodes.iterator().next();
593 560
		}
594 561
		return parentNode;
595 562
	}
596 563

  
597

  
598
	/**
599
	 * @param ermsName
600
	 * @param taxon
601
	 * @return
602
	 */
603 564
	private Taxon getAcceptedTaxon(TaxonName ermsName) {
604 565
		Taxon taxon = null;
605 566
		if (ermsName.getTaxa() != null && !ermsName.getTaxa().isEmpty()){
606 567
			taxon = ermsName.getTaxa().iterator().next();
607
			
568

  
608 569
		}else if (ermsName.getTaxonBases() != null && !ermsName.getTaxonBases().isEmpty()){
609
			TaxonBase taxonBase = ermsName.getTaxonBases().iterator().next();
570
			TaxonBase<?> taxonBase = ermsName.getTaxonBases().iterator().next();
610 571
			if (taxonBase instanceof Synonym) {
611 572
				Synonym syn = (Synonym)taxonBase;
612 573
				taxon = syn.getAcceptedTaxon();
......
614 575
		}
615 576
		return taxon;
616 577
	}
578

  
579
    public static void main(String[] args) {
580
        FaunaEuErmsFindIdenticalNamesActivator activator = new FaunaEuErmsFindIdenticalNamesActivator();
581
        activator.invoke(pesiSource);
582
        System.exit(0);
583
    }
617 584
}
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/merging/FaunaEuErmsMerging.java
1
package eu.etaxonomy.cdm.io.pesi.merging;
2

  
3
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
4

  
5
public class FaunaEuErmsMerging {
6
	
7
	private String uuidFaunaEu;
8
	private String uuidErms;
9
	
10
	private String idInFaunaEu;
11
	private String idInErms;
12
	
13
	private String nameCacheInFaunaEu;
14
	private String nameCacheInErms;
15
	
16
	private boolean statInFaunaEu;
17
	private boolean statInErms;
18
	
19
	private String authorInFaunaEu;
20
	private String authorInErms;
21
	
22
	private String rankInFaunaEu;
23
	private String rankInErms;
24
	
25
	private TaxonNodeDto phylumInFaunaEu;
26
	private TaxonNodeDto phylumInErms;
27
	
28
	private String parentStringInFaunaEu;
29
	private String parentStringInErms;
30
	
31
	private String parentRankStringInFaunaEu;
32
	private String parentRankStringInErms;
33
	
34
	
35
	public String getUuidFaunaEu() {
36
		return uuidFaunaEu;
37
	}
38

  
39
	public void setUuidFaunaEu(String uuidFaunaEu) {
40
		this.uuidFaunaEu = uuidFaunaEu;
41
	}
42
	public String getUuidErms() {
43
		return uuidErms;
44
	}
45

  
46
	public void setUuidErms(String uuidErms) {
47
		this.uuidErms = uuidErms;
48
	}
49
	
50
	public String getParentRankStringInFaunaEu() {
51
		return parentRankStringInFaunaEu;
52
	}
53

  
54
	public void setParentRankStringInFaunaEu(String parentRankStringInFaunaEu) {
55
		this.parentRankStringInFaunaEu = parentRankStringInFaunaEu;
56
	}
57

  
58
	public String getParentRankStringInErms() {
59
		return parentRankStringInErms;
60
	}
61

  
62
	public void setParentRankStringInErms(String parentRankStringInErms) {
63
		this.parentRankStringInErms = parentRankStringInErms;
64
	}
65

  
66
	public String getParentStringInFaunaEu() {
67
		return parentStringInFaunaEu;
68
	}
69

  
70
	public void setParentStringInFaunaEu(String parentStringInFaunaEu) {
71
		this.parentStringInFaunaEu = parentStringInFaunaEu;
72
	}
73

  
74
	public String getParentStringInErms() {
75
		return parentStringInErms;
76
	}
77

  
78
	public void setParentStringInErms(String parentStringInErms) {
79
		this.parentStringInErms = parentStringInErms;
80
	}
81

  
82
	public String getRankInFaunaEu() {
83
		return rankInFaunaEu;
84
	}
85

  
86
	public void setRankInFaunaEu(String rankInFaunaEu) {
87
		this.rankInFaunaEu = rankInFaunaEu;
88
	}
89

  
90
	public TaxonNodeDto getPhylumInFaunaEu() {
91
		return phylumInFaunaEu;
92
	}
93

  
94
	public void setPhylumInFaunaEu(TaxonNodeDto phylumInFaunaEu) {
95
		this.phylumInFaunaEu = phylumInFaunaEu;
96
	}
97

  
98
	public TaxonNodeDto getPhylumInErms() {
99
		return phylumInErms;
100
	}
101

  
102
	public void setPhylumInErms(TaxonNodeDto phylumInErms) {
103
		this.phylumInErms = phylumInErms;
104
	}
105

  
106
	public String getRankInErms() {
107
		return rankInErms;
108
	}
109

  
110
	public void setRankInErms(String rankInErms) {
111
		this.rankInErms = rankInErms;
112
	}
113
	
114
	
115
	public static FaunaEuErmsMerging newInstance(){
116
		return new FaunaEuErmsMerging();
117
		
118
	}
119
	
120
	public boolean isStatInFaunaEu() {
121
		return statInFaunaEu;
122
	}
123
	public void setStatInFaunaEu(boolean statInFaunaEu) {
124
		this.statInFaunaEu = statInFaunaEu;
125
	}
126
	public boolean isStatInErms() {
127
		return statInErms;
128
	}
129
	public void setStatInErms(boolean statInErms) {
130
		this.statInErms = statInErms;
131
	}
132
	public String getAuthorInFaunaEu() {
133
		return authorInFaunaEu;
134
	}
135
	public void setAuthorInFaunaEu(String authorInFaunaEu) {
136
		this.authorInFaunaEu = authorInFaunaEu;
137
	}
138
	public String getAuthorInErms() {
139
		return authorInErms;
140
	}
141
	public void setAuthorInErms(String authorInErms) {
142
		this.authorInErms = authorInErms;
143
	}
144
	public String getIdInFaunaEu() {
145
		return idInFaunaEu;
146
	}
147
	public void setIdInFaunaEu(String idInFaunaEu) {
148
		this.idInFaunaEu = idInFaunaEu;
149
	}
150
	public String getIdInErms() {
151
		return idInErms;
152
	}
153
	public void setIdInErms(String idInErms) {
154
		this.idInErms = idInErms;
155
	}
156
	public String getNameCacheInFaunaEu() {
157
		return nameCacheInFaunaEu;
158
	}
159
	public void setNameCacheInFaunaEu(String nameCacheInFaunaEu) {
160
		this.nameCacheInFaunaEu = nameCacheInFaunaEu;
161
	}
162
	public String getNameCacheInErms() {
163
		return nameCacheInErms;
164
	}
165
	public void setNameCacheInErms(String nameCacheInErms) {
166
		this.nameCacheInErms = nameCacheInErms;
167
	}
168

  
169
	
170
	
171
}
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/merging/PesiMergeObject.java
1
package eu.etaxonomy.cdm.io.pesi.merging;
2

  
3
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
4

  
5
public class PesiMergeObject {
6

  
7
	private String uuidFaunaEu;
8
	private String uuidErms;
9

  
10
	private String idInFaunaEu;
11
	private String idInErms;
12

  
13
	private String nameCacheInFaunaEu;
14
	private String nameCacheInErms;
15

  
16
	private boolean statInFaunaEu;
17
	private boolean statInErms;
18

  
19
	private String authorInFaunaEu;
20
	private String authorInErms;
21

  
22
	private String rankInFaunaEu;
23
	private String rankInErms;
24

  
25
	private TaxonNodeDto phylumInFaunaEu;
26
	private TaxonNodeDto phylumInErms;
27

  
28
	private String parentStringInFaunaEu;
29
	private String parentStringInErms;
30

  
31
	private String parentRankStringInFaunaEu;
32
	private String parentRankStringInErms;
33

  
34

  
35
	public String getUuidFaunaEu() {
36
		return uuidFaunaEu;
37
	}
38
	public void setUuidFaunaEu(String uuidFaunaEu) {
39
		this.uuidFaunaEu = uuidFaunaEu;
40
	}
41

  
42
	public String getUuidErms() {
43
		return uuidErms;
44
	}
45

  
46
	public void setUuidErms(String uuidErms) {
47
		this.uuidErms = uuidErms;
48
	}
49

  
50
	public String getParentRankStringInFaunaEu() {
51
		return parentRankStringInFaunaEu;
52
	}
53

  
54
	public void setParentRankStringInFaunaEu(String parentRankStringInFaunaEu) {
55
		this.parentRankStringInFaunaEu = parentRankStringInFaunaEu;
56
	}
57

  
58
	public String getParentRankStringInErms() {
59
		return parentRankStringInErms;
60
	}
61

  
62
	public void setParentRankStringInErms(String parentRankStringInErms) {
63
		this.parentRankStringInErms = parentRankStringInErms;
64
	}
65

  
66
	public String getParentStringInFaunaEu() {
67
		return parentStringInFaunaEu;
68
	}
69

  
70
	public void setParentStringInFaunaEu(String parentStringInFaunaEu) {
71
		this.parentStringInFaunaEu = parentStringInFaunaEu;
72
	}
73

  
74
	public String getParentStringInErms() {
75
		return parentStringInErms;
76
	}
77

  
78
	public void setParentStringInErms(String parentStringInErms) {
79
		this.parentStringInErms = parentStringInErms;
80
	}
81

  
82
	public String getRankInFaunaEu() {
83
		return rankInFaunaEu;
84
	}
85

  
86
	public void setRankInFaunaEu(String rankInFaunaEu) {
87
		this.rankInFaunaEu = rankInFaunaEu;
88
	}
89

  
90
	public TaxonNodeDto getPhylumInFaunaEu() {
91
		return phylumInFaunaEu;
92
	}
93

  
94
	public void setPhylumInFaunaEu(TaxonNodeDto phylumInFaunaEu) {
95
		this.phylumInFaunaEu = phylumInFaunaEu;
96
	}
97

  
98
	public TaxonNodeDto getPhylumInErms() {
99
		return phylumInErms;
100
	}
101

  
102
	public void setPhylumInErms(TaxonNodeDto phylumInErms) {
103
		this.phylumInErms = phylumInErms;
104
	}
105

  
106
	public String getRankInErms() {
107
		return rankInErms;
108
	}
109

  
110
	public void setRankInErms(String rankInErms) {
111
		this.rankInErms = rankInErms;
112
	}
113

  
114

  
115
	public static PesiMergeObject newInstance(){
116
		return new PesiMergeObject();
117

  
118
	}
119

  
120
	public boolean isStatInFaunaEu() {
121
		return statInFaunaEu;
122
	}
123
	public void setStatInFaunaEu(boolean statInFaunaEu) {
124
		this.statInFaunaEu = statInFaunaEu;
125
	}
126
	public boolean isStatInErms() {
127
		return statInErms;
128
	}
129
	public void setStatInErms(boolean statInErms) {
130
		this.statInErms = statInErms;
131
	}
132
	public String getAuthorInFaunaEu() {
133
		return authorInFaunaEu;
134
	}
135
	public void setAuthorInFaunaEu(String authorInFaunaEu) {
136
		this.authorInFaunaEu = authorInFaunaEu;
137
	}
138
	public String getAuthorInErms() {
139
		return authorInErms;
140
	}
141
	public void setAuthorInErms(String authorInErms) {
142
		this.authorInErms = authorInErms;
143
	}
144
	public String getIdInFaunaEu() {
145
		return idInFaunaEu;
146
	}
147
	public void setIdInFaunaEu(String idInFaunaEu) {
148
		this.idInFaunaEu = idInFaunaEu;
149
	}
150
	public String getIdInErms() {
151
		return idInErms;
152
	}
153
	public void setIdInErms(String idInErms) {
154
		this.idInErms = idInErms;
155
	}
156
	public String getNameCacheInFaunaEu() {
157
		return nameCacheInFaunaEu;
158
	}
159
	public void setNameCacheInFaunaEu(String nameCacheInFaunaEu) {
160
		this.nameCacheInFaunaEu = nameCacheInFaunaEu;
161
	}
162
	public String getNameCacheInErms() {
163
		return nameCacheInErms;
164
	}
165
	public void setNameCacheInErms(String nameCacheInErms) {
166
		this.nameCacheInErms = nameCacheInErms;
167
	}
168

  
169

  
170

  
171
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)