Skip to content

Integrate with SearchRxiv #15373

Open
LoayTarek5 wants to merge 15 commits intoJabRef:mainfrom
LoayTarek5:integrate-with-SearchRxiv-12618
Open

Integrate with SearchRxiv #15373
LoayTarek5 wants to merge 15 commits intoJabRef:mainfrom
LoayTarek5:integrate-with-SearchRxiv-12618

Conversation

@LoayTarek5
Copy link
Copy Markdown
Contributor

Related issues and pull requests

Closes #12618

PR Description

Adds SearchRxiv integration to the SLR feature.
A new "Export search queries (search-query format)" button in the Finalize tab exports study search queries as JSON files following the search-query library standard format , then opens SearchRxiv in the browser for submission.

Steps to test

1- Go to Tools > Start new systematic literature review
2- Fill in all tabs:
Authors and Title: add a title and at least one author
Research Questions: add at least one question
Queries: add a query
Catalogs: enable at least one catalog
Finalize: select a study directory
3- In the Finalize tab, click "Export search queries (search-query format)", then choose an output directory
4- Browser opens to https://www.cabidigitallibrary.org/journal/searchrxiv
capture_260319_113915
capture_260319_113947
capture_260319_114050
capture_260319_114016

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • [/] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@qodo-free-for-open-source-projects
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Integrate SearchRxiv with SLR feature for query export

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add SearchRxiv integration to SLR feature with export functionality
• Create SearchRxivExporter to export queries as search-query JSON format
• Add "Export search queries" button in Finalize tab with validation
• Refactor buildStudy() method for code reuse across save and export
• Fix pre-existing compile error in AcademicPagesExporter
Diagram
flowchart LR
  A["SLR Study Definition"] -->|buildStudy| B["Study Object"]
  B -->|SearchRxivExporter| C["JSON Files<br/>search-query format"]
  C -->|export| D["Output Directory"]
  D -->|open browser| E["SearchRxiv Website"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java ✨ Enhancement +36/-0

Add SearchRxiv export button and handler

• Add shareOnSearchRxivButton FXML field and shareOnSearchRxiv() action handler
• Implement button disable binding based on queries and enabled catalogs
• Integrate SearchRxivExporter to export queries and open browser
• Add error handling with user notifications for export failures
• Import NativeDesktop and SearchRxivExporter dependencies

jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java


2. jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionViewModel.java ✨ Enhancement +14/-6

Refactor Study object creation logic

• Extract Study building logic into new buildStudy() method
• Refactor saveStudy() to use buildStudy() for DRY principle
• Enable reuse of Study object creation for export functionality

jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionViewModel.java


3. jablib/src/main/java/org/jabref/logic/exporter/SearchRxivExporter.java ✨ Enhancement +64/-0

New SearchRxiv exporter for JSON queries

• Create new exporter class for search-query JSON format
• Generate one JSON file per query and database combination
• Build JSON with search_string, platform, authors, record_info, and date fields
• Implement filename generation with sanitization and truncation

jablib/src/main/java/org/jabref/logic/exporter/SearchRxivExporter.java


View more (5)
4. jablib/src/test/java/org/jabref/logic/exporter/SearchRxivExporterTest.java 🧪 Tests +71/-0

Unit tests for SearchRxivExporter

• Add unit tests for SearchRxivExporter functionality
• Test file creation count for query and database combinations
• Verify JSON structure and field contents
• Test multiple database export scenarios

jablib/src/test/java/org/jabref/logic/exporter/SearchRxivExporterTest.java


5. jablib/src/main/java/org/jabref/logic/exporter/AcademicPagesExporter.java 🐞 Bug fix +1/-2

Fix pre-existing compile error

• Remove unused import of JournalAbbreviationLoader
• Fix compile error by passing null instead of JournalAbbreviationLoader.loadBuiltInRepository()

jablib/src/main/java/org/jabref/logic/exporter/AcademicPagesExporter.java


6. jabgui/src/main/resources/org/jabref/gui/slr/ManageStudyDefinition.fxml ✨ Enhancement +33/-8

Add SearchRxiv export button to FXML

• Add new shareOnSearchRxivButton with tooltip and action binding
• Reformat existing FXML elements for consistency and readability
• Position export button in Finalize tab layout

jabgui/src/main/resources/org/jabref/gui/slr/ManageStudyDefinition.fxml


7. jablib/src/main/resources/l10n/JabRef_en.properties 📝 Documentation +4/-0

Add localization strings for SearchRxiv feature

• Add localization strings for export button label and tooltip
• Add success and error notification messages for export operation

jablib/src/main/resources/l10n/JabRef_en.properties


8. CHANGELOG.md 📝 Documentation +1/-0

Document SearchRxiv SLR integration

• Document SearchRxiv integration feature addition
• Reference issue #12618 in changelog entry

CHANGELOG.md


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown
Contributor

qodo-free-for-open-source-projects bot commented Mar 19, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (3) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Action required

1. export() passes null repository 📘 Rule violation ⛯ Reliability
Description
AcademicPagesExporter.export(...) now passes null for abbreviationRepository despite the class
being @NullMarked, which can violate nullability assumptions and lead to runtime NPEs when the
repository is used downstream.
Code

jablib/src/main/java/org/jabref/logic/exporter/AcademicPagesExporter.java[77]

+        export(databaseContext, outputFile, entries, List.of(), null);
Evidence
The compliance rule requires avoiding passing null in new/changed code; the PR changes
AcademicPagesExporter.export(...) to forward null as abbreviationRepository, and the
repository is then passed to LayoutHelper without null checks.

AGENTS.md
jablib/src/main/java/org/jabref/logic/exporter/AcademicPagesExporter.java[75-78]
jablib/src/main/java/org/jabref/logic/exporter/AcademicPagesExporter.java[169-179]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`AcademicPagesExporter.export(...)` forwards `null` as `abbreviationRepository` even though the code path passes it into `LayoutHelper` without null handling.

## Issue Context
The class is `@NullMarked`, so parameters are non-null by default; passing `null` here can violate null-safety expectations and cause NPEs.

## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/exporter/AcademicPagesExporter.java[75-78]
- jablib/src/main/java/org/jabref/logic/exporter/AcademicPagesExporter.java[169-179]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. validationHeaderLabel ends with colon 📘 Rule violation ⚙ Maintainability
Description
The FXML label validationHeaderLabel uses text that ends with :, which violates the UI label
style rule and introduces a style violation in modified UI markup.
Code

jabgui/src/main/resources/org/jabref/gui/slr/ManageStudyDefinition.fxml[R286-290]

+                                    <Label fx:id="validationHeaderLabel"
+                                           text="%In order to proceed:"
+                                           style="-fx-text-fill: -jr-error; -fx-font-weight: bold"
+                                           visible="false"
+                                           managed="false"/>
Evidence
The compliance checklist forbids UI labels ending with a colon; the updated FXML sets
validationHeaderLabel to %In order to proceed: which renders a colon-suffixed label.

AGENTS.md
jabgui/src/main/resources/org/jabref/gui/slr/ManageStudyDefinition.fxml[284-290]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A UI label (`validationHeaderLabel`) ends with a trailing colon, which is disallowed.

## Issue Context
The FXML uses `%In order to proceed:`. Adjust the displayed localized value so the rendered label does not end with `:` (and keep translations consistent).

## Fix Focus Areas
- jabgui/src/main/resources/org/jabref/gui/slr/ManageStudyDefinition.fxml[284-290]
- jablib/src/main/resources/l10n/JabRef_en.properties[2915-2915]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Catalog toggle not observed 🐞 Bug ✓ Correctness
Description
The new SearchRxiv export button disable-binding only observes the catalogs list, not changes to
each catalog’s enabledProperty, so toggling catalogs does not re-evaluate the binding. This can
leave the button enabled when no catalogs are selected, resulting in an export that writes zero
files but still opens SearchRxiv and shows a success notification.
Code

jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java[R188-194]

+        shareOnSearchRxivButton.disableProperty().bind(
+                Bindings.or(
+                        Bindings.isEmpty(viewModel.getQueries()),
+                        Bindings.createBooleanBinding(
+                                () -> viewModel.getCatalogs().stream().noneMatch(StudyCatalogItem::isEnabled),
+                                viewModel.getCatalogs())
+                ));
Evidence
The disabled binding depends only on viewModel.getCatalogs() (the list), while catalog toggling
mutates StudyCatalogItem.enabledProperty() without changing the list structure; since the list is
created without an extractor, property changes do not invalidate bindings that only observe the
list.

jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java[188-195]
jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java[242-247]
jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionViewModel.java[54-59]
jabgui/src/main/java/org/jabref/gui/slr/StudyCatalogItem.java[34-44]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`shareOnSearchRxivButton.disableProperty()` uses a `createBooleanBinding(..., viewModel.getCatalogs())`. Because `getCatalogs()` is a plain `FXCollections.observableArrayList()` (no extractor), flipping a catalog’s `enabledProperty` does not invalidate that binding. The button can remain enabled even when all catalogs are disabled, leading to a misleading “Exported…” notification while exporting zero files.

### Issue Context
The catalogs are toggled via `entry.setEnabled(!entry.isEnabled())` in the catalogs table click handler; this changes only the item property.

### Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java[188-195]
- jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java[242-247]
- jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionViewModel.java[54-59]

### Suggested fix
- Make the `databases` list observe item property changes by creating it with an extractor, e.g. `FXCollections.observableArrayList(item -&gt; new Observable[] { item.enabledProperty() })`. This will also fix similar `noneMatch(isEnabled)` bindings in the view model.
- Optionally add a defensive check in `shareOnSearchRxiv()` to abort with a clear message when `buildStudy().getDatabases()` is empty.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
4. Unclosed Files.list streams 🐞 Bug ⛯ Reliability
Description
SearchRxivExporterTest calls Files.list(...) without closing the returned Stream, leaking directory
handles. This can cause flaky tests (especially on Windows) when @TempDir cleanup runs.
Code

jablib/src/test/java/org/jabref/logic/exporter/SearchRxivExporterTest.java[R34-45]

+    void exportCreatesOneFilePerQueryAndDatabase(@TempDir Path tempDir) throws Exception {
+        exporter.export(buildStudy(), tempDir);
+
+        assertEquals(1, Files.list(tempDir).count());
+    }
+
+    @Test
+    void exportedJsonContainsCorrectFields(@TempDir Path tempDir) throws Exception {
+        exporter.export(buildStudy(), tempDir);
+
+        Path file = Files.list(tempDir).findFirst().orElseThrow();
+        String content = Files.readString(file);
Evidence
The test creates Streams from Files.list(tempDir) and immediately consumes them without
try-with-resources; other tests in the repo explicitly close these streams via try-with-resources to
avoid resource leaks.

jablib/src/test/java/org/jabref/logic/exporter/SearchRxivExporterTest.java[33-45]
jablib/src/test/java/org/jabref/logic/exporter/SearchRxivExporterTest.java[57-70]
jablib/src/test/java/org/jabref/logic/exporter/MSBibExportFormatFilesTest.java[44-53]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`SearchRxivExporterTest` uses `Files.list(tempDir)` multiple times without closing the returned `Stream&lt;Path&gt;`. This leaks directory handles and may break `@TempDir` cleanup on Windows, causing flaky CI.

### Issue Context
Other tests in the codebase use try-with-resources around `Files.list(...)`.

### Fix Focus Areas
- jablib/src/test/java/org/jabref/logic/exporter/SearchRxivExporterTest.java[33-45]
- jablib/src/test/java/org/jabref/logic/exporter/SearchRxivExporterTest.java[57-70]

### Suggested fix
- Wrap each `Files.list(...)` call in a try-with-resources block, or collect to a list within try-with-resources and then assert on the list (count/findFirst).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

5. shareOnSearchRxiv blocks UI 📘 Rule violation ➹ Performance
Description
The shareOnSearchRxiv event handler performs file I/O export synchronously on the JavaFX UI
thread, which can freeze the UI for larger studies and violates the responsiveness requirement.
Code

jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java[R314-330]

+    private void shareOnSearchRxiv() {
+        DirectoryDialogConfiguration config = new DirectoryDialogConfiguration.Builder()
+                .withInitialDirectory(pathToStudyDataDirectory)
+                .build();
+
+        dialogService.showDirectorySelectionDialog(config).ifPresent(directory -> {
+            try {
+                new SearchRxivExporter().export(viewModel.buildStudy(), directory);
+                NativeDesktop.openBrowserShowPopup(
+                        "https://www.cabidigitallibrary.org/journal/searchrxiv",
+                        dialogService,
+                        preferences.getExternalApplicationsPreferences());
+                dialogService.notify(Localization.lang("Exported search queries for SearchRxiv."));
+            } catch (IOException e) {
+                LOGGER.error("Could not export search queries for SearchRxiv", e);
+                dialogService.notify(Localization.lang("Could not export search queries."));
+            }
Evidence
The UI responsiveness rule requires long-running work to run off the UI thread; the handler directly
calls new SearchRxivExporter().export(...) (writing files) inside the action callback.

jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java[313-329]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The SearchRxiv export runs synchronously in the JavaFX action handler, potentially blocking the UI.

## Issue Context
`SearchRxivExporter.export(...)` writes one JSON file per query/database combination and can take noticeable time for larger studies.

## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java[313-329]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Locale-sensitive lowercasing 🐞 Bug ✓ Correctness
Description
SearchRxivExporter lowercases the platform using String.toLowerCase() without specifying
Locale.ROOT, which can produce incorrect platform identifiers on some locales (e.g., Turkish). This
can generate invalid or unexpected JSON content for SearchRxiv submission.
Code

jablib/src/main/java/org/jabref/logic/exporter/SearchRxivExporter.java[R43-45]

+        data.put("search_string", query);
+        data.put("platform", platform.toLowerCase());
+        data.put("authors", study.getAuthors().stream()
Evidence
The exporter uses locale-dependent toLowerCase() for a value that is effectively an identifier;
elsewhere in the codebase (LayoutHelper) case normalization is done with Locale.ROOT to avoid
locale-specific transformations.

jablib/src/main/java/org/jabref/logic/exporter/SearchRxivExporter.java[41-45]
jablib/src/main/java/org/jabref/logic/layout/LayoutHelper.java[61-73]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`SearchRxivExporter` uses `platform.toLowerCase()` which is locale-sensitive and can produce unexpected characters for identifiers (notably in Turkish locales).

### Issue Context
Other normalization code in the repo uses `toLowerCase(Locale.ROOT)` for locale-stable behavior.

### Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/exporter/SearchRxivExporter.java[41-45]

### Suggested fix
- Change to `platform.toLowerCase(Locale.ROOT)` and add the required `import java.util.Locale;`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@Override
public void export(BibDatabaseContext databaseContext, Path outputFile, List<BibEntry> entries) throws SaveException {
export(databaseContext, outputFile, entries, List.of(), JournalAbbreviationLoader.loadBuiltInRepository());
export(databaseContext, outputFile, entries, List.of(), null);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. export() passes null repository 📘 Rule violation ⛯ Reliability

AcademicPagesExporter.export(...) now passes null for abbreviationRepository despite the class
being @NullMarked, which can violate nullability assumptions and lead to runtime NPEs when the
repository is used downstream.
Agent Prompt
## Issue description
`AcademicPagesExporter.export(...)` forwards `null` as `abbreviationRepository` even though the code path passes it into `LayoutHelper` without null handling.

## Issue Context
The class is `@NullMarked`, so parameters are non-null by default; passing `null` here can violate null-safety expectations and cause NPEs.

## Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/exporter/AcademicPagesExporter.java[75-78]
- jablib/src/main/java/org/jabref/logic/exporter/AcademicPagesExporter.java[169-179]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LoayTarek5 no new nullaway warnings.

@testlens-app

This comment has been minimized.

@subhramit
Copy link
Copy Markdown
Member

subhramit commented Mar 19, 2026

From your singular commit for this feature

Integrate SLR feature with SearchRxiv (#12618)

  • Add SearchRxivExporter to export study search queries as JSON files
    in the search-query library standard format (one file per query x database)
  • Add Export search queries button in Finalize tab
  • Open SearchRxiv submission page in browser after export
  • Refactor buildStudy() out of saveStudy() for reuse (DRY)
  • Add localization strings for new UI elements
  • Fix pre-existing compile error in AcademicPagesExporter
    Closes Integrate with SearchRxiv #12618

Can you point us to the "pre-existing compile error" in AcademicPagesExporter?

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

Can you point us to the "pre-existing compile error" in AcademicPagesExporter?

The pre-existing compile error where loadBuiltInRepository() was called with no arguments:
// Before:
export(databaseContext, outputFile, entries, List.of(), JournalAbbreviationLoader.loadBuiltInRepository());

loadBuiltInRepository() had been updated to require a DataSource argument, making this call fail to compile:
i fixed it by passing null instead, since the 5-arg export() method in AcademicPagesExporter handles a null abbreviationRepository :
// After:
export(databaseContext, outputFile, entries, List.of(), null);
This fix was needed to unblock compilation and run/test my new feature

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

singular commit for this feature

The single commit was intentional to keep the PR history clean, during development, the branch accumulated extra commits from merging main to fix a compile error, so to clean up the diff and show only the changes relevant to this issue, i squashed all my commits into one and rebased onto main

If this behavior is inconveniencing, tell me and i will try to split those commits

@subhramit
Copy link
Copy Markdown
Member

Can you point us to the "pre-existing compile error" in AcademicPagesExporter?

The pre-existing compile error where loadBuiltInRepository() was called with no arguments:
// Before:
export(databaseContext, outputFile, entries, List.of(), JournalAbbreviationLoader.loadBuiltInRepository());

loadBuiltInRepository() had been updated to require a DataSource argument, making this call fail to compile:
i fixed it by passing null instead, since the 5-arg export() method in AcademicPagesExporter handles a null abbreviationRepository :
// After:
export(databaseContext, outputFile, entries, List.of(), null);
This fix was needed to unblock compilation and run/test my new feature

I did not ask for an LLM copy paste, rather a pointer to where in our main branch does the pre-existing compile error exist.

Anyway, we can guess what happened here. Add disclosures of the code, commit etc being generated by AI to the PR description. Usually we don't tolerate misrepresentation but since you have tested this, we'll review the PR at some point.

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

I did not ask for an LLM copy paste, rather a pointer to where in our main branch does the pre-existing compile error exist.

Anyway, we can guess what happened here. Add disclosures of the code, commit etc being generated by AI to the PR description. Usually we don't tolerate misrepresentation but since you have tested this, we'll review the PR at some point.

I apologize for you, @subhramit, i did not mean to depend on LLM fully, you are right the commits part was by the LLM becuase i faced problems while merging main.

but i am always being careful of using ai and try as much as possible to depend on myself and from the documentation,
so sorry about this behavior.

@LoayTarek5 LoayTarek5 force-pushed the integrate-with-SearchRxiv-12618 branch from 006fc76 to 3b53d84 Compare March 20, 2026 08:19
@testlens-app

This comment has been minimized.

@LoayTarek5 LoayTarek5 requested a review from calixtus March 20, 2026 08:26
@github-actions github-actions bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels Mar 20, 2026
@LoayTarek5 LoayTarek5 force-pushed the integrate-with-SearchRxiv-12618 branch from 3b53d84 to aec497b Compare March 20, 2026 08:45
@testlens-app

This comment has been minimized.

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

I apologize for the force pushes, i was trying to clean up the commit history , i will avoid force pushing

@testlens-app
Copy link
Copy Markdown

testlens-app bot commented Mar 21, 2026

✅ All tests passed ✅

🏷️ Commit: 91cd952
▶️ Tests: 10206 executed
⚪️ Checks: 50/50 completed


Learn more about TestLens at testlens.app.

@github-actions github-actions bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Mar 21, 2026
@calixtus
Copy link
Copy Markdown
Member

calixtus commented Apr 4, 2026

Can you address qodo comments please?

@github-actions github-actions bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels Apr 7, 2026
@LoayTarek5 LoayTarek5 force-pushed the integrate-with-SearchRxiv-12618 branch 2 times, most recently from e56addd to b1ef4fd Compare April 7, 2026 16:56
@LoayTarek5
Copy link
Copy Markdown
Contributor Author

I rebased and squashed into a single commit,
apologies for the earlier messy merge history, i know that was not the best practice.
I will ensure this doesn't happen again.

@calixtus
Copy link
Copy Markdown
Member

calixtus commented Apr 7, 2026

We don't like force pushes, because all the comments we made to the code are detached in and partially lost. It adds a lot to our workload, reading your changes again and to do the review partially again.

…ON format, adhering to the search-query library's specifications.
@InAnYan
Copy link
Copy Markdown
Member

InAnYan commented Apr 11, 2026

Thanks for answering!

Sorry, I misleaded you. By database I actually meant what we have in JabRef for “catalog”. What I mean is that you can (probably) create one json file per 1 question that would search across different catalogs (e.g. arxiv, google scholar). Because the field “database” is a list

@LoayTarek5 LoayTarek5 force-pushed the integrate-with-SearchRxiv-12618 branch from 148882f to ec9f863 Compare April 11, 2026 15:30
@subhramit
Copy link
Copy Markdown
Member

@LoayTarek5 kindly stop force pushing changes.

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

@LoayTarek5 kindly stop force pushing changes.

i know that is the second time😅 happened
But sometimes while merging, some problems happened, so i had to do that
I'm really sorry for that, that is my fault
I will be more careful.

@calixtus
Copy link
Copy Markdown
Member

Yes this was the second time. And it will be the last time. Again, this causes more work on our side since comments on code get detached and some get lost.

If you have problems, ask us. Even a bit of a mess with fixing merge commits afterwards happens all the time.

Instead I feel like you are trying to hide something from us.

First time force pushing might happen by accident. Second time, being informed by bot message and having us mentioned it (if I remember correctly), was obviously knowingly and willingly against our contribution rules.

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

Yes this was the second time. And it will be the last time. Again, this causes more work on our side since comments on code get detached and some get lost.

If you have problems, ask us. Even a bit of a mess with fixing merge commits afterwards happens all the time.

Instead I feel like you are trying to hide something from us.

First time force pushing might happen by accident. Second time, being informed by bot message and having us mentioned it (if I remember correctly), was obviously knowingly and willingly against our contribution rules.

I know that causes more work on your side, and I'm really sorry for that @calixtus.
But as i said before, while merging i get a conflict, while resolving, the other files with commits get in my branch, that's it.
Of course, nothing i try to hide, there is no point in that, and i'm sorry for that confusion, it is my fault.
I will do my best next time and learn more about that. Sorry again.

@subhramit
Copy link
Copy Markdown
Member

But as i said before, while merging i get a conflict, while resolving, the other files with commits get in my branch, that's it.

There were no conflicting changes between main and this PR.

the other files with commits get in my branch

That is the purpose of a merge commit, to integrate the changes in other files in the feature branch so that history is kept in sync.

See if you are merging with rebase enabled or something - simply one merge commit should be present when a merge happens.
Try to learn these basics about Git, or at least ask if this is the only way forward before you force push.

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

Ok @subhramit, Thanks for that, i will learn more, especially when conflicts happen, and of course, you are right i have to ask questions instead of just going on my way

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

Thanks for answering!

Sorry, I misleaded you. By database I actually meant what we have in JabRef for “catalog”. What I mean is that you can (probably) create one json file per 1 question that would search across different catalogs (e.g. arxiv, google scholar). Because the field “database” is a list

I searched to verify that, and you are right.
Looking at the actual JSON examples in the search-query repo (for example: search_history_file_1.json):

json
{
"platform": "Web of Science",
"database": ["SCI-EXPANDED", "SSCI", "A&HCI"],
"search_string": "TS=(quantum AND dot AND spin)"
}

also in JabRef each StudyDatabase entry (IEEE, ACM Portal, Springer, DBLP) resolves to a separate SearchBasedFetcher.
They are independent search services, not sub-databases within a single platform, from my understanding.

I will add an empty database list to the JSON output to fully match the format spec.

@InAnYan
Copy link
Copy Markdown
Member

InAnYan commented Apr 11, 2026

Thanks for answering!
Sorry, I misleaded you. By database I actually meant what we have in JabRef for “catalog”. What I mean is that you can (probably) create one json file per 1 question that would search across different catalogs (e.g. arxiv, google scholar). Because the field “database” is a list

I searched to verify that, and you are right. Looking at the actual JSON examples in the search-query repo (for example: search_history_file_1.json*
):

json { "platform": "Web of Science", "database": ["SCI-EXPANDED", "SSCI", "A&HCI"], "search_string": "TS=(quantum AND dot AND spin)" }

also in JabRef each StudyDatabase entry (IEEE, ACM Portal, Springer, DBLP) resolves to a separate SearchBasedFetcher. They are independent search services, not sub-databases within a single platform, from my understanding.

I will add an empty database list to the JSON output to fully match the format spec.

Okay cool, so database field in the JSON doesn't mean Arxiv/DBLP/WoS but it's actually some sub-index/sub-database. And the StudyDatabase is encoded in platform field, which is not a list.

So this finally answers my question of why there are many separate JSON files

private void shareOnSearchRxiv() {
viewModel.shareOnSearchRxiv(
pathToStudyDataDirectory,
preferences.getExternalApplicationsPreferences());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The view model should get and store external applications preferences, so the method shareOnSearchRxiv should accept only one argument

dialogService.showDirectorySelectionDialog(config).ifPresent(exportDirectory -> {
try {
new SearchRxivExporter().export(study, exportDirectory);
NativeDesktop.openBrowserShowPopup(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure if we want to open a website after exporting the search queries to JSON. @koppor @calixtus @subhramit what do you think?

Copy link
Copy Markdown
Member

@calixtus calixtus Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is partially known behaviour, if I export something, I open the browser to show the result of the export. If it's just Json exportet, I wouldn't show the result, its just technical.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn’t really find the button “use json search” on the website, so I think it’s better not to show

LaTeX\ citations=LaTeX citations
Search\ for\ citations\ in\ LaTeX\ files...=Search for citations in LaTeX files...
LaTeX\ Citations\ Search\ Results=LaTeX Citations Search Results
PDF\ file=PDF file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, but why are there so many deletions? I think the feature only introduces new strings, or not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deletions in JabRef_en.properties are from a bad merge, not intentional, i will fix it.

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

@InAnYan, Could you please reset the integrate-with-SearchRxiv-12618 branch to main? The branch has accumulated many unrelated commits from previous bad merges. I will then push only my changes cleanly on top

(searchrxiv-backup) $ git log upstream/main..integrate-with-SearchRxiv-12618 --oneline
9b11df4a14 (HEAD -> searchrxiv-backup, integrate-with-SearchRxiv-12618) keep only new SearchRxiv strings
c87506a814 Add assertions for database field in SearchRxivExporterTest to verify JSON export structure
668e7b58ef Add database field to JSON export data in SearchRxivExporter
60e352fa49 Update tooltip text for export button in ManageStudyDefinition.fxml to clarify functionality
7e16b4c582 Refactor shareOnSearchRxiv method to remove unused parameters and remove browser opening functionality
dc333e0543 Refactor shareOnSearchRxiv method to simplify parameters and remove browser opening after SearchRxiv export
ae0e753c1b restore deleted strings lost in merge conflict
148882f Merge origin into integrate-with-SearchRxiv-12618
d645516 Address review: extract URL constant, add format docs, fix ObjectMapper, add comments
54a3202 Add search-query format documentation link to SearchRxivExporter
e0ac952 Address review comments: move logic to ViewModel, extract URL constant, add comment, fix unclosed streams
553cb09 Add comment explaining databases list extractor
24669a1 Extract SearchRxiv URL to constant
96f7a75 Move shareOnSearchRxiv logic to ViewModel
880bd0f Merge branch 'main' into integrate-with-SearchRxiv-12618
7d69741 Merge branch 'main' into integrate-with-SearchRxiv-12618
b1ef4fd (integrate-with-SearchRxiv-12618-clean) Fix missing merge
e56addd Add unit tests for SearchRxivExporter
e328d77 Implement sharing functionality for SearchRxiv
c5b4317 Fix unclosed Files.list() streams in SearchRxivExporterTest
50467d3 Add defensive check for empty databases before SearchRxiv export
7118e33 Fix catalog toggle not observed in databases list
a0cee3c revert AcademicPagesExporter change
4aa674c Integrate SLR feature with SearchRxiv (#12618)
85aa8a7 Trigger CI re-run
bd89ce8 Fix AbbreviateJournalCleanup to use direct string methods instead of get()
b731648 Restore AbbreviateJournalCleanup to use direct string methods instead of get()
336ecd3 Fix LspLauncher to accept DataSource and fix module-info requires
69f2155 Restore files modified by editor whitespace changes
f7b8d81 enhance input sanitization and add custom fuzzy matching
3f54d20 Update module-info.java to export org.jabref.support for improved test support
ad44ba2 Add JournalAbbreviationTestUtil for shared Postgres-backed testing utility
5d512c8 Add java.sql and embedded.postgres requirements to module-info for enhanced testing
8a26ceb Add embedded PostgreSQL dependency to build.gradle.kts for improved testing capabilities
60059f5 Integrate PostgreServer into ServerCli for enhanced data source management in LspLauncher initialization
90dfb01 include DataSource for improved JournalAbbreviationRepository initialization
672448a Add java.sql requirement to module-info for database connectivity
c5d4404 refactor setUp method in LtwaRepositoryTest to use JournalAbbreviationTestUtil for improved data source management
1ac65a5 refactor setUp method in AbbreviationsTest to use JournalAbbreviationTestUtil for improved data source management
841346d refactor setUp method in JournalInAbbreviationListCheckerTest to use JournalAbbreviationTestUtil for improved data source management
68371c8 initialize JournalAbbreviationRepository in IntegrityCheckTest for consistent data source usage across tests
a67ab24 utilize JournalAbbreviationTestUtil for enhanced data source management
5beb84c replace deprecated methods with specific calls for checking known and abbreviated names, enhancing test clarity and accuracy
e2327e2 replace deprecated get method with specific methods for retrieving default abbreviations, dotless forms, and full names from JournalAbbreviationRepository, enhancing clarity and functionality of tests
53e8c3a Add getter for DataSource in PostgreServer class
cd4f966 Refactor JournalAbbreviationRepository to use Postgres for abbreviation storage, implementing fuzzy matching with pg_trgm and enhancing initialization with a DataSource. Custom abbreviations are now managed in memory.
887115d populate Postgres database with built-in journal abbreviations from an SQL file, enhancing repository initialization
df2768f Make readJournalListFromFile public to allow external access for reading journal lists from a file
c5d4404 refactor setUp method in LtwaRepositoryTest to use JournalAbbreviatio
nTestUtil for improved data source management
1ac65a5 refactor setUp method in AbbreviationsTest to use JournalAbbreviation
TestUtil for improved data source management
841346d refactor setUp method in JournalInAbbreviationListCheckerTest to use
JournalAbbreviationTestUtil for improved data source management
68371c8 initialize JournalAbbreviationRepository in IntegrityCheckTest for co
nsistent data source usage across tests
a67ab24 utilize JournalAbbreviationTestUtil for enhanced data source manageme
nt
5beb84c replace deprecated methods with specific calls for checking known and
abbreviated names, enhancing test clarity and accuracy
e2327e2 replace deprecated get method with specific methods for retrieving de
fault abbreviations, dotless forms, and full names from JournalAbbreviationRepos
itory, enhancing clarity and functionality of tests
53e8c3a Add getter for DataSource in PostgreServer class
cd4f966 Refactor JournalAbbreviationRepository to use Postgres for abbreviati
on storage, implementing fuzzy matching with pg_trgm and enhancing initializatio
n with a DataSource. Custom abbreviations are now managed in memory.
887115d populate Postgres database with built-in journal abbreviations from a
n SQL file, enhancing repository initialization
df2768f Make readJournalListFromFile public to allow external access for read
ing journal lists from a file

(searchrxiv-backup) $ git diff upstream/main --name-only
.jbang/CheckoutPR.java
CHANGELOG.md
build-support/src/main/java/JournalListMvGenerator.java
build-support/src/main/java/JournalListSqlGenerator.java
build-support/src/main/java/LtwaListMvGenerator.java
build.gradle.kts
docs/requirements/dialog-with-text-input.md
jabgui/src/main/java/org/jabref/gui/JabRefGUI.java
jabgui/src/main/java/org/jabref/gui/actions/ActionHelper.java
jabgui/src/main/java/org/jabref/gui/actions/StandardActions.java
jabgui/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternsPanel.java
jabgui/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternsPanelViewModel.java
jabgui/src/main/java/org/jabref/gui/frame/MainMenu.java
jabgui/src/main/java/org/jabref/gui/groups/GroupTreeView.java
jabgui/src/main/java/org/jabref/gui/maintable/RightClickMenu.java
jabgui/src/main/java/org/jabref/gui/newentry/NewEntryView.java
jabgui/src/main/java/org/jabref/gui/relatedwork/RelatedWorkAction.java
jabgui/src/main/java/org/jabref/gui/relatedwork/RelatedWorkDialogView.java
jabgui/src/main/java/org/jabref/gui/relatedwork/RelatedWorkDialogViewModel.java
jabgui/src/main/java/org/jabref/gui/relatedwork/RelatedWorkResultDialogView.java
jabgui/src/main/java/org/jabref/gui/relatedwork/RelatedWorkResultDialogViewModel.java
jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java
jabgui/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionViewModel.java
jabgui/src/main/java/org/jabref/migrations/PreferencesMigrations.java
jabgui/src/main/resources/org/jabref/gui/Base.css
jabgui/src/main/resources/org/jabref/gui/relatedwork/RelatedWorkDialog.fxml
jabgui/src/main/resources/org/jabref/gui/relatedwork/RelatedWorkResultDialog.fxml
jabgui/src/main/resources/org/jabref/gui/slr/ManageStudyDefinition.fxml
jabgui/src/test/java/org/jabref/gui/externalfiles/AutoRenameFileOnEntryChangeTest.java
jabgui/src/test/java/org/jabref/gui/preferences/journals/JournalAbbreviationsViewModelTabTest.java
jabgui/src/test/java/org/jabref/logic/journals_gui/JournalAbbreviationRepositoryTest.java
jabkit/src/main/java/org/jabref/toolkit/JabKitLauncher.java
jabkit/src/main/java/org/jabref/toolkit/commands/CheckIntegrity.java
jabkit/src/main/java/org/jabref/toolkit/commands/GenerateCitationKeys.java
jablib/build.gradle.kts
jablib/src/main/java/module-info.java
jablib/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTestUtils.java
jablib/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyPattern.java
jablib/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyPatternPreferences.java
jablib/src/main/java/org/jabref/logic/citationkeypattern/GlobalCitationKeyPatterns.java
jablib/src/main/java/org/jabref/logic/cleanup/AbbreviateJournalCleanup.java
jablib/src/main/java/org/jabref/logic/cleanup/UnabbreviateJournalCleanup.java
jablib/src/main/java/org/jabref/logic/database/DuplicateCheck.java
jablib/src/main/java/org/jabref/logic/exporter/SearchRxivExporter.java
jablib/src/main/java/org/jabref/logic/exporter/TemplateExporter.java
jablib/src/main/java/org/jabref/logic/journals/Abbreviation.java
jablib/src/main/java/org/jabref/logic/journals/AbbreviationParser.java
jablib/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java
jablib/src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.java
jablib/src/main/java/org/jabref/logic/net/ssl/SSLPreferences.java
jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkInserter.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkInsertionResult.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkMatchResult.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkMatcher.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkReferenceResolver.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkSnippet.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkTextParser.java
jablib/src/main/java/org/jabref/logic/search/PostgreServer.java
jablib/src/main/resources/l10n/JabRef_en.properties
jablib/src/test/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTest.java
jablib/src/test/java/org/jabref/logic/citationkeypattern/MakeLabelWithDatabaseTest.java
jablib/src/test/java/org/jabref/logic/citationkeypattern/MakeLabelWithoutDatabaseTest.java
jablib/src/main/java/org/jabref/logic/journals/AbbreviationParser.java
jablib/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java
jablib/src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.jav
a
jablib/src/main/java/org/jabref/logic/net/ssl/SSLPreferences.java
jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkInserter.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkInsertionResult.jav
a
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkMatchResult.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkMatcher.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkReferenceResolver.j
ava
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkSnippet.java
jablib/src/main/java/org/jabref/logic/relatedwork/RelatedWorkTextParser.java
jablib/src/main/java/org/jabref/logic/search/PostgreServer.java
jablib/src/main/resources/l10n/JabRef_en.properties
jablib/src/test/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTes
t.java
jablib/src/test/java/org/jabref/logic/citationkeypattern/MakeLabelWithDatabaseTe
st.java
jablib/src/test/java/org/jabref/logic/citationkeypattern/MakeLabelWithoutDatabas
eTest.java

@calixtus
Copy link
Copy Markdown
Member

I have no idea what you are trying to tell us? The branch on upstream looks just fine. If you want to reset your local branch with "many bad commits" use reset on your local branch to return to an earlier stage of your branch.

For every emergency question: Look at https://ohshitgit.com/

@github-actions github-actions bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Apr 13, 2026
@LoayTarek5
Copy link
Copy Markdown
Contributor Author

I have no idea what you are trying to tell us? The branch on upstream looks just fine. If you want to reset your local branch with "many bad commits" use reset on your local branch to return to an earlier stage of your branch.

For every emergency question: Look at https://ohshitgit.com/

Finally, i push it this time without --force, i think it is big win😅.
This is the first time all of this has happened.
So sorry for any misses that happened, and thanks to you all for your patience.
Thanks, @calixtus, for your guidance.

@subhramit
Copy link
Copy Markdown
Member

subhramit commented Apr 13, 2026

Finally, i push it this time without --force, i think it is big win😅.
This is the first time all of this has happened.
So sorry for any misses that happened, and thanks to you all for your patience.
Thanks, @calixtus, for your guidance.

Please also check if you have mode rebase enabled in git pull config. I am still not sure why you have to manually sync files.

@LoayTarek5
Copy link
Copy Markdown
Contributor Author

Please also check if you have mode rebase enabled in git pull config. I am still not sure why you have to manually sync files.

Ok, @subhramit, i will check to make sure that everything will go smoothly

@LoayTarek5 LoayTarek5 requested a review from InAnYan April 14, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate with SearchRxiv

4 participants