Skip to content

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

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

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

Conversation

@prateek1497
Copy link
Copy Markdown
Contributor

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.

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>
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