Search in sources :

Example 6 with BibtexImporter

use of org.jabref.logic.importer.fileformat.BibtexImporter in project jabref by JabRef.

the class ImportFormatReader method resetImportFormats.

public void resetImportFormats(ImportFormatPreferences newImportFormatPreferences, XMPPreferences xmpPreferences) {
    this.importFormatPreferences = newImportFormatPreferences;
    formats.clear();
    formats.add(new BiblioscapeImporter());
    formats.add(new BibtexImporter(importFormatPreferences));
    formats.add(new BibTeXMLImporter());
    formats.add(new CopacImporter());
    formats.add(new EndnoteImporter(importFormatPreferences));
    formats.add(new FreeCiteImporter(importFormatPreferences));
    formats.add(new InspecImporter());
    formats.add(new IsiImporter());
    formats.add(new MedlineImporter());
    formats.add(new MedlinePlainImporter());
    formats.add(new ModsImporter());
    formats.add(new MsBibImporter());
    formats.add(new OvidImporter());
    formats.add(new PdfContentImporter(importFormatPreferences));
    formats.add(new PdfXmpImporter(xmpPreferences));
    formats.add(new RepecNepImporter(importFormatPreferences));
    formats.add(new RisImporter());
    formats.add(new SilverPlatterImporter());
    // Get custom import formats
    for (CustomImporter importer : importFormatPreferences.getCustomImportList()) {
        formats.add(importer);
    }
}
Also used : BiblioscapeImporter(org.jabref.logic.importer.fileformat.BiblioscapeImporter) IsiImporter(org.jabref.logic.importer.fileformat.IsiImporter) RisImporter(org.jabref.logic.importer.fileformat.RisImporter) CustomImporter(org.jabref.logic.importer.fileformat.CustomImporter) MsBibImporter(org.jabref.logic.importer.fileformat.MsBibImporter) RepecNepImporter(org.jabref.logic.importer.fileformat.RepecNepImporter) EndnoteImporter(org.jabref.logic.importer.fileformat.EndnoteImporter) SilverPlatterImporter(org.jabref.logic.importer.fileformat.SilverPlatterImporter) CopacImporter(org.jabref.logic.importer.fileformat.CopacImporter) ModsImporter(org.jabref.logic.importer.fileformat.ModsImporter) OvidImporter(org.jabref.logic.importer.fileformat.OvidImporter) PdfContentImporter(org.jabref.logic.importer.fileformat.PdfContentImporter) MedlinePlainImporter(org.jabref.logic.importer.fileformat.MedlinePlainImporter) BibTeXMLImporter(org.jabref.logic.importer.fileformat.BibTeXMLImporter) InspecImporter(org.jabref.logic.importer.fileformat.InspecImporter) BibtexImporter(org.jabref.logic.importer.fileformat.BibtexImporter) MedlineImporter(org.jabref.logic.importer.fileformat.MedlineImporter) PdfXmpImporter(org.jabref.logic.importer.fileformat.PdfXmpImporter) FreeCiteImporter(org.jabref.logic.importer.fileformat.FreeCiteImporter)

Example 7 with BibtexImporter

use of org.jabref.logic.importer.fileformat.BibtexImporter in project jabref by JabRef.

the class OpenDatabase method loadDatabase.

/**
     * Opens a new database.
     */
public static ParserResult loadDatabase(File fileToOpen, ImportFormatPreferences importFormatPreferences) throws IOException {
    ParserResult result = new BibtexImporter(importFormatPreferences).importDatabase(fileToOpen.toPath(), importFormatPreferences.getEncoding());
    if (importFormatPreferences.isKeywordSyncEnabled()) {
        for (BibEntry entry : result.getDatabase().getEntries()) {
            SpecialFieldsUtils.syncSpecialFieldsFromKeywords(entry, importFormatPreferences.getKeywordSeparator());
        }
        LOGGER.debug("Synchronized special fields based on keywords");
    }
    applyPostActions(result);
    return result;
}
Also used : BibEntry(org.jabref.model.entry.BibEntry) BibtexImporter(org.jabref.logic.importer.fileformat.BibtexImporter)

Aggregations

BibtexImporter (org.jabref.logic.importer.fileformat.BibtexImporter)7 BibDatabaseContext (org.jabref.model.database.BibDatabaseContext)4 Before (org.junit.Before)4 ModsImporter (org.jabref.logic.importer.fileformat.ModsImporter)3 BibTeXMLImporter (org.jabref.logic.importer.fileformat.BibTeXMLImporter)2 BiblioscapeImporter (org.jabref.logic.importer.fileformat.BiblioscapeImporter)2 CopacImporter (org.jabref.logic.importer.fileformat.CopacImporter)2 EndnoteImporter (org.jabref.logic.importer.fileformat.EndnoteImporter)2 FreeCiteImporter (org.jabref.logic.importer.fileformat.FreeCiteImporter)2 InspecImporter (org.jabref.logic.importer.fileformat.InspecImporter)2 IsiImporter (org.jabref.logic.importer.fileformat.IsiImporter)2 MedlineImporter (org.jabref.logic.importer.fileformat.MedlineImporter)2 MedlinePlainImporter (org.jabref.logic.importer.fileformat.MedlinePlainImporter)2 MsBibImporter (org.jabref.logic.importer.fileformat.MsBibImporter)2 OvidImporter (org.jabref.logic.importer.fileformat.OvidImporter)2 PdfContentImporter (org.jabref.logic.importer.fileformat.PdfContentImporter)2 PdfXmpImporter (org.jabref.logic.importer.fileformat.PdfXmpImporter)2 RepecNepImporter (org.jabref.logic.importer.fileformat.RepecNepImporter)2 RisImporter (org.jabref.logic.importer.fileformat.RisImporter)2 SilverPlatterImporter (org.jabref.logic.importer.fileformat.SilverPlatterImporter)2