Skip to content

Fix association node URIs for CFDocuments and non-CASE targets (#44, #49) - #52

Merged
alail-ims merged 2 commits into
1EdTech:mainfrom
stanbilliet:fix/44-cfdocument-node-uris
Oct 22, 2026
Merged

alail-ims merged 2 commits into
1EdTech:mainfrom
stanbilliet:fix/44-cfdocument-node-uris

Conversation

@stanbilliet

@stanbilliet stanbilliet commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #44
Fixes #49

  • Association nodes that are a CFDocument now get /ims/case/{version}/CFDocuments/{id} instead of /CFItems/{id}.
  • Nodes with a targetType other than CASE are kept as supplied (original uri and targetType).
  • targetType: CASE is kept; the uri is still rebased onto the local host.
  • toJSON('1.0') no longer strips targetType from the stored entity.
  • Tests added in CFAssociation.test.ts; full suite passes.

…EdTech#44)

CFAssociation.fromRaw regenerated originNodeURI.uri and
destinationNodeURI.uri as /ims/case/v1p1/CFItems/{identifier} for every
node, including nodes that are a CFDocument (the top-level isChildOf of
every framework, and links to the CFDocument of another framework).
Those URIs pointed at the CFItems endpoint for a document identifier and
returned 404.

A node is now regenerated as /CFDocuments/{identifier} when:
- its identifier is the package's own CFDocument identifier, or
- the source URI points at /CFDocuments/{identifier} (relative or
  absolute, any CASE version), or
- the source URI is a urn:case:document: URN.

All other nodes keep the existing /CFItems/{identifier} behaviour, and
only the identifier and node kind are trusted from the source, so URIs
are still rebased onto the local host. Because the stored URI keeps the
/CFDocuments/ path, the result is stable when the package is reloaded.

The package document identifier is passed from CreateFramework,
ImportFramework, FileCFPackageRepository and UpdateCFAssociation.
@stanbilliet
stanbilliet force-pushed the fix/44-cfdocument-node-uris branch from 5a60456 to 94e9a8f Compare October 21, 2026 16:49
…h#49)

CFAssociation.fromRaw rebuilt every origin/destination node as a local
CFItems reference and dropped targetType, so links to targets outside
CASE (CASE 1.1 §1.9.3) lost their original uri and targetType.

- Nodes with a targetType other than 'CASE' are kept exactly as
  supplied (title, identifier, uri, targetType).
- targetType 'CASE' is kept; the uri is still rebased locally.
- toJSON('1.0') no longer strips targetType from the entity's own
  LinkData objects (it now copies before removing the field).
@stanbilliet stanbilliet changed the title Keep /CFDocuments/ URIs for association nodes that are CFDocuments (#44) Fix association node URIs for CFDocuments and non-CASE targets (#44, #49) Oct 21, 2026
@alail-ims
alail-ims merged commit 5d22623 into 1EdTech:main Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants