Commit 17c0eb2
Copy linked files on entry transfer (#13535)
* refactor(RightClickMenu): pass libraryTab to createCopySubMenu
Allows tracking the source BibDatabaseContext for later use in pasteEntry()
* feat(ClipBoardManager): add static BibDatabaseContext field with getter and setter
Enables tracking the source database context for use in pasteEntry()
* refactor(ClipBoardManager): change sourceDatabaseContext to instance variable
* feat(RightClickMenu): set sourceBibDatabaseContext from libraryTab
* feat: add LinkedFileTransferHelper#adjustLinkedFilesForTarget call to CopyTo#copyEntriesWithFeedback and LibraryTab#pasteEntry
* feat(CopyTo): support file preferences in copy operations
Add filePreferences parameter to CopyTo.java to enable
LinkedFile#findIn functionality
* feat(LinkedFileTransferHelper): add new helper class to support Entry transfer
* feat(LinkedFileTransferHelper): add helper to check reachability from primary directory
* test(LinkedFileTransferHelperTest): add test cases for LinkedFileTransferHelperTest#isReachableFromPrimaryDirectory method
* feat: adjust relative file paths after entry transfer between libraries
* feat(ImportHandler): clone entry in importEntryWithDuplicateCheck
Cloning the BibEntry in importEntryWithDuplicateCheck to ensure that
any file path adjustments during the copy/paste process do not affect
the original entry in the source database.
This avoids side effects when imported entries are modified (e.g. file links),
especially when the same BibEntry instance is shared between databases.
* chore: update LinkedFileTransferHelper#adjustLinkedFilesForTarget calls in LibraryTab and CopyTo to align with new method signature
* refactor: update LibraryTab#pasteEntry to copy with feedback
* feat(LinkedFileTransferHelper): enhance linked file adjustment and copying logic during entry transfer
* test(LinkedFileTransferHelperTest): add tests for all three scenarios
* docs(requirements): add file transfer requirements specification
* chore: remove unnecessary comments and adjust filed.ms to increment the heading leven only by one
* chore: replace Collection constructors with factories
* chore: remove DisplayNames for test classes
* chore: replace assertTrue with assertEquals
* refactor: change method signature to have boolean parameter last and change to collection constructors again
* refactor: replace IOException with Exception in the throws clause and remove unnecessary throws clauses
* refactor: remove unused import
* refactor: remove static modifier
* fix: add messages for pasting entries in the properties file
* chore: use BibEntry copy constructor in LinkedFileTransferHelper for #13615
- Replaced clone() with BibEntry copy constructor in LinkedFileTransferHelper.
- Updated tests to reflect removal of Cloneable from BibEntry.
* chore: align with style rules
* fix: improve error logging and update assertions in LinkedFileTransferHelper
* fix: reorganize imports and improve code formatting in LinkedFileTransferHelper
* fix: rename filed.md to files.md for clarity
* docs: add requirement traceability comments to LinkedFileTransferHelper
* fix: replace file existence check with atomic copy and exception handling
* chore(LinkesFileTransferHelperTest): replace setters with withers
* chore(LinkesFileTransferHelperTest): change back to setters
* fix: reject null in setSourceBibDatabaseContext to enforce fail-fast
* test: update LinkedFileTransferHelperTest to use Set for returned entries and consolidate assertions
- Replace multiple individual assertions with single assertEquals calls comparing expected and actual Sets of BibEntry
- Improves test clarity and maintainability by bundling assertions into one comprehensive check
* docs: clarify definition of "reachable" for linked files in file transfer context
* chore: add line for separation
* refactor: remove requireNonNull
* docs: update file transfer documentation for clarity and consistency
- pulled up the reachable definition before the list of requirements
* refactor: streamline linked file adjustment by using ifPresent for source context
* chore: move getSourceBibDatabaseContext method to improve code organization
* chore: fix indentation in module-info.java after rebase
* refactor: move clipboard context setting from RightClickMenu to EditAction#execute
- Removed clipBoardManager.setSourceBibDatabaseContext(...) from RightClickMenu
- Set the clipboard context dynamically in EditAction before copy and cut actions
- Improves separation of concerns and ensures correct clipboard context regardless of input method (menu, keyboard shortcut, toolbar)
* test: refactor test to align with project standards
- Uses proper camelCase instead of underscores
- Replaces nested classes with region/endregion comments
- Adds comprehensive test coverage for different file preference scenarios
* chore: change indents to 4 spaces to align with project standards
* chore: change indents to 4 spaces to align with project standards in LibraryTab and EditAction
* chore: use Optional without fully qualified class name
* chore: fix import order
* refactor: improve exception handling in file path adjustment
Remove overly broad Exception catch since no checked exceptions
are thrown in this block
* refactor: add nonnull annotation to parameters
* refactor: remove null check
BibEntry#getFiles will not return null, null check is unnecessary
* fix: use shared ClipBoardManager in EditAction
Previously, EditAction created a new ClipBoardManager, which caused copy, cut, and paste to not use the shared manager. Now EditAction uses the shared ClipBoardManager, fixing copy/paste and drag & drop behavior in the right-click menu and elsewhere.
* fix: remove unnecessry injector and adjust dropEntry to handle drag and drop
* chore: remove unused import
* refactor: update dropEntry methods to include source BibDatabaseContext for linked file adjustments
* refactor: remove databasecontext from FrameDndHandler again
* refactor: remove unused imports
* refactor: set databasecontext in FramDndHandler
* Add Nullable annotation
* Rename variable
* Fix typo in JavaDoc
* Better filename in case of tabs with same filename
* refactor: streamline clipboard management and linked file adjustments
* chore: remove unused import
* chore: remove block in switch expression
* Feature: Add option to deactivate the new feature by adjusting the file preferences
Users should be able to disable the automatic file adjustment/copying during transfers
via a preference setting (default: enabled).
* chore: adjust test cases to enable file copy feature
* chore: replace Collections#emptySet with Set#of to align with best practices
* chore: remove unused import
* refactor: extract copyEntiresWithFeedback method to own utility class
* chore: fix import order issues
* chore: fix import order issues in LinkedFileTransferHelper
* chore: fix localization issues
* chore: fix formatting issues
* chore: Update CHANGELOG: mention cut support
* Refine requirements
* WIP: Refine tests
* Add comment
* Fix condition
* Split condition to reduce load on the file system
* First version with FileTestConfiguration
* Update version
* Fix test
* Convert some tests
* Split up logging
* Adjust logging configuration
* Do nothing if file is not found
* Add another exit early
* Improve comment
* Refine data structure
* Introduce LinkMode for test files
* Minor logic change
* Add nullable annotation
* Move to "right" method
* Collect all imported files
* Add TODO
* Move entry selection to final import
* Move entries selection to tracker
* Add CHANGELOG.md entry
* Add forgotten method
* Remove class variables from method parameters
* Fix naming
* Remove more obsolete parameters
* Add sourceDatabaseContext - and file adjustment at import place
* More "natural" method paramter ordering
* Change algorithm
* Remove not-needed methods
* Add forgotten closing comment
* Fix logic
* other tests...
* Compilefix
* Use Optional instead of null
* Fix tests
* Fix test
* Begin to add BibTestConfiguration
* Finish BibTestConfiguration
* Fix tempDir - should be local to each test
* One more test
* Fix init
* New test configuraiton
* First round of "complete" tests
* tmpDir should be a local variable
* All tests are green
* Re-order test parameters
* Remove debugging "number"
* Adapt test
* Fix CHANGELOG.md
* Add TODO
* Re-link requirements
* Remove dead code (and adapt logging)
* Fix typo
* Add logger statement
* Refine code
* Semanticcal grouping in SrvStateManager
* Store BibContext and transfer mode in clipboard
* Refine comment
* Add ADR-054
* Remove unused variable
* Fix syntax
* Fix typo
* Split up into three properties
* Fix variable name
* Fix .fxml and add binding
* Refine wording
* Add skipping if not configured
* Remove obsolete =
* Fix recursion
* Fix linting issues
* Optimize imports...
* Fix imports
* Apply suggestions from code review
* Compilefix
* Fix CHANGELOG
---------
Co-authored-by: Umut Akbayin <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>
Co-authored-by: Christoph <[email protected]>1 parent 4ed4f04 commit 17c0eb2
File tree
128 files changed
+1455
-375
lines changed- build-logic/src/main/kotlin
- docs
- decisions
- requirements
- jabgui/src
- main
- java
- org/jabref/gui
- clipboard
- collab
- entrychange
- desktop/os
- dialogs
- duplicationFinder
- edit
- entryeditor
- citationrelationtab
- fileannotationtab
- errorconsole
- exporter
- externalfiles
- fieldeditors
- identifier
- frame
- git
- groups
- help
- importer
- actions
- fetcher
- linkedfile
- maintable
- mergeentries
- threewaymerge
- cell
- newentry
- openoffice
- preferences/linkedfiles
- preview
- search
- sidepane
- util
- walkthrough/declarative/sideeffect
- welcome
- resources
- org/jabref/gui
- ai/components
- aichat
- chatmessage
- summary
- cleanup
- commonfxcontrols
- consistency
- documentviewer
- edit/automaticfiededitor
- copyormovecontent
- renamefield
- entryeditor
- fieldeditors
- integrity
- newentry
- preferences
- ai
- linkedfiles
- websearch
- welcome
- components
- quicksettings
- test/java/org/jabref/gui
- edit
- entryeditor/citationrelationtab
- exporter
- externalfiles
- importer/actions
- sidepane
- jablib
- src
- main
- java/org/jabref
- logic
- externalfiles
- git/conflicts
- importer/util
- preferences
- model
- database
- resources/l10n
- test/java/org/jabref/logic/externalfiles
- jabsrv/src/main/java/org/jabref/http
- versions
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
128 files changed
+1455
-375
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 83 | + | |
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
| |||
179 | 177 | | |
180 | 178 | | |
181 | 179 | | |
| 180 | + | |
182 | 181 | | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
189 | | - | |
190 | 188 | | |
191 | 189 | | |
192 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | | - | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| 109 | + | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| |||
820 | 825 | | |
821 | 826 | | |
822 | 827 | | |
823 | | - | |
| 828 | + | |
824 | 829 | | |
825 | 830 | | |
826 | 831 | | |
| |||
832 | 837 | | |
833 | 838 | | |
834 | 839 | | |
835 | | - | |
| 840 | + | |
836 | 841 | | |
837 | 842 | | |
838 | 843 | | |
839 | 844 | | |
840 | 845 | | |
841 | 846 | | |
842 | 847 | | |
843 | | - | |
| 848 | + | |
844 | 849 | | |
845 | 850 | | |
846 | 851 | | |
847 | 852 | | |
848 | 853 | | |
849 | 854 | | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
| 855 | + | |
855 | 856 | | |
856 | 857 | | |
857 | 858 | | |
| |||
860 | 861 | | |
861 | 862 | | |
862 | 863 | | |
863 | | - | |
864 | 864 | | |
865 | | - | |
| 865 | + | |
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
872 | | - | |
873 | | - | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
874 | 884 | | |
875 | 885 | | |
876 | 886 | | |
| |||
888 | 898 | | |
889 | 899 | | |
890 | 900 | | |
891 | | - | |
892 | | - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
893 | 912 | | |
894 | 913 | | |
895 | 914 | | |
896 | | - | |
| 915 | + | |
897 | 916 | | |
898 | 917 | | |
899 | 918 | | |
| |||
0 commit comments