Repository navigation
Description
Description
Content Drive needs a Status filter (Archived, Unpublished, Locked): the backend clauses on POST /api/v1/drive/search and the multiselect in the toolbar. None of the three predicates is expressible on the endpoint today.
Merged 2026-08-24. This ticket absorbed #37067, which was the frontend half. They were one vertical slice split across two tickets, each restating the same contract. #37067 is closed as merged here.
Semantics reversed 2026-08-24 (see the comment thread). This ticket originally specified AND. It now specifies OR. Everything below reflects OR.
Backend
Current state, verified against the code:
| Status | Exists in BrowserQuery? |
Notes |
|---|---|---|
| Archived | Partially | showArchived (BrowserQuery.java:55, builder :470) exists but is inclusive: it drops the cvi.deleted = false clause (BrowserAPIImpl.java:1926), returning archived plus everything else. |
| Unpublished | No | showWorking / the form's live flag is the live-only axis, which is a different question, not the inverse. |
| Locked | No | No field, no builder method, no SQL clause, no ES clause. Nothing in the drive package references locked. |
Confirmed against the full BrowserQuery field list (:44-83) and all 42 builder methods. There is no raw Lucene passthrough either: BrowserQuery.luceneQuery (:66) is fed only by withFilter / withFileName and is never read by BrowserAPIImpl.
Semantics: OR, not AND. Selecting several statuses widens the result set — UNPUBLISHED + LOCKED returns content that is unpublished or locked. This matches every other Content Drive multiselect (base type, content type, language): more checkboxes, more results.
This reverses the ticket's original wording. The case for AND was that these are independent boolean flags on the same contentlet_version_info row, so intersecting them is meaningful. It is — for one of four combinations:
| Combination | Under AND | Under OR |
|---|---|---|
ARCHIVED + UNPUBLISHED |
redundant — identical to ARCHIVED alone, since archiving removes the live version (ESContentletAPIImpl.java:3833) |
"everything with no live version" |
ARCHIVED + LOCKED |
almost always empty — needs a self-lock or a CMS-Admin archive | "archived or checked out" |
UNPUBLISHED + LOCKED |
useful — "drafts checked out by someone" | "drafts or checked out" |
| all three | empty in practice | "anything not cleanly published" |
The decisive argument is consistency. Every other chip in that toolbar row widens on selection, and no UI affordance can convey that one of them inverts the rule — a user who checks a second box and gets fewer results reads that as a bug. The other filters being OR is forced by their single-valued nature (an item has exactly one base type, so AND would always be empty), but that reasoning is invisible to the user; all they learn is the pattern.
Accepted cost: "unpublished and locked" is no longer expressible in Content Drive. If that proves to be a real need it belongs in a later refinement that makes the combining rule explicit in the UI, rather than implicit and inverted.
Legacy is a precedent for the predicates, not for how they combine. The legacy Content Search portlet combines the three in the AND sense on its backend (ContentletAjax.java:1010-1021) while exposing a mutually exclusive dropdown in its UI (view_contentlets.jsp:695-698) — so it offers neither the multiselect nor the union:
if (!showDeleted) "+deleted:false" else "+deleted:true"
if (filterLocked) "+locked:true"
if (filterUnpublish) "+live:false"The Archived chip needs a new exclusive clause. The existing showArchived is inclusive and must stay that way: the legacy Site Browser checkbox (view_browser.jsp:145) depends on it. Add the exclusive variant alongside it rather than changing it.
Target predicates:
| Chip | SQL disjunct (selectQuery) |
ES term (buildPureESQuery) |
|---|---|---|
| Archived | cvi.deleted = true |
deleted:true |
| Unpublished | cvi.live_inode is null |
live:false |
| Locked | cvi.locked_by is not null |
locked:true |
Columns exist (postgres.sql:550-552); the locked ES field is indexed (ESMappingAPIImpl.java:527).
The archived baseline sits OUTSIDE the OR group. Excluding archived content is the drive's pre-existing default (appendExcludeArchivedQuery), not a fourth status. The selected statuses are OR-ed together and that group is AND-ed against the baseline, which only ARCHIVED lifts:
-- [UNPUBLISHED, LOCKED]
and cvi.deleted = false -- baseline, still applies
and ( cvi.live_inode is null or cvi.locked_by is not null ) -- the selected statuses
-- [ARCHIVED, LOCKED] -- baseline lifted
and ( cvi.deleted = true or cvi.locked_by is not null )Folding the baseline into the group is the bug to avoid: [UNPUBLISHED, LOCKED] would read (deleted = false or ...) and match essentially every row — a filter that silently stops filtering. A single selection degenerates to a one-disjunct group, so [ARCHIVED] is still exactly cvi.deleted = true.
showWorking must learn about the new statuses. BrowserQuery.java:151 (showWorking = showWorking || showArchived) also has to be true when ARCHIVED or UNPUBLISHED is selected. Both states imply no live version, so otherwise selectQuery joins on live_inode (:1947) and the filter silently returns nothing.
Both query paths need the clauses, but only one is the default. doElasticSearchTextFiltering (:477) switches on BROWSE_API_HEURISTIC_TYPE, which defaults to HYBRID_SINGLE_CHUNKED_QUERY_ES (:695). In hybrid, the SQL query supplies the inode set and ES only text-filters within it, so the SQL clauses apply even with text in the search box. buildPureESQuery (with its hardcoded +deleted:false at :610) runs only under BROWSE_API_HEURISTIC_TYPE=PURE_ES. That is a supported config, so it must be updated too, otherwise the filters silently no-op there.
Frontend
A multiselect chip filter with three options (Archived, Unpublished, Locked), sitting after the Workflow filter and before the Locale filter (dot-content-drive-toolbar.component.html:62-63) — giving shared-assets | content-type | workflow | status | locale. Nothing selected means today's behavior: archived hidden, everything else returned.
Why there. The row has exactly one real dependency edge and it must not be broken: the workflow filter derives its scheme list from the content-type selection (getSchemesByContentTypes), so content type and workflow stay adjacent. The field-filter menu is likewise derived from content type (it only materializes at exactly one selected type). Nothing else in the row is coupled — the content-type filter reads only baseType/contentType, so there is no dependency on the shared-assets toggle, and status's three options are fixed.
Status therefore depends on nothing and goes where it costs least: beside workflow, so the two lifecycle questions ("where is this in its lifecycle, and is anyone holding it") still read as a pair, but after it rather than between workflow and the selection it reads from. Content type keeps its position, and only locale shifts right by one.
Current state: archived: false is hardcoded in the search request at dot-content-drive.store.ts:135. That pin is removed and driven by the new filter instead.
Folders carry no status. When any status is selected, folders must drop out of the results, consistent with how the store already handles the other narrowing filters (dot-content-drive.store.ts:137-146) and how ContentDriveHelper sets showFolders(false) for the workflow filter.
Navigation is inherited, not built. Keep status as a key in the flat filters bag rather than giving it its own query param. That way it rides the existing machinery unchanged: decodeFilters on init (dot-content-drive.store.ts:546), the location.subscribe popstate re-hydration (:571), setPath never touching filters so it survives folder browsing, and mapQueryParamsToCDParams (dot-content-drive-navigation.service.ts:121) carrying the whole filters string through the legacy editor round-trip.
One decode trap. The decodeByFilterKey entry (status: multiSelector) is not optional. Unknown keys fall through to a comma sniff in decodeFilterValue, so status:ARCHIVED would decode to the string 'ARCHIVED' while status:ARCHIVED,LOCKED decodes to an array. Every reader does filters()?.status?.length, which is 8 for that string — the filter would appear to work until someone selected exactly one status.
Acceptance Criteria
Backend
-
AbstractDriveRequestFormaccepts a new status field (list ofARCHIVED,UNPUBLISHED,LOCKED); defaults to empty -
BrowserQuerycarries the statuses (field + builder method), mirroring the workflow filter plumbing inbeaf846d51 -
BrowserQuery'sshowWorkingderivation is true whenARCHIVEDorUNPUBLISHEDis selected -
ContentDriveHelpermaps the form field onto the builder - Empty selection preserves today's behavior exactly: archived excluded, everything else returned
-
ARCHIVEDalone returns only archived content (cvi.deleted = true), not archived plus everything else -
UNPUBLISHEDalone returns only content with no live version, and excludes archived content -
LOCKEDalone returns only content with a lock held, and excludes archived content - Multiple statuses combine with OR (
UNPUBLISHED + LOCKEDreturns content that is either) - Adding a status never shrinks the result set; each pair equals the union of its members
-
ARCHIVEDis the only status that admits archived content into the results - The archived baseline is emitted outside the OR group, so a selection without
ARCHIVEDstill excludes archived content - The existing inclusive
archivedflag is unchanged and the legacy Site Browser "Show Archived" checkbox still behaves as before - Filters apply identically with and without a text search under the default
HYBRID_SINGLE_CHUNKED_QUERY_ESheuristic -
buildPureESQueryhonors the statuses (and stops hardcoding+deleted:false) soBROWSE_API_HEURISTIC_TYPE=PURE_ESreturns the same results - An invalid status value returns 400, consistent with how
userSearchablerejects unknown keys - Regression:
ContentDriveWorkflowArchiveStepTeststill passes.appendWorkflowQueryownscvi.deletedper branch when an archive-target step is selected (:2262-2279); a status selection combined with a workflow archive-step filter must not produce an empty or double-constrained result - Integration tests cover each status alone, each pair, all three, the empty default, and the never-shrinks property
-
openapi.yamlregenerated and committed alongside the annotation changes
Frontend
- Status multiselect renders after the Workflow filter and before the Locale filter, with options Archived, Unpublished and Locked; Content Type and Workflow stay adjacent
- Options use i18n keys via
DotMessagePipe, following thecontent-drive.*key convention - Selecting one or more statuses sends them on the drive-search request and the results widen accordingly
-
Unpublished + Lockedreturns content that is either - Empty selection sends no status and preserves current behavior (archived content stays hidden)
-
archived: falseis no longer hardcoded in the request atdot-content-drive.store.ts:135 - Selections round-trip through the URL via the shared filter bag, with an explicit
decodeByFilterKeyentry so a single selected status decodes as an array, not a string - The selection survives page reload, folder navigation, browser Back/Forward, and an editor round-trip — exactly like every other Content Drive filter
- Selections are cleared by the existing "Clear all" action
- Folders are excluded from results whenever any status is selected
- The active selection is reflected as chips, consistent with the other toolbar filters
- An empty result set shows the standard empty state, not an error
-
data-testidon the control and its options;[attr.aria-label]on the control - Jest/Spectator tests cover: single selection, multiple selection, clearing, URL round-trip (including the single-value case), navigation survival, and folders being excluded when a status is active
Priority
Medium
Additional Context
Spec and design: #37170 carries the Spec-Kit spec.md, data-model.md and the API contract for this work.
Reference commits for shape and sizing:
beaf846d51original workflow filter, shows the plumbing cost for a new drive-search filter (~65 lines across form +BrowserQuery+ helper)f92f939296archive-target workflow steps, the precedent for touchingcvi.deletedinsideBrowserAPIImpl(184 lines impl, 478 lines of tests)
The backend half is one OR-ed group plus two touched lines where cvi.deleted is already decided, so it should land well under the f92f939296 footprint.
Reference for the frontend: the workflow filter (dot-content-drive-workflow-filter.component.ts) is the closest existing toolbar filter for chip rendering, URL encoding and the folder-exclusion pattern — but it carries a service, two caches, a request-id guard and a reconcile pass because its options are fetched. Three fixed options need none of that.
Not in scope: the Shared Assets / System Host toggle, tracked separately in #34760.
Related: #37067 (closed, merged into this ticket), #34760, #33999 (parent epic).
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]Add Status filters (Archived, Unpublished, Locked) to /api/v1/drive/search[/-][+]Content Drive: Status filter (Archived, Unpublished, Locked) on drive search and in the toolbar[/+]zJaaal commentedon Aug 24, 2026
Retitled and rewritten (2026-08-24) to absorb #37067, now closed. Both halves of the Status filter live here; every criterion from #37067 is carried over verbatim under the Frontend heading.
Analysis and edit by Claude (Claude Code), posted from @zJaaal's account.
github-actions commentedon Aug 24, 2026
PRs linked to this issue
docs(content-drive): add Status filter plan, research and quickstart (#…
docs(content-drive): address spec review on the archived baseline (#3…
docs(content-drive): status filter combines with OR, not AND (#37066)
zJaaal commentedon Aug 24, 2026
Body updated 2026-08-24: the Status semantics are now OR, not AND. Flagging rather than letting the ticket and the spec diverge.
Why it changed. The AND wording came from my own earlier rewrite of this ticket (see the previous comment), not from a team decision, and it did not survive the plan phase. The argument for AND was that these are independent flags one item can hold at once, so intersecting them is meaningful. It is — for one of four combinations:
Archived + UnpublishedArchivedalone, since archiving removes the live versionArchived + LockedUnpublished + LockedThe original ticket had to document two of those as "expected, not a bug." Needing that disclaimer was the design objecting.
The decisive point is consistency: every other chip in that toolbar row widens on selection, and nothing in the UI can convey that one of them inverts the rule. A user who checks a second box and gets fewer results reads it as broken. The other filters being OR is forced by their single-valued nature — an item has exactly one base type — but that reasoning is invisible to the user; all they learn is the pattern.
Accepted cost: "unpublished and locked" is no longer expressible in Content Drive. Recorded in the spec's Assumptions rather than dropped quietly. If it turns out to matter, it belongs in a later refinement that makes the combining rule explicit in the UI.
Also changed in this edit:
filtersbag — the ticket now says not to give it its own query param.showWorkingderivation, and the single-value URL decode trap (status:ARCHIVEDdecodes to a string, not an array, without an explicitdecodeByFilterKeyentry).Spec, data model and API contract are in #37170.
Analysis and edit by Claude (Claude Code), posted from @zJaaal's account.
24 remaining items
docs(content-drive): add spec for Status filter (dotCMS#37066)
docs(content-drive): add Status filter data model and API contract (d…
feat(content-drive): add the Status filter (Archived, Unpublished, Lo…
docs(content-drive): spec and design for Status filter (Archived, Unp…
feat(content-drive): Status filter (Archived, Unpublished, Locked), t…
KevinDavilaDotCMS commentedon Sep 3, 2026
Passed QA
Tested in main
4a822032026-09-03.16-33-06.mov
Test data: created a dedicated content type (
QA37066Ticket) with its own workflow scheme (QA37066 Support Workflow, copied from System Workflow), plus a control set onwebPageContent/ System Workflow. Each group has 6 contentlets covering every relevant state: published (baseline), unpublished-only, archived, locked, unpublished+locked, archived+locked. All prefixedQA37066 -for easy lookup.Verified directly against
POST /api/v1/drive/search:ARCHIVEDonlyUNPUBLISHEDonlyLOCKEDonlyUNPUBLISHED + LOCKEDARCHIVED + LOCKEDContent Type + Workflow interaction:
Status=Archivedwith no scheme distinction, as expected.