Skip to content

Derive server-side acl:mode() from Link response headers#299

Merged
namedgraph merged 2 commits into
developfrom
rf-list-superclasses
May 14, 2026
Merged

Derive server-side acl:mode() from Link response headers#299
namedgraph merged 2 commits into
developfrom
rf-list-superclasses

Conversation

@namedgraph
Copy link
Copy Markdown
Member

@namedgraph namedgraph commented May 14, 2026

Summary

  • Java pushes outgoing response headers to XSLT as a new $ldh:httpHeaders map (map(xs:string, xs:string*)).
  • Server-side acl:mode() is rewritten to parse Link entries with rel=acl#mode out of that map, replacing the pre-aggregated $acl:mode param push.
  • Drops now-dead supertype-closure helpers (ldh:listSuperClasses, ldh:ontologyImports) and the empty $acl:mode declaration in layout.xsl; converts the lone direct $acl:mode reference in admin/layout.xsl to acl:mode().

Changes

  • XSLTWriterBase — populates $ldh:httpHeaders from outgoing response headers (LDH.httpHeaders vocabulary term added).
  • imports/default.xslacl:mode() parses Link entries via xsl:analyze-string; removes ldh:listSuperClasses and ldh:ontologyImports (unused).
  • layout.xsl — removes the $acl:mode param and the commented-out ontology-imports block in the JS docs config.
  • admin/layout.xsl, document.xsl — switch to acl:mode() function call.

Notes

  • XPath F&O regex doesn't support lookahead or \b; the Link header is split with xsl:analyze-string (regex <[^>]+>[^<]*) and the rel match uses [;\s]rel for word boundary.
  • Uncommitted on the branch right now: the acl:mode regex fix described above — fold it into the second commit (or add as a follow-up) before opening the PR.

Test plan

  • mvn clean install
  • docker-compose up --build — container starts, no XSLT transformation errors in logs on first page load
  • Authenticated request returns expected acl:mode values (e.g. owner sees Read/Write, anonymous sees Read only) and the rendered UI reflects them
  • cd http-tests && ./run.sh ssl/owner/cert.pem … ssl/secretary/cert.pem … passes
  • Confirm no remaining references to $acl:mode param or ldh:listSuperClasses / ldh:ontologyImports in the codebase

namedgraph and others added 2 commits May 15, 2026 01:17
…pHeaders

Java pushes outgoing response headers to XSLT as a $ldh:httpHeaders
XdmMap (map(xs:string, xs:string*)) and the server-side acl:mode()
parses Link entries with rel=acl#mode out of it, replacing the
pre-aggregated $acl:mode param push. Drops the now-dead $acl:mode XSLT
param default (and its ldh:listSuperClasses supertype-closure helper),
the empty layout.xsl declaration, and converts the lone direct
$acl:mode reference in admin/layout.xsl to acl:mode().

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@namedgraph namedgraph changed the title Rf list superclasses Derive server-side acl:mode() from Link response headers May 14, 2026
@namedgraph namedgraph marked this pull request as ready for review May 14, 2026 23:40
@namedgraph namedgraph merged commit 1f9cf75 into develop May 14, 2026
1 check failed
@namedgraph namedgraph deleted the rf-list-superclasses branch May 14, 2026 23:50
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.

1 participant