From 83694b3d038fd3393a341e158afe9fd873da11a8 Mon Sep 17 00:00:00 2001 From: conorfos Date: Thu, 1 Nov 2018 15:59:43 +0000 Subject: [PATCH 1/7] Added more stats to be sent to MrDLib Added OS, OS version, Java Version, and Timezone to stats sent to MDL with each request. Updated API endpoint Updated JSON parsing --- .../org/jabref/logic/importer/fetcher/MrDLibFetcher.java | 9 +++++++-- .../jabref/logic/importer/fileformat/MrDLibImporter.java | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java index 2ae7db36e35..531d2de6dd3 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java @@ -4,6 +4,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; import java.util.Optional; @@ -104,11 +105,15 @@ private String constructQuery(String queryWithTitle) { URIBuilder builder = new URIBuilder(); builder.setScheme("http"); builder.setHost(getMdlUrl()); - builder.setPath("/v2/items/" + queryWithTitle + "/related_items"); - builder.addParameter("partner_id", "jabref"); + builder.setPath("/v2/documents/" + queryWithTitle + "/related_documents"); + builder.addParameter("partner_id", "1"); builder.addParameter("app_id", "jabref_desktop"); builder.addParameter("app_version", VERSION.getFullVersion()); builder.addParameter("app_lang", LANGUAGE); + builder.addParameter("os", System.getProperty("os.name")); + builder.addParameter("os_version", System.getProperty("os.version")); + builder.addParameter("java_version", System.getProperty("java.version")); + builder.addParameter("timezone", Calendar.getInstance().getTimeZone().getID()); try { URI uri = builder.build(); LOGGER.trace("Request: " + uri.toString()); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java index 6320b8d7483..5bc8af04b8c 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java @@ -146,10 +146,10 @@ private RankedBibEntry populateBibEntry(JSONObject recommendation) { // parse each of the relevant fields into variables String authors = isRecommendationFieldPresent(recommendation, "authors") ? getAuthorsString(recommendation) : ""; String title = isRecommendationFieldPresent(recommendation, "title") ? recommendation.getString("title") : ""; - String year = isRecommendationFieldPresent(recommendation, "year_published") ? Integer.toString(recommendation.getInt("year_published")) : ""; + String year = isRecommendationFieldPresent(recommendation, "published_year") ? Integer.toString(recommendation.getInt("published_year")) : ""; String journal = isRecommendationFieldPresent(recommendation, "published_in") ? recommendation.getString("published_in") : ""; String url = isRecommendationFieldPresent(recommendation, "url") ? recommendation.getString("url") : ""; - Integer rank = isRecommendationFieldPresent(recommendation, "url") ? recommendation.getInt("recommendation_id") : 100; + Integer rank = isRecommendationFieldPresent(recommendation, "recommendation_id") ? recommendation.getInt("recommendation_id") : 100; // Populate bib entry with relevant data current.setField(FieldName.AUTHOR, authors); From 96fd4ca72e38d3251d19f5d994d756508e7509fb Mon Sep 17 00:00:00 2001 From: conorfos Date: Thu, 1 Nov 2018 16:17:43 +0000 Subject: [PATCH 2/7] Updated url for Mr DLib production server --- .../java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java index 531d2de6dd3..a11709acbb9 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java @@ -125,6 +125,6 @@ private String constructQuery(String queryWithTitle) { } private String getMdlUrl() { - return VERSION.isDevelopmentVersion() ? "api-dev.darwingoliath.com" : "api.darwingoliath.com"; + return VERSION.isDevelopmentVersion() ? "api-dev.darwingoliath.com" : "api.mr-dlib.org"; } } From 6c76758317811d1357e1a503c05d8f29bb377bcf Mon Sep 17 00:00:00 2001 From: conorfos Date: Thu, 1 Nov 2018 16:28:27 +0000 Subject: [PATCH 3/7] Updated JabRef MDL Partner ID --- .../java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java index a11709acbb9..aae7cd0023d 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java @@ -28,6 +28,7 @@ public class MrDLibFetcher implements EntryBasedFetcher { private static final Logger LOGGER = LoggerFactory.getLogger(MrDLibFetcher.class); private static final String NAME = "MDL_FETCHER"; + private static final String MDL_JABREF_PARTNER_ID = "1"; private final String LANGUAGE; private final Version VERSION; @@ -106,7 +107,7 @@ private String constructQuery(String queryWithTitle) { builder.setScheme("http"); builder.setHost(getMdlUrl()); builder.setPath("/v2/documents/" + queryWithTitle + "/related_documents"); - builder.addParameter("partner_id", "1"); + builder.addParameter("partner_id", MDL_JABREF_PARTNER_ID); builder.addParameter("app_id", "jabref_desktop"); builder.addParameter("app_version", VERSION.getFullVersion()); builder.addParameter("app_lang", LANGUAGE); From fe278a2e4817811b561eb46656237789d9f95b4e Mon Sep 17 00:00:00 2001 From: conorfos Date: Fri, 2 Nov 2018 13:14:03 +0000 Subject: [PATCH 4/7] MrDLib Importer Test fix --- .../jabref/logic/importer/fileformat/MrDLibImporterTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java index 5af07b4dfa3..723afd1b6fc 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java @@ -24,7 +24,7 @@ public class MrDLibImporterTest { @BeforeEach public void setUp() { importer = new MrDLibImporter(); - String testInput = "{ \"label\": { \"label-language\": \"en\", \"label-text\": \"Related Items\" }, \"recommendation-set-id\": \"1\", \"recommendations\": { \"74021358\": { \"abstract\": \"abstract\", \"authors\": [ \"Sajovic, Marija\" ], \"year_published\": \"2006\", \"item_id_original\": \"12088644\", \"keywords\": [ \"visoko\\u0161olski program Geodezija - smer Prostorska informatika\" ], \"language_provided\": \"sl\", \"recommendation_id\": \"1\", \"title\": \"The protection of rural lands with the spatial development strategy on the case of Hrastnik commune\", \"url\": \"http://drugg.fgg.uni-lj.si/701/1/GEV_0199_Sajovic.pdf\" }, \"82005804\": { \"abstract\": \"abstract\", \"year_published\": null, \"item_id_original\": \"30145702\", \"language_provided\": null, \"recommendation_id\": \"2\", \"title\": \"Engagement of the volunteers in the solution to the accidents in the South-Moravia region\" }, \"82149599\": { \"abstract\": \"abstract\", \"year_published\": null, \"item_id_original\": \"97690763\", \"language_provided\": null, \"recommendation_id\": \"3\", \"title\": \"\\\"The only Father's word\\\". The relationship of the Father and the Son in the documents of saint John of the Cross\", \"url\": \"http://www.nusl.cz/ntk/nusl-285711\" }, \"84863921\": { \"abstract\": \"abstract\", \"authors\": [ \"Kaffa, Elena\" ], \"year_published\": null, \"item_id_original\": \"19397104\", \"keywords\": [ \"BX\", \"D111\" ], \"language_provided\": \"en\", \"recommendation_id\": \"4\", \"title\": \"Greek Church of Cyprus, the Morea and Constantinople during the Frankish Era (1196-1303)\" }, \"88950992\": { \"abstract\": \"abstract\", \"authors\": [ \"Yasui, Kono\" ], \"year_published\": null, \"item_id_original\": \"38763657\", \"language_provided\": null, \"recommendation_id\": \"5\", \"title\": \"A Phylogenetic Consideration on the Vascular Plants, Cotyledonary Node Including Hypocotyl Being Taken as the Ancestral Form : A Preliminary Note\" } }}"; + String testInput = "{ \"label\": { \"label-language\": \"en\", \"label-text\": \"Related Items\" }, \"recommendation-set-id\": \"1\", \"recommendations\": { \"74021358\": { \"abstract\": \"abstract\", \"authors\": [ \"Sajovic, Marija\" ], \"published_year\": \"2006\", \"item_id_original\": \"12088644\", \"keywords\": [ \"visoko\\u0161olski program Geodezija - smer Prostorska informatika\" ], \"language_provided\": \"sl\", \"recommendation_id\": \"1\", \"title\": \"The protection of rural lands with the spatial development strategy on the case of Hrastnik commune\", \"url\": \"http://drugg.fgg.uni-lj.si/701/1/GEV_0199_Sajovic.pdf\" }, \"82005804\": { \"abstract\": \"abstract\", \"year_published\": null, \"item_id_original\": \"30145702\", \"language_provided\": null, \"recommendation_id\": \"2\", \"title\": \"Engagement of the volunteers in the solution to the accidents in the South-Moravia region\" }, \"82149599\": { \"abstract\": \"abstract\", \"year_published\": null, \"item_id_original\": \"97690763\", \"language_provided\": null, \"recommendation_id\": \"3\", \"title\": \"\\\"The only Father's word\\\". The relationship of the Father and the Son in the documents of saint John of the Cross\", \"url\": \"http://www.nusl.cz/ntk/nusl-285711\" }, \"84863921\": { \"abstract\": \"abstract\", \"authors\": [ \"Kaffa, Elena\" ], \"year_published\": null, \"item_id_original\": \"19397104\", \"keywords\": [ \"BX\", \"D111\" ], \"language_provided\": \"en\", \"recommendation_id\": \"4\", \"title\": \"Greek Church of Cyprus, the Morea and Constantinople during the Frankish Era (1196-1303)\" }, \"88950992\": { \"abstract\": \"abstract\", \"authors\": [ \"Yasui, Kono\" ], \"year_published\": null, \"item_id_original\": \"38763657\", \"language_provided\": null, \"recommendation_id\": \"5\", \"title\": \"A Phylogenetic Consideration on the Vascular Plants, Cotyledonary Node Including Hypocotyl Being Taken as the Ancestral Form : A Preliminary Note\" } }}"; input = new BufferedReader(new StringReader(testInput)); } From 0e33355fb1f196bcdd4c41a458ec59929dde7b5b Mon Sep 17 00:00:00 2001 From: conorfos Date: Fri, 7 Dec 2018 14:58:04 +0000 Subject: [PATCH 5/7] Implemented agreed privacy dialog Language, os, and timezone may be individually selected --- .../gui/entryeditor/RelatedArticlesTab.java | 29 ++++++++++++++----- .../logic/importer/fetcher/MrDLibFetcher.java | 20 +++++++++---- .../jabref/preferences/JabRefPreferences.java | 6 ++++ 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java b/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java index dbbe9ff096a..51196b44786 100644 --- a/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java @@ -3,11 +3,7 @@ import java.io.IOException; import java.util.List; -import javafx.scene.control.Button; -import javafx.scene.control.Hyperlink; -import javafx.scene.control.ProgressIndicator; -import javafx.scene.control.ScrollPane; -import javafx.scene.control.Tooltip; +import javafx.scene.control.*; import javafx.scene.layout.HBox; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; @@ -125,10 +121,12 @@ private ScrollPane getPrivacyDialog(BibEntry entry) { Button button = new Button(Localization.lang("I Agree")); button.setDefaultButton(true); - Text line1 = new Text(Localization.lang("Mr. DLib is an external service which provides article recommendations based on the currently selected entry. Data about the selected entry must be sent to Mr. DLib in order to provide these recommendations. Do you agree that this data may be sent?")); + Text line1 = new Text(Localization.lang("JabRef requests recommendations from Mr. DLib, which is an external service. To enable Mr. DLib to calculate recommendations, some of your data must be shared with Mr. DLib. Generally, the more data is shared the better recommendations can be calculated. However, we understand that some of your data in JabRef is sensitive, and you may not want to share it. Therefore, Mr. DLib offers a choice of which data you would like to share.")); line1.setWrappingWidth(1300.0); - Text line2 = new Text(Localization.lang("This setting may be changed in preferences at any time.")); + Text line2 = new Text(Localization.lang("Whatever option you choose, Mr. DLib may share its data with research partners to further improve recommendation quality as part of a “living lab”. Mr. DLib may also release public datasets that may contain anonymized information about you and the recommendations (sensitive information such as metadata of your articles will be anonymised through e.g. hashing). Research partners are obliged to adhere to the same strict data protection policy as Mr. DLib.")); + line2.setWrappingWidth(1300.0); + Text line3 = new Text(Localization.lang("This setting may be changed in preferences at any time.")); Hyperlink mdlLink = new Hyperlink(Localization.lang("Further information about Mr DLib. for JabRef users.")); mdlLink.setOnAction(event -> { try { @@ -138,15 +136,30 @@ private ScrollPane getPrivacyDialog(BibEntry entry) { dialogService.showErrorDialogAndWait(e); } }); + VBox vb = new VBox(); + CheckBox cbTitle = new CheckBox(Localization.lang("Entry Title")); + cbTitle.setSelected(true); + cbTitle.setDisable(true); + CheckBox cbVersion = new CheckBox(Localization.lang("JabRef Version")); + cbVersion.setSelected(true); + cbVersion.setDisable(true); + CheckBox cbLanguage = new CheckBox(Localization.lang("JabRef Language")); + CheckBox cbOS = new CheckBox(Localization.lang("Operating System")); + CheckBox cbTimezone = new CheckBox(Localization.lang("Timezone")); + vb.getChildren().addAll(cbTitle, cbVersion, cbLanguage, cbOS, cbTimezone); + vb.setSpacing(10); button.setOnAction(event -> { JabRefPreferences prefs = JabRefPreferences.getInstance(); prefs.putBoolean(JabRefPreferences.ACCEPT_RECOMMENDATIONS, true); + prefs.putBoolean(JabRefPreferences.SEND_LANGUAGE_DATA, cbLanguage.isSelected()); + prefs.putBoolean(JabRefPreferences.SEND_OS_DATA, cbOS.isSelected()); + prefs.putBoolean(JabRefPreferences.SEND_TIMEZONE_DATA, cbTimezone.isSelected()); dialogService.showWarningDialogAndWait(Localization.lang("Restart"), Localization.lang("Please restart JabRef for preferences to take effect.")); setContent(getRelatedArticlesPane(entry)); }); - vbox.getChildren().addAll(line1, mdlLink, line2, button); + vbox.getChildren().addAll(line1, line2, mdlLink, line3, vb, button); root.setContent(vbox); return root; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java index aae7cd0023d..4eb40b0cdda 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java @@ -19,6 +19,7 @@ import org.jabref.model.entry.FieldName; import org.apache.http.client.utils.URIBuilder; +import org.jabref.preferences.JabRefPreferences; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -110,14 +111,23 @@ private String constructQuery(String queryWithTitle) { builder.addParameter("partner_id", MDL_JABREF_PARTNER_ID); builder.addParameter("app_id", "jabref_desktop"); builder.addParameter("app_version", VERSION.getFullVersion()); - builder.addParameter("app_lang", LANGUAGE); - builder.addParameter("os", System.getProperty("os.name")); - builder.addParameter("os_version", System.getProperty("os.version")); - builder.addParameter("java_version", System.getProperty("java.version")); - builder.addParameter("timezone", Calendar.getInstance().getTimeZone().getID()); + + + JabRefPreferences prefs = JabRefPreferences.getInstance(); + if (prefs.getBoolean(JabRefPreferences.SEND_LANGUAGE_DATA)) { + builder.addParameter("app_lang", LANGUAGE); + } + if (prefs.getBoolean(JabRefPreferences.SEND_OS_DATA)){ + builder.addParameter("os", System.getProperty("os.name")); + } + if (prefs.getBoolean(JabRefPreferences.SEND_TIMEZONE_DATA)){ + builder.addParameter("timezone", Calendar.getInstance().getTimeZone().getID()); + } + try { URI uri = builder.build(); LOGGER.trace("Request: " + uri.toString()); + System.out.println("Request: " + uri.toString()); return uri.toString(); } catch (URISyntaxException e) { LOGGER.error(e.getMessage(), e); diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index eea8a2ee771..aff924736dd 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -306,6 +306,9 @@ public class JabRefPreferences implements PreferencesService { public static final String PUSH_TO_APPLICATION = "pushToApplication"; public static final String SHOW_RECOMMENDATIONS = "showRecommendations"; public static final String ACCEPT_RECOMMENDATIONS = "acceptRecommendations"; + public static final String SEND_LANGUAGE_DATA = "sendLanguageData"; + public static final String SEND_OS_DATA = "sendOSData"; + public static final String SEND_TIMEZONE_DATA = "sendTimezoneData"; public static final String VALIDATE_IN_ENTRY_EDITOR = "validateInEntryEditor"; // Dropped file handler public static final String DROPPEDFILEHANDLER_RENAME = "DroppedFileHandler_RenameFile"; @@ -580,6 +583,9 @@ private JabRefPreferences() { defaults.put(SHOW_RECOMMENDATIONS, Boolean.TRUE); defaults.put(ACCEPT_RECOMMENDATIONS, Boolean.FALSE); + defaults.put(SEND_LANGUAGE_DATA, Boolean.FALSE); + defaults.put(SEND_OS_DATA, Boolean.FALSE); + defaults.put(SEND_TIMEZONE_DATA, Boolean.FALSE); defaults.put(VALIDATE_IN_ENTRY_EDITOR, Boolean.TRUE); defaults.put(EDITOR_EMACS_KEYBINDINGS, Boolean.FALSE); defaults.put(EDITOR_EMACS_KEYBINDINGS_REBIND_CA, Boolean.TRUE); From 5c3d87334619749f61677f145120398bf19b1435 Mon Sep 17 00:00:00 2001 From: conorfos Date: Wed, 12 Dec 2018 10:25:07 +0000 Subject: [PATCH 6/7] Added language keys to english language file --- .../gui/entryeditor/RelatedArticlesTab.java | 19 ++++++++++++------- .../logic/importer/fetcher/MrDLibFetcher.java | 7 +++---- src/main/resources/l10n/JabRef_en.properties | 17 ++++++++++++++--- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java b/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java index 51196b44786..4bd30b7c614 100644 --- a/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java @@ -3,7 +3,12 @@ import java.io.IOException; import java.util.List; -import javafx.scene.control.*; +import javafx.scene.control.Button; +import javafx.scene.control.CheckBox; +import javafx.scene.control.Hyperlink; +import javafx.scene.control.ProgressIndicator; +import javafx.scene.control.ScrollPane; +import javafx.scene.control.Tooltip; import javafx.scene.layout.HBox; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; @@ -124,7 +129,7 @@ private ScrollPane getPrivacyDialog(BibEntry entry) { Text line1 = new Text(Localization.lang("JabRef requests recommendations from Mr. DLib, which is an external service. To enable Mr. DLib to calculate recommendations, some of your data must be shared with Mr. DLib. Generally, the more data is shared the better recommendations can be calculated. However, we understand that some of your data in JabRef is sensitive, and you may not want to share it. Therefore, Mr. DLib offers a choice of which data you would like to share.")); line1.setWrappingWidth(1300.0); - Text line2 = new Text(Localization.lang("Whatever option you choose, Mr. DLib may share its data with research partners to further improve recommendation quality as part of a “living lab”. Mr. DLib may also release public datasets that may contain anonymized information about you and the recommendations (sensitive information such as metadata of your articles will be anonymised through e.g. hashing). Research partners are obliged to adhere to the same strict data protection policy as Mr. DLib.")); + Text line2 = new Text(Localization.lang("Whatever option you choose, Mr. DLib may share its data with research partners to further improve recommendation quality as part of a 'living lab'. Mr. DLib may also release public datasets that may contain anonymized information about you and the recommendations (sensitive information such as metadata of your articles will be anonymised through e.g. hashing). Research partners are obliged to adhere to the same strict data protection policy as Mr. DLib.")); line2.setWrappingWidth(1300.0); Text line3 = new Text(Localization.lang("This setting may be changed in preferences at any time.")); Hyperlink mdlLink = new Hyperlink(Localization.lang("Further information about Mr DLib. for JabRef users.")); @@ -137,15 +142,15 @@ private ScrollPane getPrivacyDialog(BibEntry entry) { } }); VBox vb = new VBox(); - CheckBox cbTitle = new CheckBox(Localization.lang("Entry Title")); + CheckBox cbTitle = new CheckBox(Localization.lang("Entry Title (Required to deliver recommendations.)")); cbTitle.setSelected(true); cbTitle.setDisable(true); - CheckBox cbVersion = new CheckBox(Localization.lang("JabRef Version")); + CheckBox cbVersion = new CheckBox(Localization.lang("JabRef Version (Required to ensure backwards compatibility with Mr. DLib's Web Service)")); cbVersion.setSelected(true); cbVersion.setDisable(true); - CheckBox cbLanguage = new CheckBox(Localization.lang("JabRef Language")); - CheckBox cbOS = new CheckBox(Localization.lang("Operating System")); - CheckBox cbTimezone = new CheckBox(Localization.lang("Timezone")); + CheckBox cbLanguage = new CheckBox(Localization.lang("JabRef Language (Provides for better recommendations by giving an indication of user's preferred language.)")); + CheckBox cbOS = new CheckBox(Localization.lang("Operating System (Provides for better recommendations by giving an indication of user's system set-up.)")); + CheckBox cbTimezone = new CheckBox(Localization.lang("Timezone (Provides for better recommendations by indicating the time of day the request is being made.)")); vb.getChildren().addAll(cbTitle, cbVersion, cbLanguage, cbOS, cbTimezone); vb.setSpacing(10); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java index 4eb40b0cdda..66f6a5c9273 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java @@ -17,9 +17,9 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.FieldName; +import org.jabref.preferences.JabRefPreferences; import org.apache.http.client.utils.URIBuilder; -import org.jabref.preferences.JabRefPreferences; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -112,15 +112,14 @@ private String constructQuery(String queryWithTitle) { builder.addParameter("app_id", "jabref_desktop"); builder.addParameter("app_version", VERSION.getFullVersion()); - JabRefPreferences prefs = JabRefPreferences.getInstance(); if (prefs.getBoolean(JabRefPreferences.SEND_LANGUAGE_DATA)) { builder.addParameter("app_lang", LANGUAGE); } - if (prefs.getBoolean(JabRefPreferences.SEND_OS_DATA)){ + if (prefs.getBoolean(JabRefPreferences.SEND_OS_DATA)) { builder.addParameter("os", System.getProperty("os.name")); } - if (prefs.getBoolean(JabRefPreferences.SEND_TIMEZONE_DATA)){ + if (prefs.getBoolean(JabRefPreferences.SEND_TIMEZONE_DATA)) { builder.addParameter("timezone", Calendar.getInstance().getTimeZone().getID()); } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index a79cfd436cb..b3de0faf61d 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -367,6 +367,8 @@ Entry\ table=Entry table Entry\ table\ columns=Entry table columns +Entry\ Title\ (Required\ to\ deliver\ recommendations.)=Entry Title (Required to deliver recommendations.) + Entry\ type=Entry type Entry\ type\ names\ are\ not\ allowed\ to\ contain\ white\ space\ or\ the\ following\ characters=Entry type names are not allowed to contain white space or the following characters @@ -580,8 +582,14 @@ Invalid\ URL=Invalid URL Online\ help=Online help +JabRef\ Language\ (Provides\ for\ better\ recommendations\ by\ giving\ an\ indication\ of\ user's\ preferred\ language.)=JabRef Language (Provides for better recommendations by giving an indication of user's preferred language.) + JabRef\ preferences=JabRef preferences +JabRef\ requests\ recommendations\ from\ Mr.\ DLib,\ which\ is\ an\ external\ service.\ To\ enable\ Mr.\ DLib\ to\ calculate\ recommendations,\ some\ of\ your\ data\ must\ be\ shared\ with\ Mr.\ DLib.\ Generally,\ the\ more\ data\ is\ shared\ the\ better\ recommendations\ can\ be\ calculated.\ However,\ we\ understand\ that\ some\ of\ your\ data\ in\ JabRef\ is\ sensitive,\ and\ you\ may\ not\ want\ to\ share\ it.\ Therefore,\ Mr.\ DLib\ offers\ a\ choice\ of\ which\ data\ you\ would\ like\ to\ share.=JabRef requests recommendations from Mr. DLib, which is an external service. To enable Mr. DLib to calculate recommendations, some of your data must be shared with Mr. DLib. Generally, the more data is shared the better recommendations can be calculated. However, we understand that some of your data in JabRef is sensitive, and you may not want to share it. Therefore, Mr. DLib offers a choice of which data you would like to share. + +JabRef\ Version\ (Required\ to\ ensure\ backwards\ compatibility\ with\ Mr.\ DLib's\ Web\ Service)=JabRef Version (Required to ensure backwards compatibility with Mr. DLib's Web Service) + Join=Join Joins\ selected\ keywords\ and\ deletes\ selected\ keywords.=Joins selected keywords and deletes selected keywords. @@ -662,9 +670,6 @@ Move\ up=Move up Moved\ group\ "%0".=Moved group "%0". -Mr.\ DLib\ is\ an\ external\ service\ which\ provides\ article\ recommendations\ based\ on\ the\ currently\ selected\ entry.\ Data\ about\ the\ selected\ entry\ must\ be\ sent\ to\ Mr.\ DLib\ in\ order\ to\ provide\ these\ recommendations.\ Do\ you\ agree\ that\ this\ data\ may\ be\ sent?=Mr. DLib is an external service which provides article recommendations based on the currently selected entry. Data about the selected entry must be sent to Mr. DLib in order to provide these recommendations. Do you agree that this data may be sent? - - Name=Name Name\ formatter=Name formatter @@ -744,6 +749,8 @@ Opening=Opening Operation\ canceled.=Operation canceled. +Operating\ System\ (Provides\ for\ better\ recommendations\ by\ giving\ an\ indication\ of\ user's\ system\ set-up.)=Operating System (Provides for better recommendations by giving an indication of user's system set-up.) + Optional\ fields=Optional fields Options=Options @@ -1079,6 +1086,8 @@ This\ operation\ requires\ one\ or\ more\ entries\ to\ be\ selected.=This operat This\ setting\ may\ be\ changed\ in\ preferences\ at\ any\ time.=This setting may be changed in preferences at any time. +Timezone\ (Provides\ for\ better\ recommendations\ by\ indicating\ the\ time\ of\ day\ the\ request\ is\ being\ made.)=Timezone (Provides for better recommendations by indicating the time of day the request is being made.) + Toggle\ entry\ preview=Toggle entry preview Toggle\ groups\ interface=Toggle groups interface @@ -1144,6 +1153,8 @@ web\ link=web link What\ do\ you\ want\ to\ do?=What do you want to do? +Whatever\ option\ you\ choose,\ Mr.\ DLib\ may\ share\ its\ data\ with\ research\ partners\ to\ further\ improve\ recommendation\ quality\ as\ part\ of\ a\ 'living\ lab'.\ Mr.\ DLib\ may\ also\ release\ public\ datasets\ that\ may\ contain\ anonymized\ information\ about\ you\ and\ the\ recommendations\ (sensitive\ information\ such\ as\ metadata\ of\ your\ articles\ will\ be\ anonymised\ through\ e.g.\ hashing).\ Research\ partners\ are\ obliged\ to\ adhere\ to\ the\ same\ strict\ data\ protection\ policy\ as\ Mr.\ DLib.=Whatever option you choose, Mr. DLib may share its data with research partners to further improve recommendation quality as part of a 'living lab'. Mr. DLib may also release public datasets that may contain anonymized information about you and the recommendations (sensitive information such as metadata of your articles will be anonymised through e.g. hashing). Research partners are obliged to adhere to the same strict data protection policy as Mr. DLib. + When\ adding/removing\ keywords,\ separate\ them\ by=When adding/removing keywords, separate them by Will\ write\ XMP-metadata\ to\ the\ PDFs\ linked\ from\ selected\ entries.=Will write XMP-metadata to the PDFs linked from selected entries. From a2375b6babe9dc4660528cda88a50f3273fc5a11 Mon Sep 17 00:00:00 2001 From: conorfos Date: Wed, 12 Dec 2018 10:45:02 +0000 Subject: [PATCH 7/7] Removed stray System.out! --- .../java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java index 66f6a5c9273..0e3e30898bd 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java @@ -126,7 +126,6 @@ private String constructQuery(String queryWithTitle) { try { URI uri = builder.build(); LOGGER.trace("Request: " + uri.toString()); - System.out.println("Request: " + uri.toString()); return uri.toString(); } catch (URISyntaxException e) { LOGGER.error(e.getMessage(), e);