Project

General

Profile

Revision ab6f97de

IDab6f97decf93a85f0e0961731577d94da3623112
Parent 874a38f5
Child a163fed9

Added by Andreas Müller 7 months ago

cleanup

View differences:

cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/PesiExportActivatorFE.java
30 30

  
31 31
	private static final Logger logger = Logger.getLogger(PesiExportActivatorFE.class);
32 32

  
33
	//database validation status (create, update, validate ...)
34
//	static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI();
35
	static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI_2();
36 33

  
37 34
//	static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_faunaEu_mysql();
38 35
	static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_pesi_leer();
39 36

  
37
	static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI();
38
//	static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI_2();
39

  
40 40
	// ****************** ALL *****************************************
41 41

  
42 42
    boolean deleteAll = true;
......
92 92
        config.setDoDescription(doDescriptions);
93 93
        config.setDoEcologyAndLink(doEcologyAndLink);
94 94

  
95
//      config.setDoOccurrence(doOccurrence);
96
//      config.setDoOccurrenceSource(doOccurrenceSource);
97
//      config.setDoNotes(doNotes);
98
//      config.setDoNoteSources(doNoteSources);
99
//      config.setDoImages(doImage);
100

  
101 95
        config.setDoPureNames(doPureNames);
102 96

  
103 97
        config.setCheck(check);
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/validate/PesiErmsValidator.java
346 346
        success &= isNull("ExpertName", destRS, id);  //only relevant after merge
347 347
        success &= isNull("SpeciesExpertGUID", destRS, id);  //only relevant after merge
348 348
        success &= equals("Taxon cache citation", srcRS.getString("cache_citation"), destRS.getString("CacheCitation"), id);
349
        //LastAction(Date) handled in separate method
349
        //SpeciesExpertName, LastAction and LastActionDate handled in separate method
350 350
        success &= isNull("GUID2", destRS, id);  //only relevant after merge
351 351
        success &= isNull("DerivedFromGuid2", destRS, id);  //only relevant after merge
352 352
        return success;
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiTaxonExport.java
75 75
 * The export class for {@link eu.etaxonomy.cdm.model.name.TaxonNameBase TaxonNames}.<p>
76 76
 * Inserts into DataWarehouse database table <code>Taxon</code>.
77 77
 * It is divided into four phases:<p><ul>
78
 * <li>Phase 1:	Export of all {@link eu.etaxonomy.cdm.model.name.TaxonName TaxonNames} except some data exported in the following phases.
78
 * <li>Phase 1:	Export of all taxon and taxon name data
79
 *                     except for some data exported in the following phases.
79 80
 * <li>Phase 2:	Export of additional data: ParentTaxonFk and TreeIndex.
80 81
 * <li>Phase 3:	Export of additional data: Rank data, KingdomFk, TypeNameFk, expertFk and speciesExpertFk.
81 82
 * <li>Phase 4:	Export of Inferred Synonyms.</ul>
......
478 479
		int limit = state.getConfig().getLimitSave();
479 480

  
480 481
		logger.info("PHASE 3: Add Rank data, KingdomFk, TypeNameFk, expertFk and speciesExpertFk...");
481
		// Be sure to add rank information, KingdomFk, TypeNameFk, expertFk and speciesExpertFk to every taxonName
482 482

  
483 483
		// Start transaction
484 484
		TransactionStatus txStatus = startTransaction(true);
......
2148 2148
	 * @return The <code>ExpertName</code> attribute.
2149 2149
	 * @see MethodMapper
2150 2150
	 */
2151
	@SuppressWarnings("unused")  //for some reason it is also called by getCacheCitation
2151
	//@SuppressWarnings("unused")  //for some reason it is also called by getCacheCitation
2152 2152
	private static String getExpertName(TaxonBase<?> taxon) {
2153 2153
		try {
2154 2154
		    String result = null;
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiTransformer.java
52 52
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
53 53
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
54 54
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
55
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
56 55

  
57 56
/**
58 57
 * @author e.-m.lee
......
296 295
	private static int Taxa_infragen = 280;
297 296
	private static int Taxa_infraspec = 285;
298 297

  
299

  
300 298
	//NoteCategory
301 299
	private static int NoteCategory_description = 1;
302 300
	public static int NoteCategory_ecology = 4;
......
604 602
	private static int AREA_SERBIA = 294;
605 603
	private static int AREA_KOSOVO = 295;
606 604

  
607

  
608 605
	//FauEu area UUIDs
609 606
    private static UUID uuidAreaAD = UUID.fromString("38dd31d2-8275-4b05-8b85-eb71a390d67f");
610 607
    private static UUID uuidAreaAFR = UUID.fromString("c3123386-51a4-42a4-9ff4-b3905b18a83c");//x
......
714 711
	private final Map<Integer, Map<Integer, String>> rankCacheMap  = new  HashMap<>();
715 712
	private final Map<Integer, Map<Integer, String>> rankAbbrevCacheMap  = new  HashMap<>();
716 713

  
714
    private final Source destination;
717 715

  
718
	private final Source destination;
719

  
720
	public PesiTransformer(Source destination) {
721
		super();
722
		this.destination = destination;
723
		fillMaps();
724
	}
725

  
716
    public PesiTransformer(Source destination) {
717
        this.destination = destination;
718
        fillMaps();
719
    }
726 720
	private void fillMaps() {
727 721
		try {
728 722
		    //TDWG
......
838 832
                    oldId = languageCodeToKeyMap.put(iso639_3, id);
839 833
                    checkOldId(id, oldId, iso639_1);
840 834
                }
841

  
842 835
            }
843 836
			rs = null;
844 837
		} catch (Exception e) {
......
879 872
	/**
880 873
	 * Converts the databaseString to its abbreviation if its known.
881 874
	 * Otherwise the databaseString is returned.
882
	 * @param databaseString
883
	 * @return
884 875
	 */
885 876
	public static String databaseString2Abbreviation(String databaseString) {
886 877
		String result = databaseString;
......
892 883

  
893 884
	/**
894 885
	 * Returns the OccurrenceStatusId for a given PresenceAbsenceTerm.
895
	 * @param term
896
	 * @return
897
	 * @throws UnknownCdmTypeException
898 886
	 */
899 887
	public static Integer presenceAbsenceTerm2OccurrenceStatusId(PresenceAbsenceTerm term) {
900 888
		Integer result = null;
......
2301 2289

  
2302 2290
	/**
2303 2291
	 * Returns the NoteCategoryFk for a given UUID representing an ExtensionType.
2304
	 * @param uuid
2305
	 * @return
2306 2292
	 */
2307 2293
	public static Integer getNoteCategoryFk(UUID uuid) {
2308 2294
		Integer result = null;
......
2318 2304

  
2319 2305
	/**
2320 2306
	 * Returns the NoteCategoryCache for a given UUID representing an ExtensionType.
2321
	 * @param uuid
2322
	 * @return
2323 2307
	 */
2324 2308
	public static String getNoteCategoryCache(UUID uuid) {
2325 2309
		String result = null;
......
2378 2362
		}
2379 2363
	}
2380 2364

  
2381

  
2382 2365
	public Object getSourceUseCacheByKey(Integer sourceUseFk) {
2383 2366
		if (sourceUseFk == null){
2384 2367
			return null;
......
2424 2407
		if (sources.contains(PesiSource.ERMS)){
2425 2408
			result = CdmUtils.concat(",", result,  SOURCE_STR_ERMS);
2426 2409
		}
2427

  
2428 2410
		return result;
2429 2411
	}
2430 2412

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)