Project

General

Profile

Revision 4f913449

ID4f9134494db76e9b3dd8f517d4fbd130376a0951
Parent 0455fc3f
Child fad62c08

Added by Andreas Müller almost 4 years ago

ref #7216 implement pro parte misapplied names for Cuba import

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/cuba/CubaExcelImport.java
64 64
import eu.etaxonomy.cdm.model.taxon.SynonymType;
65 65
import eu.etaxonomy.cdm.model.taxon.Taxon;
66 66
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
67
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
67 68
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
68 69
import eu.etaxonomy.cdm.strategy.homotypicgroup.BasionymRelationCreator;
69 70
import eu.etaxonomy.cdm.strategy.parser.INonViralNameParser;
......
405 406
            Taxon misappliedNameTaxon = Taxon.NewInstance(name, null);
406 407
            misappliedNameTaxon.addSource(makeOriginalSource(state));
407 408
            misappliedNameTaxon.setDoubtful(doubtful);
409
            boolean isProParteMisapplied = false;
408 410
            if (secondPart.startsWith("sensu")){
409 411
                secondPart = secondPart.substring(5).trim();
412
                if (secondPart.endsWith(" p.p.")){
413
                    secondPart = secondPart.replaceAll(" p.p.$", "");
414
                    isProParteMisapplied = true;
415
                }
410 416
                Reference sensu;
411 417
                if (isConcreteReference(secondPart)) {
412 418
                    List<Reference> sensuRefs = getConcreteReferences(secondPart, state);
......
431 437
            }
432 438
            //TODO
433 439
            Reference relRef = null;
434
            state.getCurrentTaxon().addMisappliedName(misappliedNameTaxon, relRef, null);
440
            TaxonRelationship rel = state.getCurrentTaxon().addMisappliedName(misappliedNameTaxon, relRef, null);
441
            if (isProParteMisapplied){
442
                rel.setType(TaxonRelationshipType.PRO_PARTE_MISAPPLIED_NAME_FOR());
443
            }
435 444
        }else if (nomInvalMatcher.matches()){
436 445
            String firstPart = nomInvalMatcher.group(1);
437 446
            String afterInval = nomInvalMatcher.group(2);
......
500 509
        boolean result = false;
501 510
        String[] splits = secondPart.split(",");
502 511
        for (String split : splits){
503
            split = split.trim();
512
            split = split.trim().replaceAll(" p.p.$", "");
504 513
            result = split.equals("Griseb. 2") || split.equals("Sauv. 3")
505 514
                    || split.equals("Grisebach 5") || split.equals("Griseb. 78") ;
506 515
            if (result == false){
......
514 523
        List<Reference> result = new ArrayList<>();
515 524
        String[] splits = secondPart.split(",");
516 525
        for (String split : splits){
517
            split = split.trim();
526
            split = split.trim().replaceAll(" p.p.$", "");
518 527
            if (split.equals("Griseb. 2")){
519 528
                result.add(getSourceByNumber("2", state));
520 529
            }else if (split.equals("Sauv. 3")){

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)