@dbp-toolkit/nextcloud
v0.1.0
Published
Host Digital Blueprint activities inside a Nextcloud app
Downloads
215
Readme
Nextcloud integration
@dbp-toolkit/nextcloud hosts Digital Blueprint activities inside an installed Nextcloud app.
It provides the activity shell, Nextcloud theme styles, and optional native file dialogs,
notifications, and Keycloak sign-in. It runs in the Nextcloud page, not the standalone toolkit
showcase, and is bundled from source by the consuming app.
Mount a shell
Render an app-specific custom element, e.g. <dbp-example-nextcloud-shell>, in the Nextcloud
template. Serve the template at both /apps/example/ and /apps/example/{activity}. Provide
Nextcloud initial state named config with the language of the activities (lang), and optionally
entryPointUrl, hiddenActivities (route names), configured (defaults to true),
adminSettingsUrl, and keycloak: {url, realm, clientId}. You can also pass config directly.
import '@webcomponents/scoped-custom-element-registry';
import '@dbp-toolkit/nextcloud/style.css';
import '@nextcloud/dialogs/style.css';
import {mountNextcloudApp} from '@dbp-toolkit/nextcloud';
import {activities} from './activities.js';
await mountNextcloudApp({
appId: 'example',
shellTag: 'dbp-example-nextcloud-shell',
activities,
fileDialogs: true,
notifications: true,
});Each activity provides {metadata, icon, load}: DBP activity metadata, an SVG path for the
navigation icon, and an async loader that registers the activity's custom element before it
resolves. The shell uses the metadata's element, routing_name, short_name, description
and optional subscribe fields. getMetadataText() can also be used in the app's own settings UI.
Pass providerAttributes for app-specific DBP attributes and labels for app-specific,
already translated setup, navigation or login labels. The package supplies English and German
translations for its own UI.
Build and deploy
- When opting into file dialogs, the activity must use a version of
@dbp-toolkit/file-handlingthat emitsdbp-file-dialog-open. On older versions the built-in dialogs still work, but the bridge will not see them. Bundle the Nextcloud dialogs stylesheet, and supply the compile-time defines required by@nextcloud/vue(includingappNameandappVersion). - When opting into silent Keycloak SSO, copy
@dbp-toolkit/nextcloud/silent-check-sso.htmlto the app's public assets. SetsilentCheckSsoUrlto the URL of that deployed asset, not the URL of a JavaScript chunk. Register the URL with the Keycloak client and allow the relevant origins in the app's CSP. - Nextcloud PHP controllers, routes, settings, any service-specific CSP allowances, and app signing belong to the consuming app. Bundle this package with each app; it is not a standalone Nextcloud app.
For a consumer migrating from the original eSign shell, keep its existing app ID and shell tag.
Pass its localized setup and login copy via labels and its allow-annotating flag, when enabled,
via providerAttributes. Upgrade @dbp-toolkit/file-handling to a release with
dbp-file-dialog-open before removing the old picker patch. Replace the local notification
bridge and shell styles with the package integrations.
