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);
}
}
}
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(), ", "));
}
}
Aggregations