Skip to content

[FEATURE] Add a automated "bootstrap" pagetree setup#1979

Open
csidirop wants to merge 2 commits into
kitodo:mainfrom
csidirop:feat/pagetree-bootstrap
Open

[FEATURE] Add a automated "bootstrap" pagetree setup#1979
csidirop wants to merge 2 commits into
kitodo:mainfrom
csidirop:feat/pagetree-bootstrap

Conversation

@csidirop

Copy link
Copy Markdown
Contributor

This PR adds a automated root page tree setup via the new tenant module or CLI.

The bootstrap pagetree looks like one the DFG-Viewer sets up, with a root page, a viewer page, and a configuration folder. It also creates a site configuration and root TypoScript template with the required sets and constants to render the Basic Viewer.

It introduces the logic needed to create a new root page, site configuration, viewer page, configuration folder, and root TypoScript template for the standalone Basic Viewer. It can be setup via new UI element in the new tenant module or a CLI command.

pagetree-gen pagetree

This PR builds on top of the Basic Viewer PR.

Changes

  • add BootstrapRootSetupService to create the page tree and site configuration
  • add TYPO3 site configuration from Resources/Private/Data/BootstrapSiteConfig.yaml
  • include the required TypoScript sets:
    • Basic Configuration
    • Install Basic Viewer
  • write the required template constants:
    • plugin.tx_dlf.persistence.storagePid
    • plugin.tx_dlf.basicViewer.rootPid
    • plugin.tx_dlf.basicViewer.viewerPid
  • trigger a backend page tree refresh after creating the default page tree from the module!!
  • add the CLI command to run the setup from the command line, which may be useful for scripting and testing purposes:
    • kitodo:setup with default values or
    • with custom values:
      • --identifier=<CUSTOM_IDENTIFIER>
      • --base=/<CUSTOM_BASE>/
      • --root-title="<CUSTOM_ROOT_TITLE>" \
      • --root-slug=/<CUSTOM_ROOT_SLUG>/ \
      • --viewer-slug=/<CUSTOM_VIEWER_SLUG>/ \

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(); }">
@csidirop

Copy link
Copy Markdown
Contributor Author

I will take a look into those codacy issues on monday

@csidirop csidirop force-pushed the feat/pagetree-bootstrap branch 3 times, most recently from 0242892 to 242f81a Compare May 18, 2026 13:06
Signed-off-by: Christos Sidiropoulos <dev@csidirop.de>
@csidirop csidirop force-pushed the feat/pagetree-bootstrap branch from 242f81a to 3d99b6d Compare May 18, 2026 13:55
@csidirop

Copy link
Copy Markdown
Contributor Author

Checked and fixed some issues. But I think Codacy is wrong about the escaping of the exception output.

Unit and PHPStan should be fine, don't know why they all failing now. Looks more like an github issue right now.

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