Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pdf exporter - delete xmp actions in the menu bar and the cli option #3947

Merged
merged 11 commits into from
Apr 13, 2018

Conversation

johannes-manner
Copy link
Collaborator

@johannes-manner johannes-manner commented Apr 12, 2018

The idea is, to use a new exporter for writting bib entries to pdf metadata.
It enables users to select entries and export these entries via File->Export Selected Entries to a pdf file.
This exporter can also be used within the -o cli infrastructure.

java -jar JabRef.jar -o path/article.pdf,pdf path/entries.bib

Therefore, the xmp cli and the xmp actions in the menu bar can be deleted.

Opinions?


  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • Screenshots added in PR description (for bigger UI changes)
  • Ensured that the git commit message is a good one
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)

@johannes-manner johannes-manner changed the title Pdf exporter - delete xmp actions in the menu bar and the cli option [WIP] Pdf exporter - delete xmp actions in the menu bar and the cli option Apr 12, 2018
@tobiasdiez
Copy link
Member

I think having a PdfExporter (maybe rename to XmpPdfExporter?) is a good idea, especially for the cli support we get in this way. However, I would keep the "Write XMP" action in the menu. Personally, I would never look under "Export" when I want to to add metadata to my pdfs, although you are of course right that technically it is an export of some kind.

Deleted the -xmp cli option, because the pdf exporter has now the same functionality and is embedded within the common cli exporter infrastructure.
@johannes-manner
Copy link
Collaborator Author

johannes-manner commented Apr 13, 2018

I deleted the cli option -xmp (integrated with #3756), because the new XmpPdfExporter now enables the cli interaction via the -o exporter mechanism.

Maybe, we can automize the writing to xmp via a preference setting. I discussed this yesterday with @stefan-kolb. Imagine a workflow, where I save my bib database and all changed entries are written to the linked pdfs. I would try to implement this in another PR.

@johannes-manner johannes-manner changed the title [WIP] Pdf exporter - delete xmp actions in the menu bar and the cli option Pdf exporter - delete xmp actions in the menu bar and the cli option Apr 13, 2018
@johannes-manner johannes-manner added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 13, 2018

@Override
public void export(BibDatabaseContext databaseContext, Path pdfFile, Charset encoding, List<BibEntry> entries) throws Exception {
if (pdfFile.toString().endsWith(".pdf")) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary? I think for an export it should not play a role if my flie is named test.asdf for export, as long as the format is correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it is necessary, because the xmp write functionality in this case tries to load a pdf file and writes the xmp metadata explicitly only to pdf files. Other usage makes no sense here.

There is also the xmp exporter, where you can use file names like "test.asdf" to write your metadata

@Siedlerchr
Copy link
Member

Please have a look at the faling exporter test. Then we can merge

@Siedlerchr Siedlerchr merged commit 1d9ce25 into JabRef:master Apr 13, 2018
Siedlerchr added a commit that referenced this pull request Apr 13, 2018
* upstream/master:
  Pdf exporter - delete xmp actions in the menu bar and the cli option (#3947)
  Improve search performance (#3950)
  New Crowdin translations (#3949)
  Update dependencies for junit, mockito and checkstyle (#3951)
  Add XMP Exporter (#3895)
  Switch colors of search icon for the two search modes (#3871)

# Conflicts:
#	src/main/java/org/jabref/gui/search/GlobalSearchBar.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants