Skip to content

Commit

Permalink
Add an importer for Citavi backup files (#8848)
Browse files Browse the repository at this point in the history
* First draft for citavi
Add generated citavi xsd schema

* add 'CitaviXmlImporter.java' first draft, based on endnotexmlimporter.

* Add '.ctv6bak' and '.ctv5bak' file type in the file type list.

* Modify the citavi importer, draft of importDatabase()

* Modify the citavi importer, draft of isRecognizedFormat()

* fix spell error for citavi

* update getReaderFromZip()

* XSD file for Citavi updated and isRecognizedFormat method updated

* update xsd

* update xsd

* update CitaviXmlImporter.java

* update CitaviXmlImporter.java. Add a function to check and delete the utf-8 BOM bytes in the XML file

* update xsd file and parseData function in citaviimporter

* Add CitaviXmlImporterTestFiles.java

* fix codestyle

* CitaviXmlImporterTestFiles.java update the test functions

* Add test example

* XSD file updated. Importing functions in CitaviXmlImporter updated.

* Add clean up for temp file

* Add test files

* Importing authors' name functionality fixed

* Some other fields added

* fix the author and editor format

* Small bug fixed

* fixed the null pointer exception of publishers ,keywords,editors and authors

* add the test examples.

* update CHANGELOG.md

* update CHANGELOG.md

* Remove unused import format preferences
Fix some resouces leaks

Use AuthorListParser

* checkstyle

* Store knownPersons in a HashMap, for efficient lookup
Store referenceId and identified persons also

* checkstyle

* remove blank lines

* update the logic to parse Keywords and Publishers.

* Update src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java

Co-authored-by: Christoph <[email protected]>

* Update src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java

Co-authored-by: Christoph <[email protected]>

* update CHANGELOG.md

* delete the optional warp of getPages()

* delete the JavaDoc lines

* add an empty line between varable declaration and method.

Co-authored-by: Siedlerchr <[email protected]>
Co-authored-by: Lefei Mei <[email protected]>
  • Loading branch information
3 people authored Jun 1, 2022
1 parent a445eaa commit 943489e
Show file tree
Hide file tree
Showing 16 changed files with 2,541 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We added a fetcher for [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/). [8539](https://github.com/JabRef/jabref/issues/8539)
- We added support for multiple messages in the snackbar. [#7340](https://github.com/JabRef/jabref/issues/7340)
- JabRef now writes log files. Linux: `$home/.cache/jabref/logs/version`, Windows: `%APPDATA%\..\Local\harawata\jabref\version\logs`, Mac: `Users/.../Library/Logs/jabref/version`
- We added an importer for Citavi backup files, support ".ctv5bak" and ".ctv6bak" file formats. [#8322](https://github.com/JabRef/jabref/issues/8322)

### Changed

Expand Down
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ task generateSource(dependsOn: ["generateBstGrammarSource",
"generateMedlineSource",
"generateBibtexmlSource",
"generateEndnoteSource",
"generateModsSource"]) {
"generateModsSource",
"generateCitaviSource"]) {
group = 'JabRef'
description 'Generates all necessary (Java) source files.'
}
Expand Down Expand Up @@ -319,6 +320,15 @@ task generateEndnoteSource(type: XjcTask) {
javaPackage = "org.jabref.logic.importer.fileformat.endnote"
}

task generateCitaviSource(type: XjcTask) {
group = 'JabRef'
description = "Generates java files for the citavi importer."

schemaFile = "src/main/resources/xjc/citavi/citavi.xsd"
outputDirectory = "src-gen/main/java/"
javaPackage = "org.jabref.logic.importer.fileformat.citavi"
}

task generateModsSource(type: XjcTask) {
group = 'JabRef'
description = "Generates java files for the mods importer."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.jabref.logic.importer.fileformat.BiblioscapeImporter;
import org.jabref.logic.importer.fileformat.BibtexImporter;
import org.jabref.logic.importer.fileformat.CffImporter;
import org.jabref.logic.importer.fileformat.CitaviXmlImporter;
import org.jabref.logic.importer.fileformat.CopacImporter;
import org.jabref.logic.importer.fileformat.EndnoteImporter;
import org.jabref.logic.importer.fileformat.EndnoteXmlImporter;
Expand Down Expand Up @@ -84,6 +85,7 @@ public void resetImportFormats(ImporterPreferences importerPreferences, GeneralP
formats.add(new CffImporter());
formats.add(new BiblioscapeImporter());
formats.add(new BibtexImporter(importFormatPreferences, fileMonitor));
formats.add(new CitaviXmlImporter());

// Get custom import formats
formats.addAll(importFormatPreferences.getCustomImportList());
Expand Down
Loading

0 comments on commit 943489e

Please sign in to comment.