Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed database to catalog in org.jabref.gui.slr and org.jabref.logic.crawler #9989

Merged
merged 7 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- In case the library contains empty entries, they are not written to disk. [#8645](https://github.com/JabRef/jabref/issues/8645)
- The formatter `remove_unicode_ligatures` is now called `replace_unicode_ligatures`. [#9890](https://github.com/JabRef/jabref/pull/9890)
- We improved the error message when no terminal was found [#9607](https://github.com/JabRef/jabref/issues/9607)
- In the context of the "systematic literature functionality", we changed the name "database" to "catalog" to use a separate term for online catalogs in comparison to SQL databases. [#9951](https://github.com/JabRef/jabref/pull/9951)

### Fixed

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/jabref/gui/slr/ManageStudyDefinition.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -208,30 +208,30 @@
</VBox>
</ScrollPane>
</Tab>
<Tab text="%Databases">
<Tab text="%Catalogs">
<ScrollPane
fitToWidth="true"
fitToHeight="true"
styleClass="slr-tab">
<VBox spacing="20.0">
<Label text="%Select Databases:"/>
<Label text="%Select Catalogs:"/>
<HBox alignment="CENTER_LEFT">
<TableView
fx:id="databaseTable"
fx:id="catalogTable"
HBox.hgrow="ALWAYS"
editable="true">
<columns>
<TableColumn
fx:id="databaseEnabledColumn"
fx:id="catalogEnabledColumn"
text="%Enabled"
maxWidth="80.0"
prefWidth="80.0"
minWidth="80.0"
reorderable="false"
resizable="false"/>
<TableColumn
fx:id="databaseColumn"
text="%Database"/>
fx:id="catalogColumn"
text="%Catalog"/>
</columns>
<columnResizePolicy>
<TableView
Expand Down
36 changes: 18 additions & 18 deletions src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public class ManageStudyDefinitionView extends BaseDialog<SlrStudyAndDirectory>
@FXML private TableColumn<String, String> queriesColumn;
@FXML private TableColumn<String, String> queriesActionColumn;

@FXML private TableView<StudyDatabaseItem> databaseTable;
@FXML private TableColumn<StudyDatabaseItem, Boolean> databaseEnabledColumn;
@FXML private TableColumn<StudyDatabaseItem, String> databaseColumn;
@FXML private TableView<StudyCatalogItem> catalogTable;
@FXML private TableColumn<StudyCatalogItem, Boolean> catalogEnabledColumn;
@FXML private TableColumn<StudyCatalogItem, String> catalogColumn;

@Inject private DialogService dialogService;
@Inject private PreferencesService prefs;
Expand Down Expand Up @@ -132,7 +132,7 @@ private void setupSaveSurveyButton(boolean isEdit) {

saveSurveyButton.disableProperty().bind(Bindings.or(Bindings.or(Bindings.or(Bindings.or(
Bindings.isEmpty(viewModel.getQueries()),
Bindings.isEmpty(viewModel.getDatabases())),
Bindings.isEmpty(viewModel.getCatalogs())),
Bindings.isEmpty(viewModel.getAuthors())),
viewModel.getTitle().isEmpty()),
viewModel.getDirectory().isEmpty()));
Expand Down Expand Up @@ -166,14 +166,14 @@ private void initialize() {
selectStudyDirectory.setDisable(true);
}

// Listen whether any databases are removed from selection -> Add back to the database selector
// Listen whether any catalogs are removed from selection -> Add back to the catalog selector
studyTitle.textProperty().bindBidirectional(viewModel.titleProperty());
studyDirectory.textProperty().bindBidirectional(viewModel.getDirectory());

initAuthorTab();
initQuestionsTab();
initQueriesTab();
initDatabasesTab();
initCatalogsTab();
}

private void initAuthorTab() {
Expand Down Expand Up @@ -202,27 +202,27 @@ private void initQueriesTab() {
.toString()));
}

private void initDatabasesTab() {
new ViewModelTableRowFactory<StudyDatabaseItem>()
private void initCatalogsTab() {
new ViewModelTableRowFactory<StudyCatalogItem>()
.withOnMouseClickedEvent((entry, event) -> {
if (event.getButton() == MouseButton.PRIMARY) {
entry.setEnabled(!entry.isEnabled());
}
})
.install(databaseTable);
.install(catalogTable);

databaseColumn.setReorderable(false);
databaseColumn.setCellFactory(TextFieldTableCell.forTableColumn());
catalogColumn.setReorderable(false);
catalogColumn.setCellFactory(TextFieldTableCell.forTableColumn());

databaseEnabledColumn.setResizable(false);
databaseEnabledColumn.setReorderable(false);
databaseEnabledColumn.setCellFactory(CheckBoxTableCell.forTableColumn(databaseEnabledColumn));
databaseEnabledColumn.setCellValueFactory(param -> param.getValue().enabledProperty());
catalogEnabledColumn.setResizable(false);
catalogEnabledColumn.setReorderable(false);
catalogEnabledColumn.setCellFactory(CheckBoxTableCell.forTableColumn(catalogEnabledColumn));
catalogEnabledColumn.setCellValueFactory(param -> param.getValue().enabledProperty());

databaseColumn.setEditable(false);
databaseColumn.setCellValueFactory(param -> param.getValue().nameProperty());
catalogColumn.setEditable(false);
catalogColumn.setCellValueFactory(param -> param.getValue().nameProperty());

databaseTable.setItems(viewModel.getDatabases());
catalogTable.setItems(viewModel.getCatalogs());
}

private void setupCommonPropertiesForTables(Node addControl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class ManageStudyDefinitionViewModel {
private final ObservableList<String> authors = FXCollections.observableArrayList();
private final ObservableList<String> researchQuestions = FXCollections.observableArrayList();
private final ObservableList<String> queries = FXCollections.observableArrayList();
private final ObservableList<StudyDatabaseItem> databases = FXCollections.observableArrayList();
private final ObservableList<StudyCatalogItem> databases = FXCollections.observableArrayList();

// Hold the complement of databases for the selector
private final SimpleStringProperty directory = new SimpleStringProperty();
Expand All @@ -74,7 +74,7 @@ public ManageStudyDefinitionViewModel(ImportFormatPreferences importFormatPrefer
.filter(name -> !name.equals(CompositeSearchBasedFetcher.FETCHER_NAME))
.map(name -> {
boolean enabled = DEFAULT_SELECTION.contains(name);
return new StudyDatabaseItem(name, enabled);
return new StudyCatalogItem(name, enabled);
})
.toList());
this.dialogService = Objects.requireNonNull(dialogService);
Expand Down Expand Up @@ -105,7 +105,7 @@ public ManageStudyDefinitionViewModel(Study study,
.filter(name -> !name.equals(CompositeSearchBasedFetcher.FETCHER_NAME))
.map(name -> {
boolean enabled = studyDatabases.contains(new StudyDatabase(name, true));
return new StudyDatabaseItem(name, enabled);
return new StudyCatalogItem(name, enabled);
})
.toList());

Expand Down Expand Up @@ -133,7 +133,7 @@ public ObservableList<String> getQueries() {
return queries;
}

public ObservableList<StudyDatabaseItem> getDatabases() {
public ObservableList<StudyCatalogItem> getCatalogs() {
return databases;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
/**
* View representation of {@link StudyDatabase}
*/
public class StudyDatabaseItem {
public class StudyCatalogItem {
private final StringProperty name;
private final BooleanProperty enabled;

public StudyDatabaseItem(String name, boolean enabled) {
public StudyCatalogItem(String name, boolean enabled) {
this.name = new SimpleStringProperty(Objects.requireNonNull(name));
this.enabled = new SimpleBooleanProperty(enabled);
}
Expand Down Expand Up @@ -47,7 +47,7 @@ public BooleanProperty enabledProperty() {

@Override
public String toString() {
return "StudyDatabaseItem{" +
return "StudyCatalogItem{" +
"name=" + name.get() +
", enabled=" + enabled.get() +
'}';
Expand All @@ -61,7 +61,7 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
StudyDatabaseItem that = (StudyDatabaseItem) o;
StudyCatalogItem that = (StudyCatalogItem) o;
return Objects.equals(getName(), that.getName()) && Objects.equals(isEnabled(), that.isEnabled());
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/logic/crawler/Crawler.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ public Crawler(Path studyRepositoryRoot,
preferencesService,
fileUpdateMonitor,
bibEntryTypesManager);
StudyDatabaseToFetcherConverter studyDatabaseToFetcherConverter = new StudyDatabaseToFetcherConverter(
StudyCatalogToFetcherConverter studyCatalogToFetcherConverter = new StudyCatalogToFetcherConverter(
studyRepository.getActiveLibraryEntries(),
preferencesService.getImportFormatPreferences(),
preferencesService.getImporterPreferences());
this.studyFetcher = new StudyFetcher(
studyDatabaseToFetcherConverter.getActiveFetchers(),
studyCatalogToFetcherConverter.getActiveFetchers(),
studyRepository.getSearchQueryStrings());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
/**
* Converts library entries from the given study into their corresponding fetchers.
*/
class StudyDatabaseToFetcherConverter {
class StudyCatalogToFetcherConverter {
private final List<StudyDatabase> libraryEntries;
private final ImportFormatPreferences importFormatPreferences;
private final ImporterPreferences importerPreferences;

public StudyDatabaseToFetcherConverter(List<StudyDatabase> libraryEntries,
ImportFormatPreferences importFormatPreferences,
ImporterPreferences importerPreferences) {
public StudyCatalogToFetcherConverter(List<StudyDatabase> libraryEntries,
ImportFormatPreferences importFormatPreferences,
ImporterPreferences importerPreferences) {
this.libraryEntries = libraryEntries;
this.importFormatPreferences = importFormatPreferences;
this.importerPreferences = importerPreferences;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/crawler/StudyFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private QueryResult getQueryResult(String searchQuery) {
}

/**
* Queries all Databases on the given searchQuery.
* Queries all catalogs on the given searchQuery.
*
* @param searchQuery The query the search is performed for.
* @return Mapping of each fetcher by name and all their retrieved publications as a BibDatabase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ private void updateWorkAndSearchBranch() throws IOException, GitAPIException {
*/
private void setUpRepositoryStructureForQueriesAndFetchers() throws IOException {
// Cannot use stream here since IOException has to be thrown
StudyDatabaseToFetcherConverter converter = new StudyDatabaseToFetcherConverter(
StudyCatalogToFetcherConverter converter = new StudyCatalogToFetcherConverter(
this.getActiveLibraryEntries(),
preferencesService.getImportFormatPreferences(),
preferencesService.getImporterPreferences());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/model/study/StudyDatabase.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.jabref.model.study;

/**
* data model for the view {@link org.jabref.gui.slr.StudyDatabaseItem}
* data model for the view {@link org.jabref.gui.slr.StudyCatalogItem}
*/
public class StudyDatabase {
private String name;
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -735,4 +735,3 @@ Copy\ or\ move\ the\ content\ of\ one\ field\ to\ another=نسخ أو نقل م




1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,5 @@ Default\ pattern=Standardmønster






3 changes: 1 addition & 2 deletions src/main/resources/l10n/JabRef_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2394,7 +2394,7 @@ Recommended=Empfohlen

Authors\ and\ Title=Autoren und Titel
Database=Datenbank
Databases=Datenbanken

Add\ Author\:=Autor hinzufügen\:
Add\ Query\:=Abfrage hinzufügen\:
Add\ Research\ Question\:=Forschungsfrage hinzufügen\:
Expand All @@ -2405,7 +2405,6 @@ Start\ new\ systematic\ literature\ review=Neue systematische Literaturübersich
Manage\ study\ definition=Studiendefinition verwalten
Update\ study\ search\ results=Studiensuchergebnisse aktualisieren
Study\ repository\ could\ not\ be\ created=Studienrepository konnte nicht angelegt werden
Select\ Databases\:=Datenbanken auswählen\:

All\ query\ terms\ are\ joined\ using\ the\ logical\ AND,\ and\ OR\ operators=Alle Suchbegriffe werden mit den logischen Operatoren AND und OR verknüpft
Finalize=Fertigstellen
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2385,8 +2385,9 @@ Others=Others
Recommended=Recommended

Authors\ and\ Title=Authors and Title
Database=Database
Databases=Databases
Catalog=Catalog
Catalogs=Catalogs
Select\ Catalogs\:=Select Catalogs:
Add\ Author\:=Add Author\:
Add\ Query\:=Add Query\:
Add\ Research\ Question\:=Add Research Question\:
Expand All @@ -2397,7 +2398,6 @@ Start\ new\ systematic\ literature\ review=Start new systematic literature revie
Manage\ study\ definition=Manage study definition
Update\ study\ search\ results=Update study search results
Study\ repository\ could\ not\ be\ created=Study repository could not be created
Select\ Databases\:=Select Databases:

All\ query\ terms\ are\ joined\ using\ the\ logical\ AND,\ and\ OR\ operators=All query terms are joined using the logical AND, and OR operators
Finalize=Finalize
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,6 @@ Recommended=Recomendado

Authors\ and\ Title=Autoría y título
Database=Base de datos
Databases=Bases de datos
Add\ Author\:=Añadir autor\:
Add\ Query\:=Añadir consulta\:
Add\ Research\ Question\:=Añadir pregunta de investigación\:
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/l10n/JabRef_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ exportFormat=Format d'exportation
Output\ file\ missing=Fichier de sortie manquant
The\ output\ option\ depends\ on\ a\ valid\ input\ option.=L'option de sortie dépend d'une option d'entrée valide.
Linked\ file\ name\ conventions=Conventions pour les noms de fichiers liés
Filename\ format\ pattern=Modèle de format de nom de fichier
Filename\ format\ pattern=Modèle de format de nom de fichier
Additional\ parameters=Paramètres additionnels
Cite\ selected\ entries\ between\ parenthesis=Citer les entrées sélectionnées entre parenthèses
Cite\ selected\ entries\ with\ in-text\ citation=Citer les entrées sélectionnées comme incluse dans le texte
Expand Down Expand Up @@ -2394,7 +2394,6 @@ Recommended=Usuels

Authors\ and\ Title=Auteurs et titre
Database=Base de données
Databases=Bases de données
Add\ Author\:=Ajouter un auteur \:
Add\ Query\:=Ajouter une requête \:
Add\ Research\ Question\:=Ajouter une question de recherche \:
Expand All @@ -2405,7 +2404,6 @@ Start\ new\ systematic\ literature\ review=Lancer une nouvelle revue systématiq
Manage\ study\ definition=Gérer la définition de la revue
Update\ study\ search\ results=Mettre à jour les résultats de recherche de la revue
Study\ repository\ could\ not\ be\ created=Le dépôt de la revue n'a pas pu être créé
Select\ Databases\:=Sélectionnez les bases de données \:

All\ query\ terms\ are\ joined\ using\ the\ logical\ AND,\ and\ OR\ operators=Tous les termes de la requête sont joints en utilisant les opérateurs logiques AND et OR
Finalize=Finaliser
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/l10n/JabRef_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2394,7 +2394,6 @@ Recommended=Consigliato

Authors\ and\ Title=Autori e Titolo
Database=Database
Databases=Banche dati
Add\ Author\:=Aggiungi Autore\:
Add\ Query\:=Aggiungi Query\:
Add\ Research\ Question\:=Aggiungi Domanda Di Ricerca\:
Expand All @@ -2405,7 +2404,6 @@ Start\ new\ systematic\ literature\ review=Inizia una nuova revisione sistematic
Manage\ study\ definition=Gestisci definizione di studio
Update\ study\ search\ results=Aggiorna i risultati della ricerca
Study\ repository\ could\ not\ be\ created=Impossibile creare il repository dello studio
Select\ Databases\:=Seleziona i Database\:

All\ query\ terms\ are\ joined\ using\ the\ logical\ AND,\ and\ OR\ operators=Tutti i termini di query sono uniti utilizzando gli operatori logici AND e OR
Finalize=Concludere
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,6 @@ Recommended=推奨

Authors\ and\ Title=著者とタイトル
Database=データベース
Databases=データベース
Add\ Author\:=著者を追加\:
Add\ Query\:=クエリを追加:
Add\ Research\ Question\:=研究課題を追加
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/l10n/JabRef_ko.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,7 @@ Add\ new\ String=문자열 추가
Must\ not\ be\ empty\!=비워둘 수 없습니다\!
Open\ Help\ page=도움말 열기
Add\ new\ field\ name=새 필드 이름 추가
Field\ name\:=필드 이름\:
Field\ name\:=필드 이름\:
Field\ name\ "%0"\ already\ exists=필드 이름 "%0"이 이미 존재합니다
No\ field\ name\ selected\!=필드 이름을 선택하지 않았습니다
Remove\ field\ name=필드 이름 제거
Expand Down Expand Up @@ -2257,7 +2257,6 @@ Recommended=권장

Authors\ and\ Title=작가와 제목
Database=데이터베이스
Databases=데이터베이스
Add\ Author\:=작가 추가\:
Add\ Query\:=쿼리 추가하기
Add\ Research\ Question\:=연구 질문 추가\:
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_no.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,5 @@ Default\ pattern=Standardmønster






1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_pl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1062,4 +1062,3 @@ plain\ text=czysty tekst




Loading