Skip to content

Implement: Integration: XWiki (External Knowledge) #1326

@rubenvdlinde

Description

@rubenvdlinde

OpenSpec Change: integration-xwiki

Spec path: openspec/changes/integration-xwiki

Depends on: #1307 (pluggable-integration-registry)

⚠️ Blocked — Waiting on Dependencies

When the umbrella is merged, remove the blocked label and add ready-to-build to let Hydra pick this up.

Spec PR: #1300

Real-world consumer

ConductionNL/deskdesk ships a desk-booking app whose Part 4 tutorial demonstrates the xWiki integration end to end. The app currently uses a wrong-shape implementation (custom knowledge_article schema + sync) as a placeholder. When this leaf lands, deskdesk:

  1. Drops the knowledge_article schema, the KnowledgeTab.vue custom sidebar component, and the DetailPageWrapper.vue workaround
  2. Adds "linkedTypes": ["xwiki"] to the desk schema configuration
  3. The XwikiProvider supplies the sidebar tab + widget + reference rendering automatically
  4. Part 4 of the academy tutorial gets a clean rewrite teaching the correct pattern

The xWiki dev environment lives in openregister/docker-compose.yml under the xwiki / integrations profile (docker compose --profile xwiki up -d xwiki). Container hostname openregister-xwiki:8080 is reachable from the Nextcloud container; host port 8086 for browser access.

Tasks

1. Backend

  • 1.1 Create lib/Service/Integration/Providers/XwikiProvider.php
    • id='xwiki', label='Articles', icon='FileDocumentMultiple', group='external'
    • requiredApp=null, storage='external'
    • getOpenConnectorSource() returns 'xwiki'
  • 1.2 Declare auth requirements (basic or oauth2, configurable at source level)
    • authRequirements() returns the OpenConnector source's declared auth type
  • 1.3 Delegate CRUD to ExternalIntegrationRouter
    • Provider stays thin; routing logic lives in the umbrella's router
  • 1.4 Ship OpenConnector source config template config/openconnector-sources/xwiki.yaml
    • YAML template: base URL, auth type, headers (Accept: application/json), pagination
  • 1.5 DI-tag the provider in lib/AppInfo/Application.php
    • IntegrationRegistry discovers it automatically
  • 1.6 Unit tests (OpenConnector client mocked)
    • At least 5 test methods: registration, auth, list pages, get page, missing-page exception

2. Frontend — Tab

  • 2.1 CnXwikiTab.vue — linked pages with title + full breadcrumb
    • Row format: title + breadcrumb (Wiki / Department / Subspace / Page)
    • Link-by-URL (parses to space.page)
    • Link-by-path
    • Unlink action
    • Auth-expired banner
  • 2.2 Barrel + tests
    • src/components/CnXwikiTab/index.js
    • Tests covering URL parsing, breadcrumb rendering, auth banner

3. Frontend — Widget

  • 3.1 CnXwikiCard.vue — 4 surfaces with detail-page text preview
    • user-dashboard: recent linked pages
    • app-dashboard: scoped to app
    • detail-page: linked pages + 500-char text preview (macros stripped) + link to full page
    • single-entity: page-title + breadcrumb chip
  • 3.2 Barrel + surface tests
    • All four surfaces tested
    • Security: macros stripped, no <script> in preview output

4. Registration

  • 4.1 src/integrations/builtin/xwiki.js — register with referenceType: 'xwiki'
    • Tab + widget components wired
    • Schema reference properties can render an xwiki chip via referenceType

5. Quality

  • 5.1 Parity gate, nl+en translations, strict checks, ESLint
    • scripts/check-integration-parity.sh passes
    • nl + en translations for every user-facing string
    • composer check:strict passes
    • npm run lint passes

6. Acceptance verification

  • 6.1 E2E: configure OpenConnector xwiki source, link a page, verify breadcrumb in tab + text preview on detail-page
    • Runs against the dev environment's openregister-xwiki container
  • 6.2 Link-by-URL test: paste full URL, verify resolution to canonical space.page
    • https://wiki.example/xwiki/bin/view/Dept/Policy/Privacy → space='Dept.Policy', page='Privacy'
  • 6.3 Auth test, hide test, reference-property test
    • Auth-expired banner when source credentials fail
    • Provider hidden from registry when OpenConnector source missing/disabled
    • Reference-property renders xwiki chip in CnFormDialog
  • 6.4 Security: verify XWiki macros are NOT executed in preview (text-only)
    • Render a page with {{velocity}} macro
    • Confirm macro stripped from preview, no <script> in output
    • ADR-005 compliance

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedWaiting on a dependency to be mergedopenspecOpenSpec-driven change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions