Skip to main content

Dashboard: the app shell, deep links and widgets

OpenCatalogi's internal pages are one Vue single-page app. Nextcloud serves the same HTML template for every page of it, and the app's router picks the view from the URL, so a link to any page can be bookmarked, shared and reloaded.

Every page the router knows has its own server route in appinfo/routes.php, answered by UiController, which returns the app template:

URL under /apps/opencatalogiPage
/Dashboard
/catalogiCatalogues
/publications/{catalogSlug}Publications of one catalogue
/publications/{catalogSlug}/{id}One publication
/searchSearch
/organizationsOrganisations
/themesThemes
/glossaryGlossary
/pagesPages
/menusMenus
/directoryDirectory of federated catalogues

A URL that is not in this list answers 404 from Nextcloud. catalogSlug and id accept letters, digits and hyphens.

The template's Content Security Policy allows the page to connect to any domain (connect-src *), because the Directory page and the search read other OpenCatalogi instances straight from the browser.

Dashboard widgets​

The app registers these widgets on the Nextcloud dashboard (lib/Dashboard/DashboardRegistrar.php):

WidgetShows
Catalogi OverviewThe catalogues of this instance
Concept publicatiesPublications that are not published yet (see below)
Unpublished documentsFiles on a publication that are not published yet (see below)
Most viewed publicationsThe publications read most often
Retention reviewPublications whose retention term needs a decision

Unpublished publications and documents​

Both widgets read GET /api/dashboard/unpublished (kind=publications or kind=documents, limit up to 50). The list holds only what the signed-in user may read, newest first, with the total above it.

  • Concept publicaties lists a publication that has no publication date, or one in the future (scheduled), and has not been withdrawn. A public or a withdrawn publication is not listed.
  • Unpublished documents lists a file on a publication whose published time is empty or in the future, with the title of its publication.
  • A row opens its publication in the app, under the catalogue it belongs to. A publication outside every catalogue shows, but its row opens nothing.
  • With nothing to show, the widgets say "No concept publications found" and "No unpublished documents".
  • To stay fast, both lists look at the 200 most recently changed publications. When there are more, the answer says so (scope: recent-200).

The demo data (installed on request) carries one scheduled example publication, the council agenda of the fictional Gemeente Voorbeeld, so the widget shows a row after installing it; its withdrawn example quarterly report is not listed.

What the app does on start​

Application::register() loads the app's Composer autoload and lets each part register its own classes: dashboard widgets, event listeners, MCP tools, observability, the portal, services and tools. The listeners that matter for the catalogue:

OpenRegister eventListenerWhy
object created / updatedObjectCreatedEventListener, ObjectUpdatedEventListenerAutomatic publishing rules
object created / updated / deletedCatalogCacheEventListenerKeeps the catalogue cache current
tool registrationToolRegistrationListenerOffers OpenCatalogi's tools to the AI assistant

boot() does nothing on purpose: the settings are initialised by the InitializeSettings repair step during install and upgrade, not on every request.

Changes​

  • The route GET /index pointed at a controller method that no longer existed and gave a server error. It was removed; the URL now answers 404.

See also directory.md for the federated directory and its scheduled jobs.