You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "Select Existing Content" dialog in the Relationship Field currently makes 2 requests without server-side pagination, which doesn't scale with large datasets (e.g., 5k+ contentlets). Additionally, a second request is needed to determine which child contentlets are already "taken" by other parents in ONE_TO_ONE and ONE_TO_MANY relationships.
Current Behavior
POST /api/v1/content/search returns all contentlets at once — the dialog does not use server-side pagination
Response has pagination: null — no pagination metadata returned
The endpoint already accepts page and perPage in ContentSearchForm, but the response doesn't include pagination metadata. Return pagination info in the response:
When relationshipContext is provided, each contentlet in the response includes a relationParentIds field — an array of parent identifiers that already have this child related:
Problem Statement
The "Select Existing Content" dialog in the Relationship Field currently makes 2 requests without server-side pagination, which doesn't scale with large datasets (e.g., 5k+ contentlets). Additionally, a second request is needed to determine which child contentlets are already "taken" by other parents in ONE_TO_ONE and ONE_TO_MANY relationships.
Current Behavior
POST /api/v1/content/searchreturns all contentlets at once — the dialog does not use server-side paginationpagination: null— no pagination metadata returned/api/content/_searchis needed to find which children are already related to other parents (workaround implemented in PR #32792 Relationship Field: disable already-related items in dialog #35134)Proposed Solution
1. Server-side pagination in the response
The endpoint already accepts
pageandperPageinContentSearchForm, but the response doesn't include pagination metadata. Return pagination info in the response:{ "entity": { "jsonObjectView": { "contentlets": [...] }, "resultsSize": 5000, "pagination": { "page": 1, "perPage": 50, "totalPages": 100 } } }2. Relationship constraint info via
relationshipContextAccept an optional
relationshipContextin the request payload:{ "searchableFieldsByContentType": { "contentTypeId": {} }, "page": 1, "perPage": 50, "relationshipContext": { "fieldVariable": "relation", "parentContentType": "MAIN" } }When
relationshipContextis provided, each contentlet in the response includes arelationParentIdsfield — an array of parent identifiers that already have this child related:{ "identifier": "82c25d2e-...", "comment": "comment 2", "relationParentIds": ["ccb20dddbb896bd75800a2a672515a99"] }[]→ child is free, selectablerelationshipContextis NOT provided,relationParentIdsis omitted (backward compatible)Acceptance Criteria
POST /api/v1/content/searchreturns pagination metadata in the response whenpage/perPageare providedContentSearchFormaccepts an optionalrelationshipContextobject withfieldVariableandparentContentTyperelationshipContextis included, each contentlet in the response includes arelationParentIdsstring arrayrelationParentIdsis[]when the child has no parent in that relationshiprelationParentIdscontains parent identifiers when the child is already relatedrelationshipContextis NOT provided, the response remains unchanged (backward compatible)ExistingContentServiceupdated to sendpage/perPageandrelationshipContextto the APIExistingContentStoreupdated to use server-side pagination andrelationParentIdsinstead of the separate/api/content/_searchrequest/api/content/_searchfor parents) can be removed from the frontendTechnical Context
ContentResource.java→POST /search(/api/v1/content/search)ContentSearchForm.java— addrelationshipContextfieldSearchView.java— add pagination metadatacore-web/.../dot-select-existing-content/store/existing-content.service.tscore-web/.../dot-select-existing-content/store/existing-content.store.tsProposed Priority
Priority 3 - Average
Proposed Objective
Core Features