-
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
Import Configurations #5038
Import Configurations #5038
Conversation
c5bb957
to
ad57ffa
Compare
Kitodo/src/main/java/org/kitodo/production/enums/ObjectType.java
Outdated
Show resolved
Hide resolved
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 have only looked over the code so far the application test still follows.
The implementation is great have found a few small things that can be adjusted.
Following question from my side:
- Can you add the known issues as a GitHub issue or will they be provided directly to this PR next?
- For my interest: Currently the database tables are created via flyway. Doesn't JPA or Hibernate already do this?
- Are there plans to migrate existing XML's? Or will this just have to be done manually.
- Default of kitodo_opac.xml "K10Plus OPAC PICA" should be should be created initially. (I have not tested it yet whether it may already happen :))
Kitodo/src/main/webapp/WEB-INF/templates/includes/processFromTemplate/dialogs/fileUpload.xhtml
Show resolved
Hide resolved
Kitodo/src/main/webapp/WEB-INF/templates/includes/processFromTemplate/dialogs/import.xhtml
Show resolved
Hide resolved
Kitodo/src/main/webapp/WEB-INF/templates/includes/processFromTemplate/dialogs/searchEdit.xhtml
Show resolved
Hide resolved
Kitodo/src/main/webapp/WEB-INF/templates/includes/importConfigurationEdit/rows/formatRow.xhtml
Show resolved
Hide resolved
Kitodo/src/main/webapp/WEB-INF/templates/includes/importConfigurationEdit/rows/formatRow.xhtml
Show resolved
Hide resolved
...c/main/webapp/WEB-INF/templates/includes/importConfigurationEdit/processTemplateFields.xhtml
Show resolved
Hide resolved
...do/src/main/webapp/WEB-INF/templates/includes/importConfigurationEdit/opacSearchFields.xhtml
Show resolved
Hide resolved
...rc/main/webapp/WEB-INF/templates/includes/importConfigurationEdit/newSearchFieldDialog.xhtml
Show resolved
Hide resolved
@solth When starting "opac-config" branch application does not deploy cause of following error:
Flyway is executed. Is something missing or is there something I haven't thought of? |
Have you updated your local |
See last paragraph in pull request description. I would prefer to add the issues once this PR is merged since they would not actually apply to the master branch before the merge.
Maybe, I don't know. I used flyway because that's how we always made changes to the database in the past (not a really good reason, I guess, but at least this guarantees all changes made to the database tables can be found in one place within the repository)
Yes, as a future development I would like to add an XML configuration import/export tool (see last paragraph in pull request description)
Can that be done in a separate pull request or do you think it has to be added to this one? |
Please fix ST test |
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.
Finished review but i will test the behavior next.
Kitodo/src/main/webapp/WEB-INF/templates/includes/projects/importConfigurations.xhtml
Outdated
Show resolved
Hide resolved
Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/ImportConfiguration.java
Outdated
Show resolved
Hide resolved
Kitodo/src/main/webapp/WEB-INF/templates/includes/processFromTemplate/dialogs/searchEdit.xhtml
Show resolved
Hide resolved
Kitodo/src/main/webapp/WEB-INF/templates/includes/processFromTemplate/dialogs/fileUpload.xhtml
Show resolved
Hide resolved
Kitodo/src/main/webapp/WEB-INF/templates/includes/processFromTemplate/dialogs/import.xhtml
Show resolved
Hide resolved
@markusweigelt thanks for the review remarks. Concerning the |
Okay, I had expressed myself in a misleading way. I meant something like that.
If that is not too cumbersome otherwise the initial variant without toString also suits me. |
@solth @Kathrin-Huber The selenium test does not run here yet because the Chrome Drive version does not fit to the current Chrome version. Created an update PR #5155 for that. The source code is also great except for the few notes. Currently, the search fields I created are not yet displayed in the search field selection. |
@Kathrin-Huber For the manual test I have the following information sources: the existing opac config files, the tests and the descriptions on the fields. The most of the fields I can guess what is meant based on the information sources. Some fields are not clear to me and are not available in Import Configuration at first glance. e.g.
or
or
Others are present but not in the information sources I have e.g. I can only look over with limited knowledge because I still lack the knowledge in catalogue configuration what is needed and whether something is missing. Here a specialist should look over it again. From my side I can only say that we need a user documentation here since some topics are not self-explanatory. If there is already one for the XML configuration, it should be adapted within another issue. |
I will rebase this branch against the master to update the Chrome driver version because your PR has already been merged.
I think this is because all your search fields are set to "visible=false" (according to the screenshot you provided, each search field has a "-" in the "Sichtbar"/"Visible" column) |
I am not sure if this would bring any advantage in our case, because we do not require the full enum constants or any potential properties here but just their names. I think using the |
@markusweigelt I added another commit to this branch to set the default value of "visible" to "true", because that should be the normal case for SearchFields. |
@markusweigelt I agree, we need a better documentation for all these import configuration fields. The "?" buttons next to the fields was a first attempt to place the required information as close to the actual input fields as possible, but the preliminary help texts I added as a first draft are far from perfect and should be improved upon in a subsequent pull request. Let me just quickly explain these fields you mentioned by name:
If
The |
@solth Thx I like the approach with the tooltips. I also wanted to implement this approach, but I did not get around to it. Good that you implemented this now. Here is the question whether a documentation can be replaced with it. From my opinion the texts need to be described in more detail and, at best, backed up with an example. The question here is whether a tooltip is sufficient to store more documentation with html stucture and formattings. Besides a wiki page makes sense to describe the concept for non-savvy users. The configuration works well so far. The import then worked with a test ruleset and XSL. However, I have only tested it through with a fraction of the configuration. |
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.
Appoved code and implementation but I think we run into problems here (e.g. communication overhead among others due to questions of developer and normal user, deciding whether bug or error in the configuration etc.) when setting up or migrating the catalogs without comprehensive documentation.
Please resolve conflicts |
…fault configurations
This pull request introduces a new
ImportConfiguration
class that holds information about specific ways to import metadata in Kitodo.Production, thus replacing the current configuration filekitodo_opac.xml
.Each
ImportConfiguration
can have one of the following types:OPAC_SEARCH
: corresponds tocatalogue
entries in thekitodo_opac.xml
with<fileUpload>false</fileUpload>
(or no<fileUpload>
setting at all) and offers the same settings relevant for this type of configuration, like URL, search interface type (SRU, OAI etc.), search fields, default import depth etc.FILE_UPLOAD
: corresponds tocatalogue
entries in thekitodo_opac.xml
with<fileUpload>true</fileUpload>
and offers the settings relevant for this type of configuration, like file format, metadata format and mapping file for included parent recordTEMPLATE_PROCESS
: represents a configuration where a specific template process is preselected as the source to copy metadata when creating a new processImportConfigurations can be created and edited via the GUI instead of having to edit an XML file on the server. This allows Kitodo system admins with appropriate permissions (also added in this pull request) to configure everything necessary via the frontend without depending on file system access on the server.
Moving the import configurations from the
kitodo_opac.xml
configuration file to the database and allowing the user to edit it via the GUI brings the following advantages:Additionally, xslt mappings are now also saved as
MappingFile
entites to the database and mapped to import configurations. Mapping file entites now also save information about which input metadata format is transformed into which output metadata format. This way, the system can validate that the metadata format of the configured search interface or upload file fits the configured metadata format and is eventually transformed into the internal Kitodo metadata format.The configuration edit mask also shows tooltips for all import configuration input fields to support the user when editing configurations.
Known issues:
when adding new fields the "Add search field" popup dialog does not reset it's values-> doneImportConfigurations assigned as default configurations can be deleted which leads to subsequent null pointer exceptions; this should be prevented-> doneImprovements:
kitodo_opac.xml
file has not been removed in this pull request, because thedocTypes
section is still used somewhere and the system crashes if the file cannot be found -> Remove catalog configurations from "kitodo_opac.xml" #5262the "Hidden" value for "SearchFields" should be inverted to "Visible" and be "true" by default-> doneOPAC_SEARCH
as the setting type, added an interface URL and then changed the configuration type toFILE_UPLOAD
, the host url will still be saved to the database, even though it's not used for file uploads)Potential future developments:
kitodo_opac.xml
files; for this the existingOPACConfig.java
class could be used, which is the reason I haven't deleted it yet, even though it's unused at the moment -> Importer for kitodo_opac.xml #5224If this pull request gets merged, bugfix/improvement/feature issues should be created for the points listed above.
Part of #4322
Dokumenation: https://github.com/kitodo/kitodo-production/wiki/Projektauswahl-und-Katalogsuche