[TASK] Implement clean assets endpoints
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
Implement POST /v1/maintenance/_cleanAssets and GET /v1/maintenance/_cleanAssets in MaintenanceResource.java. POST starts a background thread that walks the assets directory and deletes orphan binary folders with no matching contentlet. GET returns the current progress status.
Acceptance Criteria
POST /v1/maintenance/_cleanAssets
- Endpoint must start
CleanAssetsThreadviaCleanAssetsThread.getInstance(true, true) - API caller must receive the initial process status (totalFiles, currentFiles, deleted, running, status)
- Must not start a new thread if one is already running
- Must require CMS Administrator role and Maintenance portlet access
GET /v1/maintenance/_cleanAssets
- API caller must receive current process status: totalFiles, currentFiles, deleted, running (boolean), status (string)
- Status values: "Starting", "Counting", "Cleaning", "Finished", or "Error: ..."
- Must require CMS Administrator role and Maintenance portlet access
Priority
None
Additional Context
CleanAssetsThreadis a singleton thread that walksassets/0-f/0-f/*hex directory structure- For each directory: looks up contentlet by inode via
ContentletAPI.find(inode), deletes if not found or has no identifier - Progress is updated via
BasicProcessStatusand read viabuildStatusMap()(usesBeanUtils.describe()) - Angular should poll GET at ~1 second interval while
running === "true" - DWR legacy:
CMSMaintenanceAjax.cleanAssets()andgetCleanAssetsStatus()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in MaintenanceResource.java and read CleanAssetsThread.getInstance(true, true), BasicProcessStatus, and buildStatusMap(). Trace the legacy CMSMaintenanceAjax.cleanAssets() and getCleanAssetsStatus() entry points for expected behavior. Done means POST and GET expose the specified progress fields, avoid duplicate runs, enforce the CMS Administrator and Maintenance portlet requirements, and return the documented status values.
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
- 76/100