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

Prevent duplicate and invalid titles #6326

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

BartChris
Copy link
Collaborator

Fixes
#6303
#6055

@BartChris BartChris force-pushed the fix_duplicate_titles branch 2 times, most recently from e8c63dd to f23289c Compare November 22, 2024 12:51
@@ -367,7 +367,7 @@ public enum ParameterCore implements ParameterInterface {
/**
* Validation of process title via regular expression.
*/
VALIDATE_PROCESS_TITLE_REGEX(new Parameter<>("validateProzessTitelRegex", "[\\w-]*")),
VALIDATE_PROCESS_TITLE_REGEX(new Parameter<>("validateProzessTitelRegex", "^[a-zA-Z0-9_-]+$")),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the new default value not even updated in the kitodo_config.properties files?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am wondering: This is a hard limitation of the Kitodo software, some titles lead to problems later. Should we allow to change that in the config.properties at all? Or should we hardcode that in the application? Additionally one can think of allowing additional regexes which might be checked on top of the minimal requirements. See #6055

cc @solth

Copy link
Collaborator

Choose a reason for hiding this comment

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

At SLUB we allow even the . inside the process title as for historical reasons this was needed to create the processes. Maybe this can be changed now but this should be discussed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

One more note: the w meta character in regular expressions stands for a-z, A-Z, 0-9, including _ (underscore) . So the expression can be simplified to ^[\\w-]+$?

Copy link
Member

Choose a reason for hiding this comment

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

What about chosing a new parameter name "validateProcessTitle" which avoids the current "denglisch" (English-German mix)?

}

@Test
public void shouldNotAllowDuplicateTitles() throws Exception {
Copy link
Collaborator Author

@BartChris BartChris Nov 22, 2024

Choose a reason for hiding this comment

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

We probably have to take into account the configuration here. On some systems this is allowed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants