Project

General

Profile

Revision 3fcbef80

ID3fcbef808bbb6bb02f2ffaa52ca46ab1cc958a1d
Parent be33baac
Child 17d2281a

Added by Andreas Müller about 3 years ago

ref #6636 handle Books correctly in RIS import

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/reference/ris/in/RisReferenceImport.java
110 110
        ReferenceType type = makeReferenceType(state, record);
111 111
        Reference ref = ReferenceFactory.newReference(type);
112 112
        Reference inRef = null;
113
        if (ref.getType().isSection()){
113
        if (hasInRef(ref)){
114 114
            ReferenceType inRefType =
115 115
                    type == ReferenceType.Article ? ReferenceType.Journal:
116 116
                    type == ReferenceType.BookSection ? ReferenceType.Book :
......
266 266
        return ref;
267 267
    }
268 268

  
269
    /**
270
     * @param ref
271
     * @return
272
     */
273
    private boolean hasInRef(Reference ref) {
274
        return ref.getType() == ReferenceType.BookSection || ref.getType() == ReferenceType.Article ;
275
    }
276

  
269 277

  
270 278
    /**
271 279
     * @param state
cdmlib-io/src/test/java/eu/etaxonomy/cdm/io/reference/RisReferenceImportTest.java
146 146
        String report = result.createReport().toString();
147 147
        System.out.println(report);
148 148

  
149
        Integer expected = 123;  //did not count yet
149
        Integer expected = 118;  //did not count yet
150 150
        Assert.assertEquals(expected, result.getNewRecords(Reference.class));
151 151

  
152 152
//        List<Reference> list = referenceService.list(Reference.class, null, null, null, null);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)