Skip to content

feat(af-core): FORMS-25463 expose cq:annotations parallel to fd:dor#1883

Open
prateek1497 wants to merge 4 commits into
devfrom
FORMS-25463
Open

feat(af-core): FORMS-25463 expose cq:annotations parallel to fd:dor#1883
prateek1497 wants to merge 4 commits into
devfrom
FORMS-25463

Conversation

@prateek1497
Copy link
Copy Markdown
Contributor

@prateek1497 prateek1497 commented May 15, 2026

Adds cq:annotations read support to the IC GET flow for the print channel /
author CRISPR path.

  • getCqAnnotations() reads the cq:annotations child resource (a sibling of fd:dorContainer on the component node) and returns each annotation as a map entry keyed by node name. Each entry carries color, text, x, y, and optional state/resolvedBy/resolvedAt plus JCR audit fields. Null fields are stripped so the serialized shape matches the JCR content exactly.
  • getProperties() is wired to call getCqAnnotations() and place the result under properties.cq:annotations — parallel to fd:dor / fd:path / fd:associate. Returns null when no cq:annotations child exists; Jackson omits the key, keeping output non-breaking for forms without annotations.
  • getCustomProperties() explicitly excludes cq:annotations to prevent it leaking as a double-serialized JSON string via the catch-all custom-properties path.
  • Gated: only runs when channel == PRINT and isAuthorMode(request) — web channel and publish mode are unaffected.

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

@prateek1497
Copy link
Copy Markdown
Contributor Author

In short why its not following AFv2 annotations - if you look at how AFv2 annotations work, it does network call for each annotation, bringing the infinity json for that annotation, for IC, we would be taking hit on first load, adding cq:annotations in the first GET call, and flushing everything on the UI at once.

Prateek Awasthi and others added 3 commits May 20, 2026 18:03
Add getCqAnnotations() on AbstractFormComponentImpl that reads the
cq:annotations child resource (a sibling of fd:dorContainer on the
component node) and exposes its child annotations as a per-annotation
map keyed by node name. Each entry carries color, text, x, y, optional
state/resolvedBy/resolvedAt and the JCR audit fields. Null fields are
stripped so the serialised shape matches the JCR content exactly.

Wire the call into getProperties() so the resulting map is placed
under properties.cq:annotations -- parallel to fd:dor / fd:path /
fd:associate -- not nested inside dorContainer. Returns null when no
cq:annotations child exists; Jackson then omits the key, keeping the
output non-breaking for forms without annotations.
…ties

getCustomProperties() reads all non-reserved JCR properties from the
resource ValueMap and includes them as raw Strings. cq:annotations is
not in the excluded-prefix list ("fd:", "jcr:", "sling:"), so a stale
String-typed cq:annotations property on the node was leaking through and
appearing as a double-serialised JSON string in the GET IC response.

Adding an explicit key exclusion for CUSTOM_ANNOTATIONS_PROPERTY_WRAPPER
ensures the property is handled exclusively by getCqAnnotations(), which
returns it as Map<String,Object> and produces proper nested JSON.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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