Project

General

Profile

« Previous | Next » 

Revision 60f8f830

Added by Patrick Plitzner about 6 years ago

Export concept realtion type #5452

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/bfnXml/BfnXmlConstants.java
69 69
    public static final String EL_SYNONYM = "SYNONYM";
70 70
    public static final String EL_STATI = "STATI";
71 71
    public static final String EL_STATUS = "STATUS";
72
    public static final String ATT_STATUS_KONZEPTSYNONYM_STATUS = "Konzeptsynonymstatus";
72 73
    public static final String ATT_TYP = "typ";
73 74

  
74 75
    public static final String EL_INFORMATIONEN = "INFORMATIONEN";
app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/bfnXml/out/BfnXmlExportConceptRelations.java
18 18

  
19 19
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
20 20
import eu.etaxonomy.cdm.io.redlist.bfnXml.BfnXmlConstants;
21
import eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlTransformer;
21 22
import eu.etaxonomy.cdm.model.common.DefinedTerm;
22 23
import eu.etaxonomy.cdm.model.taxon.Classification;
23 24
import eu.etaxonomy.cdm.model.taxon.Taxon;
......
62 63
                    if(!state.getKnownConceptRelations().contains(uuid)) {
63 64
                        if(konzeptbeziehungen==null){
64 65
                            konzeptbeziehungen = new Element(BfnXmlConstants.EL_KONZEPTBEZIEHUNGEN);
65
                            document.addContent(konzeptbeziehungen);
66
                            document.getRootElement().addContent(konzeptbeziehungen);
66 67
                        }
67 68
                        Element konzeptbeziehung = new Element(BfnXmlConstants.EL_KONZEPTBEZIEHUNG);
68 69
                        konzeptbeziehungen.addContent(konzeptbeziehung);
......
82 83
                        addConceptTaxonym(taxNrIdentifierType, taxonym2, toTaxon);
83 84

  
84 85
                        //relation type
85

  
86
                        Element konzeptSynonymStatus = new Element(BfnXmlConstants.EL_STATUS);
87
                        konzeptbeziehung.addContent(konzeptSynonymStatus);
88
                        konzeptSynonymStatus.setAttribute(BfnXmlConstants.ATT_STANDARDNAME, BfnXmlConstants.ATT_STATUS_KONZEPTSYNONYM_STATUS);
89
                        konzeptSynonymStatus.addContent(BfnXmlTransformer.getConceptCodeForTaxonRelation(taxonRelationship.getType()));
86 90
                    }
87 91
                }
88 92
            }
......
96 100
            logger.error(taxon+" has more than one taxon node. First one is used");
97 101
        }
98 102
        Classification classification = taxon.getTaxonNodes().iterator().next().getClassification();
99
        taxonym.setAttribute(BfnXmlConstants.ATT_QUELLE, classification.getTitleCache());
100 103
        taxonym.setAttribute(BfnXmlConstants.ATT_TAXNR, taxNr);
104
        taxonym.setAttribute(BfnXmlConstants.ATT_QUELLE, classification.getTitleCache());
101 105
        addIwert(taxonym, BfnXmlConstants.ATT_NAME, taxon.getName().getTitleCache());
102 106
    }
103 107

  
app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/bfnXml/out/BfnXmlExportConfigurator.java
13 13

  
14 14
import org.apache.log4j.Logger;
15 15
import org.jdom2.Document;
16

  
16 17
import eu.etaxonomy.cdm.database.ICdmDataSource;
17 18
import eu.etaxonomy.cdm.io.common.XmlExportConfiguratorBase;
18 19
import eu.etaxonomy.cdm.io.common.mapping.out.IExportTransformer;
......
44 45
	@Override
45 46
    protected void makeIoClassList(){
46 47
		ioClassList = new Class[]{
47
				BfnXmlTaxonNameExport.class
48
				BfnXmlTaxonNameExport.class,
49
				BfnXmlExportConceptRelations.class
48 50
		};
49 51

  
50 52
	}

Also available in: Unified diff