Issue 36151 implement new site/folder field component (edit contentlet)#36263
Issue 36151 implement new site/folder field component (edit contentlet)#36263freddyDOTCMS wants to merge 13 commits into
Conversation
…ing to eliminate N+1 queries
|
I'll analyze this and get back to you. |
🤖 Bedrock Review —
|
|
Semgrep found 1
The method identified is susceptible to injection. The input should be validated and properly If this is a critical or high severity finding, please also link this issue in the #security channel in Slack. |
…-new-site/folder-field-component-(Edit-Contentlet)

Proposed Changes
GET /api/v1/folder/searchendpoint supporting optional case-insensitive name filter (min 3 chars), path scope, recursive depth control, pagination (page/per_page), and sort (name/mod_date) — replaces the deprecatedPOST /byPathPOST /byPath(@Deprecated(forRemoval = true)) and mark it as deprecated in the OpenAPI spec; existing callers continue to work unchangedFolderSearchParamsrecord with a fluent builder to consolidate all search parameters acrossFolderAPI,FolderFactory, andFolderSearchPaginator, replacing a 10-argument method signatureFolderSearchResultViewfrom a plain class to a Java recordPermissionAPI.filterCollection(Collection<P>, int, User, boolean)— a batch permission check that resolves the entire collection in one SQL round-trip, eliminating the N+1 permission queries that caused ~2s response times on large sitesPermissionBitFactory.getPermittedIds()as the SQL backbone for the batch check, using a UNION of direct (permission) and inherited (permission_reference) permissions chunked in batches of 500Checklist
FolderSearchPaginatorTest,PermissionBitAPIImplFilterCollectionTest,PermissionBitFactoryImplGetPermittedIdsTest; integration:FolderAPIImplFilterTest,FolderFactoryImplFilterTest,FolderResourceSearchTest)siteIdis required and validated server-side before any DB query runs; role IDs injected into SQL are system-generated UUIDs (not user input), consistent with the existingfilterCollectionByDBPermissionReferencepattern inPermissionBitFactoryImplAdditional Info
The deprecated
POST /byPathendpoint is kept intact with backward-compatible pagination parameters (offset/limit) to avoid breaking existing integrations. The new endpoint uses the standard dotCMS pagination contract (page/per_page) and returns aResponseEntityPaginatedDataViewwith full pagination metadata.The batch permission approach reduces query count from O(N) — one DB/cache lookup per folder — to O(1) regardless of result set size, which is the primary fix for the 2-second response times reported on large sites.
Screenshots
N/A — backend API changes only
This PR fixes: #36151