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
Description
Implement
DELETE /v1/maintenance/_oldVersionsinMaintenanceResource.java. Deletes all versions of versionable objects (Contentlets, Containers, Templates, Links, Workflow History) older than a specified date.Acceptance Criteria
CMSMaintenanceFactory.deleteOldAssetVersions(date)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 transactionDropOldContentletRunner(contentlets),ContainerAPI.deleteOldVersions(),TemplateAPI.deleteOldVersions(),MenuLinkAPI.deleteOldVersions(),WorkflowAPI.deleteWorkflowHistoryOldVersions()CMSMaintenanceAjax.removeOldVersions(date)line 260