Skip to content

Commit

Permalink
Changed database to catalog in org.jabref.gui.slr and org.jabref.logi…
Browse files Browse the repository at this point in the history
…c.crawler (#9989)

* Fix for issue 615

* Add missing key pair English file

* Delete translation in non-english file

* We changed database to catalog in org.jabref.gui.slr and org.jabref.logic.crawler (Issue #9951)

* Made required changes

---------

Co-authored-by: wy8881 <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>
  • Loading branch information
3 people authored Jun 8, 2023
1 parent 85386e6 commit c3f13b6
Show file tree
Hide file tree
Showing 28 changed files with 88 additions and 108 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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 @@ -2386,8 +2386,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 @@ -2398,7 +2399,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
2 changes: 0 additions & 2 deletions src/main/resources/l10n/JabRef_fr.properties
Original file line number Diff line number Diff line change
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
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_ko.properties
Original file line number Diff line number Diff line change
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
2 changes: 0 additions & 2 deletions src/main/resources/l10n/JabRef_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2394,7 +2394,6 @@ Recommended=Recomendado

Authors\ and\ Title=Autores e Título
Database=Banco de dados
Databases=Bancos de dados
Add\ Author\:=Adicionar Autor\:
Add\ Query\:=Adicionar Consulta\:
Add\ Research\ Question\:=Adicionar Questões de Pesquisa\:
Expand All @@ -2405,7 +2404,6 @@ Start\ new\ systematic\ literature\ review=Iniciar nova revisão sistemática da
Manage\ study\ definition=Gerenciar definição de estudo
Update\ study\ search\ results=Atualizar resultados da busca de estudo
Study\ repository\ could\ not\ be\ created=Não foi possível criar o repositório de estudo
Select\ Databases\:=Selecionar Banco de Dados\:

All\ query\ terms\ are\ joined\ using\ the\ logical\ AND,\ and\ OR\ operators=Todos os termos de consulta são unidos usando os operadores lógicos AND e OR
Finalize=Finalizar
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,6 @@ Recommended=Рекомендованный
Authors\ and\ Title=Авторы и Заголовок
Database=База данных
Databases=Базы данных
Add\ Author\:=Добавить автора\:
Add\ Query\:=Добавить запрос\:
Add\ Research\ Question\:=Добавить вопрос исследования\:
Expand Down
Loading

0 comments on commit c3f13b6

Please sign in to comment.