Search in sources :

Example 1 with ELocationID

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

the class MedlineImporter method addArticleInformation.

private void addArticleInformation(Map<String, String> fields, List<Object> content) {
    for (Object object : content) {
        if (object instanceof Journal) {
            Journal journal = (Journal) object;
            putIfValueNotNull(fields, FieldName.JOURNAL, journal.getTitle());
            ISSN issn = journal.getISSN();
            if (issn != null) {
                putIfValueNotNull(fields, FieldName.ISSN, issn.getContent());
            }
            JournalIssue journalIssue = journal.getJournalIssue();
            putIfValueNotNull(fields, FieldName.VOLUME, journalIssue.getVolume());
            putIfValueNotNull(fields, FieldName.ISSUE, journalIssue.getIssue());
            addPubDate(fields, journalIssue.getPubDate());
        } else if (object instanceof ArticleTitle) {
            ArticleTitle articleTitle = (ArticleTitle) object;
            fields.put(FieldName.TITLE, StringUtil.stripBrackets(articleTitle.getContent().toString()));
        } else if (object instanceof Pagination) {
            Pagination pagination = (Pagination) object;
            addPagination(fields, pagination);
        } else if (object instanceof ELocationID) {
            ELocationID eLocationID = (ELocationID) object;
            addElocationID(fields, eLocationID);
        } else if (object instanceof Abstract) {
            Abstract abs = (Abstract) object;
            addAbstract(fields, abs);
        } else if (object instanceof AuthorList) {
            AuthorList authors = (AuthorList) object;
            handleAuthors(fields, authors);
        }
    }
}
Also used : Pagination(org.jabref.logic.importer.fileformat.medline.Pagination) JournalIssue(org.jabref.logic.importer.fileformat.medline.JournalIssue) Abstract(org.jabref.logic.importer.fileformat.medline.Abstract) ISSN(org.jabref.logic.importer.fileformat.medline.ISSN) AuthorList(org.jabref.logic.importer.fileformat.medline.AuthorList) ArticleTitle(org.jabref.logic.importer.fileformat.medline.ArticleTitle) ELocationID(org.jabref.logic.importer.fileformat.medline.ELocationID) Journal(org.jabref.logic.importer.fileformat.medline.Journal)

Example 2 with ELocationID

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

the class MedlineImporter method addBookInformation.

private void addBookInformation(Map<String, String> fields, Book book) {
    if (book.getPublisher() != null) {
        Publisher publisher = book.getPublisher();
        putIfValueNotNull(fields, "publocation", publisher.getPublisherLocation());
        putStringFromSerializableList(fields, FieldName.PUBLISHER, publisher.getPublisherName().getContent());
    }
    if (book.getBookTitle() != null) {
        BookTitle title = book.getBookTitle();
        putStringFromSerializableList(fields, FieldName.TITLE, title.getContent());
    }
    if (book.getPubDate() != null) {
        addPubDate(fields, book.getPubDate());
    }
    if (book.getAuthorList() != null) {
        List<AuthorList> authorLists = book.getAuthorList();
        //authorLists size should be one
        if (authorLists.size() == 1) {
            for (AuthorList authorList : authorLists) {
                handleAuthors(fields, authorList);
            }
        } else {
            LOGGER.info(String.format("Size of authorlist was %s", authorLists.size()));
        }
    }
    putIfValueNotNull(fields, FieldName.VOLUME, book.getVolume());
    putIfValueNotNull(fields, FieldName.EDITION, book.getEdition());
    putIfValueNotNull(fields, "medium", book.getMedium());
    putIfValueNotNull(fields, "reportnumber", book.getReportNumber());
    if (book.getELocationID() != null) {
        for (ELocationID id : book.getELocationID()) {
            addElocationID(fields, id);
        }
    }
    if (book.getIsbn() != null) {
        fields.put(FieldName.ISBN, join(book.getIsbn(), ", "));
    }
}
Also used : AuthorList(org.jabref.logic.importer.fileformat.medline.AuthorList) ELocationID(org.jabref.logic.importer.fileformat.medline.ELocationID) Publisher(org.jabref.logic.importer.fileformat.medline.Publisher) BookTitle(org.jabref.logic.importer.fileformat.medline.BookTitle)

Aggregations

AuthorList (org.jabref.logic.importer.fileformat.medline.AuthorList)2 ELocationID (org.jabref.logic.importer.fileformat.medline.ELocationID)2 Abstract (org.jabref.logic.importer.fileformat.medline.Abstract)1 ArticleTitle (org.jabref.logic.importer.fileformat.medline.ArticleTitle)1 BookTitle (org.jabref.logic.importer.fileformat.medline.BookTitle)1 ISSN (org.jabref.logic.importer.fileformat.medline.ISSN)1 Journal (org.jabref.logic.importer.fileformat.medline.Journal)1 JournalIssue (org.jabref.logic.importer.fileformat.medline.JournalIssue)1 Pagination (org.jabref.logic.importer.fileformat.medline.Pagination)1 Publisher (org.jabref.logic.importer.fileformat.medline.Publisher)1