[TASK] Implement drop old versions endpoint
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
Implement DELETE /v1/maintenance/_oldVersions in MaintenanceResource.java. Deletes all versions of versionable objects (Contentlets, Containers, Templates, Links, Workflow History) older than a specified date.
Acceptance Criteria
- API caller must provide a date query parameter in MM/dd/yyyy format
- Endpoint must call
CMSMaintenanceFactory.deleteOldAssetVersions(date) - API caller must receive the count of deleted records in response
- API caller must receive a success indicator (deletedCount >= 0 means success, -1 means error)
- Must require CMS Administrator role and Maintenance portlet access
- API caller must receive 400 Bad Request if date is missing or invalid
Priority
None
Additional Context
CMSMaintenanceFactory.deleteOldAssetVersions()iterates in 30-day chunks from the oldest inode date to the specified date, each chunk in a Hibernate transaction- Deletes via:
DropOldContentletRunner(contentlets),ContainerAPI.deleteOldVersions(),TemplateAPI.deleteOldVersions(),MenuLinkAPI.deleteOldVersions(),WorkflowAPI.deleteWorkflowHistoryOldVersions() - Flushes all caches when totalRecords > 0
- Can take minutes on large datasets
- DWR legacy:
CMSMaintenanceAjax.removeOldVersions(date)line 260
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 compare the requested endpoint with the legacy CMSMaintenanceAjax.removeOldVersions(date) at line 260. Trace CMSMaintenanceFactory.deleteOldAssetVersions(date) and the existing maintenance authorization patterns. Done means the DELETE endpoint validates MM/dd/yyyy input, enforces the required access, returns the deletion count and success indicator, and responds with 400 for missing or invalid dates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, authorization, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100