From 058cf2fbdeeb4f80060cfd0cdf7c743475d8c9dc Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Mon, 5 Sep 2016 19:14:40 +0200 Subject: [PATCH 01/12] create new fetcher and test --- .../logic/importer/fetcher/AdsFetcher.java | 111 ++++++++++++++++++ .../importer/fetcher/AdsFetcherTest.java | 69 +++++++++++ 2 files changed, 180 insertions(+) create mode 100644 src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java create mode 100644 src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java diff --git a/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java b/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java new file mode 100644 index 00000000000..c1a90327cc2 --- /dev/null +++ b/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java @@ -0,0 +1,111 @@ +package net.sf.jabref.logic.importer.fetcher; + +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.Optional; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; + +import net.sf.jabref.logic.help.HelpFile; +import net.sf.jabref.logic.importer.FetcherException; +import net.sf.jabref.logic.importer.IdBasedFetcher; +import net.sf.jabref.logic.importer.ImportFormatPreferences; +import net.sf.jabref.logic.importer.fileformat.BibtexParser; +import net.sf.jabref.logic.l10n.Localization; +import net.sf.jabref.model.entry.BibEntry; +import net.sf.jabref.model.entry.FieldName; + +import com.mashape.unirest.http.Unirest; +import com.mashape.unirest.http.exceptions.UnirestException; +import org.apache.http.client.utils.URIBuilder; + +/** + * This class handles accessing and obtaining BibTeX entry + * from ADS(The NASA Astrophysics Data System). + * Fetching using DOI(Document Object Identifier) is only supported. + */ +public class AdsFetcher implements IdBasedFetcher { + + private static final String URL_PATTERN = "http://adsabs.harvard.edu/doi/"; + + private ImportFormatPreferences preferences; + + public AdsFetcher(ImportFormatPreferences preferences) { + this.preferences = preferences; + } + + @Override + public String getName() { + return "ADS from ADS-DOI"; + } + + @Override + public HelpFile getHelpPage() { + return HelpFile.FETCHER_ADS; + } + + @Override + public Optional performSearchById(String identifier) throws FetcherException { + Optional result = Optional.empty(); + + String key = identifier.replaceAll("^(doi:|DOI:)", ""); + + try { + URIBuilder uriBuilder = new URIBuilder(URL_PATTERN + key); + uriBuilder.addParameter("data_type", "BIBTEX"); + URL url = uriBuilder.build().toURL(); + + String bibtexString = Unirest.get(url.toString()).asString().getBody(); + + if(bibtexString.contains("@")) { + bibtexString = bibtexString.substring(bibtexString.indexOf("@")); + result = BibtexParser.singleFromString(bibtexString, preferences); + } + + if (result.isPresent()) { + BibEntry entry = result.get(); + URIBuilder uriBuilderAbstract = new URIBuilder(URL_PATTERN + key); + uriBuilderAbstract.addParameter("data_type", "XML"); + URL urlAbstract = uriBuilderAbstract.build().toURL(); + + String abstractString = Unirest.get(urlAbstract.toString()).asString().getBody(); + InputStream stream = new ByteArrayInputStream(abstractString.getBytes(StandardCharsets.UTF_8)); + + XMLInputFactory factory = XMLInputFactory.newInstance(); + XMLStreamReader reader = factory.createXMLStreamReader(new BufferedInputStream(stream)); + boolean isAbstract = false; + StringBuilder abstractSB = new StringBuilder(); + while (reader.hasNext()) { + reader.next(); + if (reader.isStartElement() && + FieldName.ABSTRACT.equals(reader.getLocalName())) { + isAbstract = true; + } + if (isAbstract && reader.isCharacters()) { + abstractSB.append(reader.getText()); + } + if (isAbstract && reader.isEndElement()) { + isAbstract = false; + } + } + String abstractText = abstractSB.toString(); + abstractText = abstractText.replace("\n", " "); + entry.setField(FieldName.ABSTRACT, abstractText); + result = Optional.of(entry); + } + } catch (MalformedURLException | UnirestException | URISyntaxException e) { + throw new FetcherException("Error fetching ADS", e); + } catch (XMLStreamException e) { + throw new FetcherException(Localization.lang("An_error_occurred_while_parsing_abstract"), e); + } + return result; + } + +} diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java new file mode 100644 index 00000000000..4a06cc7fa11 --- /dev/null +++ b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java @@ -0,0 +1,69 @@ +package net.sf.jabref.logic.importer.fetcher; + +import java.util.Optional; + +import net.sf.jabref.Globals; +import net.sf.jabref.model.entry.BibEntry; +import net.sf.jabref.model.entry.BibLatexEntryTypes; + +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class AdsFetcherTest { + + private AdsFetcher fetcher; + private BibEntry bibEntry; + + @Before + public void setUp() { + fetcher = new AdsFetcher(Globals.prefs.getImportFormatPreferences()); + + bibEntry = new BibEntry(); + bibEntry.setType(BibLatexEntryTypes.ARTICLE); + bibEntry.setField("bibtexkey", "2012LRR....15...10F"); + bibEntry.setField("author", "{Famaey}, B. and {McGaugh}, S.~S."); + bibEntry.setField("title", "{Modified Newtonian Dynamics (MOND): Observational Phenomenology and Relativistic Extensions}"); + bibEntry.setField("journal", "Living Reviews in Relativity"); + bibEntry.setField("year", "2012"); + bibEntry.setField("volume", "15"); + bibEntry.setField("month", "#sep#"); + bibEntry.setField("adsnote", "Provided by the SAO/NASA Astrophysics Data System"); + bibEntry.setField("adsurl", "http://adsabs.harvard.edu/abs/2012LRR....15...10F"); + bibEntry.setField("archiveprefix", "arXiv"); + bibEntry.setField("doi", "10.12942/lrr-2012-10"); + bibEntry.setField("eprint", "1112.3960"); + bibEntry.setField("keywords", "astronomical observations, Newtonian limit, equations of motion, extragalactic astronomy, cosmology, theories of gravity, fundamental physics, astrophysics"); + bibEntry.setField("abstract", "A wealth of astronomical data indicate the presence of mass discrepancies in the Universe. The motions observed in a variety of classes of extragalactic systems exceed what can be explained by the mass visible in stars and gas. Either (i) there is a vast amount of unseen mass in some novel form - dark matter - or (ii) the data indicate a breakdown of our understanding of dynamics on the relevant scales, or (iii) both. Here, we first review a few outstanding challenges for the dark matter interpretation of mass discrepancies in galaxies, purely based on observations and independently of any alternative theoretical framework. We then show that many of these puzzling observations are predicted by one single relation - Milgrom's law - involving an acceleration constant a_0 (or a characteristic surface density Σ_† = a_0/G) on the order of the square-root of the cosmological constant in natural units. This relation can at present most easily be interpreted as the effect of a single universal force law resulting from a modification of Newtonian dynamics (MOND) on galactic scales. We exhaustively review the current observational successes and problems of this alternative paradigm at all astrophysical scales, and summarize the various theoretical attempts (TeVeS, GEA, BIMOND, and others) made to effectively embed this modification of Newtonian dynamics within a relativistic theory of gravity."); + } + + + @Test + public void testName() { + assertEquals("ADS from ADS-DOI", fetcher.getName()); + } + + @Test + public void testHelpPage() { + assertEquals("ADSHelp", fetcher.getHelpPage().getPageName()); + } + + @Test + public void testPerformSearchById() throws Exception { + Optional fetchedEntry = fetcher.performSearchById("10.12942/lrr-2012-10"); + assertEquals(Optional.of(bibEntry), fetchedEntry); + } + + @Test + public void testPerformSearchByIdEmpty() throws Exception { + Optional fetchedEntry = fetcher.performSearchById(""); + assertEquals(Optional.empty(), fetchedEntry); + } + + @Test + public void testPerformSearchByIdInvalidDoi() throws Exception { + Optional fetchedEntry = fetcher.performSearchById("this.doi.will.fail"); + assertEquals(Optional.empty(), fetchedEntry); + } +} From 4e84b9ef37fe971e4763040a50991a7110177733 Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Mon, 5 Sep 2016 19:14:57 +0200 Subject: [PATCH 02/12] remove old fetcher --- .../gui/importer/fetcher/ADSFetcher.java | 165 ------------------ 1 file changed, 165 deletions(-) delete mode 100644 src/main/java/net/sf/jabref/gui/importer/fetcher/ADSFetcher.java diff --git a/src/main/java/net/sf/jabref/gui/importer/fetcher/ADSFetcher.java b/src/main/java/net/sf/jabref/gui/importer/fetcher/ADSFetcher.java deleted file mode 100644 index dd124b576bd..00000000000 --- a/src/main/java/net/sf/jabref/gui/importer/fetcher/ADSFetcher.java +++ /dev/null @@ -1,165 +0,0 @@ -package net.sf.jabref.gui.importer.fetcher; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; -import java.nio.charset.Charset; - -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import net.sf.jabref.Globals; -import net.sf.jabref.logic.help.HelpFile; -import net.sf.jabref.logic.importer.ImportInspector; -import net.sf.jabref.logic.importer.OutputPrinter; -import net.sf.jabref.logic.importer.ParserResult; -import net.sf.jabref.logic.importer.fileformat.BibtexParser; -import net.sf.jabref.logic.l10n.Localization; -import net.sf.jabref.model.database.BibDatabase; -import net.sf.jabref.model.entry.BibEntry; -import net.sf.jabref.model.entry.FieldName; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * - * This class handles accessing and obtaining BibTeX entry - * from ADS(The NASA Astrophysics Data System). - * Fetching using DOI(Document Object Identifier) is only supported. - * - * @author Ryo IGARASHI - */ -public class ADSFetcher implements EntryFetcher { - - private static final Log LOGGER = LogFactory.getLog(ADSFetcher.class); - - - @Override - public JPanel getOptionsPanel() { - return null; - } - - @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_ADS; - } - - @Override - public String getTitle() { - return "ADS from ADS-DOI"; - } - - @Override - public boolean processQuery(String query, ImportInspector dialog, OutputPrinter status) { - try { - /* Remove "doi:" scheme identifier */ - /* Allow fetching only 1 key */ - String key = query.replaceAll("^(doi:|DOI:)", ""); - /* Query ADS and load the results into the BibDatabase */ - status.setStatus(Localization.lang("Processing %0", key)); - BibDatabase bd = importADSEntries(key, status); - if ((bd != null) && bd.hasEntries()) { - /* Add the entry to the inspection dialog */ - for (BibEntry entry : bd.getEntries()) { - importADSAbstract(key, entry, status); - dialog.addEntry(entry); - } - } else { - return false; - } - } catch (Exception e) { - status.setStatus(Localization.lang("Error while fetching from %0", "ADS") + ": " + e.getMessage()); - LOGGER.warn("Error while fetching from ADS", e); - } - return true; - } - - @Override - public void stopFetching() { - // Do nothing - } - - private BibDatabase importADSEntries(String key, OutputPrinter status) { - String url = constructUrl(key); - try { - URL ADSUrl = new URL(url + "&data_type=BIBTEX"); - HttpURLConnection ADSConnection = (HttpURLConnection) ADSUrl.openConnection(); - ADSConnection.setRequestProperty("User-Agent", "JabRef"); - try (BufferedReader reader = new BufferedReader( - new InputStreamReader(ADSConnection.getInputStream(), Charset.forName("ISO-8859-1")))) { - ParserResult pr = BibtexParser.parse(reader, Globals.prefs.getImportFormatPreferences()); - return pr.getDatabase(); - } - } catch (FileNotFoundException e) { - status.showMessage( - Localization.lang("'%0' is not a valid ADS bibcode.", key) + "\n\n" + Localization - .lang("Note: A full text search is currently not supported for %0", getTitle()), - getTitle(), JOptionPane.ERROR_MESSAGE); - LOGGER.debug("File not found", e); - } catch (IOException e) { - status.showMessage(Localization.lang("An exception occurred while accessing '%0'", url) + "\n\n" + e, - getTitle(), JOptionPane.ERROR_MESSAGE); - LOGGER.debug("Problem accessing URL", e); - } catch (RuntimeException e) { - status.showMessage( - Localization.lang("An error occurred while fetching from ADS (%0):", url) + "\n\n" + e.getMessage(), - getTitle(), JOptionPane.ERROR_MESSAGE); - LOGGER.warn("Problem fetching from ADS", e); - } - return null; - } - - private static String constructUrl(String key) { - return "http://adsabs.harvard.edu/doi/" + key; - } - - private void importADSAbstract(String key, BibEntry entry, OutputPrinter status) { - /* TODO: construct ADSUrl from BibEntry */ - String url = constructUrl(key); - try { - URL ADSUrl = new URL(url + "&data_type=XML"); - HttpURLConnection ADSConnection = (HttpURLConnection) ADSUrl.openConnection(); - ADSConnection.setRequestProperty("User-Agent", "JabRef"); - BufferedInputStream bis = new BufferedInputStream(ADSConnection.getInputStream()); - - XMLInputFactory factory = XMLInputFactory.newInstance(); - XMLStreamReader reader = factory.createXMLStreamReader(bis); - boolean isAbstract = false; - StringBuilder abstractSB = new StringBuilder(); - while (reader.hasNext()) { - reader.next(); - if (reader.isStartElement() && - FieldName.ABSTRACT.equals(reader.getLocalName())) { - isAbstract = true; - } - if (isAbstract && reader.isCharacters()) { - abstractSB.append(reader.getText()); - } - if (isAbstract && reader.isEndElement()) { - isAbstract = false; - } - } - String abstractText = abstractSB.toString(); - abstractText = abstractText.replace("\n", " "); - entry.setField(FieldName.ABSTRACT, abstractText); - } catch (XMLStreamException e) { - status.showMessage(Localization.lang("An error occurred while parsing abstract"), getTitle(), - JOptionPane.ERROR_MESSAGE); - } catch (IOException e) { - status.showMessage(Localization.lang("An exception occurred while accessing '%0'", url) + "\n\n" + e, - getTitle(), JOptionPane.ERROR_MESSAGE); - } catch (RuntimeException e) { - status.showMessage( - Localization.lang("An error occurred while fetching from ADS (%0):", url) + "\n\n" + e.getMessage(), - getTitle(), JOptionPane.ERROR_MESSAGE); - } - } -} From 373c4ead4d9fde52b870b2cfdb6e086fcf053482 Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Mon, 5 Sep 2016 19:15:10 +0200 Subject: [PATCH 03/12] remove obsolete keys --- src/main/resources/l10n/JabRef_da.properties | 2 -- src/main/resources/l10n/JabRef_de.properties | 2 -- src/main/resources/l10n/JabRef_en.properties | 2 -- src/main/resources/l10n/JabRef_es.properties | 2 -- src/main/resources/l10n/JabRef_fa.properties | 2 -- src/main/resources/l10n/JabRef_fr.properties | 2 -- src/main/resources/l10n/JabRef_in.properties | 2 -- src/main/resources/l10n/JabRef_it.properties | 2 -- src/main/resources/l10n/JabRef_ja.properties | 2 -- src/main/resources/l10n/JabRef_nl.properties | 2 -- src/main/resources/l10n/JabRef_no.properties | 2 -- src/main/resources/l10n/JabRef_pt_BR.properties | 2 -- src/main/resources/l10n/JabRef_ru.properties | 2 -- src/main/resources/l10n/JabRef_sv.properties | 2 -- src/main/resources/l10n/JabRef_tr.properties | 2 -- src/main/resources/l10n/JabRef_vi.properties | 2 -- src/main/resources/l10n/JabRef_zh.properties | 2 -- 17 files changed, 34 deletions(-) diff --git a/src/main/resources/l10n/JabRef_da.properties b/src/main/resources/l10n/JabRef_da.properties index c8999d8ea87..b3e0681ea0a 100644 --- a/src/main/resources/l10n/JabRef_da.properties +++ b/src/main/resources/l10n/JabRef_da.properties @@ -1190,7 +1190,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_fetching_from_ADS_(%0)\:= An_error_occurred_while_parsing_abstract= Log= @@ -1306,7 +1305,6 @@ Could_not_connect_to_%0=Kunne_ikke_forbinde_til_%0 %0_image= %0_problem(s)_found= -'%0'_is_not_a_valid_ADS_bibcode.= Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Added_new_'%0'_entry.= diff --git a/src/main/resources/l10n/JabRef_de.properties b/src/main/resources/l10n/JabRef_de.properties index e2b3f462a80..c355069bd2d 100644 --- a/src/main/resources/l10n/JabRef_de.properties +++ b/src/main/resources/l10n/JabRef_de.properties @@ -1894,7 +1894,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Nach_der_Such Import_conversions=Konvertierungen_importieren Please_enter_a_search_string=Bitte_geben_Sie_eine_Suchphrase_ein Please_open_or_start_a_new_database_before_searching=Bitte_öffnen_Sie_eine_Datei_oder_legen_Sie_eine_neue_an,_bevor_Sie_suchen -An_error_occurred_while_fetching_from_ADS_(%0)\:=Beim_Abrufen_von_ADS_ist_ein_Fehler_aufgetreten_(%0)\: An_error_occurred_while_parsing_abstract=Beim_Parsen_der_Zusammenfassung_ist_ein_Fehler_aufgetreten Log=Protokoll @@ -2011,7 +2010,6 @@ Could_not_connect_to_%0=Verbindung_zu_%0_fehlgeschlagen %0_image=%0-Bild %0_problem(s)_found=%0_Problem(e)_gefunden -'%0'_is_not_a_valid_ADS_bibcode.='%0'_ist_kein_gültiger_ADS-Bibcode Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=Akzeptieren_der_Änderungen_führt_dazu,_dass_die_komplette_Gruppenstruktur_durch_die_externen_Änderungen_erstetzt_wird. Added_entry=Eintrag_hinzugefügt Added_new_'%0'_entry.=Neuer_'%0'_Eintrag_hinzugefügt. diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 2600c1d9bba..71cf77e3e66 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1783,7 +1783,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Add_{}_to_spe Import_conversions=Import_conversions Please_enter_a_search_string=Please_enter_a_search_string Please_open_or_start_a_new_database_before_searching=Please_open_or_start_a_new_database_before_searching -An_error_occurred_while_fetching_from_ADS_(%0)\:=An_error_occurred_while_fetching_from_ADS_(%0)\: An_error_occurred_while_parsing_abstract=An_error_occurred_while_parsing_abstract Log=Log @@ -1935,7 +1934,6 @@ Copy_BibTeX_key_and_title=Copy_BibTeX_key_and_title File_rename_failed_for_%0_entries.=File_rename_failed_for_%0_entries. To_set_up,_go_to=To_set_up,_go_to Merged_BibTeX_source_code=Merged_BibTeX_source_code -'%0'_is_not_a_valid_ADS_bibcode.='%0'_is_not_a_valid_ADS_bibcode. Invalid_DOI\:_'%0'.=Invalid_DOI\:_'%0'. should_start_with_a_name=should_start_with_a_name should_end_with_a_name=should_end_with_a_name diff --git a/src/main/resources/l10n/JabRef_es.properties b/src/main/resources/l10n/JabRef_es.properties index b4b342b0271..1e261d21a5b 100644 --- a/src/main/resources/l10n/JabRef_es.properties +++ b/src/main/resources/l10n/JabRef_es.properties @@ -1099,7 +1099,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Añadir_{}_pa Import_conversions=Importar_conversiones Please_enter_a_search_string=Introduzca_una_cadena_de_búsqueda,_por_favor Please_open_or_start_a_new_database_before_searching=Abra_o_cree_una_nueva_base_de_datos_antes_de_buscar,_por_favor -An_error_occurred_while_fetching_from_ADS_(%0)\:=Ocurrió_un_error_al_recuperar_desde_ADS_(%0)\: An_error_occurred_while_parsing_abstract=Ocurrió_un_error_mientras_se_analizaba_el_resumen Log=Registro Canceled_merging_entries=Cancelar_fusionado_de_entradas @@ -1210,7 +1209,6 @@ Path_to_%0=Ruta_hasta_%0 %0_image=imagen_%0 %0_problem(s)_found=%0_problema(s)_encontrado(s) -'%0'_is_not_a_valid_ADS_bibcode.='%0'_no_es_un_bibcode_ADS_válido Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=Aceptar_el_cambio_reemplaza_el_árbol_completo_de_grupos_por_el_árbol_de_grupos_modificado_externamente Added_entry=Entrada_añadida Added_new_'%0'_entry.=Añadida_la_nueva_entrada_'%0' diff --git a/src/main/resources/l10n/JabRef_fa.properties b/src/main/resources/l10n/JabRef_fa.properties index 687d0f26847..1429cd18074 100644 --- a/src/main/resources/l10n/JabRef_fa.properties +++ b/src/main/resources/l10n/JabRef_fa.properties @@ -1846,7 +1846,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_fetching_from_ADS_(%0)\:= An_error_occurred_while_parsing_abstract= Log= @@ -1960,7 +1959,6 @@ Could_not_connect_to_%0= %0_image= %0_problem(s)_found= -'%0'_is_not_a_valid_ADS_bibcode.= Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Added_new_'%0'_entry.= diff --git a/src/main/resources/l10n/JabRef_fr.properties b/src/main/resources/l10n/JabRef_fr.properties index a1b392c01b6..570ef676d3e 100644 --- a/src/main/resources/l10n/JabRef_fr.properties +++ b/src/main/resources/l10n/JabRef_fr.properties @@ -1128,7 +1128,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Ajouter_{}_au Import_conversions=Importer_les_conversions Please_enter_a_search_string=Entrez_s'il_vous_plait_une_chaine_de_recherche Please_open_or_start_a_new_database_before_searching=S'il_vous_plait,_ouvrez_ou_créer_une_nouvelle_base_avant_la_recherche -An_error_occurred_while_fetching_from_ADS_(%0)\:=Une_erreur_est_survenue_lors_de_la_recherche_ADS_(%0)_\: An_error_occurred_while_parsing_abstract=Une_erreur_est_survenue_pendant_le_traitement_du_résumé Log=Message @@ -1245,7 +1244,6 @@ Invalid_DOI\:_'%0'.=DOI_invalide\:_'%0'. Could_not_connect_to_%0=La_connexion_à_%0_n'a_pas_pu_être_établie %0_image=%0_image %0_problem(s)_found=%0_problème(s)_trouvé(s). -'%0'_is_not_a_valid_ADS_bibcode.='%0'n'est_pas_un_bibcode_ADS_valide. Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=Acceptation_que_l'arbre_des_groupes_entier_soit_remplacé_par_l'arbre_des_groupes_modifiés_externalement. Added_entry=Entrée_ajoutée Added_new_'%0'_entry.=Nouvelle_entrée_'%0'_ajoutée diff --git a/src/main/resources/l10n/JabRef_in.properties b/src/main/resources/l10n/JabRef_in.properties index 026f41afe9e..7d27459a0ed 100644 --- a/src/main/resources/l10n/JabRef_in.properties +++ b/src/main/resources/l10n/JabRef_in.properties @@ -1108,7 +1108,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions=Impor_konversi Please_enter_a_search_string=Tuliskan_string_pencarian Please_open_or_start_a_new_database_before_searching=Buka_atau_jalankan_basisdata_yang_baru_sebelum_mencari -An_error_occurred_while_fetching_from_ADS_(%0)\:=Kesalahan_ketika_mengambil_dari_ADS_(%0)\: An_error_occurred_while_parsing_abstract=Kesalahan_ketika_mengurai_abstrak Log=Log @@ -1224,7 +1223,6 @@ Path_to_%0=Lokasi_%0 %0_image= %0_problem(s)_found=%0_kesalahan_ditemukan -'%0'_is_not_a_valid_ADS_bibcode.='%0'_bukan_kode_BIB_ADS_yang_sah. Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry=Entri_ditambahkan Added_new_'%0'_entry.=Entri_yang_baru_'%0'_ditambahkan. diff --git a/src/main/resources/l10n/JabRef_it.properties b/src/main/resources/l10n/JabRef_it.properties index 5b205b18c88..62f24be8f59 100644 --- a/src/main/resources/l10n/JabRef_it.properties +++ b/src/main/resources/l10n/JabRef_it.properties @@ -1208,7 +1208,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Aggiungere_{} Import_conversions=Importare_le_conversioni Please_enter_a_search_string=Inserire_una_stringa_di_ricerca Please_open_or_start_a_new_database_before_searching=Aprire_o_creare_un_nuovo_database_prima_di_effettuare_la_ricerca -An_error_occurred_while_fetching_from_ADS_(%0)\:=Si_\u00e8_verificato_un_errore_durante_il_recupero_da_ADS_(%0)\: An_error_occurred_while_parsing_abstract=Si_\u00e8_verificato_un_errore_durante_l'elaborazione_del_riassunto Log=Registro @@ -1325,7 +1324,6 @@ Could_not_connect_to_%0=Impossibile_la_connessione_a_%0 %0_image= %0_problem(s)_found= -'%0'_is_not_a_valid_ADS_bibcode.= Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Added_new_'%0'_entry.= diff --git a/src/main/resources/l10n/JabRef_ja.properties b/src/main/resources/l10n/JabRef_ja.properties index 56145eb609e..d8492de8748 100644 --- a/src/main/resources/l10n/JabRef_ja.properties +++ b/src/main/resources/l10n/JabRef_ja.properties @@ -1874,7 +1874,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=大小文字 Import_conversions=読み込み時変換 Please_enter_a_search_string=検索文字列を入力してください Please_open_or_start_a_new_database_before_searching=検索前にデータベースを開くか新規データベースを開始してください -An_error_occurred_while_fetching_from_ADS_(%0)\:=ADSからの取得中にエラーが発生しました(%0)\: An_error_occurred_while_parsing_abstract=abstractの解析時にエラー発生 Log=ログ @@ -1992,7 +1991,6 @@ Could_not_connect_to_%0=%0に接続することができませんでした %0_image=%0画像 %0_problem(s)_found=%0件問題を検出しました -'%0'_is_not_a_valid_ADS_bibcode.=「%0」は有効なADS bibcodeではありません。 Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=変更を承認すると、外部で修正されたグループツリーで,グループツリー全体を置き換えます。 Added_entry=項目を追加しました Added_new_'%0'_entry.=「%0」項目を新規に追加しました。 diff --git a/src/main/resources/l10n/JabRef_nl.properties b/src/main/resources/l10n/JabRef_nl.properties index 1bb5f89670e..547c89f29cc 100644 --- a/src/main/resources/l10n/JabRef_nl.properties +++ b/src/main/resources/l10n/JabRef_nl.properties @@ -1877,7 +1877,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_fetching_from_ADS_(%0)\:= An_error_occurred_while_parsing_abstract= Log= @@ -1994,7 +1993,6 @@ Could_not_connect_to_%0= %0_image= %0_problem(s)_found= -'%0'_is_not_a_valid_ADS_bibcode.= Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Added_new_'%0'_entry.= diff --git a/src/main/resources/l10n/JabRef_no.properties b/src/main/resources/l10n/JabRef_no.properties index 174a8bb9a5a..bf14c74846e 100644 --- a/src/main/resources/l10n/JabRef_no.properties +++ b/src/main/resources/l10n/JabRef_no.properties @@ -2272,7 +2272,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_fetching_from_ADS_(%0)\:= An_error_occurred_while_parsing_abstract= Log= @@ -2390,7 +2389,6 @@ Could_not_connect_to_%0=Kunne_ikke_koble_til_%0 %0_image= %0_problem(s)_found= -'%0'_is_not_a_valid_ADS_bibcode.= Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Added_new_'%0'_entry.= diff --git a/src/main/resources/l10n/JabRef_pt_BR.properties b/src/main/resources/l10n/JabRef_pt_BR.properties index 7bfddfebcde..b1a66477fb5 100644 --- a/src/main/resources/l10n/JabRef_pt_BR.properties +++ b/src/main/resources/l10n/JabRef_pt_BR.properties @@ -1106,7 +1106,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Adicione_{}_ Import_conversions=Importar_conversões Please_enter_a_search_string=Favor_digitar_uma_string_de_busca Please_open_or_start_a_new_database_before_searching=Por_favor,_abra_ou_inicie_uma_base_de_dados_antes_de_realizar_a_busca -An_error_occurred_while_fetching_from_ADS_(%0)\:=Um_Erro_ocorreu_enquanto_pensquisando_a_partir_do_ADS_(%0)\: An_error_occurred_while_parsing_abstract=Um_erro_ocorreu_durante_a_interpretação_do_abstract_(resumo) Log=Log @@ -1222,7 +1221,6 @@ Invalid_DOI\:_'%0'.=DOI_inválida\:_'%0'. Could_not_connect_to_%0=Não_foi_possível_conectar_a_%0 %0_image= %0_problem(s)_found= -'%0'_is_not_a_valid_ADS_bibcode.= Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry=Referência_adicionada Added_new_'%0'_entry.= diff --git a/src/main/resources/l10n/JabRef_ru.properties b/src/main/resources/l10n/JabRef_ru.properties index 89a91843ae6..9f734143318 100644 --- a/src/main/resources/l10n/JabRef_ru.properties +++ b/src/main/resources/l10n/JabRef_ru.properties @@ -1846,7 +1846,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Добавл Import_conversions=Импорт_преобразований Please_enter_a_search_string=Введите_строку_для_поиска Please_open_or_start_a_new_database_before_searching=Для_начала_поиска_откройте_существующую_БД_или_создайте_новую_БД -An_error_occurred_while_fetching_from_ADS_(%0)\:=Ошибка_выборки_из_ADS_(%0)\: An_error_occurred_while_parsing_abstract=Ошибка_анализа_конспекта Log=Отчет @@ -1966,7 +1965,6 @@ Could_not_connect_to_%0=Не_удалось_подключиться_к_серв Push_to_%0=Передать_в_%0 %0_image= %0_problem(s)_found= -'%0'_is_not_a_valid_ADS_bibcode.= Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Added_new_'%0'_entry.= diff --git a/src/main/resources/l10n/JabRef_sv.properties b/src/main/resources/l10n/JabRef_sv.properties index 575e8d253bf..22f40482deb 100644 --- a/src/main/resources/l10n/JabRef_sv.properties +++ b/src/main/resources/l10n/JabRef_sv.properties @@ -12,7 +12,6 @@ %0_mode=%0-läge %0_problem(s)_found=%0_problem_hittades '%0'_exists._Overwrite_file?='%0'_finns_redan._Skriv_över_filen? -'%0'_is_not_a_valid_ADS_bibcode.='%0'_är_inte_en_giltig_ADS-bibkod. Could_not_find_file_'%0'
linked_from_entry_'%1'=Hittar_inte_filen_'%0'
som_länkas_från_posten_'%1' = All_Entries_(this_group_cannot_be_edited_or_removed)=Alla_poster_(den_här_gruppen_kan_inte_ändras_eller_tas_bort) @@ -66,7 +65,6 @@ Allow_overwriting_existing_links.=Tillåt_att_befintliga_länkar_skrivs_över. Always_add_letter_(a,_b,_...)_to_generated_keys=Lägg_alltid_till_en_bokstav_(a,_b_...)_på_genererade_nycklar Always_reformat_BIB_file_on_save_and_export=Formattera_alltid_om_BIB-filen_vid_när_den_sparas_eller_exporteras Always_use_this_PDF_import_style_(and_do_not_ask_for_each_import)=Använd_alltid_detta_vid_import_av_PDF_(och_fråga_inte_för_varje_fil) -An_error_occurred_while_fetching_from_ADS_(%0)\:=Ett_fel_inträffade_vid_hämtning_från_ADS_(%0)\: An_error_occurred_while_parsing_abstract=Ett_fel_inträffade_när_sammanfattningen_tolkades An_exception_occurred_while_accessing_'%0'=Ett_undantag_inträffade_när_'%0'_accessades A_SAX_exception_occurred_while_parsing_'%0'\:=Ett_SAX-undantag_inträffade_när_'%0'_tolkades\: diff --git a/src/main/resources/l10n/JabRef_tr.properties b/src/main/resources/l10n/JabRef_tr.properties index d3f44a89840..1847c2e552d 100644 --- a/src/main/resources/l10n/JabRef_tr.properties +++ b/src/main/resources/l10n/JabRef_tr.properties @@ -1128,7 +1128,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Aramada_doğr Import_conversions=Dönüşümleri_içe_aktar Please_enter_a_search_string=Lütfen_bir_arama_dizgesi_girin Please_open_or_start_a_new_database_before_searching=Lütfen_aramadan_önce_bir_veri_tabanı_açın_ya_da_başlatın -An_error_occurred_while_fetching_from_ADS_(%0)\:=ADS'den_getirirken_bir_hata_oluştu_(%0)\: An_error_occurred_while_parsing_abstract=Özet_ayrıştırılırken_bir_hata_oluştu Log=Kayıt @@ -1241,7 +1240,6 @@ Could_not_connect_to_%0=%0'e_bağlanılamadı %0_image=%0_resim %0_problem(s)_found=%0_sorun_bulundu -'%0'_is_not_a_valid_ADS_bibcode.='%0'_geçerli_bir_ADS_bibkodu_değil. Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=Değişikliği_kabul_etmek,_harici_olarak_değiştirilmiş_grup_ağacını_mevcut_grup_ağacının_tamamının_yerine_koyar. Add_new_file_type=Yeni_dosya_türü_ekle Added_entry=Eklenen_girdi diff --git a/src/main/resources/l10n/JabRef_vi.properties b/src/main/resources/l10n/JabRef_vi.properties index abfcb6789ac..b18398f2f72 100644 --- a/src/main/resources/l10n/JabRef_vi.properties +++ b/src/main/resources/l10n/JabRef_vi.properties @@ -1872,7 +1872,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_fetching_from_ADS_(%0)\:= An_error_occurred_while_parsing_abstract= Log= @@ -1986,7 +1985,6 @@ Could_not_connect_to_%0=Không_thể_kết_nối_đến_%0 %0_image= %0_problem(s)_found= -'%0'_is_not_a_valid_ADS_bibcode.= Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Added_new_'%0'_entry.= diff --git a/src/main/resources/l10n/JabRef_zh.properties b/src/main/resources/l10n/JabRef_zh.properties index 7e05884e0b3..ee932449779 100644 --- a/src/main/resources/l10n/JabRef_zh.properties +++ b/src/main/resources/l10n/JabRef_zh.properties @@ -1182,7 +1182,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=搜索时为 Import_conversions=导入约定 Please_enter_a_search_string=请输入一个搜索字符串 Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_fetching_from_ADS_(%0)\:= An_error_occurred_while_parsing_abstract= Log=日志 @@ -1299,7 +1298,6 @@ Could_not_connect_to_%0=无法连接到_%0 %0_image= %0_problem(s)_found= -'%0'_is_not_a_valid_ADS_bibcode.= Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry=已添加记录 Added_new_'%0'_entry.=已添加新_'%0'_记录。 From 43ff1e888ceaa789b85168d9901ca0f8a8f14205 Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Mon, 5 Sep 2016 19:15:32 +0200 Subject: [PATCH 04/12] add new fetcher in EntryFetchers --- .../java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java | 3 ++- .../net/sf/jabref/logic/importer/fetcher/IsbnFetcherTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java b/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java index b83002f3bf4..e30ac66ea80 100644 --- a/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java +++ b/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java @@ -5,6 +5,7 @@ import java.util.List; import net.sf.jabref.Globals; +import net.sf.jabref.logic.importer.fetcher.AdsFetcher; import net.sf.jabref.logic.importer.fetcher.ArXiv; import net.sf.jabref.logic.importer.fetcher.DiVA; import net.sf.jabref.logic.importer.fetcher.GvkFetcher; @@ -16,7 +17,6 @@ public class EntryFetchers { private final List entryFetchers = new LinkedList<>(); public EntryFetchers(JournalAbbreviationLoader abbreviationLoader) { - entryFetchers.add(new ADSFetcher()); entryFetchers.add(new CiteSeerXFetcher()); entryFetchers.add(new DBLPFetcher()); entryFetchers.add(new DOItoBibTeXFetcher()); @@ -30,6 +30,7 @@ public EntryFetchers(JournalAbbreviationLoader abbreviationLoader) { entryFetchers.add(new DOAJFetcher()); entryFetchers.add(new SpringerFetcher()); + entryFetchers.add(new IdBasedEntryFetcher(new AdsFetcher(Globals.prefs.getImportFormatPreferences()))); entryFetchers.add(new IdBasedEntryFetcher(new DiVA(Globals.prefs.getImportFormatPreferences()))); entryFetchers.add(new IdBasedEntryFetcher(new IsbnFetcher(Globals.prefs.getImportFormatPreferences()))); entryFetchers.add(new SearchBasedEntryFetcher(new ArXiv())); diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/IsbnFetcherTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/IsbnFetcherTest.java index fd3e7080f72..206c191161f 100644 --- a/src/test/java/net/sf/jabref/logic/importer/fetcher/IsbnFetcherTest.java +++ b/src/test/java/net/sf/jabref/logic/importer/fetcher/IsbnFetcherTest.java @@ -20,7 +20,7 @@ public class IsbnFetcherTest { @Before public void setUp() { - fetcher = new IsbnFetcher(Globals.prefs.getImportFormatPreferences ()); + fetcher = new IsbnFetcher(Globals.prefs.getImportFormatPreferences()); bibEntry = new BibEntry(); bibEntry.setType(BibLatexEntryTypes.BOOK); From f4e2e0beff93ae906ceb18d5324b459e9e6c29c8 Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Tue, 6 Sep 2016 16:11:40 +0200 Subject: [PATCH 05/12] include feedback use BIBTEXPLUS as type --- .../logic/importer/fetcher/AdsFetcher.java | 55 +++++-------------- src/main/resources/l10n/JabRef_da.properties | 1 - src/main/resources/l10n/JabRef_de.properties | 1 - src/main/resources/l10n/JabRef_en.properties | 1 - src/main/resources/l10n/JabRef_es.properties | 1 - src/main/resources/l10n/JabRef_fa.properties | 1 - src/main/resources/l10n/JabRef_fr.properties | 1 - src/main/resources/l10n/JabRef_in.properties | 1 - src/main/resources/l10n/JabRef_it.properties | 1 - src/main/resources/l10n/JabRef_ja.properties | 1 - src/main/resources/l10n/JabRef_nl.properties | 1 - src/main/resources/l10n/JabRef_no.properties | 1 - .../resources/l10n/JabRef_pt_BR.properties | 1 - src/main/resources/l10n/JabRef_ru.properties | 1 - src/main/resources/l10n/JabRef_sv.properties | 1 - src/main/resources/l10n/JabRef_tr.properties | 1 - src/main/resources/l10n/JabRef_vi.properties | 1 - src/main/resources/l10n/JabRef_zh.properties | 1 - .../importer/fetcher/AdsFetcherTest.java | 23 +++++++- 19 files changed, 35 insertions(+), 60 deletions(-) diff --git a/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java b/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java index c1a90327cc2..f1a979e35aa 100644 --- a/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java +++ b/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java @@ -1,24 +1,15 @@ package net.sf.jabref.logic.importer.fetcher; -import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; -import java.io.InputStream; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; -import java.nio.charset.StandardCharsets; import java.util.Optional; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - import net.sf.jabref.logic.help.HelpFile; import net.sf.jabref.logic.importer.FetcherException; import net.sf.jabref.logic.importer.IdBasedFetcher; import net.sf.jabref.logic.importer.ImportFormatPreferences; import net.sf.jabref.logic.importer.fileformat.BibtexParser; -import net.sf.jabref.logic.l10n.Localization; import net.sf.jabref.model.entry.BibEntry; import net.sf.jabref.model.entry.FieldName; @@ -59,53 +50,33 @@ public Optional performSearchById(String identifier) throws FetcherExc try { URIBuilder uriBuilder = new URIBuilder(URL_PATTERN + key); - uriBuilder.addParameter("data_type", "BIBTEX"); + uriBuilder.addParameter("data_type", "BIBTEXPLUS"); URL url = uriBuilder.build().toURL(); String bibtexString = Unirest.get(url.toString()).asString().getBody(); if(bibtexString.contains("@")) { - bibtexString = bibtexString.substring(bibtexString.indexOf("@")); + bibtexString = bibtexString.substring(bibtexString.indexOf('@')); result = BibtexParser.singleFromString(bibtexString, preferences); } if (result.isPresent()) { - BibEntry entry = result.get(); - URIBuilder uriBuilderAbstract = new URIBuilder(URL_PATTERN + key); - uriBuilderAbstract.addParameter("data_type", "XML"); - URL urlAbstract = uriBuilderAbstract.build().toURL(); - - String abstractString = Unirest.get(urlAbstract.toString()).asString().getBody(); - InputStream stream = new ByteArrayInputStream(abstractString.getBytes(StandardCharsets.UTF_8)); - - XMLInputFactory factory = XMLInputFactory.newInstance(); - XMLStreamReader reader = factory.createXMLStreamReader(new BufferedInputStream(stream)); - boolean isAbstract = false; - StringBuilder abstractSB = new StringBuilder(); - while (reader.hasNext()) { - reader.next(); - if (reader.isStartElement() && - FieldName.ABSTRACT.equals(reader.getLocalName())) { - isAbstract = true; - } - if (isAbstract && reader.isCharacters()) { - abstractSB.append(reader.getText()); - } - if (isAbstract && reader.isEndElement()) { - isAbstract = false; - } - } - String abstractText = abstractSB.toString(); - abstractText = abstractText.replace("\n", " "); - entry.setField(FieldName.ABSTRACT, abstractText); - result = Optional.of(entry); + result = postProcess(result.get()); } + } catch (MalformedURLException | UnirestException | URISyntaxException e) { throw new FetcherException("Error fetching ADS", e); - } catch (XMLStreamException e) { - throw new FetcherException(Localization.lang("An_error_occurred_while_parsing_abstract"), e); } return result; } + private Optional postProcess(BibEntry entry){ + //TODO: Remove useless brackets + String titleString = entry.getField(FieldName.TITLE).get(); + String abstractString = entry.getField(FieldName.ABSTRACT).get(); + String authorString = entry.getField(FieldName.AUTHOR).get(); + + return Optional.of(entry); + } + } diff --git a/src/main/resources/l10n/JabRef_da.properties b/src/main/resources/l10n/JabRef_da.properties index b3e0681ea0a..6fb15cb319c 100644 --- a/src/main/resources/l10n/JabRef_da.properties +++ b/src/main/resources/l10n/JabRef_da.properties @@ -1190,7 +1190,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_parsing_abstract= Log= diff --git a/src/main/resources/l10n/JabRef_de.properties b/src/main/resources/l10n/JabRef_de.properties index c355069bd2d..288aa33f764 100644 --- a/src/main/resources/l10n/JabRef_de.properties +++ b/src/main/resources/l10n/JabRef_de.properties @@ -1894,7 +1894,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Nach_der_Such Import_conversions=Konvertierungen_importieren Please_enter_a_search_string=Bitte_geben_Sie_eine_Suchphrase_ein Please_open_or_start_a_new_database_before_searching=Bitte_öffnen_Sie_eine_Datei_oder_legen_Sie_eine_neue_an,_bevor_Sie_suchen -An_error_occurred_while_parsing_abstract=Beim_Parsen_der_Zusammenfassung_ist_ein_Fehler_aufgetreten Log=Protokoll diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 71cf77e3e66..503695d40f5 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1783,7 +1783,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Add_{}_to_spe Import_conversions=Import_conversions Please_enter_a_search_string=Please_enter_a_search_string Please_open_or_start_a_new_database_before_searching=Please_open_or_start_a_new_database_before_searching -An_error_occurred_while_parsing_abstract=An_error_occurred_while_parsing_abstract Log=Log Canceled_merging_entries=Canceled_merging_entries diff --git a/src/main/resources/l10n/JabRef_es.properties b/src/main/resources/l10n/JabRef_es.properties index 1e261d21a5b..0d2718457e2 100644 --- a/src/main/resources/l10n/JabRef_es.properties +++ b/src/main/resources/l10n/JabRef_es.properties @@ -1099,7 +1099,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Añadir_{}_pa Import_conversions=Importar_conversiones Please_enter_a_search_string=Introduzca_una_cadena_de_búsqueda,_por_favor Please_open_or_start_a_new_database_before_searching=Abra_o_cree_una_nueva_base_de_datos_antes_de_buscar,_por_favor -An_error_occurred_while_parsing_abstract=Ocurrió_un_error_mientras_se_analizaba_el_resumen Log=Registro Canceled_merging_entries=Cancelar_fusionado_de_entradas Format_units_by_adding_non-breaking_separators_and_keeping_the_correct_case_on_search=Formatear_unidades_añadiendo_separadores_no_divisores_y_manteniendo_mayúsculas/minúsculas_correctamente_en_la_búsqueda diff --git a/src/main/resources/l10n/JabRef_fa.properties b/src/main/resources/l10n/JabRef_fa.properties index 1429cd18074..78417b0b305 100644 --- a/src/main/resources/l10n/JabRef_fa.properties +++ b/src/main/resources/l10n/JabRef_fa.properties @@ -1846,7 +1846,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_parsing_abstract= Log= Canceled_merging_entries= diff --git a/src/main/resources/l10n/JabRef_fr.properties b/src/main/resources/l10n/JabRef_fr.properties index 570ef676d3e..2aabed0a8b6 100644 --- a/src/main/resources/l10n/JabRef_fr.properties +++ b/src/main/resources/l10n/JabRef_fr.properties @@ -1128,7 +1128,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Ajouter_{}_au Import_conversions=Importer_les_conversions Please_enter_a_search_string=Entrez_s'il_vous_plait_une_chaine_de_recherche Please_open_or_start_a_new_database_before_searching=S'il_vous_plait,_ouvrez_ou_créer_une_nouvelle_base_avant_la_recherche -An_error_occurred_while_parsing_abstract=Une_erreur_est_survenue_pendant_le_traitement_du_résumé Log=Message diff --git a/src/main/resources/l10n/JabRef_in.properties b/src/main/resources/l10n/JabRef_in.properties index 7d27459a0ed..8da84582b5a 100644 --- a/src/main/resources/l10n/JabRef_in.properties +++ b/src/main/resources/l10n/JabRef_in.properties @@ -1108,7 +1108,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions=Impor_konversi Please_enter_a_search_string=Tuliskan_string_pencarian Please_open_or_start_a_new_database_before_searching=Buka_atau_jalankan_basisdata_yang_baru_sebelum_mencari -An_error_occurred_while_parsing_abstract=Kesalahan_ketika_mengurai_abstrak Log=Log diff --git a/src/main/resources/l10n/JabRef_it.properties b/src/main/resources/l10n/JabRef_it.properties index 62f24be8f59..2f770d6b13a 100644 --- a/src/main/resources/l10n/JabRef_it.properties +++ b/src/main/resources/l10n/JabRef_it.properties @@ -1208,7 +1208,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Aggiungere_{} Import_conversions=Importare_le_conversioni Please_enter_a_search_string=Inserire_una_stringa_di_ricerca Please_open_or_start_a_new_database_before_searching=Aprire_o_creare_un_nuovo_database_prima_di_effettuare_la_ricerca -An_error_occurred_while_parsing_abstract=Si_\u00e8_verificato_un_errore_durante_l'elaborazione_del_riassunto Log=Registro diff --git a/src/main/resources/l10n/JabRef_ja.properties b/src/main/resources/l10n/JabRef_ja.properties index d8492de8748..200aeb87729 100644 --- a/src/main/resources/l10n/JabRef_ja.properties +++ b/src/main/resources/l10n/JabRef_ja.properties @@ -1874,7 +1874,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=大小文字 Import_conversions=読み込み時変換 Please_enter_a_search_string=検索文字列を入力してください Please_open_or_start_a_new_database_before_searching=検索前にデータベースを開くか新規データベースを開始してください -An_error_occurred_while_parsing_abstract=abstractの解析時にエラー発生 Log=ログ diff --git a/src/main/resources/l10n/JabRef_nl.properties b/src/main/resources/l10n/JabRef_nl.properties index 547c89f29cc..20e2af80b97 100644 --- a/src/main/resources/l10n/JabRef_nl.properties +++ b/src/main/resources/l10n/JabRef_nl.properties @@ -1877,7 +1877,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_parsing_abstract= Log= diff --git a/src/main/resources/l10n/JabRef_no.properties b/src/main/resources/l10n/JabRef_no.properties index bf14c74846e..fd519c7aeff 100644 --- a/src/main/resources/l10n/JabRef_no.properties +++ b/src/main/resources/l10n/JabRef_no.properties @@ -2272,7 +2272,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_parsing_abstract= Log= diff --git a/src/main/resources/l10n/JabRef_pt_BR.properties b/src/main/resources/l10n/JabRef_pt_BR.properties index b1a66477fb5..50c13238cfe 100644 --- a/src/main/resources/l10n/JabRef_pt_BR.properties +++ b/src/main/resources/l10n/JabRef_pt_BR.properties @@ -1106,7 +1106,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Adicione_{}_ Import_conversions=Importar_conversões Please_enter_a_search_string=Favor_digitar_uma_string_de_busca Please_open_or_start_a_new_database_before_searching=Por_favor,_abra_ou_inicie_uma_base_de_dados_antes_de_realizar_a_busca -An_error_occurred_while_parsing_abstract=Um_erro_ocorreu_durante_a_interpretação_do_abstract_(resumo) Log=Log diff --git a/src/main/resources/l10n/JabRef_ru.properties b/src/main/resources/l10n/JabRef_ru.properties index 9f734143318..81aaefee190 100644 --- a/src/main/resources/l10n/JabRef_ru.properties +++ b/src/main/resources/l10n/JabRef_ru.properties @@ -1846,7 +1846,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Добавл Import_conversions=Импорт_преобразований Please_enter_a_search_string=Введите_строку_для_поиска Please_open_or_start_a_new_database_before_searching=Для_начала_поиска_откройте_существующую_БД_или_создайте_новую_БД -An_error_occurred_while_parsing_abstract=Ошибка_анализа_конспекта Log=Отчет Canceled_merging_entries=Слияние_записей_отменено diff --git a/src/main/resources/l10n/JabRef_sv.properties b/src/main/resources/l10n/JabRef_sv.properties index 22f40482deb..488eddfc7cd 100644 --- a/src/main/resources/l10n/JabRef_sv.properties +++ b/src/main/resources/l10n/JabRef_sv.properties @@ -65,7 +65,6 @@ Allow_overwriting_existing_links.=Tillåt_att_befintliga_länkar_skrivs_över. Always_add_letter_(a,_b,_...)_to_generated_keys=Lägg_alltid_till_en_bokstav_(a,_b_...)_på_genererade_nycklar Always_reformat_BIB_file_on_save_and_export=Formattera_alltid_om_BIB-filen_vid_när_den_sparas_eller_exporteras Always_use_this_PDF_import_style_(and_do_not_ask_for_each_import)=Använd_alltid_detta_vid_import_av_PDF_(och_fråga_inte_för_varje_fil) -An_error_occurred_while_parsing_abstract=Ett_fel_inträffade_när_sammanfattningen_tolkades An_exception_occurred_while_accessing_'%0'=Ett_undantag_inträffade_när_'%0'_accessades A_SAX_exception_occurred_while_parsing_'%0'\:=Ett_SAX-undantag_inträffade_när_'%0'_tolkades\: An_autosave_file_was_found_for_this_database._This_could_indicate_that_JabRef_did_not_shut_down_cleanly_last_time_the_file_was_used.=En_automatiskt_sparad_fil_hittades_för_databasen._Det_kan_betyda_att_JabRef_inte_avslutades_korrekt_senaste_gången_databasen_användes. diff --git a/src/main/resources/l10n/JabRef_tr.properties b/src/main/resources/l10n/JabRef_tr.properties index 1847c2e552d..3a1b87625d2 100644 --- a/src/main/resources/l10n/JabRef_tr.properties +++ b/src/main/resources/l10n/JabRef_tr.properties @@ -1128,7 +1128,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Aramada_doğr Import_conversions=Dönüşümleri_içe_aktar Please_enter_a_search_string=Lütfen_bir_arama_dizgesi_girin Please_open_or_start_a_new_database_before_searching=Lütfen_aramadan_önce_bir_veri_tabanı_açın_ya_da_başlatın -An_error_occurred_while_parsing_abstract=Özet_ayrıştırılırken_bir_hata_oluştu Log=Kayıt Canceled_merging_entries=Girdilerin_birleştirilmesi_iptal_edildi diff --git a/src/main/resources/l10n/JabRef_vi.properties b/src/main/resources/l10n/JabRef_vi.properties index b18398f2f72..329e1bc9b5e 100644 --- a/src/main/resources/l10n/JabRef_vi.properties +++ b/src/main/resources/l10n/JabRef_vi.properties @@ -1872,7 +1872,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_parsing_abstract= Log= diff --git a/src/main/resources/l10n/JabRef_zh.properties b/src/main/resources/l10n/JabRef_zh.properties index ee932449779..f780a711a10 100644 --- a/src/main/resources/l10n/JabRef_zh.properties +++ b/src/main/resources/l10n/JabRef_zh.properties @@ -1182,7 +1182,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=搜索时为 Import_conversions=导入约定 Please_enter_a_search_string=请输入一个搜索字符串 Please_open_or_start_a_new_database_before_searching= -An_error_occurred_while_parsing_abstract= Log=日志 diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java index 4a06cc7fa11..063db8458f5 100644 --- a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java +++ b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java @@ -35,7 +35,28 @@ public void setUp() { bibEntry.setField("doi", "10.12942/lrr-2012-10"); bibEntry.setField("eprint", "1112.3960"); bibEntry.setField("keywords", "astronomical observations, Newtonian limit, equations of motion, extragalactic astronomy, cosmology, theories of gravity, fundamental physics, astrophysics"); - bibEntry.setField("abstract", "A wealth of astronomical data indicate the presence of mass discrepancies in the Universe. The motions observed in a variety of classes of extragalactic systems exceed what can be explained by the mass visible in stars and gas. Either (i) there is a vast amount of unseen mass in some novel form - dark matter - or (ii) the data indicate a breakdown of our understanding of dynamics on the relevant scales, or (iii) both. Here, we first review a few outstanding challenges for the dark matter interpretation of mass discrepancies in galaxies, purely based on observations and independently of any alternative theoretical framework. We then show that many of these puzzling observations are predicted by one single relation - Milgrom's law - involving an acceleration constant a_0 (or a characteristic surface density Σ_† = a_0/G) on the order of the square-root of the cosmological constant in natural units. This relation can at present most easily be interpreted as the effect of a single universal force law resulting from a modification of Newtonian dynamics (MOND) on galactic scales. We exhaustively review the current observational successes and problems of this alternative paradigm at all astrophysical scales, and summarize the various theoretical attempts (TeVeS, GEA, BIMOND, and others) made to effectively embed this modification of Newtonian dynamics within a relativistic theory of gravity."); + bibEntry.setField("abstract", "{A wealth of astronomical data indicate the presence of mass\n" + + "discrepancies in the Universe. The motions observed in a variety of\n" + + "classes of extragalactic systems exceed what can be explained by the\n" + + "mass visible in stars and gas. Either (i) there is a vast amount of\n" + + "unseen mass in some novel form - dark matter - or (ii) the data indicate\n" + + "a breakdown of our understanding of dynamics on the relevant scales, or\n" + + "(iii) both. Here, we first review a few outstanding challenges for the\n" + + "dark matter interpretation of mass discrepancies in galaxies, purely\n" + + "based on observations and independently of any alternative theoretical\n" + + "framework. We then show that many of these puzzling observations are\n" + + "predicted by one single relation - Milgrom's law - involving an\n" + + "acceleration constant a\\_0 (or a characteristic surface density\n" + + "{$\\Sigma$}\\_{\\dagger} = a\\_0/G) on the order of the square-root of the\n" + + "cosmological constant in natural units. This relation can at present\n" + + "most easily be interpreted as the effect of a single universal force law\n" + + "resulting from a modification of Newtonian dynamics (MOND) on galactic\n" + + "scales. We exhaustively review the current observational successes and\n" + + "problems of this alternative paradigm at all astrophysical scales, and\n" + + "summarize the various theoretical attempts (TeVeS, GEA, BIMOND, and\n" + + "others) made to effectively embed this modification of Newtonian\n" + + "dynamics within a relativistic theory of gravity.\n" + + "}"); } From 440828cb6b6bacb42fe9bf0b4160d32cede8b36c Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Wed, 7 Sep 2016 11:11:46 +0200 Subject: [PATCH 06/12] remove useless curly brackets --- .../logic/importer/fetcher/AdsFetcher.java | 36 ++++++-- .../importer/fetcher/AdsFetcherTest.java | 85 ++++++++++++++----- 2 files changed, 95 insertions(+), 26 deletions(-) diff --git a/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java b/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java index f1a979e35aa..2acc7c85be2 100644 --- a/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java +++ b/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java @@ -10,6 +10,7 @@ import net.sf.jabref.logic.importer.IdBasedFetcher; import net.sf.jabref.logic.importer.ImportFormatPreferences; import net.sf.jabref.logic.importer.fileformat.BibtexParser; +import net.sf.jabref.logic.util.strings.StringUtil; import net.sf.jabref.model.entry.BibEntry; import net.sf.jabref.model.entry.FieldName; @@ -55,7 +56,7 @@ public Optional performSearchById(String identifier) throws FetcherExc String bibtexString = Unirest.get(url.toString()).asString().getBody(); - if(bibtexString.contains("@")) { + if (bibtexString.contains("@")) { bibtexString = bibtexString.substring(bibtexString.indexOf('@')); result = BibtexParser.singleFromString(bibtexString, preferences); } @@ -70,12 +71,35 @@ public Optional performSearchById(String identifier) throws FetcherExc return result; } - private Optional postProcess(BibEntry entry){ - //TODO: Remove useless brackets - String titleString = entry.getField(FieldName.TITLE).get(); - String abstractString = entry.getField(FieldName.ABSTRACT).get(); - String authorString = entry.getField(FieldName.AUTHOR).get(); + /** + * Remove all useless curly brackets in the given entry. + * The original fetcher fetches a bibtex file containing "{ and }" at the end of an abstract or title. This causes a {{ and }} in JabRef. + * @param entry Fetched entry with useless curly brackets + * @return cleaned entry + */ + private Optional postProcess(BibEntry entry) { + Optional optTitleString = entry.getField(FieldName.TITLE); + if (optTitleString.isPresent()) { + String titleString = optTitleString.get(); + titleString = StringUtil.shaveString(titleString); + entry.setField(FieldName.TITLE, titleString.trim()); + } + + Optional optAuthorString = entry.getField(FieldName.AUTHOR); + if (optAuthorString.isPresent()) { + String authorString = optAuthorString.get(); + authorString = authorString.replace('{', ' '); + authorString = authorString.replace('}', ' '); + authorString = authorString.replace(" ", " "); + entry.setField(FieldName.AUTHOR, authorString.trim()); + } + Optional optAbstractStirng = entry.getField(FieldName.ABSTRACT); + if (optAbstractStirng.isPresent()) { + String abstractString = optAbstractStirng.get(); + abstractString = StringUtil.shaveString(abstractString); + entry.setField(FieldName.ABSTRACT, abstractString.trim()); + } return Optional.of(entry); } diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java index 063db8458f5..3c1e2a7af2b 100644 --- a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java +++ b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java @@ -14,28 +14,28 @@ public class AdsFetcherTest { private AdsFetcher fetcher; - private BibEntry bibEntry; + private BibEntry firstEntry, secondEntry; @Before public void setUp() { fetcher = new AdsFetcher(Globals.prefs.getImportFormatPreferences()); - bibEntry = new BibEntry(); - bibEntry.setType(BibLatexEntryTypes.ARTICLE); - bibEntry.setField("bibtexkey", "2012LRR....15...10F"); - bibEntry.setField("author", "{Famaey}, B. and {McGaugh}, S.~S."); - bibEntry.setField("title", "{Modified Newtonian Dynamics (MOND): Observational Phenomenology and Relativistic Extensions}"); - bibEntry.setField("journal", "Living Reviews in Relativity"); - bibEntry.setField("year", "2012"); - bibEntry.setField("volume", "15"); - bibEntry.setField("month", "#sep#"); - bibEntry.setField("adsnote", "Provided by the SAO/NASA Astrophysics Data System"); - bibEntry.setField("adsurl", "http://adsabs.harvard.edu/abs/2012LRR....15...10F"); - bibEntry.setField("archiveprefix", "arXiv"); - bibEntry.setField("doi", "10.12942/lrr-2012-10"); - bibEntry.setField("eprint", "1112.3960"); - bibEntry.setField("keywords", "astronomical observations, Newtonian limit, equations of motion, extragalactic astronomy, cosmology, theories of gravity, fundamental physics, astrophysics"); - bibEntry.setField("abstract", "{A wealth of astronomical data indicate the presence of mass\n" + + firstEntry = new BibEntry(); + firstEntry.setType(BibLatexEntryTypes.ARTICLE); + firstEntry.setField("bibtexkey", "2012LRR....15...10F"); + firstEntry.setField("author", "Famaey , B. and McGaugh , S.~S."); + firstEntry.setField("title", "Modified Newtonian Dynamics (MOND): Observational Phenomenology and Relativistic Extensions"); + firstEntry.setField("journal", "Living Reviews in Relativity"); + firstEntry.setField("year", "2012"); + firstEntry.setField("volume", "15"); + firstEntry.setField("month", "#sep#"); + firstEntry.setField("adsnote", "Provided by the SAO/NASA Astrophysics Data System"); + firstEntry.setField("adsurl", "http://adsabs.harvard.edu/abs/2012LRR....15...10F"); + firstEntry.setField("archiveprefix", "arXiv"); + firstEntry.setField("doi", "10.12942/lrr-2012-10"); + firstEntry.setField("eprint", "1112.3960"); + firstEntry.setField("keywords", "astronomical observations, Newtonian limit, equations of motion, extragalactic astronomy, cosmology, theories of gravity, fundamental physics, astrophysics"); + firstEntry.setField("abstract", "A wealth of astronomical data indicate the presence of mass\n" + "discrepancies in the Universe. The motions observed in a variety of\n" + "classes of extragalactic systems exceed what can be explained by the\n" + "mass visible in stars and gas. Either (i) there is a vast amount of\n" + @@ -55,8 +55,46 @@ public void setUp() { "problems of this alternative paradigm at all astrophysical scales, and\n" + "summarize the various theoretical attempts (TeVeS, GEA, BIMOND, and\n" + "others) made to effectively embed this modification of Newtonian\n" + - "dynamics within a relativistic theory of gravity.\n" + - "}"); + "dynamics within a relativistic theory of gravity."); + + + secondEntry = new BibEntry(); + secondEntry.setType(BibLatexEntryTypes.ARTICLE); + secondEntry.setField("bibtexkey", "2012NatMa..11...44S"); + secondEntry.setField("abstract", "Organic photovoltaic devices that can be fabricated by simple processing\n" + + "techniques are under intense investigation in academic and industrial\n" + + "laboratories because of their potential to enable mass production of\n" + + "flexible and cost-effective devices. Most of the attention has been\n" + + "focused on solution-processed polymer bulk-heterojunction (BHJ) solar\n" + + "cells. A combination of polymer design, morphology control, structural\n" + + "insight and device engineering has led to power conversion efficiencies\n" + + "(PCEs) reaching the 6-8\\% range for conjugated polymer/fullerene blends.\n" + + "Solution-processed small-molecule BHJ (SM BHJ) solar cells have received\n" + + "less attention, and their efficiencies have remained below those of\n" + + "their polymeric counterparts. Here, we report efficient\n" + + "solution-processed SM BHJ solar cells based on a new molecular donor,\n" + + "DTS(PTTh$_{2}$)$_{2}$. A record PCE of 6.7\\% under AM\n" + + "1.5{\\thinsp}G irradiation (100{\\thinsp}mW{\\thinsp}cm$^{-2}$) is\n" + + "achieved for small-molecule BHJ devices from\n" + + "DTS(PTTh$_{2}$)$_{2}$:PC$_{70}$BM (donor to acceptor\n" + + "ratio of 7:3). This high efficiency was obtained by using remarkably\n" + + "small percentages of solvent additive (0.25\\%{\\thinsp}v/v of\n" + + "1,8-diiodooctane, DIO) during the film-forming process, which leads to\n" + + "reduced domain sizes in the BHJ layer. These results provide important\n" + + "progress for solution-processed organic photovoltaics and demonstrate\n" + + "that solar cells fabricated from small donor molecules can compete with\n" + + "their polymeric counterparts."); + secondEntry.setField("adsnote", "Provided by the SAO/NASA Astrophysics Data System"); + secondEntry.setField("adsurl", "http://adsabs.harvard.edu/abs/2012NatMa..11...44S"); + secondEntry.setField("author", "Sun , Y. and Welch , G.~C. and Leong , W.~L. and Takacs , C.~J. and Bazan , G.~C. and Heeger , A.~J."); + secondEntry.setField("doi", "10.1038/nmat3160"); + secondEntry.setField("journal", "Nature Materials"); + secondEntry.setField("month", "#jan#"); + secondEntry.setField("pages", "44-48"); + secondEntry.setField("title", "Solution-processed small-molecule solar cells with 6.7\\% efficiency"); + secondEntry.setField("volume", "11"); + secondEntry.setField("year", "2012"); + } @@ -73,7 +111,7 @@ public void testHelpPage() { @Test public void testPerformSearchById() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.12942/lrr-2012-10"); - assertEquals(Optional.of(bibEntry), fetchedEntry); + assertEquals(Optional.of(firstEntry), fetchedEntry); } @Test @@ -87,4 +125,11 @@ public void testPerformSearchByIdInvalidDoi() throws Exception { Optional fetchedEntry = fetcher.performSearchById("this.doi.will.fail"); assertEquals(Optional.empty(), fetchedEntry); } + + @Test + public void testPerformSearchById2() throws Exception { + Optional fetchedEntry = fetcher.performSearchById("10.1038/nmat3160"); + assertEquals(Optional.of(secondEntry), fetchedEntry); + } + } From b92c734bfbda29e6ec55338dab188912b10ea605 Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Mon, 19 Sep 2016 13:29:39 +0200 Subject: [PATCH 07/12] rename test cases --- .../sf/jabref/logic/importer/fetcher/AdsFetcherTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java index 3c1e2a7af2b..b75fc30dcd5 100644 --- a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java +++ b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java @@ -109,13 +109,13 @@ public void testHelpPage() { } @Test - public void testPerformSearchById() throws Exception { + public void testPerformSearchByDOIlrr201210() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.12942/lrr-2012-10"); assertEquals(Optional.of(firstEntry), fetchedEntry); } @Test - public void testPerformSearchByIdEmpty() throws Exception { + public void testPerformSearchByIdEmptyDOI() throws Exception { Optional fetchedEntry = fetcher.performSearchById(""); assertEquals(Optional.empty(), fetchedEntry); } @@ -127,7 +127,7 @@ public void testPerformSearchByIdInvalidDoi() throws Exception { } @Test - public void testPerformSearchById2() throws Exception { + public void testPerformSearchByDOInmat3160() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.1038/nmat3160"); assertEquals(Optional.of(secondEntry), fetchedEntry); } From 93036962e288562bdfdb3ee3f9707e36b4c258c1 Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Mon, 19 Sep 2016 13:59:03 +0200 Subject: [PATCH 08/12] use IdBasedParserFetcher, update adsfetcher and test, add to entryfetchers --- .../gui/importer/fetcher/EntryFetchers.java | 2 + .../logic/importer/fetcher/AdsFetcher.java | 55 ++++++------------- .../importer/fetcher/AdsFetcherTest.java | 10 ++-- 3 files changed, 25 insertions(+), 42 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java b/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java index 61ca7da9052..611a77b9a79 100644 --- a/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java +++ b/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java @@ -7,6 +7,7 @@ import net.sf.jabref.Globals; import net.sf.jabref.logic.importer.IdBasedFetcher; +import net.sf.jabref.logic.importer.fetcher.AdsFetcher; import net.sf.jabref.logic.importer.fetcher.ArXiv; import net.sf.jabref.logic.importer.fetcher.AstrophysicsDataSystem; import net.sf.jabref.logic.importer.fetcher.DiVA; @@ -48,6 +49,7 @@ public List getEntryFetchers() { public static ArrayList getIdFetchers() { ArrayList list = new ArrayList<>(); + list.add(new AdsFetcher(Globals.prefs.getImportFormatPreferences())); list.add(new IsbnFetcher(Globals.prefs.getImportFormatPreferences())); list.add(new DiVA(Globals.prefs.getImportFormatPreferences())); list.add(new DoiFetcher(Globals.prefs.getImportFormatPreferences())); diff --git a/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java b/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java index 2acc7c85be2..7b3505b7857 100644 --- a/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java +++ b/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java @@ -7,8 +7,9 @@ import net.sf.jabref.logic.help.HelpFile; import net.sf.jabref.logic.importer.FetcherException; -import net.sf.jabref.logic.importer.IdBasedFetcher; +import net.sf.jabref.logic.importer.IdBasedParserFetcher; import net.sf.jabref.logic.importer.ImportFormatPreferences; +import net.sf.jabref.logic.importer.Parser; import net.sf.jabref.logic.importer.fileformat.BibtexParser; import net.sf.jabref.logic.util.strings.StringUtil; import net.sf.jabref.model.entry.BibEntry; @@ -23,19 +24,19 @@ * from ADS(The NASA Astrophysics Data System). * Fetching using DOI(Document Object Identifier) is only supported. */ -public class AdsFetcher implements IdBasedFetcher { +public class AdsFetcher implements IdBasedParserFetcher { private static final String URL_PATTERN = "http://adsabs.harvard.edu/doi/"; - private ImportFormatPreferences preferences; + private ImportFormatPreferences importFormatPreferences; - public AdsFetcher(ImportFormatPreferences preferences) { - this.preferences = preferences; + public AdsFetcher(ImportFormatPreferences importFormatPreferences) { + this.importFormatPreferences = importFormatPreferences; } @Override public String getName() { - return "ADS from ADS-DOI"; + return "ADS-DOI"; } @Override @@ -44,40 +45,20 @@ public HelpFile getHelpPage() { } @Override - public Optional performSearchById(String identifier) throws FetcherException { - Optional result = Optional.empty(); - + public URL getURLForID(String identifier) throws URISyntaxException, MalformedURLException, FetcherException { String key = identifier.replaceAll("^(doi:|DOI:)", ""); + URIBuilder uriBuilder = new URIBuilder(URL_PATTERN + key); + uriBuilder.addParameter("data_type", "BIBTEXPLUS"); + return uriBuilder.build().toURL(); + } - try { - URIBuilder uriBuilder = new URIBuilder(URL_PATTERN + key); - uriBuilder.addParameter("data_type", "BIBTEXPLUS"); - URL url = uriBuilder.build().toURL(); - - String bibtexString = Unirest.get(url.toString()).asString().getBody(); - - if (bibtexString.contains("@")) { - bibtexString = bibtexString.substring(bibtexString.indexOf('@')); - result = BibtexParser.singleFromString(bibtexString, preferences); - } - - if (result.isPresent()) { - result = postProcess(result.get()); - } - - } catch (MalformedURLException | UnirestException | URISyntaxException e) { - throw new FetcherException("Error fetching ADS", e); - } - return result; + @Override + public Parser getParser() { + return new BibtexParser(importFormatPreferences); } - /** - * Remove all useless curly brackets in the given entry. - * The original fetcher fetches a bibtex file containing "{ and }" at the end of an abstract or title. This causes a {{ and }} in JabRef. - * @param entry Fetched entry with useless curly brackets - * @return cleaned entry - */ - private Optional postProcess(BibEntry entry) { + @Override + public void doPostCleanup(BibEntry entry){ Optional optTitleString = entry.getField(FieldName.TITLE); if (optTitleString.isPresent()) { String titleString = optTitleString.get(); @@ -100,7 +81,5 @@ private Optional postProcess(BibEntry entry) { abstractString = StringUtil.shaveString(abstractString); entry.setField(FieldName.ABSTRACT, abstractString.trim()); } - return Optional.of(entry); } - } diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java index b75fc30dcd5..f9bbe132045 100644 --- a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java +++ b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java @@ -3,8 +3,10 @@ import java.util.Optional; import net.sf.jabref.Globals; +import net.sf.jabref.logic.importer.FetcherException; import net.sf.jabref.model.entry.BibEntry; import net.sf.jabref.model.entry.BibLatexEntryTypes; +import net.sf.jabref.preferences.JabRefPreferences; import org.junit.Before; import org.junit.Test; @@ -18,7 +20,7 @@ public class AdsFetcherTest { @Before public void setUp() { - fetcher = new AdsFetcher(Globals.prefs.getImportFormatPreferences()); + fetcher = new AdsFetcher(JabRefPreferences.getInstance().getImportFormatPreferences()); firstEntry = new BibEntry(); firstEntry.setType(BibLatexEntryTypes.ARTICLE); @@ -100,12 +102,12 @@ public void setUp() { @Test public void testName() { - assertEquals("ADS from ADS-DOI", fetcher.getName()); + assertEquals("ADS-DOI", fetcher.getName()); } @Test public void testHelpPage() { - assertEquals("ADSHelp", fetcher.getHelpPage().getPageName()); + assertEquals("ADS", fetcher.getHelpPage().getPageName()); } @Test @@ -120,7 +122,7 @@ public void testPerformSearchByIdEmptyDOI() throws Exception { assertEquals(Optional.empty(), fetchedEntry); } - @Test + @Test(expected = FetcherException.class) public void testPerformSearchByIdInvalidDoi() throws Exception { Optional fetchedEntry = fetcher.performSearchById("this.doi.will.fail"); assertEquals(Optional.empty(), fetchedEntry); From 9f29a2d073439bd4bbef1eac34e0f6e86af614f8 Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Mon, 19 Sep 2016 15:05:33 +0200 Subject: [PATCH 09/12] integrate AdsFetcher into AstrophysicsDataSystem --- .../gui/importer/fetcher/EntryFetchers.java | 3 +- .../logic/importer/fetcher/AdsFetcher.java | 85 ----------- .../fetcher/AstrophysicsDataSystem.java | 18 ++- .../importer/fetcher/AdsFetcherTest.java | 137 ------------------ .../fetcher/AstrophysicsDataSystemTest.java | 111 +++++++++++++- 5 files changed, 128 insertions(+), 226 deletions(-) delete mode 100644 src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java delete mode 100644 src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java diff --git a/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java b/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java index 611a77b9a79..f7d0a7d70fd 100644 --- a/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java +++ b/src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java @@ -7,7 +7,6 @@ import net.sf.jabref.Globals; import net.sf.jabref.logic.importer.IdBasedFetcher; -import net.sf.jabref.logic.importer.fetcher.AdsFetcher; import net.sf.jabref.logic.importer.fetcher.ArXiv; import net.sf.jabref.logic.importer.fetcher.AstrophysicsDataSystem; import net.sf.jabref.logic.importer.fetcher.DiVA; @@ -49,7 +48,7 @@ public List getEntryFetchers() { public static ArrayList getIdFetchers() { ArrayList list = new ArrayList<>(); - list.add(new AdsFetcher(Globals.prefs.getImportFormatPreferences())); + list.add(new AstrophysicsDataSystem(Globals.prefs.getImportFormatPreferences())); list.add(new IsbnFetcher(Globals.prefs.getImportFormatPreferences())); list.add(new DiVA(Globals.prefs.getImportFormatPreferences())); list.add(new DoiFetcher(Globals.prefs.getImportFormatPreferences())); diff --git a/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java b/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java deleted file mode 100644 index 7b3505b7857..00000000000 --- a/src/main/java/net/sf/jabref/logic/importer/fetcher/AdsFetcher.java +++ /dev/null @@ -1,85 +0,0 @@ -package net.sf.jabref.logic.importer.fetcher; - -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Optional; - -import net.sf.jabref.logic.help.HelpFile; -import net.sf.jabref.logic.importer.FetcherException; -import net.sf.jabref.logic.importer.IdBasedParserFetcher; -import net.sf.jabref.logic.importer.ImportFormatPreferences; -import net.sf.jabref.logic.importer.Parser; -import net.sf.jabref.logic.importer.fileformat.BibtexParser; -import net.sf.jabref.logic.util.strings.StringUtil; -import net.sf.jabref.model.entry.BibEntry; -import net.sf.jabref.model.entry.FieldName; - -import com.mashape.unirest.http.Unirest; -import com.mashape.unirest.http.exceptions.UnirestException; -import org.apache.http.client.utils.URIBuilder; - -/** - * This class handles accessing and obtaining BibTeX entry - * from ADS(The NASA Astrophysics Data System). - * Fetching using DOI(Document Object Identifier) is only supported. - */ -public class AdsFetcher implements IdBasedParserFetcher { - - private static final String URL_PATTERN = "http://adsabs.harvard.edu/doi/"; - - private ImportFormatPreferences importFormatPreferences; - - public AdsFetcher(ImportFormatPreferences importFormatPreferences) { - this.importFormatPreferences = importFormatPreferences; - } - - @Override - public String getName() { - return "ADS-DOI"; - } - - @Override - public HelpFile getHelpPage() { - return HelpFile.FETCHER_ADS; - } - - @Override - public URL getURLForID(String identifier) throws URISyntaxException, MalformedURLException, FetcherException { - String key = identifier.replaceAll("^(doi:|DOI:)", ""); - URIBuilder uriBuilder = new URIBuilder(URL_PATTERN + key); - uriBuilder.addParameter("data_type", "BIBTEXPLUS"); - return uriBuilder.build().toURL(); - } - - @Override - public Parser getParser() { - return new BibtexParser(importFormatPreferences); - } - - @Override - public void doPostCleanup(BibEntry entry){ - Optional optTitleString = entry.getField(FieldName.TITLE); - if (optTitleString.isPresent()) { - String titleString = optTitleString.get(); - titleString = StringUtil.shaveString(titleString); - entry.setField(FieldName.TITLE, titleString.trim()); - } - - Optional optAuthorString = entry.getField(FieldName.AUTHOR); - if (optAuthorString.isPresent()) { - String authorString = optAuthorString.get(); - authorString = authorString.replace('{', ' '); - authorString = authorString.replace('}', ' '); - authorString = authorString.replace(" ", " "); - entry.setField(FieldName.AUTHOR, authorString.trim()); - } - - Optional optAbstractStirng = entry.getField(FieldName.ABSTRACT); - if (optAbstractStirng.isPresent()) { - String abstractString = optAbstractStirng.get(); - abstractString = StringUtil.shaveString(abstractString); - entry.setField(FieldName.ABSTRACT, abstractString.trim()); - } - } -} diff --git a/src/main/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java b/src/main/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java index a4b3efb0cb8..499fd38a0b4 100644 --- a/src/main/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java +++ b/src/main/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java @@ -9,8 +9,10 @@ import net.sf.jabref.logic.formatter.bibtexfields.ClearFormatter; import net.sf.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter; import net.sf.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter; +import net.sf.jabref.logic.help.HelpFile; import net.sf.jabref.logic.importer.EntryBasedParserFetcher; import net.sf.jabref.logic.importer.FetcherException; +import net.sf.jabref.logic.importer.IdBasedParserFetcher; import net.sf.jabref.logic.importer.ImportFormatPreferences; import net.sf.jabref.logic.importer.Parser; import net.sf.jabref.logic.importer.SearchBasedParserFetcher; @@ -29,10 +31,11 @@ * There is also a new API (https://github.com/adsabs/adsabs-dev-api) but it returns JSON * (or at least needs multiple calls to get BibTeX, status: September 2016) */ -public class AstrophysicsDataSystem implements SearchBasedParserFetcher, EntryBasedParserFetcher { +public class AstrophysicsDataSystem implements IdBasedParserFetcher, SearchBasedParserFetcher, EntryBasedParserFetcher { private static String API_QUERY_URL = "http://adsabs.harvard.edu/cgi-bin/nph-basic_connect"; private static String API_ENTRY_URL = "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect"; + private static String API_DOI_URL = "http://adsabs.harvard.edu/doi/"; private final ImportFormatPreferences preferences; public AstrophysicsDataSystem(ImportFormatPreferences preferences) { @@ -89,6 +92,19 @@ public URL getURLForEntry(BibEntry entry) throws URISyntaxException, MalformedUR return uriBuilder.build().toURL(); } + @Override + public URL getURLForID(String identifier) throws URISyntaxException, MalformedURLException, FetcherException { + String key = identifier.replaceAll("^(doi:|DOI:)", ""); + URIBuilder uriBuilder = new URIBuilder(API_DOI_URL + key); + uriBuilder.addParameter("data_type", "BIBTEXPLUS"); + return uriBuilder.build().toURL(); + } + + @Override + public HelpFile getHelpPage() { + return HelpFile.FETCHER_ADS; + } + @Override public Parser getParser() { return new BibtexParser(preferences); diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java deleted file mode 100644 index f9bbe132045..00000000000 --- a/src/test/java/net/sf/jabref/logic/importer/fetcher/AdsFetcherTest.java +++ /dev/null @@ -1,137 +0,0 @@ -package net.sf.jabref.logic.importer.fetcher; - -import java.util.Optional; - -import net.sf.jabref.Globals; -import net.sf.jabref.logic.importer.FetcherException; -import net.sf.jabref.model.entry.BibEntry; -import net.sf.jabref.model.entry.BibLatexEntryTypes; -import net.sf.jabref.preferences.JabRefPreferences; - -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class AdsFetcherTest { - - private AdsFetcher fetcher; - private BibEntry firstEntry, secondEntry; - - @Before - public void setUp() { - fetcher = new AdsFetcher(JabRefPreferences.getInstance().getImportFormatPreferences()); - - firstEntry = new BibEntry(); - firstEntry.setType(BibLatexEntryTypes.ARTICLE); - firstEntry.setField("bibtexkey", "2012LRR....15...10F"); - firstEntry.setField("author", "Famaey , B. and McGaugh , S.~S."); - firstEntry.setField("title", "Modified Newtonian Dynamics (MOND): Observational Phenomenology and Relativistic Extensions"); - firstEntry.setField("journal", "Living Reviews in Relativity"); - firstEntry.setField("year", "2012"); - firstEntry.setField("volume", "15"); - firstEntry.setField("month", "#sep#"); - firstEntry.setField("adsnote", "Provided by the SAO/NASA Astrophysics Data System"); - firstEntry.setField("adsurl", "http://adsabs.harvard.edu/abs/2012LRR....15...10F"); - firstEntry.setField("archiveprefix", "arXiv"); - firstEntry.setField("doi", "10.12942/lrr-2012-10"); - firstEntry.setField("eprint", "1112.3960"); - firstEntry.setField("keywords", "astronomical observations, Newtonian limit, equations of motion, extragalactic astronomy, cosmology, theories of gravity, fundamental physics, astrophysics"); - firstEntry.setField("abstract", "A wealth of astronomical data indicate the presence of mass\n" + - "discrepancies in the Universe. The motions observed in a variety of\n" + - "classes of extragalactic systems exceed what can be explained by the\n" + - "mass visible in stars and gas. Either (i) there is a vast amount of\n" + - "unseen mass in some novel form - dark matter - or (ii) the data indicate\n" + - "a breakdown of our understanding of dynamics on the relevant scales, or\n" + - "(iii) both. Here, we first review a few outstanding challenges for the\n" + - "dark matter interpretation of mass discrepancies in galaxies, purely\n" + - "based on observations and independently of any alternative theoretical\n" + - "framework. We then show that many of these puzzling observations are\n" + - "predicted by one single relation - Milgrom's law - involving an\n" + - "acceleration constant a\\_0 (or a characteristic surface density\n" + - "{$\\Sigma$}\\_{\\dagger} = a\\_0/G) on the order of the square-root of the\n" + - "cosmological constant in natural units. This relation can at present\n" + - "most easily be interpreted as the effect of a single universal force law\n" + - "resulting from a modification of Newtonian dynamics (MOND) on galactic\n" + - "scales. We exhaustively review the current observational successes and\n" + - "problems of this alternative paradigm at all astrophysical scales, and\n" + - "summarize the various theoretical attempts (TeVeS, GEA, BIMOND, and\n" + - "others) made to effectively embed this modification of Newtonian\n" + - "dynamics within a relativistic theory of gravity."); - - - secondEntry = new BibEntry(); - secondEntry.setType(BibLatexEntryTypes.ARTICLE); - secondEntry.setField("bibtexkey", "2012NatMa..11...44S"); - secondEntry.setField("abstract", "Organic photovoltaic devices that can be fabricated by simple processing\n" + - "techniques are under intense investigation in academic and industrial\n" + - "laboratories because of their potential to enable mass production of\n" + - "flexible and cost-effective devices. Most of the attention has been\n" + - "focused on solution-processed polymer bulk-heterojunction (BHJ) solar\n" + - "cells. A combination of polymer design, morphology control, structural\n" + - "insight and device engineering has led to power conversion efficiencies\n" + - "(PCEs) reaching the 6-8\\% range for conjugated polymer/fullerene blends.\n" + - "Solution-processed small-molecule BHJ (SM BHJ) solar cells have received\n" + - "less attention, and their efficiencies have remained below those of\n" + - "their polymeric counterparts. Here, we report efficient\n" + - "solution-processed SM BHJ solar cells based on a new molecular donor,\n" + - "DTS(PTTh$_{2}$)$_{2}$. A record PCE of 6.7\\% under AM\n" + - "1.5{\\thinsp}G irradiation (100{\\thinsp}mW{\\thinsp}cm$^{-2}$) is\n" + - "achieved for small-molecule BHJ devices from\n" + - "DTS(PTTh$_{2}$)$_{2}$:PC$_{70}$BM (donor to acceptor\n" + - "ratio of 7:3). This high efficiency was obtained by using remarkably\n" + - "small percentages of solvent additive (0.25\\%{\\thinsp}v/v of\n" + - "1,8-diiodooctane, DIO) during the film-forming process, which leads to\n" + - "reduced domain sizes in the BHJ layer. These results provide important\n" + - "progress for solution-processed organic photovoltaics and demonstrate\n" + - "that solar cells fabricated from small donor molecules can compete with\n" + - "their polymeric counterparts."); - secondEntry.setField("adsnote", "Provided by the SAO/NASA Astrophysics Data System"); - secondEntry.setField("adsurl", "http://adsabs.harvard.edu/abs/2012NatMa..11...44S"); - secondEntry.setField("author", "Sun , Y. and Welch , G.~C. and Leong , W.~L. and Takacs , C.~J. and Bazan , G.~C. and Heeger , A.~J."); - secondEntry.setField("doi", "10.1038/nmat3160"); - secondEntry.setField("journal", "Nature Materials"); - secondEntry.setField("month", "#jan#"); - secondEntry.setField("pages", "44-48"); - secondEntry.setField("title", "Solution-processed small-molecule solar cells with 6.7\\% efficiency"); - secondEntry.setField("volume", "11"); - secondEntry.setField("year", "2012"); - - } - - - @Test - public void testName() { - assertEquals("ADS-DOI", fetcher.getName()); - } - - @Test - public void testHelpPage() { - assertEquals("ADS", fetcher.getHelpPage().getPageName()); - } - - @Test - public void testPerformSearchByDOIlrr201210() throws Exception { - Optional fetchedEntry = fetcher.performSearchById("10.12942/lrr-2012-10"); - assertEquals(Optional.of(firstEntry), fetchedEntry); - } - - @Test - public void testPerformSearchByIdEmptyDOI() throws Exception { - Optional fetchedEntry = fetcher.performSearchById(""); - assertEquals(Optional.empty(), fetchedEntry); - } - - @Test(expected = FetcherException.class) - public void testPerformSearchByIdInvalidDoi() throws Exception { - Optional fetchedEntry = fetcher.performSearchById("this.doi.will.fail"); - assertEquals(Optional.empty(), fetchedEntry); - } - - @Test - public void testPerformSearchByDOInmat3160() throws Exception { - Optional fetchedEntry = fetcher.performSearchById("10.1038/nmat3160"); - assertEquals(Optional.of(secondEntry), fetchedEntry); - } - -} diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java index 282e4b27cd1..156809ce3b8 100644 --- a/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -2,10 +2,13 @@ import java.util.Collections; import java.util.List; +import java.util.Optional; import net.sf.jabref.logic.bibtex.FieldContentParserPreferences; +import net.sf.jabref.logic.importer.FetcherException; import net.sf.jabref.logic.importer.ImportFormatPreferences; import net.sf.jabref.model.entry.BibEntry; +import net.sf.jabref.model.entry.BibLatexEntryTypes; import net.sf.jabref.model.entry.BibtexEntryTypes; import org.junit.Before; @@ -20,7 +23,7 @@ public class AstrophysicsDataSystemTest { AstrophysicsDataSystem fetcher; - BibEntry diezSliceTheoremEntry; + BibEntry diezSliceTheoremEntry,famaeyMcGaughEntry, sunWelchEntry; @Before public void setUp() throws Exception { @@ -57,6 +60,88 @@ public void setUp() throws Exception { + "setting. The examples of the Klein-Gordon field and general Yang-Mills" + NEWLINE + "theory illustrate that the presented approach conveniently handles the" + NEWLINE + "occurring symmetries." + NEWLINE); + + + famaeyMcGaughEntry = new BibEntry(); + famaeyMcGaughEntry.setType(BibLatexEntryTypes.ARTICLE); + famaeyMcGaughEntry.setField("bibtexkey", "2012LRR....15...10F"); + famaeyMcGaughEntry.setField("author", "Famaey, B. and McGaugh, S. S."); + famaeyMcGaughEntry.setField("title", "Modified Newtonian Dynamics (MOND): Observational Phenomenology and Relativistic Extensions"); + famaeyMcGaughEntry.setField("journal", "Living Reviews in Relativity"); + famaeyMcGaughEntry.setField("year", "2012"); + famaeyMcGaughEntry.setField("volume", "15"); + famaeyMcGaughEntry.setField("month", "#sep#"); + famaeyMcGaughEntry.setField("archiveprefix", "arXiv"); + famaeyMcGaughEntry.setField("doi", "10.12942/lrr-2012-10"); + famaeyMcGaughEntry.setField("eprint", "1112.3960"); + famaeyMcGaughEntry.setField("keywords", "astronomical observations, Newtonian limit, equations of motion, extragalactic astronomy, cosmology, theories of gravity, fundamental physics, astrophysics"); + famaeyMcGaughEntry.setField("abstract", "A wealth of astronomical data indicate the presence of mass" + NEWLINE + + "discrepancies in the Universe. The motions observed in a variety of" + NEWLINE + + "classes of extragalactic systems exceed what can be explained by the" + NEWLINE + + "mass visible in stars and gas. Either (i) there is a vast amount of" + NEWLINE + + "unseen mass in some novel form - dark matter - or (ii) the data indicate" + NEWLINE + + "a breakdown of our understanding of dynamics on the relevant scales, or" + NEWLINE + + "(iii) both. Here, we first review a few outstanding challenges for the" + NEWLINE + + "dark matter interpretation of mass discrepancies in galaxies, purely" + NEWLINE + + "based on observations and independently of any alternative theoretical" + NEWLINE + + "framework. We then show that many of these puzzling observations are" + NEWLINE + + "predicted by one single relation - Milgrom's law - involving an" + NEWLINE + + "acceleration constant a\\_0 (or a characteristic surface density" + NEWLINE + + "{$\\Sigma$}\\_{\\dagger} = a\\_0/G) on the order of the square-root of the" + NEWLINE + + "cosmological constant in natural units. This relation can at present" + NEWLINE + + "most easily be interpreted as the effect of a single universal force law" + NEWLINE + + "resulting from a modification of Newtonian dynamics (MOND) on galactic" + NEWLINE + + "scales. We exhaustively review the current observational successes and" + NEWLINE + + "problems of this alternative paradigm at all astrophysical scales, and" + NEWLINE + + "summarize the various theoretical attempts (TeVeS, GEA, BIMOND, and" + NEWLINE + + "others) made to effectively embed this modification of Newtonian" + NEWLINE + + "dynamics within a relativistic theory of gravity."+ NEWLINE); + + + sunWelchEntry = new BibEntry(); + sunWelchEntry.setType(BibLatexEntryTypes.ARTICLE); + sunWelchEntry.setField("bibtexkey", "2012NatMa..11...44S"); + sunWelchEntry.setField("abstract", "Organic photovoltaic devices that can be fabricated by simple processing"+ NEWLINE + + "techniques are under intense investigation in academic and industrial"+ NEWLINE + + "laboratories because of their potential to enable mass production of"+ NEWLINE + + "flexible and cost-effective devices. Most of the attention has been"+ NEWLINE + + "focused on solution-processed polymer bulk-heterojunction (BHJ) solar"+ NEWLINE + + "cells. A combination of polymer design, morphology control, structural"+ NEWLINE + + "insight and device engineering has led to power conversion efficiencies"+ NEWLINE + + "(PCEs) reaching the 6-8\\% range for conjugated polymer/fullerene blends."+ NEWLINE + + "Solution-processed small-molecule BHJ (SM BHJ) solar cells have received"+ NEWLINE + + "less attention, and their efficiencies have remained below those of"+ NEWLINE + + "their polymeric counterparts. Here, we report efficient"+ NEWLINE + + "solution-processed SM BHJ solar cells based on a new molecular donor,"+ NEWLINE + + "DTS(PTTh$_{2}$)$_{2}$. A record PCE of 6.7\\% under AM"+ NEWLINE + + "1.5{\\thinsp}G irradiation (100{\\thinsp}mW{\\thinsp}cm$^{-2}$) is"+ NEWLINE + + "achieved for small-molecule BHJ devices from"+ NEWLINE + + "DTS(PTTh$_{2}$)$_{2}$:PC$_{70}$BM (donor to acceptor"+ NEWLINE + + "ratio of 7:3). This high efficiency was obtained by using remarkably"+ NEWLINE + + "small percentages of solvent additive (0.25\\%{\\thinsp}v/v of"+ NEWLINE + + "1,8-diiodooctane, DIO) during the film-forming process, which leads to"+ NEWLINE + + "reduced domain sizes in the BHJ layer. These results provide important"+ NEWLINE + + "progress for solution-processed organic photovoltaics and demonstrate"+ NEWLINE + + "that solar cells fabricated from small donor molecules can compete with"+ NEWLINE + + "their polymeric counterparts."+ NEWLINE); + sunWelchEntry.setField("author", "Sun, Y. and Welch, G. C. and Leong, W. L. and Takacs, C. J. and Bazan, G. C. and Heeger, A. J."); + sunWelchEntry.setField("doi", "10.1038/nmat3160"); + sunWelchEntry.setField("journal", "Nature Materials"); + sunWelchEntry.setField("month", "#jan#"); + sunWelchEntry.setField("pages", "44-48"); + sunWelchEntry.setField("title", "Solution-processed small-molecule solar cells with 6.7\\% efficiency"); + sunWelchEntry.setField("volume", "11"); + sunWelchEntry.setField("year", "2012"); + } + + @Test + public void testHelpPage() { + assertEquals("ADS", fetcher.getHelpPage().getPageName()); + } + + @Test + public void testGetName() { + assertEquals("SAO/NASA Astrophysics Data System", fetcher.getName()); } @Test @@ -75,4 +160,28 @@ public void searchByEntryFindsEntry() throws Exception { assertFalse(fetchedEntries.isEmpty()); assertEquals(diezSliceTheoremEntry, fetchedEntries.get(0)); } + + @Test + public void testPerformSearchByFamaeyMcGaughEntry() throws Exception { + Optional fetchedEntry = fetcher.performSearchById("10.12942/lrr-2012-10"); + assertEquals(Optional.of(famaeyMcGaughEntry), fetchedEntry); + } + + @Test + public void testPerformSearchByIdEmptyDOI() throws Exception { + Optional fetchedEntry = fetcher.performSearchById(""); + assertEquals(Optional.empty(), fetchedEntry); + } + + @Test(expected = FetcherException.class) + public void testPerformSearchByIdInvalidDoi() throws Exception { + Optional fetchedEntry = fetcher.performSearchById("this.doi.will.fail"); + assertEquals(Optional.empty(), fetchedEntry); + } + + @Test + public void testPerformSearchBySunWelchEntry() throws Exception { + Optional fetchedEntry = fetcher.performSearchById("10.1038/nmat3160"); + assertEquals(Optional.of(sunWelchEntry), fetchedEntry); + } } From 586ca9ae51383118a4657eea0cf917593106b0a6 Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Mon, 19 Sep 2016 15:40:01 +0200 Subject: [PATCH 10/12] fix localization --- src/main/resources/l10n/JabRef_da.properties | 9 +----- src/main/resources/l10n/JabRef_de.properties | 11 +------ src/main/resources/l10n/JabRef_es.properties | 9 +----- src/main/resources/l10n/JabRef_fa.properties | 12 +------ src/main/resources/l10n/JabRef_fr.properties | 11 ++----- src/main/resources/l10n/JabRef_in.properties | 9 +----- src/main/resources/l10n/JabRef_it.properties | 9 +----- src/main/resources/l10n/JabRef_ja.properties | 9 ++---- src/main/resources/l10n/JabRef_nl.properties | 11 +------ src/main/resources/l10n/JabRef_no.properties | 11 +------ .../resources/l10n/JabRef_pt_BR.properties | 9 +----- src/main/resources/l10n/JabRef_ru.properties | 12 +------ src/main/resources/l10n/JabRef_sv.properties | 31 ++++++------------- src/main/resources/l10n/JabRef_tr.properties | 10 +----- src/main/resources/l10n/JabRef_vi.properties | 11 +------ src/main/resources/l10n/JabRef_zh.properties | 23 +------------- src/main/resources/l10n/Menu_ja.properties | 7 +---- 17 files changed, 27 insertions(+), 177 deletions(-) diff --git a/src/main/resources/l10n/JabRef_da.properties b/src/main/resources/l10n/JabRef_da.properties index de359c293c8..6f6c9a27df8 100644 --- a/src/main/resources/l10n/JabRef_da.properties +++ b/src/main/resources/l10n/JabRef_da.properties @@ -1324,7 +1324,6 @@ Unmark_entries=Fjern_mærkning Unmark_entry=Fjern_mærkning - untitled=uden_navn Up=Op @@ -1419,6 +1418,7 @@ Fetching_Medline_by_term...=Henter_fra_Medline_via_udtryk... Please_enter_a_valid_number=Indtast_venligst_et_gyldigt_tal Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Indtast_venligst_en_kommasepareret_liste_af_Medline_IDer_(numre)_eller_søgeudtryk. Show_search_results_in_a_window=Vis_søgeresultater_i_et_vindue +Search_in_all_open_databases= Move_file_to_file_directory?=Flyt_fil_til_filbibliotek? Rename_to_'%0'=Omdøb_til_'%0' You_have_changed_the_menu_and_label_font_size.=Du_har_ændret_menu-_og_tekst-skriftstørrelsen. @@ -1885,8 +1885,6 @@ OpenDocument_text= OpenDocument_spreadsheet= OpenDocument_presentation= %0_image= -%0_problem(s)_found= -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Modified_entry= Deleted_entry= @@ -1921,7 +1919,6 @@ Copy_BibTeX_key_and_title= File_rename_failed_for_%0_entries.= To_set_up,_go_to=For_at_sætte_op,_gå_til Merged_BibTeX_source_code= -'%0'_is_not_a_valid_ADS_bibcode.= Invalid_DOI\:_'%0'.=Ugyldig_DOI\:_'%0'. should_start_with_a_name= should_end_with_a_name= @@ -2155,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2301,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_de.properties b/src/main/resources/l10n/JabRef_de.properties index 9951a660e86..2a3f6d6ac6a 100644 --- a/src/main/resources/l10n/JabRef_de.properties +++ b/src/main/resources/l10n/JabRef_de.properties @@ -1324,9 +1324,6 @@ Unmark_entries=Markierung_aufheben Unmark_entry=Markierung_aufheben - - - untitled=ohne_Titel Up=Hoch @@ -1421,6 +1418,7 @@ Fetching_Medline_by_term...=Rufe_Medline_mittels_Suchbegriff_ab... Please_enter_a_valid_number=Bitte_geben_Sie_eine_gültige_Zahl_ein Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Bitte_geben_Sie_eine_durch_Kommas_unterteilte_Liste_von_Medline-IDs_(Zahlen)_oder_Suchausdrücken_ein. Show_search_results_in_a_window=Suchergebnisse_in_einem_Fenster_anzeigen +Search_in_all_open_databases= Move_file_to_file_directory?=Datei_in_Dateiverzeichnis_verschieben? Rename_to_'%0'=Umbenennen_in_'%0' You_have_changed_the_menu_and_label_font_size.=Sie_haben_die_Schriftgröße_für_Menüs_und_Label_geändert. @@ -1863,7 +1861,6 @@ Could_not_open_browser.=Konnte_Browser_nicht_öffnen. Please_open_%0_manually.=Bitte_öffnen_Sie_%0_manuell. The_link_has_been_copied_to_the_clipboard.=Der_Link_wurde_in_die_Zwischenablage_kopiert. - Open_%0_file=%0_Datei_öffnen Cannot_delete_file=Datei_kann_nicht_gelöscht_werden. @@ -1888,8 +1885,6 @@ OpenDocument_text=OpenDocument-Text OpenDocument_spreadsheet=OpenDocument-Tabelle OpenDocument_presentation=OpenDocument-Präsentation %0_image=%0-Bild -%0_problem(s)_found=%0_Problem(e)_gefunden -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=Akzeptieren_der_Änderungen_führt_dazu,_dass_die_komplette_Gruppenstruktur_durch_die_externen_Änderungen_erstetzt_wird. Added_entry=Eintrag_hinzugefügt Modified_entry=Eintrag_ bearbeitet Deleted_entry=Eintrag_gelöscht @@ -1924,7 +1919,6 @@ Copy_BibTeX_key_and_title=BibTeX-Key_und_Titel_kopieren File_rename_failed_for_%0_entries.=Dateiumbennung_schlug_ür_%0_Einträge_fehl. To_set_up,_go_to=Einstellungen_unter Merged_BibTeX_source_code=BibTeX-Quelltext_zusammengeführt -'%0'_is_not_a_valid_ADS_bibcode.='%0'_ist_kein_gültiger_ADS-Bibcode Invalid_DOI\:_'%0'.=Ungültiger_DOI\:_'%0'. should_start_with_a_name=sollte_mit_einem_Name_beginnen should_end_with_a_name=sollte_mit_einem_Name_enden @@ -2158,7 +2152,6 @@ OpenOffice/LibreOffice_integration=OpenOffice/LibreOffice-Integration incorrect_control_digit=Falsche_Prüfziffer incorrect_format=Falsches_Format - Copy_version_to_clipboard=Kopiere_Version_in_die_Zwischenablage Copied_version_to_clipboard=Version_in_die_Zwischenablage_kopiert @@ -2303,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.=Der_Fetcher_%0_hat_keinen_Eintra Select_first_entry=Ersten_Eintrag_auswählen Select_last_entry=Letzten_Eintrag_auswählen -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_es.properties b/src/main/resources/l10n/JabRef_es.properties index 35506ef6801..69db9f5494b 100644 --- a/src/main/resources/l10n/JabRef_es.properties +++ b/src/main/resources/l10n/JabRef_es.properties @@ -1324,7 +1324,6 @@ Unmark_entries=Desmarcar_entradas Unmark_entry=Desmarcar_entrada - untitled=sin_título Up=Arriba @@ -1419,6 +1418,7 @@ Fetching_Medline_by_term...=Recuperando_desde_Medline_por_término... Please_enter_a_valid_number=Por_favor,_introduzca_un_número_válido Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Por_favor,_introduzca_una_lista_de_valores_separados_por_coma_de_IDs_de_Medline_(números)_o_términos_de_búsqueda. Show_search_results_in_a_window=Mostrar_los_resultados_de_la_búsqueda_en_una_ventana +Search_in_all_open_databases= Move_file_to_file_directory?=¿Mover_archivo_a_la_carpeta_de_archivos? Rename_to_'%0'=Renombrar_a_'%0' You_have_changed_the_menu_and_label_font_size.=Ha_cambiado_el_tamaño_de_tipo_de_letra_para_el_menu_y_etiqueta. @@ -1885,8 +1885,6 @@ OpenDocument_text=Texto_OpenDocument OpenDocument_spreadsheet=Hoja_de_cálculo_OpenDocument OpenDocument_presentation=Presentación_OpenDocument %0_image=imagen_%0 -%0_problem(s)_found=%0_problema(s)_encontrado(s) -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=Aceptar_el_cambio_reemplaza_el_árbol_completo_de_grupos_por_el_árbol_de_grupos_modificado_externamente Added_entry=Entrada_añadida Modified_entry=Entrada_modificada Deleted_entry=Entrada_eliminada @@ -1921,7 +1919,6 @@ Copy_BibTeX_key_and_title=Copiar_clave_y_título_BibTeX File_rename_failed_for_%0_entries.=Ha_fallado_el_renombrado_para_%0_entradas. To_set_up,_go_to=Para_configurar,_vaya_a Merged_BibTeX_source_code=Código_fuente_BibTex_fusionado -'%0'_is_not_a_valid_ADS_bibcode.='%0'_no_es_un_bibcode_ADS_válido Invalid_DOI\:_'%0'.=DOI_no_válida\:_'%0'. should_start_with_a_name=debería_comenzar_por_un_nombre should_end_with_a_name=debería_acabar_por_un_nombre @@ -2155,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2301,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_fa.properties b/src/main/resources/l10n/JabRef_fa.properties index cecde6152d2..0079aafe2f5 100644 --- a/src/main/resources/l10n/JabRef_fa.properties +++ b/src/main/resources/l10n/JabRef_fa.properties @@ -1324,9 +1324,6 @@ Unmark_entries= Unmark_entry= - - - untitled= Up= @@ -1421,6 +1418,7 @@ Fetching_Medline_by_term...= Please_enter_a_valid_number= Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.= Show_search_results_in_a_window= +Search_in_all_open_databases= Move_file_to_file_directory?= Rename_to_'%0'= You_have_changed_the_menu_and_label_font_size.= @@ -1863,7 +1861,6 @@ Could_not_open_browser.= Please_open_%0_manually.= The_link_has_been_copied_to_the_clipboard.= - Open_%0_file= Cannot_delete_file= @@ -1888,8 +1885,6 @@ OpenDocument_text= OpenDocument_spreadsheet= OpenDocument_presentation= %0_image= -%0_problem(s)_found= -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Modified_entry= Deleted_entry= @@ -1924,7 +1919,6 @@ Copy_BibTeX_key_and_title= File_rename_failed_for_%0_entries.= To_set_up,_go_to= Merged_BibTeX_source_code= -'%0'_is_not_a_valid_ADS_bibcode.= Invalid_DOI\:_'%0'.= should_start_with_a_name= should_end_with_a_name= @@ -2158,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2304,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_fr.properties b/src/main/resources/l10n/JabRef_fr.properties index 6e17f0d1614..d293bb06934 100644 --- a/src/main/resources/l10n/JabRef_fr.properties +++ b/src/main/resources/l10n/JabRef_fr.properties @@ -1175,7 +1175,7 @@ Show_icons_for_groups=Afficher_les_icônes_pour_les_groupes Show_last_names_only=Afficher_uniquement_les_noms_propres Show_names_unchanged=Ordre_des_noms_inchangé - + Show_optional_fields=Montrer_les_champs_optionnels Show_required_fields=Montrer_les_champs_requis @@ -1324,7 +1324,6 @@ Unmark_entries=Désétiqueter_ces_entrées Unmark_entry=Désétiqueter_l'entrée - untitled=sans_titre Up=Haut @@ -1419,6 +1418,7 @@ Fetching_Medline_by_term...=Recherche_sur_Medline_par_terme... Please_enter_a_valid_number=SVP,_entrez_un_nombre_valide Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=SVP,_entrez_une_liste_séparée_par_des_virgules_d'ID_Medline_(nombres)_ou_de_termes_de_recherche. Show_search_results_in_a_window=Afficher_les_résultats_de_recherche_dans_une_fenêtre +Search_in_all_open_databases=Rechercher_sur_toutes_les_bases_ouvertes Move_file_to_file_directory?=Déplacer_le_fichier_vers_le_répertoire_de_fichiers_? Rename_to_'%0'=Renommer_vers_'%0' You_have_changed_the_menu_and_label_font_size.=Vous_avez_modifié_la_taille_de_police_des_menus_et_des_étiquettes. @@ -1885,8 +1885,6 @@ OpenDocument_text=Texte_OpenDocument OpenDocument_spreadsheet=Tableau_OpenDocument OpenDocument_presentation=Présentation_OpenDocument %0_image=%0_image -%0_problem(s)_found=%0_problème(s)_trouvé(s). -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=Acceptation_que_l'arbre_des_groupes_entier_soit_remplacé_par_l'arbre_des_groupes_modifiés_externalement. Added_entry=Entrée_ajoutée Modified_entry=Entrée_modifiée Deleted_entry=Entrée_supprimée @@ -1921,7 +1919,6 @@ Copy_BibTeX_key_and_title=Copier_la_clef_BibTeX_et_le_titre File_rename_failed_for_%0_entries.=Le_renommage_des_fichiers_a_échoué_pour_%0_entrées. To_set_up,_go_to=Pour_configurer,_voir Merged_BibTeX_source_code=Code_source_BibTeX_fusionné -'%0'_is_not_a_valid_ADS_bibcode.='%0'n'est_pas_un_bibcode_ADS_valide. Invalid_DOI\:_'%0'.=DOI_invalide\:_'%0'. should_start_with_a_name=devrait_débuter_par_un_nom should_end_with_a_name=devrait_se_terminer_par_un_nom @@ -2155,8 +2152,6 @@ OpenOffice/LibreOffice_integration=Intégration_OpenOffice/LibreOffice incorrect_control_digit=chiffre_de_contrôle_incorrect incorrect_format=format_incorrect - - Copy_version_to_clipboard=Copier_la_version_dans_le_presse-papiers Copied_version_to_clipboard=Version_copiée_dans_le_presse-papiers @@ -2301,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.=L'outil_de_recherche_%0_n'a_pas_ Select_first_entry=Sélectionner_la_première_entrée Select_last_entry=Sélectionner_la_dernière_entrée -Search_in_all_open_databases=Rechercher_sur_toutes_les_bases_ouvertes - Invalid_ISBN\:_'%0'.=ISBN_invalide_:_%0. diff --git a/src/main/resources/l10n/JabRef_in.properties b/src/main/resources/l10n/JabRef_in.properties index dbe5475aa7e..a7d1bc6a2b5 100644 --- a/src/main/resources/l10n/JabRef_in.properties +++ b/src/main/resources/l10n/JabRef_in.properties @@ -1324,7 +1324,6 @@ Unmark_entries=Hilangkan_tanda_entri Unmark_entry=Hilangkan_tanda_entri - untitled=tanpa_judul Up=Naik @@ -1419,6 +1418,7 @@ Fetching_Medline_by_term...=Mengambil_Medline_berdasar_istilah... Please_enter_a_valid_number=Tuliskan_nomor_yang_benar Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Gunakan_pemisah_koma_dari_ID_Medline_(angka)_atau_cari_istilah. Show_search_results_in_a_window=Tampilkan_hasil_pencarian_di_jendela +Search_in_all_open_databases= Move_file_to_file_directory?=Pindah_berkas_ke_direktori_berkas? Rename_to_'%0'=Ganti_nama_menjadi_'%0' You_have_changed_the_menu_and_label_font_size.=Ukuran_huruf_menu_dan_label_sudah_anda_ubah. @@ -1885,8 +1885,6 @@ OpenDocument_text=Teks_OpenDocument OpenDocument_spreadsheet=Lembatang_lajur_OpenDocument OpenDocument_presentation=Presentasi_Open_Document %0_image= -%0_problem(s)_found=%0_kesalahan_ditemukan -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry=Entri_ditambahkan Modified_entry= Deleted_entry=Entri_dihapus @@ -1921,7 +1919,6 @@ Copy_BibTeX_key_and_title=Salin_kunci_BibTeX_dan_judul File_rename_failed_for_%0_entries.=Perubahan_nama_berkas_gagal_untuk_%0_entri. To_set_up,_go_to=Untuk_mengatur,_dari Merged_BibTeX_source_code= -'%0'_is_not_a_valid_ADS_bibcode.='%0'_bukan_kode_BIB_ADS_yang_sah. Invalid_DOI\:_'%0'.=DOI_salah\:_'%0'. should_start_with_a_name=harus_bermula_dengan_nama should_end_with_a_name=harus_berakhiran_nama @@ -2155,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2301,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_it.properties b/src/main/resources/l10n/JabRef_it.properties index f1436502ac1..4aae59282d4 100644 --- a/src/main/resources/l10n/JabRef_it.properties +++ b/src/main/resources/l10n/JabRef_it.properties @@ -1324,7 +1324,6 @@ Unmark_entries=Rimuovi_i_contrassegni_dalle_voci Unmark_entry=Rimuovi_il_contrassegno_dalla_voce - untitled=senza_titolo Up=Su @@ -1419,6 +1418,7 @@ Fetching_Medline_by_term...=Recupero_da_Medline_per_termine... Please_enter_a_valid_number=Inserire_un_numero_valido Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Inserire_una_lista_separata_da_virgole_di_ID_Medline_(numeri)_o_termini_di_ricerca. Show_search_results_in_a_window=Mostra_i_risultati_della_ricerca_in_una_finestra +Search_in_all_open_databases= Move_file_to_file_directory?=Spostare_i_file_nella_cartella_dei_file_principale? Rename_to_'%0'=Rinomina_in_'%0' You_have_changed_the_menu_and_label_font_size.=Sono_state_modificate_le_dimensioni_del_carattere_di_menu_ed_etichette. @@ -1885,8 +1885,6 @@ OpenDocument_text= OpenDocument_spreadsheet= OpenDocument_presentation= %0_image= -%0_problem(s)_found= -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Modified_entry= Deleted_entry= @@ -1921,7 +1919,6 @@ Copy_BibTeX_key_and_title=Copia_la_chiave_BibTeX_ed_il_titolo File_rename_failed_for_%0_entries.=Rinominazione_dei_file_fallita_per_%0_voci. To_set_up,_go_to=Per_configurare_vedi Merged_BibTeX_source_code= -'%0'_is_not_a_valid_ADS_bibcode.= Invalid_DOI\:_'%0'.=DOI_non_valido\:_'%0'. should_start_with_a_name= should_end_with_a_name= @@ -2155,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2301,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_ja.properties b/src/main/resources/l10n/JabRef_ja.properties index 19bcc30dd96..86474621162 100644 --- a/src/main/resources/l10n/JabRef_ja.properties +++ b/src/main/resources/l10n/JabRef_ja.properties @@ -1,4 +1,3 @@ - #! #! created/edited by Popeye version 0.55 (github.com/JabRef/popeye) #! encoding:UTF-8 @@ -466,7 +465,6 @@ Entry_types=項目型 Error=エラー Error_exporting_to_clipboard=クリップボード書き出し中にエラー発生 -##Error\:_check_your_External_viewer_settings_in_Preferences=エラー:環境設定中の外部ビューアの設定を見直してください Error_occurred_when_parsing_entry=項目を解析中にエラーが発生 Error_opening_file=ファイルを開く際にエラー発生 @@ -1420,6 +1418,7 @@ Fetching_Medline_by_term...=Medlineからterm順で取得中... Please_enter_a_valid_number=有効な数値を入力してください Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=コンマ区切りでMedline_ID_(番号)ないしは検索項目の一覧を入力してください。 Show_search_results_in_a_window=検索結果をウィンドウに表示 +Search_in_all_open_databases= Move_file_to_file_directory?=ファイルをファイルディレクトリに移動しますか? Rename_to_'%0'=「%0」に改名 You_have_changed_the_menu_and_label_font_size.=メニュートラベルのフォント寸法が変更されました。 @@ -1886,8 +1885,6 @@ OpenDocument_text=OpenDocument文書 OpenDocument_spreadsheet=OpenDocument表計算 OpenDocument_presentation=OpenDocumentプレゼンテーション %0_image=%0画像 -%0_problem(s)_found=%0件問題を検出しました -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=変更を承認すると、外部で修正されたグループツリーで,グループツリー全体を置き換えます。 Added_entry=項目を追加しました Modified_entry=項目を修正しました Deleted_entry=項目を削除 @@ -1922,7 +1919,6 @@ Copy_BibTeX_key_and_title=BibTeX鍵とタイトルをコピー File_rename_failed_for_%0_entries.=%0項目のファイル名変更が失敗しました。 To_set_up,_go_to=設定するには、 Merged_BibTeX_source_code=統合後のBibTeXソースコード -'%0'_is_not_a_valid_ADS_bibcode.=「%0」は有効なADS bibcodeではありません。 Invalid_DOI\:_'%0'.=無効なDOIです\:_'%0'. should_start_with_a_name=始まりは名前でなくてはなりません should_end_with_a_name=終わりは名前でなくてはなりません @@ -2153,6 +2149,7 @@ booktitle_ends_with_'conference_on'=「conference_on」で終わるbooktitle All_external_files=全外部ファイル OpenOffice/LibreOffice_integration=OpenOffice/LibreOfficeの統合 + incorrect_control_digit=誤った制御数字 incorrect_format=誤った書式 Copy_version_to_clipboard=バージョンをクリップボードにコピー @@ -2282,7 +2279,6 @@ Opens_JabRef's_website=JabRefのウェブサイトを開きます Opens_a_link_where_the_current_development_version_can_be_downloaded=現行開発版をダウンロードできる場所へのリンクを開きます See_what_has_been_changed_in_the_JabRef_versions=JabRefの各版における変更点を見ます Referenced_BibTeX_key_does_not_exist=参照されたBibTeX鍵は存在しません - Finished_downloading_full_text_document_for_entry_%0.=項目%0の文書本体のダウンロードが終了しました. Full_text_document_download_failed_for_entry_%0.=項目%0の文書本体のダウンロードに失敗しました. Look_up_full_text_documents=文書本体を見る @@ -2297,7 +2293,6 @@ ID_type=ID型 ID-based_entry_generator=ID基準項目生成子 Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.=取得子「%0」は,IDが「%1」の項目を見つけられませんでした. -Search_in_all_open_databases= Select_first_entry=最初の項目を選択 Select_last_entry=最後の項目を選択 diff --git a/src/main/resources/l10n/JabRef_nl.properties b/src/main/resources/l10n/JabRef_nl.properties index d892b3cebdf..c192e1c8863 100644 --- a/src/main/resources/l10n/JabRef_nl.properties +++ b/src/main/resources/l10n/JabRef_nl.properties @@ -1324,9 +1324,6 @@ Unmark_entries=Alle_markeringen_van_entries_ongedaan_maken Unmark_entry=Markering_van_entry_ongedaan_maken - - - untitled=naamloos Up=Omhoog @@ -1421,6 +1418,7 @@ Fetching_Medline_by_term...= Please_enter_a_valid_number= Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.= Show_search_results_in_a_window= +Search_in_all_open_databases= Move_file_to_file_directory?= Rename_to_'%0'= You_have_changed_the_menu_and_label_font_size.= @@ -1887,8 +1885,6 @@ OpenDocument_text= OpenDocument_spreadsheet= OpenDocument_presentation= %0_image= -%0_problem(s)_found= -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Modified_entry= Deleted_entry= @@ -1923,7 +1919,6 @@ Copy_BibTeX_key_and_title=Kopieer_BibTeX_sleutel_en_titel File_rename_failed_for_%0_entries.= To_set_up,_go_to=Om_in_te_stellen,_ga_naar Merged_BibTeX_source_code= -'%0'_is_not_a_valid_ADS_bibcode.= Invalid_DOI\:_'%0'.=Ongeldig_DOI\:_'%0'. should_start_with_a_name= should_end_with_a_name= @@ -2157,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2303,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_no.properties b/src/main/resources/l10n/JabRef_no.properties index e7a73319bb9..0f678231ba9 100644 --- a/src/main/resources/l10n/JabRef_no.properties +++ b/src/main/resources/l10n/JabRef_no.properties @@ -1324,9 +1324,6 @@ Unmark_entries=Fjern_merking Unmark_entry=Fjern_merking - - - untitled=uten_navn Up=Opp @@ -1421,6 +1418,7 @@ Fetching_Medline_by_term...=Henter_Medline_ved_hjelp_av_n\u00f8kkelord... Please_enter_a_valid_number=Vennligst_skriv_inn_et_gyldig_tall Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Vennligst_skriv_inn_en_kommaseparert_liste_av_Medline-IDer_(tall)_eller_s\u00f8keord. Show_search_results_in_a_window=Vis_s\u00f8keresultatene_i_et_vundu +Search_in_all_open_databases= Move_file_to_file_directory?=Flytt_filen_til_hovedkatalogen_for_filer? Rename_to_'%0'=Endre_navn_til_'%0' You_have_changed_the_menu_and_label_font_size.=Du_har_endret_skriftst\u00f8rrelser. @@ -1887,8 +1885,6 @@ OpenDocument_text= OpenDocument_spreadsheet= OpenDocument_presentation= %0_image= -%0_problem(s)_found= -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Modified_entry= Deleted_entry= @@ -1923,7 +1919,6 @@ Copy_BibTeX_key_and_title=Kopier_BibTeX-n\u00f8kkel_og_tittel File_rename_failed_for_%0_entries.= To_set_up,_go_to=For_\u00e5_sette_opp,_g\u00e5_til Merged_BibTeX_source_code= -'%0'_is_not_a_valid_ADS_bibcode.= Invalid_DOI\:_'%0'.=Ugyldig_DOI\:_'%0'. should_start_with_a_name= should_end_with_a_name= @@ -2157,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2303,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_pt_BR.properties b/src/main/resources/l10n/JabRef_pt_BR.properties index 81788b757b9..c4b336513d8 100644 --- a/src/main/resources/l10n/JabRef_pt_BR.properties +++ b/src/main/resources/l10n/JabRef_pt_BR.properties @@ -1324,7 +1324,6 @@ Unmark_entries=Desmarcar_referências Unmark_entry=Desmarcar_referência - untitled=Sem_título Up=Acima @@ -1419,6 +1418,7 @@ Fetching_Medline_by_term...=Recuperando_do_Medline_por_termo... Please_enter_a_valid_number=Por_favor,_digite_um_número_válido Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Por_favor,_digite_uma_lista_separada_por_vírgulas_de_IDs_ou_termos_de_busca_Medline. Show_search_results_in_a_window=Exibir_resultados_de_busca_em_uma_janela +Search_in_all_open_databases= Move_file_to_file_directory?=Mover_arquivo_para_o_diretório_de_arquivos? Rename_to_'%0'=Renomear_para_'%0' You_have_changed_the_menu_and_label_font_size.=Você_alterou_o_menu_e_tamanho_de_fonte_dos_rótulos. @@ -1885,8 +1885,6 @@ OpenDocument_text= OpenDocument_spreadsheet= OpenDocument_presentation= %0_image= -%0_problem(s)_found= -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry=Referência_adicionada Modified_entry=Referência_modificada Deleted_entry=Referência_deletada @@ -1921,7 +1919,6 @@ Copy_BibTeX_key_and_title=Copiar_chave_BibTeX_e_título File_rename_failed_for_%0_entries.= To_set_up,_go_to=Para_configurar,_acesse_o_menu Merged_BibTeX_source_code= -'%0'_is_not_a_valid_ADS_bibcode.= Invalid_DOI\:_'%0'.=DOI_inválida\:_'%0'. should_start_with_a_name= should_end_with_a_name= @@ -2155,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2301,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_ru.properties b/src/main/resources/l10n/JabRef_ru.properties index f7926798750..7122f28e91c 100644 --- a/src/main/resources/l10n/JabRef_ru.properties +++ b/src/main/resources/l10n/JabRef_ru.properties @@ -1324,9 +1324,6 @@ Unmark_entries=Снять_метки_записей Unmark_entry=Снять_метку_записи - - - untitled=без_заглавия Up=Вверх @@ -1421,6 +1418,7 @@ Fetching_Medline_by_term...=Выполняется_выборка_Medline_по_ Please_enter_a_valid_number=Введите_допустимое_число Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Введите_список_ид._Medline_(числ.),_разделенных_запятыми_или_условия_поиска. Show_search_results_in_a_window=Показать_результаты_в_окне +Search_in_all_open_databases= Move_file_to_file_directory?=Файл_будет_перемещен_в_каталог_файлов._Продолжить? Rename_to_'%0'=Переименовать_в_'%0' You_have_changed_the_menu_and_label_font_size.=Кегль_меню_и_надписи_изменен_пользователем. @@ -1863,7 +1861,6 @@ Could_not_open_browser.=Не_удалось_открыть_браузер. Please_open_%0_manually.= The_link_has_been_copied_to_the_clipboard.= - Open_%0_file= Cannot_delete_file= @@ -1888,8 +1885,6 @@ OpenDocument_text= OpenDocument_spreadsheet= OpenDocument_presentation= %0_image= -%0_problem(s)_found= -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Modified_entry= Deleted_entry= @@ -1924,7 +1919,6 @@ Copy_BibTeX_key_and_title=Копировать_ключ_и_заголовок_Bi File_rename_failed_for_%0_entries.=Ошибка_переименования_файла_для_%0_записи. To_set_up,_go_to=Для_настройки_перейдите\: Merged_BibTeX_source_code= -'%0'_is_not_a_valid_ADS_bibcode.= Invalid_DOI\:_'%0'.=Недопустимый_DOI-адрес\:_'%0'. should_start_with_a_name= should_end_with_a_name= @@ -2158,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2304,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_sv.properties b/src/main/resources/l10n/JabRef_sv.properties index 086878b2230..6b9095f9b2b 100644 --- a/src/main/resources/l10n/JabRef_sv.properties +++ b/src/main/resources/l10n/JabRef_sv.properties @@ -15,12 +15,6 @@ %0_matches_the_regular_expression_%1=%0_matchar_det_reguljära_uttrycket_%1 %0_matches_the_term_%1=%0_matchar_termen_%1 -%0_mode=%0-läge -%0_problem(s)_found=%0_problem_hittades -'%0'_exists._Overwrite_file?='%0'_finns_redan._Skriv_över_filen? -Could_not_find_file_'%0'
linked_from_entry_'%1'=Hittar_inte_filen_'%0'
som_länkas_från_posten_'%1' -= -All_Entries_(this_group_cannot_be_edited_or_removed)=Alla_poster_(den_här_gruppen_kan_inte_ändras_eller_tas_bort) = Could_not_find_file_'%0'
linked_from_entry_'%1'=Hittar_inte_filen_'%0'
som_länkas_från_posten_'%1' @@ -87,7 +81,6 @@ All_fields=Alla_fält All_subgroups_(recursively)=Alla_undergrupper_(rekursivt) Always_reformat_BIB_file_on_save_and_export=Formattera_alltid_om_BIB-filen_vid_när_den_sparas_eller_exporteras -Always_use_this_PDF_import_style_(and_do_not_ask_for_each_import)=Använd_alltid_detta_vid_import_av_PDF_(och_fråga_inte_för_varje_fil) An_exception_occurred_while_accessing_'%0'=Ett_undantag_inträffade_när_'%0'_accessades A_SAX_exception_occurred_while_parsing_'%0'\:=Ett_SAX-undantag_inträffade_när_'%0'_tolkades\: @@ -1291,8 +1284,6 @@ This_entry_type_cannot_be_removed.=Denna_posttyp_kan_inte_tas_bort. This_external_link_is_of_the_type_'%0',_which_is_undefined._What_do_you_want_to_do?=Den_här_externa_länken_är_av_typen_'%0',_som_är_odefinierad._Vad_vill_du_göra? -This_feature_generates_a_new_database_based_on_which_entries_are_needed_in_an_existing_LaTeX_document.= -This_feature_lets_new_files_be_opened_or_imported_into_an_already_running_instance_of_JabRef
instead_of_opening_a_new_instance._For_instance,_this_is_useful_when_you_open_a_file_in_JabRef
from_your_web_browser.
Note_that_this_will_prevent_you_from_running_more_than_one_instance_of_JabRef_at_a_time.= This_group_contains_entries_based_on_manual_assignment._Entries_can_be_assigned_to_this_group_by_selecting_them_then_using_either_drag_and_drop_or_the_context_menu._Entries_can_be_removed_from_this_group_by_selecting_them_then_using_the_context_menu.= This_group_contains_entries_whose_%0_field_contains_the_keyword_%1=Denna_grupp_innehåller_poster_där_fältet_%0_innehåller_nyckelordet_%1 @@ -1333,13 +1324,8 @@ Unmark_entries=Avmarkera_poster Unmark_entry=Avmarkera_post - untitled=namnlös -Unmarked_all_%0_selected_entries=Avmarkerade_alla_%0_valda_poster -Unmarked_all_entries=Avmarkerade_alla_poster -Unmarked_selected_entry=Avmarkerade_valda_poster -Unselect_all= Up=Uppåt Update_to_current_column_widths=Uppdatera_till_aktuella_kolumnbredder @@ -1432,6 +1418,7 @@ Fetching_Medline_by_term...=Hämta_från_Medline_med_sökterm... Please_enter_a_valid_number=Ange_ett_giltigt_tal Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.= Show_search_results_in_a_window=Visa_sökresultaten_i_ett_fönster +Search_in_all_open_databases= Move_file_to_file_directory?=Flytta_fil_till_filmapp? Rename_to_'%0'=Byt_namn_till_'%0' You_have_changed_the_menu_and_label_font_size.= @@ -1446,6 +1433,8 @@ BibTeX_key_generator=BibTeX-nyckelgenerator Unable_to_open_link.=Kan_inte_öppna_länk. Move_the_keyboard_focus_to_the_entry_table=Flytta_tangentbordsfokus_till_tabellen MIME_type=MIME-typ + +This_feature_lets_new_files_be_opened_or_imported_into_an_already_running_instance_of_JabRef
instead_of_opening_a_new_instance._For_instance,_this_is_useful_when_you_open_a_file_in_JabRef
from_your_web_browser.
Note_that_this_will_prevent_you_from_running_more_than_one_instance_of_JabRef_at_a_time.= Run_fetcher,_e.g._"--fetch\=Medline\:cancer"= The_ACM_Digital_Library=ACMs_digitala_bibliotek @@ -1648,6 +1637,7 @@ JabRef_includes_a_built-in_list_of_journal_abbreviations.=JabRef_har_en_inbyggd_ You_must_select_either_a_valid_style_file,_or_use_one_of_the_default_styles.=Du_måste_antingen_välja_en_giltig_stilfil_eller_använda_en_av_standardstilarna. This_is_a_simple_copy_and_paste_dialog._First_load_or_paste_some_text_into_the_text_input_area.
After_that,_you_can_mark_text_and_assign_it_to_a_BibTeX_field.= +This_feature_generates_a_new_database_based_on_which_entries_are_needed_in_an_existing_LaTeX_document.= You_need_to_select_one_of_your_open_databases_from_which_to_choose_entries,_as_well_as_the_AUX_file_produced_by_LaTeX_when_compiling_your_document.= First_select_entries_to_clean_up.=Välj_först_de_poster_som_du_vill_städa_upp. @@ -1689,6 +1679,7 @@ Unable_to_clear_preferences.=Kan_inte_rensa_inställningar. Reset_preferences_(key1,key2,..._or_'all')=Återställ_inställningar_(nyckel1,nyckel2,..._eller_'all') Find_unlinked_files=Hitta_olänkade_filer +Unselect_all= Expand_all=Expandera_alla Collapse_all=Fäll_ihop_alla Opens_the_file_browser.=Öppnar_filbläddraren @@ -1780,8 +1771,6 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case=Lägg_till_{} Import_conversions=Konverteringar_vid_import Please_enter_a_search_string=Ange_en_söksträng Please_open_or_start_a_new_database_before_searching=Öppna_eller_skapa_en_ny_databas_innan_sökning. -An_error_occurred_while_fetching_from_ADS_(%0)\:=Ett_fel_inträffade_vid_hämtning_från_ADS_(%0)\: -An_error_occurred_while_parsing_abstract=Ett_fel_inträffade_när_sammanfattningen_tolkades Log=Logg Canceled_merging_entries=Avbröt_sammanslagning_av_poster @@ -1858,9 +1847,13 @@ Table_row_height_padding=Extra_höjd_på_tabellrader Marked_selected_entry=Markerade_vald_post Marked_all_%0_selected_entries=Markerade_alla_%0_valda_poster +Unmarked_selected_entry=Avmarkerade_valda_poster +Unmarked_all_%0_selected_entries=Avmarkerade_alla_%0_valda_poster Toggle_print_status=Växla_utskriftsstatus +Unmarked_all_entries=Avmarkerade_alla_poster + Unable_to_find_the_requested_look_and_feel_and_thus_the_default_one_is_used.= Opens_JabRef's_GitHub_page=Öppnar_JabRefs_GitHub-sida @@ -1868,7 +1861,6 @@ Could_not_open_browser.=Kunde_inte_öppna_webbläsaren. Please_open_%0_manually.=Öppna_%0_för_hand. The_link_has_been_copied_to_the_clipboard.=Länken_har_kopierats_till_urklipp. - Open_%0_file=Öppna_%0-fil Cannot_delete_file=Kan_inte_radera_fil @@ -1927,7 +1919,6 @@ Copy_BibTeX_key_and_title=Kopiera_BibTeX-nyckel_och_titel File_rename_failed_for_%0_entries.=Döpa_om_filen_misslyckades_för_%0_poster. To_set_up,_go_to=För_att_ställa_in,_gå_till Merged_BibTeX_source_code=Kombinerad_BibTeX-källkod -'%0'_is_not_a_valid_ADS_bibcode.='%0'_är_inte_en_giltig_ADS-bibkod. Invalid_DOI\:_'%0'.=Ogiltig_DOI\:_'%0'. should_start_with_a_name=ska_börja_med_ett_namn should_end_with_a_name=ska_avslutas_med_ett_namn @@ -2161,8 +2152,6 @@ OpenOffice/LibreOffice_integration=OpenOffice/LibreOffice-integration incorrect_control_digit=felaktig_kontrollsiffra incorrect_format=felaktigit_format - - Copy_version_to_clipboard=Kopiera_version_till_urklipp Copied_version_to_clipboard=Kopierade_version_till_urklipp @@ -2307,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_tr.properties b/src/main/resources/l10n/JabRef_tr.properties index 23870b195b7..57884d7172e 100644 --- a/src/main/resources/l10n/JabRef_tr.properties +++ b/src/main/resources/l10n/JabRef_tr.properties @@ -1324,7 +1324,6 @@ Unmark_entries=Girdilerin_işaretini_kaldır Unmark_entry=Girdinin_işaretini_kaldır - untitled=başlıksız Up=Yukarı @@ -1419,6 +1418,7 @@ Fetching_Medline_by_term...=Medline_terim_aracılığıyla_getirliyor... Please_enter_a_valid_number=Lütfen_geçerli_bir_sayı_giriniz Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Lütfen_virgülle_ayrılmış_bir_Medline_No_ya_da_arama_terimi_listesi_giriniz. Show_search_results_in_a_window=Arama_sonuçlarını_bir_pencerede_göster +Search_in_all_open_databases=Tüm_açık_veri_tabanlarında_ara Move_file_to_file_directory?=Dosya,_dosya_dizinine_taşınsın_mı? Rename_to_'%0'='%0'_olarak_yeniden_adlandır You_have_changed_the_menu_and_label_font_size.=Menü_ve_etiket_yazıtipi_boyutunu_değiştirdiniz. @@ -1885,9 +1885,6 @@ OpenDocument_text=AçıkBelge_metni OpenDocument_spreadsheet=AçıkBelge_iş_tablosu OpenDocument_presentation=AçıkBelge_sunumu %0_image=%0_resim -%0_problem(s)_found=%0_sorun_bulundu -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.=Değişikliği_kabul_etmek,_harici_olarak_değiştirilmiş_grup_ağacını_mevcut_grup_ağacının_tamamının_yerine_koyar. -Add_new_file_type=Yeni_dosya_türü_ekle Added_entry=Eklenen_girdi Modified_entry=Değiştirilmiş_girdi Deleted_entry=Girdi_silindi @@ -1922,7 +1919,6 @@ Copy_BibTeX_key_and_title=BibTeX_anahtarı_ve_başlığını_kopyala File_rename_failed_for_%0_entries.=%0_girdide_dosya_yeniden_adlandırma_başarısız. To_set_up,_go_to=Kurmak_için,_şuraya_git Merged_BibTeX_source_code=Birleşik_BibTeX_kaynak_kodu -'%0'_is_not_a_valid_ADS_bibcode.='%0'_geçerli_bir_ADS_bibkodu_değil. Invalid_DOI\:_'%0'.=Geçersiz_DOI\:_'%0'. should_start_with_a_name=bir_isimle_başlamalı should_end_with_a_name=bir_isimle_sonlanmalı @@ -2156,8 +2152,6 @@ OpenOffice/LibreOffice_integration=OpenOffice/LibreOffice_entegrasyonu incorrect_control_digit=yanlış_kontrol_numarası incorrect_format=yanlış_biçem - - Copy_version_to_clipboard=Sürümü_panoya_kopyala Copied_version_to_clipboard=Sürüm_panoya_kopyalandı @@ -2302,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.='%0'_getiricisi_'%1'_kimliği_i Select_first_entry=İlk_girdiyi_seç Select_last_entry=Son_girdiyi_seç -Search_in_all_open_databases=Tüm_açık_veri_tabanlarında_ara - Invalid_ISBN\:_'%0'.=Geçersiz_ISBN\:_'%0'. diff --git a/src/main/resources/l10n/JabRef_vi.properties b/src/main/resources/l10n/JabRef_vi.properties index 912cb4ad793..712899b2066 100644 --- a/src/main/resources/l10n/JabRef_vi.properties +++ b/src/main/resources/l10n/JabRef_vi.properties @@ -1324,9 +1324,6 @@ Unmark_entries=Khử_đánh_dấu_các_mục Unmark_entry=Khử_đánh_dấu_mục - - - untitled=không_tiêu_đề Up=Lên @@ -1421,6 +1418,7 @@ Fetching_Medline_by_term...=Lấy_về_từ_Medline_theo_thuật_ngữ... Please_enter_a_valid_number=Vui_lòng_nhập_một_con_số_hợp_lệ Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=Vui_lòng_nhập_một_danh_sách_các_id_Medline_(con_số),_cách_nhau_bởi_dấu_phẩy,_hoặc_nhập_thuật_ngữ_cần_tìm. Show_search_results_in_a_window=Hiển_thị_kết_quả_tìm_trong_một_cửa_sổ +Search_in_all_open_databases= Move_file_to_file_directory?=Di_chuyển_tập_tin_vào_thư_mục_tập_tin? Rename_to_'%0'=Đổi_tên_thành_'%0' You_have_changed_the_menu_and_label_font_size.= @@ -1887,8 +1885,6 @@ OpenDocument_text= OpenDocument_spreadsheet= OpenDocument_presentation= %0_image= -%0_problem(s)_found= -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= Added_entry= Modified_entry= Deleted_entry= @@ -1923,7 +1919,6 @@ Copy_BibTeX_key_and_title= File_rename_failed_for_%0_entries.= To_set_up,_go_to=Để_cài_đặt,_chọn Merged_BibTeX_source_code= -'%0'_is_not_a_valid_ADS_bibcode.= Invalid_DOI\:_'%0'.=DOI_không_hợp_lệ\:_'%0'. should_start_with_a_name= should_end_with_a_name= @@ -2157,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2303,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/JabRef_zh.properties b/src/main/resources/l10n/JabRef_zh.properties index bc807bf0607..6e2a6faf849 100644 --- a/src/main/resources/l10n/JabRef_zh.properties +++ b/src/main/resources/l10n/JabRef_zh.properties @@ -1324,7 +1324,6 @@ Unmark_entries=撤销选中高亮标记 Unmark_entry=撤销记录高亮标记 - untitled=未命名 Up=上 @@ -1419,6 +1418,7 @@ Fetching_Medline_by_term...=依据_term_从_Medline_抓取... Please_enter_a_valid_number=请输入一个合法的数字 Please_enter_a_comma_separated_list_of_Medline_IDs_(numbers)_or_search_terms.=请输入以逗号分割的_Medline_ID_(数字)_或者_term_列表。 Show_search_results_in_a_window=在新窗口中显示查询结果 +Search_in_all_open_databases= Move_file_to_file_directory?=移动文件到文件目录? Rename_to_'%0'=重命名为_'%0' You_have_changed_the_menu_and_label_font_size.=您已经修改了菜单和标签的字号。 @@ -1918,24 +1918,7 @@ Copy_\\cite{BibTeX_key}=复制_\\cite{BibTeX_键值} Copy_BibTeX_key_and_title=复制_BibTeX_键值和标题 File_rename_failed_for_%0_entries.= To_set_up,_go_to=要设置的话,请到 -Search_%0=搜索_%0 -Could_not_connect_to_%0=无法连接到_%0 - -%0_image= -%0_problem(s)_found= -Accepting_the_change_replaces_the_complete_groups_tree_with_the_externally_modified_groups_tree.= -Added_entry=已添加记录 -Added_new_'%0'_entry.=已添加新_'%0'_记录。 -Deleted_entry=已删除记录 -Discard_changes=放弃修改 -Donate_to_JabRef=捐款给_JabRef -Export_with_selected_format=使用选中的格式导出 -Field_is_missing= -File_rename_failed_for_%0_entries.= -Filled= -From_import= Merged_BibTeX_source_code=已合并_BibTeX_源代码 -'%0'_is_not_a_valid_ADS_bibcode.= Invalid_DOI\:_'%0'.=不合法的_DOI\: should_start_with_a_name= should_end_with_a_name= @@ -2169,8 +2152,6 @@ OpenOffice/LibreOffice_integration= incorrect_control_digit= incorrect_format= - - Copy_version_to_clipboard= Copied_version_to_clipboard= @@ -2315,6 +2296,4 @@ Fetcher_'%0'_did_not_find_an_entry_for_id_'%1'.= Select_first_entry= Select_last_entry= -Search_in_all_open_databases= - Invalid_ISBN\:_'%0'.= diff --git a/src/main/resources/l10n/Menu_ja.properties b/src/main/resources/l10n/Menu_ja.properties index 63f1d4e938d..5d435ca3190 100644 --- a/src/main/resources/l10n/Menu_ja.properties +++ b/src/main/resources/l10n/Menu_ja.properties @@ -65,6 +65,7 @@ Save_database_as...=データベースに名前を付けて保存(&A)… Save_selected_as...=選択部に名前を付けて保存(&L)… # Tools Search=検索(&S) +Global_Search=グローバル検索 Select_all=全て選択(&A) Set_up_general_fields=汎用フィールドを設定(&G) Show_error_console=エラーコンソールを表示 @@ -125,16 +126,10 @@ Delete_entry=項目を削除 Check_integrity=整合性検査 Quality=品質 - Online_help_forum=オンラインヘルプ フォーラム - Manage_protected_terms=予約語の管理 - Website=ウェブサイト Blog=ブログ JabRef_resources=JabRefリソース - Development_version=開発版 View_change_log=変更履歴を閲覧 - -Global_Search=グローバル検索 From 4e6dd8dd57ec0fa856e73c48bb19b304045b320d Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Wed, 21 Sep 2016 14:15:33 +0200 Subject: [PATCH 11/12] modify remove doi pattern and testPerformSearchByIdEmptyDOI --- .../logic/importer/fetcher/AstrophysicsDataSystem.java | 4 +++- .../logic/importer/fetcher/AstrophysicsDataSystemTest.java | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java b/src/main/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java index 499fd38a0b4..2babed0a125 100644 --- a/src/main/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java +++ b/src/main/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java @@ -36,6 +36,8 @@ public class AstrophysicsDataSystem implements IdBasedParserFetcher, SearchBased private static String API_QUERY_URL = "http://adsabs.harvard.edu/cgi-bin/nph-basic_connect"; private static String API_ENTRY_URL = "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect"; private static String API_DOI_URL = "http://adsabs.harvard.edu/doi/"; + + private final String patternRemoveDOI = "^(doi:|DOI:)"; private final ImportFormatPreferences preferences; public AstrophysicsDataSystem(ImportFormatPreferences preferences) { @@ -94,7 +96,7 @@ public URL getURLForEntry(BibEntry entry) throws URISyntaxException, MalformedUR @Override public URL getURLForID(String identifier) throws URISyntaxException, MalformedURLException, FetcherException { - String key = identifier.replaceAll("^(doi:|DOI:)", ""); + String key = identifier.replaceAll(patternRemoveDOI, ""); URIBuilder uriBuilder = new URIBuilder(API_DOI_URL + key); uriBuilder.addParameter("data_type", "BIBTEXPLUS"); return uriBuilder.build().toURL(); diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java index 156809ce3b8..dcbfd4ff2c5 100644 --- a/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -17,6 +17,7 @@ import static net.sf.jabref.logic.util.OS.NEWLINE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -175,8 +176,8 @@ public void testPerformSearchByIdEmptyDOI() throws Exception { @Test(expected = FetcherException.class) public void testPerformSearchByIdInvalidDoi() throws Exception { - Optional fetchedEntry = fetcher.performSearchById("this.doi.will.fail"); - assertEquals(Optional.empty(), fetchedEntry); + fetcher.performSearchById("this.doi.will.fail"); + fail(); } @Test From fa381f9d6e2506dc09b60fcc7f8e484ad6e8edef Mon Sep 17 00:00:00 2001 From: Sascha Zeller Date: Wed, 21 Sep 2016 14:37:38 +0200 Subject: [PATCH 12/12] remove abstract in existing entries and add new without any abstract by default --- .../fetcher/AstrophysicsDataSystemTest.java | 108 ++++++++++-------- 1 file changed, 60 insertions(+), 48 deletions(-) diff --git a/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java b/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java index dcbfd4ff2c5..ac59126a7b9 100644 --- a/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/src/test/java/net/sf/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -10,6 +10,7 @@ import net.sf.jabref.model.entry.BibEntry; import net.sf.jabref.model.entry.BibLatexEntryTypes; import net.sf.jabref.model.entry.BibtexEntryTypes; +import net.sf.jabref.model.entry.FieldName; import org.junit.Before; import org.junit.Test; @@ -23,8 +24,8 @@ public class AstrophysicsDataSystemTest { - AstrophysicsDataSystem fetcher; - BibEntry diezSliceTheoremEntry,famaeyMcGaughEntry, sunWelchEntry; + private AstrophysicsDataSystem fetcher; + private BibEntry diezSliceTheoremEntry, famaeyMcGaughEntry, sunWelchEntry, xiongSunEntry, ingersollPollardEntry, luceyPaulEntry; @Before public void setUp() throws Exception { @@ -62,7 +63,6 @@ public void setUp() throws Exception { + "theory illustrate that the presented approach conveniently handles the" + NEWLINE + "occurring symmetries." + NEWLINE); - famaeyMcGaughEntry = new BibEntry(); famaeyMcGaughEntry.setType(BibLatexEntryTypes.ARTICLE); famaeyMcGaughEntry.setField("bibtexkey", "2012LRR....15...10F"); @@ -76,55 +76,10 @@ public void setUp() throws Exception { famaeyMcGaughEntry.setField("doi", "10.12942/lrr-2012-10"); famaeyMcGaughEntry.setField("eprint", "1112.3960"); famaeyMcGaughEntry.setField("keywords", "astronomical observations, Newtonian limit, equations of motion, extragalactic astronomy, cosmology, theories of gravity, fundamental physics, astrophysics"); - famaeyMcGaughEntry.setField("abstract", "A wealth of astronomical data indicate the presence of mass" + NEWLINE - + "discrepancies in the Universe. The motions observed in a variety of" + NEWLINE - + "classes of extragalactic systems exceed what can be explained by the" + NEWLINE - + "mass visible in stars and gas. Either (i) there is a vast amount of" + NEWLINE - + "unseen mass in some novel form - dark matter - or (ii) the data indicate" + NEWLINE - + "a breakdown of our understanding of dynamics on the relevant scales, or" + NEWLINE - + "(iii) both. Here, we first review a few outstanding challenges for the" + NEWLINE - + "dark matter interpretation of mass discrepancies in galaxies, purely" + NEWLINE - + "based on observations and independently of any alternative theoretical" + NEWLINE - + "framework. We then show that many of these puzzling observations are" + NEWLINE - + "predicted by one single relation - Milgrom's law - involving an" + NEWLINE - + "acceleration constant a\\_0 (or a characteristic surface density" + NEWLINE - + "{$\\Sigma$}\\_{\\dagger} = a\\_0/G) on the order of the square-root of the" + NEWLINE - + "cosmological constant in natural units. This relation can at present" + NEWLINE - + "most easily be interpreted as the effect of a single universal force law" + NEWLINE - + "resulting from a modification of Newtonian dynamics (MOND) on galactic" + NEWLINE - + "scales. We exhaustively review the current observational successes and" + NEWLINE - + "problems of this alternative paradigm at all astrophysical scales, and" + NEWLINE - + "summarize the various theoretical attempts (TeVeS, GEA, BIMOND, and" + NEWLINE - + "others) made to effectively embed this modification of Newtonian" + NEWLINE - + "dynamics within a relativistic theory of gravity."+ NEWLINE); - sunWelchEntry = new BibEntry(); sunWelchEntry.setType(BibLatexEntryTypes.ARTICLE); sunWelchEntry.setField("bibtexkey", "2012NatMa..11...44S"); - sunWelchEntry.setField("abstract", "Organic photovoltaic devices that can be fabricated by simple processing"+ NEWLINE - + "techniques are under intense investigation in academic and industrial"+ NEWLINE - + "laboratories because of their potential to enable mass production of"+ NEWLINE - + "flexible and cost-effective devices. Most of the attention has been"+ NEWLINE - + "focused on solution-processed polymer bulk-heterojunction (BHJ) solar"+ NEWLINE - + "cells. A combination of polymer design, morphology control, structural"+ NEWLINE - + "insight and device engineering has led to power conversion efficiencies"+ NEWLINE - + "(PCEs) reaching the 6-8\\% range for conjugated polymer/fullerene blends."+ NEWLINE - + "Solution-processed small-molecule BHJ (SM BHJ) solar cells have received"+ NEWLINE - + "less attention, and their efficiencies have remained below those of"+ NEWLINE - + "their polymeric counterparts. Here, we report efficient"+ NEWLINE - + "solution-processed SM BHJ solar cells based on a new molecular donor,"+ NEWLINE - + "DTS(PTTh$_{2}$)$_{2}$. A record PCE of 6.7\\% under AM"+ NEWLINE - + "1.5{\\thinsp}G irradiation (100{\\thinsp}mW{\\thinsp}cm$^{-2}$) is"+ NEWLINE - + "achieved for small-molecule BHJ devices from"+ NEWLINE - + "DTS(PTTh$_{2}$)$_{2}$:PC$_{70}$BM (donor to acceptor"+ NEWLINE - + "ratio of 7:3). This high efficiency was obtained by using remarkably"+ NEWLINE - + "small percentages of solvent additive (0.25\\%{\\thinsp}v/v of"+ NEWLINE - + "1,8-diiodooctane, DIO) during the film-forming process, which leads to"+ NEWLINE - + "reduced domain sizes in the BHJ layer. These results provide important"+ NEWLINE - + "progress for solution-processed organic photovoltaics and demonstrate"+ NEWLINE - + "that solar cells fabricated from small donor molecules can compete with"+ NEWLINE - + "their polymeric counterparts."+ NEWLINE); sunWelchEntry.setField("author", "Sun, Y. and Welch, G. C. and Leong, W. L. and Takacs, C. J. and Bazan, G. C. and Heeger, A. J."); sunWelchEntry.setField("doi", "10.1038/nmat3160"); sunWelchEntry.setField("journal", "Nature Materials"); @@ -133,6 +88,43 @@ public void setUp() throws Exception { sunWelchEntry.setField("title", "Solution-processed small-molecule solar cells with 6.7\\% efficiency"); sunWelchEntry.setField("volume", "11"); sunWelchEntry.setField("year", "2012"); + + xiongSunEntry = new BibEntry(); + xiongSunEntry.setType(BibLatexEntryTypes.ARTICLE); + xiongSunEntry.setField("bibtexkey", "2007ITGRS..45..879X"); + xiongSunEntry.setField("author", "Xiong, X. and Sun, J. and Barnes, W. and Salomonson, V. and Esposito, J. and Erives, H. and Guenther, B."); + xiongSunEntry.setField("doi", "10.1109/TGRS.2006.890567"); + xiongSunEntry.setField("journal", "IEEE Transactions on Geoscience and Remote Sensing"); + xiongSunEntry.setField("month", "#apr#"); + xiongSunEntry.setField("pages", "879-889"); + xiongSunEntry.setField("title", "Multiyear On-Orbit Calibration and Performance of Terra MODIS Reflective Solar Bands"); + xiongSunEntry.setField("volume", "45"); + xiongSunEntry.setField("year", "2007"); + + ingersollPollardEntry = new BibEntry(); + ingersollPollardEntry.setType(BibLatexEntryTypes.ARTICLE); + ingersollPollardEntry.setField("bibtexkey", "1982Icar...52...62I"); + ingersollPollardEntry.setField("author", "Ingersoll, A. P. and Pollard, D."); + ingersollPollardEntry.setField("doi", "10.1016/0019-1035(82)90169-5"); + ingersollPollardEntry.setField("journal", "\\icarus"); + ingersollPollardEntry.setField("keywords", "Atmospheric Circulation, Barotropic Flow, Convective Flow, Flow Stability, Jupiter Atmosphere, Rotating Fluids, Saturn Atmosphere, Adiabatic Flow, Anelasticity, Compressible Fluids, Planetary Rotation, Rotating Cylinders, Scaling Laws, Wind Profiles, PLANETS, JUPITER, SATURN, MOTION, INTERIORS, ATMOSPHERE, ANALYSIS, SCALE, BAROTROPY, CHARACTERISTICS, STRUCTURE, WINDS, VISCOSITY, DATA, CONVECTION, ROTATION, EDDY EFFECTS, ENERGY, ADIABATICITY, DIAGRAMS, REVIEW, LATITUDE, ZONES, VELOCITY, MATHEMATICAL MODELS, HEAT FLOW, EQUATIONS OF MOTION, FLUIDS, DYNAMICS, TEMPERATURE, GRADIENTS"); + ingersollPollardEntry.setField("month", "#oct#"); + ingersollPollardEntry.setField("pages", "62-80"); + ingersollPollardEntry.setField("title", "Motion in the interiors and atmospheres of Jupiter and Saturn - Scale analysis, anelastic equations, barotropic stability criterion"); + ingersollPollardEntry.setField("volume", "52"); + ingersollPollardEntry.setField("year", "1982"); + + luceyPaulEntry = new BibEntry(); + luceyPaulEntry.setType(BibLatexEntryTypes.ARTICLE); + luceyPaulEntry.setField("bibtexkey", "2000JGR...10520297L"); + luceyPaulEntry.setField("author", "Lucey, P. G. and Blewett, D. T. and Jolliff, B. L."); + luceyPaulEntry.setField("doi", "10.1029/1999JE001117"); + luceyPaulEntry.setField("journal", "\\jgr"); + luceyPaulEntry.setField("keywords", "Planetology: Solid Surface Planets: Composition, Planetology: Solid Surface Planets: Remote sensing, Planetology: Solid Surface Planets: Surface materials and properties, Planetology: Solar System Objects: Moon (1221)"); + luceyPaulEntry.setField("pages", "20297-20306"); + luceyPaulEntry.setField("title", "Lunar iron and titanium abundance algorithms based on final processing of Clementine ultraviolet-visible images"); + luceyPaulEntry.setField("volume", "105"); + luceyPaulEntry.setField("year", "2000"); } @Test @@ -165,6 +157,7 @@ public void searchByEntryFindsEntry() throws Exception { @Test public void testPerformSearchByFamaeyMcGaughEntry() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.12942/lrr-2012-10"); + fetchedEntry.ifPresent(entry -> entry.clearField(FieldName.ABSTRACT));//Remove abstract due to copyright assertEquals(Optional.of(famaeyMcGaughEntry), fetchedEntry); } @@ -183,6 +176,25 @@ public void testPerformSearchByIdInvalidDoi() throws Exception { @Test public void testPerformSearchBySunWelchEntry() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.1038/nmat3160"); + fetchedEntry.ifPresent(entry -> entry.clearField(FieldName.ABSTRACT)); //Remove abstract due to copyright assertEquals(Optional.of(sunWelchEntry), fetchedEntry); } + + @Test + public void testPerformSearchByXiongSunEntry() throws Exception { + Optional fetchedEntry = fetcher.performSearchById("10.1109/TGRS.2006.890567"); + assertEquals(Optional.of(xiongSunEntry), fetchedEntry); + } + + @Test + public void testPerformSearchByIngersollPollardEntry() throws Exception { + Optional fetchedEntry = fetcher.performSearchById("10.1016/0019-1035(82)90169-5"); + assertEquals(Optional.of(ingersollPollardEntry), fetchedEntry); + } + + @Test + public void testPerformSearchByLuceyPaulEntry() throws Exception { + Optional fetchedEntry = fetcher.performSearchById("10.1029/1999JE001117"); + assertEquals(Optional.of(luceyPaulEntry), fetchedEntry); + } }