From 40c29be6c106fb51b4b0cc5cb1af68cda3578137 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2019 09:01:10 +0000 Subject: [PATCH 1/3] Bump jaxb-xjc from 2.2.4-1 to 2.3.2 Bumps jaxb-xjc from 2.2.4-1 to 2.3.2. Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d4ed5e7e680..1a2867ad4f2 100644 --- a/build.gradle +++ b/build.gradle @@ -225,7 +225,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 'com.sun.xml.bind:jaxb-xjc:2.3.2' jython 'org.python:jython-standalone:2.7.1' } From b104cb7ca7242554f0096c42c074afcd7e75e171 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 9 Sep 2019 21:28:21 +0200 Subject: [PATCH 2/3] Fix build --- build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 1a2867ad4f2..da279fc28e7 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.3.2' + xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.2' jython 'org.python:jython-standalone:2.7.1' } From 76b3cd7581614c2c70a48d6cbc714bd5f0cb49f5 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 9 Sep 2019 21:59:54 +0200 Subject: [PATCH 3/3] Fix endnote by converting to xsd --- build.gradle | 3 +- .../fileformat/EndnoteXmlImporter.java | 26 +- src/main/resources/xjc/endnote/RSXML.dtd | 168 ---- src/main/resources/xjc/endnote/endnote.xsd | 790 ++++++++++++++++++ 4 files changed, 804 insertions(+), 183 deletions(-) delete mode 100644 src/main/resources/xjc/endnote/RSXML.dtd create mode 100644 src/main/resources/xjc/endnote/endnote.xsd diff --git a/build.gradle b/build.gradle index da279fc28e7..ca879487f64 100644 --- a/build.gradle +++ b/build.gradle @@ -353,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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +