diff --git a/build.gradle b/build.gradle index d4ed5e7e680..ca879487f64 100644 --- a/build.gradle +++ b/build.gradle @@ -35,6 +35,8 @@ plugins { // use the gradle build scan feature: https://scans.gradle.com/get-started buildScan { termsOfServiceUrl = 'https://gradle.com/terms-of-service'; termsOfServiceAgree = 'yes' } +// show stacktrace on error +gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.ShowStacktrace.ALWAYS apply plugin: 'java' apply plugin: 'application' @@ -225,7 +227,7 @@ dependencies { testCompile "org.testfx:testfx-junit5:4.0.15-alpha" checkstyle 'com.puppycrawl.tools:checkstyle:8.24' - xjc 'com.sun.xml.bind:jaxb-xjc:2.2.4-1' + xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.2' jython 'org.python:jython-standalone:2.7.1' } @@ -351,10 +353,9 @@ task generateEndnoteSource(type: XjcTask) { group = 'JabRef' description = "Generates java files for the endnote importer." - schemaFile = "src/main/resources/xjc/endnote/RSXML.dtd" + schemaFile = "src/main/resources/xjc/endnote/endnote.xsd" outputDirectory = "src/main/gen/" javaPackage = "org.jabref.logic.importer.fileformat.endnote" - arguments = '-dtd' } task generateModsSource(type: XjcTask) { diff --git a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java index 9268a519630..fb2d6bc2b36 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java @@ -186,49 +186,49 @@ private BibEntry parseRecord(Record record) { Optional.ofNullable(record.getTitles()) .map(Titles::getTitle) .map(Title::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(value -> entry.setField(StandardField.TITLE, clean(value))); Optional.ofNullable(record.getTitles()) .map(Titles::getSecondaryTitle) .map(SecondaryTitle::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(value -> entry.setField(StandardField.JOURNAL, clean(value))); Optional.ofNullable(record.getPages()) .map(Pages::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(value -> entry.setField(StandardField.PAGES, value)); Optional.ofNullable(record.getNumber()) .map(Number::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(value -> entry.setField(StandardField.NUMBER, value)); Optional.ofNullable(record.getVolume()) .map(Volume::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(value -> entry.setField(StandardField.VOLUME, value)); Optional.ofNullable(record.getDates()) .map(Dates::getYear) .map(Year::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(value -> entry.setField(StandardField.YEAR, value)); Optional.ofNullable(record.getNotes()) .map(Notes::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(value -> entry.setField(StandardField.NOTE, value.trim())); getUrl(record) .ifPresent(value -> entry.setField(StandardField.URL, value)); entry.putKeywords(getKeywords(record), preferences.getKeywordSeparator()); Optional.ofNullable(record.getAbstract()) .map(Abstract::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(value -> entry.setField(StandardField.ABSTRACT, value.trim())); entry.setFiles(getLinkedFiles(record)); Optional.ofNullable(record.getIsbn()) .map(Isbn::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(value -> entry.setField(StandardField.ISBN, clean(value))); Optional.ofNullable(record.getElectronicResourceNum()) .map(ElectronicResourceNum::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .ifPresent(doi -> entry.setField(StandardField.DOI, doi.trim())); return entry; @@ -263,7 +263,7 @@ private Optional getUrl(Record record) { private Optional getUrlValue(Url url) { return Optional.ofNullable(url) .map(Url::getStyle) - .map(Style::getvalue) + .map(Style::getContent) .map(this::clean); } @@ -272,7 +272,7 @@ private List getKeywords(Record record) { if (keywords != null) { return keywords.getKeyword() .stream() - .map(keyword -> keyword.getStyle().getvalue()) + .map(keyword -> keyword.getStyle().getContent()) .collect(Collectors.toList()); } else { return Collections.emptyList(); @@ -284,7 +284,7 @@ private String getAuthors(Record record) { .map(Contributors::getAuthors); return OptionalUtil.toStream(authors) .flatMap(value -> value.getAuthor().stream()) - .map(author -> author.getStyle().getvalue()) + .map(author -> author.getStyle().getContent()) .collect(Collectors.joining(" and ")); } diff --git a/src/main/resources/xjc/endnote/RSXML.dtd b/src/main/resources/xjc/endnote/RSXML.dtd deleted file mode 100644 index 32aa229358b..00000000000 --- a/src/main/resources/xjc/endnote/RSXML.dtd +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/xjc/endnote/endnote.xsd b/src/main/resources/xjc/endnote/endnote.xsd new file mode 100644 index 00000000000..5cfbe1893ca --- /dev/null +++ b/src/main/resources/xjc/endnote/endnote.xsd @@ -0,0 +1,790 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +