Add option to delete XMP metadata#8681
Conversation
… currently the button uses the Preferences's xmp Privacy Filter to delete. In deletion, the functionality mirrors XmpUtilWriter except that it still lacks DublinCore settings and it does not set the other fields to whatever values the filter does not include.
disable filter list if select-all is checked change to XmpPreference class to add field for select-all
|
Thanks for your contribution, please setup Jabrefs code style for intellij https://github.com/JabRef/jabref/tree/main/config |
|
|
Regarding the code style warnings. You can go to the "Files" tab in this PR and see the warnings directly. Deep link: https://github.com/JabRef/jabref/pull/8681/files Screenshot: May we ask that you DO NOT reformat the JavaDoc comments when you do not touch them? Reformatting then to a single line makes them more hard to read. |
The previous commit formatted the javadoc This reverts commit ced851f.
koppor
left a comment
There was a problem hiding this comment.
A short review with some comments. More comments will follow, but you can work on the current comments if you want!
| optionsDialog.getProgressArea().appendText(" " + Localization.lang("Error while deleting") + " '" | ||
| + file.toString() + "':\n"); |
There was a problem hiding this comment.
Localization works in a different way. See https://devdocs.jabref.org/getting-into-the-code/code-howtos#using-localization-correctly for details.
In short: Use placeholders instead of string concatenation.
Currently, we log the exception (Logger.error(...)), but we do not show the concrete error in the UI.
(The developers should refine https://devdocs.jabref.org/getting-into-the-code/code-howtos#outputting-errors-in-the-ui accordingly).
| Platform.runLater(() -> optionsDialog.getProgressArea() | ||
| .appendText(" " + Localization.lang("Skipped - No PDF linked") + ".\n")); |
There was a problem hiding this comment.
Isn't it possible to collect the messages using a StringJoiner and then output it as a whole?
There was a problem hiding this comment.
Yes, please see the changes.
| } | ||
| } | ||
|
|
||
| errors = entriesChanged = skipped = 0; |
There was a problem hiding this comment.
Please split up into multiple lines - we do not have the joined assignements as code style.
| if (optionsDialog == null) { | ||
| optionsDialog = new OptionsDialog(); | ||
| } |
There was a problem hiding this comment.
Shouldn't the options dialog be recreated at each run? To ensure that the information messages are empty at each run? If not, please comment here why caching is a good idea
There was a problem hiding this comment.
I took your suggestion and recreated at each run.
|
|
||
| private void DeleteMetadataFromFile(Path file, BibEntry entry, BibDatabaseContext databaseContext, BibDatabase database) throws Exception { | ||
| XmpUtilRemover.deleteXmp(file, entry, database, xmpPreferences); | ||
| embeddedBibExporter.exportToFileByPath(databaseContext, database, filePreferences, file); |
There was a problem hiding this comment.
I don't know what this does? export does not read as delete. (Don't have the code at hand currently).
There was a problem hiding this comment.
The export, the second line, is removed and it still have its intended function
…to same file, also fix some small text
consider select-all-fields when filling dublin core schema rename test file
…rtSingleEntryWithPrivacyFilter test method in XmpExporterTest class
…-for-issue-8277
|
|
For the changes:
|
|
You are welcome! I am impressed with the amount of changes that needed to be done for this feature. Thank you! Will try out this pull request within the next 3 days. |
|
@koppor I fixed the check style and it passed the check style test. However, the fetcher test failed here but passed on my fix branch 'revise-8277' on my repository. Which, I then merged to this branch. I read the log, and there seems to be a network problem if I'm not mistaken. Can I do something here? |
|
I just did some testing: Test A)
Test B) |
|
Problem: Selecting the field
This seems a lot for one single option and will lead to confusion. At the very least, there needs to be some kind of documentation. Maybe this can be separated into separate tickable preference? Another option would be renaming. How about: Underneath the option, put following text: |
|
I would be happy, if you could address my remarks! |
|
@ThiloteE So when deleting, we don't need to consider any information about the library data of entry (whether fields to be deleted are also in the entry...). Is that right? Regarding ambiguity, we are leaning more toward the second option (Clearer description) because it seems simpler for us. |
…ta of entry some changes to interface in XmpUtilRemover some changes to JavaDoc some changes to test add description to test add text description to privacy filter tab
+1 for that. - I think, the intention of the issue is to clean-up the meta data of a PDF (as you shown in the screenshots). The preference setting was more a privacy setting - maybe, we should remove that setting in the future. --> @ThiloteE Let's discuss the use cases and workflows soon. |
|
@ThiloteE
Regarding ambiguity, we added the description: Problem/Confusion we have:
|
|
I will try it. What do I have to do to start "Linked file view model"? E.g. how can I find the dialogue for what you show in the picture beneath 5.? |
|
@ThiloteE |
|
Ah, and I had a lot of Typos in my text. It does not really look good. Here, this is a better text: Underneath the option, put following (or something similar) text and format it in a way that looks nice! :D To do in a follow up pull-request: |
|
But looking already pretty good. You are definitely getting closer to the desired outcome! |
|
got it, we will follow up very soon |
|
what is the status here? |
|
@ThiloteE There is a delay on the work, but we are still working on it! We will let you know once we have the changes. |
|
ok thanks! :))) |
|
any update here? |
|
Attempt at summarizing this PR: As far as I remember Done:
To Do:
To Do In Follow Up PR:
|
|
Closing this issue due to inactivity 💤 |




















Fixes #8277
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)Hi, I am working with Jefferson on this issue and we made some changes to fix issue #8277.

Our changes added a button to delete metadata that are selected under xmpPreferences in the screenshot here.
We also added a checkbox to include all fields inside the xmpPreferences, which should select all fields of an entry.The UI works as follows:
There are some problems that we face: