-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support output of metadata in docket creation #4968
Conversation
65f347f
to
106dded
Compare
58dfd45
to
9b7d526
Compare
please fix checkstyle |
9b7d526
to
0bbc69c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests (with and without parent metadata)
This comment was marked as resolved.
This comment was marked as resolved.
d8ae28f
to
f1b7c51
Compare
f1b7c51
to
ad89196
Compare
Kitodo-Docket/src/main/java/org/kitodo/docket/ExportXmlLog.java
Outdated
Show resolved
Hide resolved
Kitodo-Docket/src/main/java/org/kitodo/docket/ExportXmlLog.java
Outdated
Show resolved
Hide resolved
Please resolve conflicts |
f2e050c
to
2c5eab6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only a code review, no function review and beside my code remarks I have one more:
Changing nearly all methods to static
of the moved class and some of the existing methods in other classes only to get ride out of the new operator for the class instance is wrong as the static methods are violating against the poly morph principle of object operating programming and is a sign of lazy programming in my opinion.
Kitodo-Docket/src/test/java/org/kitodo/docket/ExportXmlLogTest.java
Outdated
Show resolved
Hide resolved
<groupId>commons-collections</groupId> | ||
<artifactId>commons-collections</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- used version of commons-collections is very, very old and should be replaced by commons-collections4
- in the new created unit test there is no usage of this library or I did not see the usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apache Commons XMLConfiguration needs it. When I don’t add it, the test throw NoClassDefFoundError: org/apache/commons/collections/CollectionUtils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is then the used scope test
right? Should then the scope not changed to the default value so this dependency is visible and not hidden solved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is only needed for the test to work. Don’t ask me why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is, that this dependency exists somewhere else too and is resolved there and as the application provide all needed dependencies the dependency here is solved in a "hidden" (or magic) way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed test
scope
Kitodo/src/main/java/org/kitodo/production/services/data/ProcessService.java
Outdated
Show resolved
Hide resolved
Please rebase against master to fix broken Github CI builds! |
591edd2
to
cc0b700
Compare
- make metadata available for docket generation - use docket module to save XML log (= input to docket XSLT procss) - deduplicate code
d8e7d48
to
8f2617b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again only a code review as we did not use this feature:
Looks okay but I don't see any requirements to made a lot of methods static. This may be possible but I don't likes static methods except for only a few tiny reasons.
A function is |
Independent of the "static method" changes I'm unsure if all this changes should belong to the "Kitodo-Docket" module as this module in my understanding is only for creating the dockets and not for general generating pdf files depending on xslt, xml and meta data of the process. Maybe this should be discussed first before the changes are made. |
The sole purpose of generating the XML log is to create the docket from it. Previously, there were two places where the XML log was generated (duplicate code), one copy in the core for saving it to the user folder, and another copy in the docket module for creating the docket. These two have now been deduplicated and the code now only exists once. In addition, due to incomplete copy-paste, the saved XML log was not exactly identical to what was generated in the Docket module, so if you developed an XSLT for a docket for a customer and it ran with the saved XML log, it still didn't work reliably with the docket module. This was very nerve-wracking when the customer wants many adjustments to the docket.xslt. I think this change makes sense for both reasons, code deduplication and better configurability. |
This may be true (I did not validate your statement in any little detail) but and in mind of the current module concept the base (generating the XML log) should then be in a separate module and the current docket module should depend on this new module or if there are only some common logic: the common logic should be in one module and the outputs in two depending modules of this common module. But I don't know if the current module concept is still valid or not. Maybe this should be discussed but there is no discussion ongoing as no one is participating as everyone has only his/her stuff to do. So @solth should be decide if this changes should all go into the current docket module or not. |
Hi @henning-gerhardt: I removed the I think the questions of dividing the functions into modules, and how to proceed at all with the modularization of the source code (there are quite a few more open questions, I think), are important, and you are welcome to open a GitHub discussion for this. |
I can review this maybe next week and I'm discussing some in deep details only in my native language. |
Fixes #4964, fixes #4963, fixes #4984