Skip to content

Conversation

@solth
Copy link
Member

@solth solth commented Jan 22, 2026

I have spoken to quite a few Kitodo users over the years who were not aware of the option to link subordinate processes via the "Neues Strukturelement" dialog in the metadata editor.

That dialog can be opened using the context menu option "Element hinzufügen" of the structure tree in the metadata editor of Kitodo:

Bildschirmfoto 2026-01-22 um 20 30 35

The reason for the option to link processes being so little known among users is that the corresponding functionality is well hidden behind a inconspicuous little checkbox in the dialog that many users don't notice:

Bildschirmfoto 2026-01-22 um 20 22 06

Activating this checkbox completely replaces the content of the dialog with a search mask to link a subordinate process instead of adding a new structural element:

Bildschirmfoto 2026-01-22 um 20 23 33

Apart from effectively hiding this option, the whole dialog with conditionally rendered components and buttons makes for very awkward template code.

To improve this situation I separated the two functionalities into separate dialogs that can now be opened directly via individual context menu options.

The first option, "Element hinzufügen":

Bildschirmfoto 2026-01-22 um 20 36 14

leads to the dedicated dialog for adding structural elements:

Bildschirmfoto 2026-01-22 um 20 36 03

and the second option, "Untergeordneten Vorgang verknüpfen":

Bildschirmfoto 2026-01-22 um 20 26 44

leads to the dedicated dialog for linking processes:

Bildschirmfoto 2026-01-22 um 20 36 23

@solth solth requested a review from thomaslow January 22, 2026 19:32
@solth solth force-pushed the link-process-dialog branch from 4260337 to 429efa6 Compare January 23, 2026 09:03
@solth solth requested review from BartChris and removed request for thomaslow January 26, 2026 07:45
@solth solth force-pushed the link-process-dialog branch 2 times, most recently from df54bda to 9a56e2d Compare January 28, 2026 10:09
@BartChris
Copy link
Collaborator

BartChris commented Jan 28, 2026

Yes, very good idea, which works nice on first tests.
One related thing i noticed is that i have problems searching for a process by its ID, searching for its title works. But i have to check in more depths, what exactly is failing in the ID search and whether this is a general bug.

Edit: ID search seems to work. It seems like i can only search for processes which are not already linked, which is the right behaviour. So if the process is not already linked or is unlinked and then this unlinking is saved, searching for ID and title works.

@solth
Copy link
Member Author

solth commented Jan 28, 2026

Edit: ID search seems to work. It seems like i can only search for processes which are not already linked, which is the right behaviour. So if the process is not already linked or is unlinked and then this unlinking is saved, searching for ID and title works.

There might be some quirks in the general functionality of this feature - some search results I got sometimes seemed incomplete, but I was unable to detect a pattern.

In any way, I did not change the implementation of the search (which should therefore be identical to the main branch) but just splitted the "link process" and "create structure" functions into individual context menu options and dialogs. My suggestion would be to work on the underlying functionality of "link process" separately (if necessary)

@BartChris
Copy link
Collaborator

BartChris commented Jan 28, 2026

I tracked your changes and so far i cannot see any difference in behaviour, all the refactorings are good and make the code better.

One functional thing: Right now it seems, that it is not checked whether the selected doctype can actually have child processes. The button is always displayed although e.g. "volumes" in my test system cannot have child processes. Should we also check whether the selected doctyp can have children?

image

@solth
Copy link
Member Author

solth commented Jan 28, 2026

One functional thing: Right now it seems, that it is not checked whether the selected doctype can actually have child processes. The button is always displayed although e.g. "volumes" in my test system cannot have child processes. Should we also check whether the selected doctyp can have children?

Good idea, I will add a corresponding check!

@solth
Copy link
Member Author

solth commented Jan 28, 2026

@BartChris I added a check for document types that are allowed as child structures for the currently selected tree node. I no such document type is allowed as child structure, the context menu option to link subordinate processes is not displayed.

Due to the complexity of this check I moved it from DataEditorForm to DataEditorService. I am unsure if the condition checks for the other context menu items (like isAddingElementPossible) should be moved to the service class as well - for uniformity - because they are less complex. Thus, creating corresponding methods in the service class does not seem mandatory to me, in this case, but if you disagree I can adjust that as well.

Copy link
Collaborator

@BartChris BartChris left a comment

Choose a reason for hiding this comment

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

I am fine with your changes and only added one suggestion for simplification; i had hoped that we could do this useful check for substructures with less code, or could reuse existing methods from ProcessService (canCreateChildProcess()) but underestimated the complexity.

@solth
Copy link
Member Author

solth commented Jan 29, 2026

@BartChris thanks for the review. I applied your code suggestion.

i had hoped that we could do this useful check for substructures with less code, or could reuse existing methods from ProcessService (canCreateChildProcess()) but underestimated the complexity.

Maybe there is room for reducing the complexity, but this is the simplest sollution I could come up with.

@solth solth force-pushed the link-process-dialog branch from 1d7e419 to 4054bcc Compare January 29, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants