Skip to content

[FEATURE] Add a tenant setup CLI command#1980

Open
csidirop wants to merge 3 commits into
kitodo:mainfrom
csidirop:feat/tenant-setup-cli
Open

[FEATURE] Add a tenant setup CLI command#1980
csidirop wants to merge 3 commits into
kitodo:mainfrom
csidirop:feat/tenant-setup-cli

Conversation

@csidirop

Copy link
Copy Markdown
Contributor

This PR adds a new tenant setup flow, which does exaclty the same as the original new tenant backend module but is accessible through a new CLI command.

It introduces a dedicated CLI command for applying tenant defaults to an existing configuration folder and refactors the backend new-tenant module so that both use the same shared setup logic and future changes affect both.

This PR builds on top of:

  1. the Basic Viewer PR
  2. the root page tree setup

Changes

  • add the CLI command:
    • kitodo:tenantSetup --config-page=<uid> for all
    • or one or multiple for individual setup:
      • --namespaces
      • --structures
      • --metadata
  • make the CLI and backend module share one implementation for tenant defaults
    • add TenantModuleSetupService
    • add TenantDefaultsSetupService
  • support full tenant setup or selected setup steps:
    • --namespaces
    • --formats as alias for --namespaces
    • --structures
    • --metadata
    • --solr-core

New Tenant module refactor

This PR moves significant parts out of the original NewTenantController. I did not find a nice other way.

Because the tenant setup logic is now shared between the backend module and the CLI command, it makes sense to extract that logic into shared services. The NewTenantController now acts as a coordinator that delegates to those services.

  • NewTenantController acts as a coordinator
  • setup actions delegate to TenantDefaultsSetupService
  • the same service is used by the CLI command

This hopefully keeps the backend and CLI behavior aligned and avoids maintaining two separate implementations of the same setup steps.

Signed-off-by: Christos Sidiropoulos <dev@csidirop.de>
This installation already includes a working viewer page and a prepared configuration folder.
</p>

<form class="tx-dlf-default-viewer-input-form" action="{f:uri.page(pageUid: viewerPid)}" method="get" onsubmit="var input=this.querySelector('input[name='tx_dlf[id]']'); if(input){ input.value=input.value.trim(); }">
Signed-off-by: Christos Sidiropoulos <dev@csidirop.de>
@csidirop csidirop force-pushed the feat/tenant-setup-cli branch 2 times, most recently from 365afd3 to 009d389 Compare May 18, 2026 14:30
Signed-off-by: Christos Sidiropoulos <dev@csidirop.de>
@csidirop csidirop force-pushed the feat/tenant-setup-cli branch from 009d389 to 755eb98 Compare May 18, 2026 14:55
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.

2 participants