Project

General

Profile

« Previous | Next » 

Revision 32be2fc4

Added by Patrick Plitzner over 6 years ago

Correct combination author handling

  • ex author error handling

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportNames.java
45 45
@Component
46 46
@SuppressWarnings("serial")
47 47
public class RedListGefaesspflanzenImportNames extends DbImportBase<RedListGefaesspflanzenImportState, RedListGefaesspflanzenImportConfigurator> {
48
    /**
49
     *
50
     */
48

  
51 49
    private static final String EX = " ex ";
52 50

  
53 51
    private static final Logger logger = Logger.getLogger(RedListGefaesspflanzenImportNames.class);
......
145 143
        if(authorKombString.contains(EX)){
146 144
            //TODO: what happens with multiple ex authors??
147 145
            String[] kombSplit = authorKombString.split(EX);
146
            if(kombSplit.length!=2){
147
                logger.error("NAMNR: "+id+" Multiple ex combination authors found");
148
            }
148 149
            for (int i = 0; i < kombSplit.length; i++) {
149 150
                if(i==0){
150 151
                    //first author is ex author
......
165 166
        if(authorBasiString.contains(EX)){
166 167
            String[] basiSplit = authorBasiString.split(EX);
167 168
            for (int i = 0; i < basiSplit.length; i++) {
169
                if(basiSplit.length!=2){
170
                    logger.error("NAMNR: "+id+" Multiple ex basionymn authors found");
171
                }
168 172
                if(i==0){
169 173
                    TeamOrPersonBase authorBasi = HibernateProxyHelper.deproxy(getAgentService().load(state.getAuthorMap().get(basiSplit[i])), TeamOrPersonBase.class);
170 174
                    name.setExBasionymAuthorship(authorBasi);
......
176 180
            }
177 181
        }
178 182
        else if(!CdmUtils.isBlank(authorBasiString)){
183
            //this seems to be a convention in the source database: When there is only a single author then only the "AUTOR_BASI" column is used
179 184
            TeamOrPersonBase authorBasi = HibernateProxyHelper.deproxy(getAgentService().load(state.getAuthorMap().get(authorBasiString)), TeamOrPersonBase.class);
180
            name.setBasionymAuthorship(authorBasi);
185
            if(CdmUtils.isBlank(authorKombString)){
186
                name.setCombinationAuthorship(authorBasi);
187
            }
188
            else{
189
                name.setBasionymAuthorship(authorBasi);
190
            }
181 191
        }
182 192

  
183 193
        //check authorship consistency

Also available in: Unified diff