Skip to content

Feat: Add select entries CAYW feature and command endpoint#13554

Merged
koppor merged 31 commits into
JabRef:mainfrom
palukku:feat-cayw-params
Jul 23, 2025
Merged

Feat: Add select entries CAYW feature and command endpoint#13554
koppor merged 31 commits into
JabRef:mainfrom
palukku:feat-cayw-params

Conversation

@palukku

@palukku palukku commented Jul 18, 2025

Copy link
Copy Markdown
Member

Closes palukku#1 and Closes palukku#9

Added the "select=true" parameter to cayw and implemented an commands endpoint which can be used to select entries of a specific library

Steps to test

You can use the commands.http to test the selection in the chocolate.bib file.

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • [/] Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [/] Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • [/] Screenshots added in PR description (if change is visible to the user)
  • [/] Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • [/] Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Comment thread jabgui/src/main/java/org/jabref/gui/JabRefGUI.java Outdated
Comment thread jabsrv/src/main/java/org/jabref/http/JabRefCliStateManager.java Outdated
Comment thread jabsrv/src/main/java/org/jabref/http/JabRefCliStateManager.java Outdated
Comment thread jabsrv/src/main/java/org/jabref/http/JabRefSrvStateManager.java Outdated
@palukku palukku marked this pull request as ready for review July 22, 2025 16:18
Comment thread jabgui/src/main/java/org/jabref/gui/JabRefGUI.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/StateManager.java
Comment thread jabgui/src/main/java/org/jabref/gui/preferences/general/GeneralTabViewModel.java Outdated
Comment thread jabgui/src/test/java/org/jabref/gui/entryeditor/SourceTabTest.java
Comment thread jabgui/src/main/java/org/jabref/gui/maintable/MainTable.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java Outdated
Comment on lines +19 to +21
public ObservableList<BibDatabaseContext> getOpenDatabases() {
return FXCollections.emptyObservableList();
}

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.

Follow-up: the should be a set - and org.jabref.http.server.services.ServerUtils#getBibDatabaseContext rewritten accordingly.

Here, I am a bit undecided whether a thow should be used, but maybe OK :)

}

@Override
public List<String> collectAllDatabasePaths() {

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.

This is needed later in the project, therefore it is there?

I only see usages in the GUI currently

image

Maybe, its the preparation for the global search?

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.

Should be called get...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did put it there because I remembered there was a List of Paths for the Library Resources, I thought later on we could maybe use it to integrate it to use in filesToServe and just use this instead of filestoserve or context.

For example maybe here https://github.com/palukku/jabref/blob/561acce7864fba4023645d1d14f1ae9ebdf7bc06/jabsrv/src/main/java/org/jabref/http/server/Server.java#L76

Comment thread jabsrv/src/main/java/org/jabref/http/dto/cayw/SimpleJson.java Outdated
Comment thread jabsrv/src/main/java/org/jabref/http/server/cayw/CAYWResource.java Outdated
Comment thread jabsrv/src/main/java/org/jabref/http/server/cayw/CAYWResource.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/JabRefGuiStateManager.java
Comment on lines +223 to +227
public Optional<BibEntryTableViewModel> getViewModelByCitationKey(String citationKey) {
return entriesViewModel.stream()
.filter(viewModel -> citationKey.equals(viewModel.getEntry().getCitationKey().orElse("")))
.findFirst();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The method accepts a String parameter without null check, which could lead to NullPointerException. According to special instruction 19, null should never be passed to a method.

Comment thread jabgui/src/main/java/org/jabref/gui/maintable/MainTable.java Outdated
Comment thread jabsrv/src/main/java/org/jabref/http/server/cayw/CAYWResource.java Outdated
@koppor koppor mentioned this pull request Jul 23, 2025
@trag-bot

trag-bot Bot commented Jul 23, 2025

Copy link
Copy Markdown

@trag-bot didn't find any issues in the code! ✅✨

@koppor koppor enabled auto-merge July 23, 2025 13:43
@koppor koppor added this pull request to the merge queue Jul 23, 2025
Merged via the queue into JabRef:main with commit 47d438b Jul 23, 2025
1 check passed
@koppor koppor deleted the feat-cayw-params branch July 23, 2025 14:09
dcarpentiero pushed a commit to dcarpentiero/jabref that referenced this pull request Jul 24, 2025
* add GuiHolder

* remove disable wadl

* refactor guibridge

* replace ListChangeListener with WeakListChangeListener for garbage collection

* replace ListChangeListener with WeakListChangeListener for garbage collection

* refactor

* add active database to guibridge

* refactor selection of Entries through GuiBridge and added Command Resource for executing commands through http

* update SelectEntriesCommand

* add sources to jbang

* fix tests

* fix tests

* rework StateManager

* fix ServerTest

* rename CliStateManager and remove extends from the GuiStateManager to make instanceof possible

* remove sout

* add empty returns to JabRefSrvStateManager

* add CommandSelectionTab Interface

* add sources to jbang

* remove old comments

* refine

* changes requested by koppor

* removed or else

* change to use identity

* change indent
@subhramit subhramit added project: gsoc component: cite-as-you-write cayw (similar to better-bibtex for Zotero) labels Aug 16, 2025
@palukku palukku changed the title add select entries cayw feature and command endpoint Feat: Add select entries CAYW feature and command endpoint Nov 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: cite-as-you-write cayw (similar to better-bibtex for Zotero) project: gsoc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable jump to entry CAYW Zotero Endpoint

4 participants