feat(af-core): FORMS-25463 expose cq:annotations parallel to fd:dor#1883
Open
prateek1497 wants to merge 3 commits into
Open
feat(af-core): FORMS-25463 expose cq:annotations parallel to fd:dor#1883prateek1497 wants to merge 3 commits into
prateek1497 wants to merge 3 commits into
Conversation
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. |
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>
43ab18f to
420d5e8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Checklist: