dotCMS / dotCMS/core

[TASK] Implement delete contentlets endpoint

Open
#35,203 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale Team : Modernization
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Description

Implement DELETE /v1/maintenance/_contentlets in MaintenanceResource.java. Takes a list of contentlet identifiers, retrieves all language siblings for each, and permanently destroys them (bypasses trash).

Acceptance Criteria
  • API caller must provide a list of contentlet identifiers in JSON body
  • For each identifier, endpoint must retrieve all language siblings via ContentletAPI.getSiblings(identifier)
  • Endpoint must permanently destroy each contentlet via ContentletAPI.destroy(contentlet, user, true)
  • API caller must receive the count of successfully deleted contentlets
  • API caller must receive a list of identifiers that failed to delete (e.g., not archived)
  • Must require CMS Administrator role and Maintenance portlet access
  • API caller must receive 400 Bad Request if identifiers list is empty
Priority

None

Additional Context
  • destroy() is a permanent delete — no recovery. Different from delete() which archives
  • getSiblings() returns all language variants for a given identifier — all siblings are destroyed together
  • The DWR version takes a comma-separated string; the REST endpoint should accept a JSON array
  • DWR legacy: CMSMaintenanceAjax.deleteContentletsFromIdList() lines 184–220

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in MaintenanceResource.java and compare the DWR legacy implementation in CMSMaintenanceAjax.deleteContentletsFromIdList() at lines 184–220. Verify the endpoint accepts a JSON identifier list, retrieves siblings and permanently destroys them with the required access checks, then confirm the response includes deletion and failure results and rejects an empty list with 400 Bad Request.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.