dotCMS / dotCMS/core

[FEATURE] Maintenance Tools APIs

Open
#35,191 1 comment 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

Problem

System maintenance operations (search-replace, fix assets, drop old versions, clean orphan assets, delete contentlets, delete pushed assets) are currently only accessible via DWR calls to CMSMaintenanceAjax and Struts form actions in ViewCMSMaintenanceAction. Need REST endpoints to answer "How do I clean up and fix the system?"

Goal

Provide REST endpoints for all maintenance tools operations. Long-running operations (fix assets, clean orphan assets) use a start/poll pattern — POST to start, GET to check progress.

APIs

  • POST /v1/maintenance/_searchAndReplace — DB-wide find/replace across content tables
  • POST /v1/maintenance/_fixAssets — Start fix assets inconsistencies task
  • GET /v1/maintenance/_fixAssets — Poll fix assets progress
  • DELETE /v1/maintenance/_oldVersions — Drop old versions of versionable objects by date
  • POST /v1/maintenance/_cleanAssets — Start orphan binary asset cleanup
  • GET /v1/maintenance/_cleanAssets — Poll orphan cleanup progress
  • DELETE /v1/maintenance/_contentlets — Bulk delete contentlets by identifier list
  • DELETE /v1/maintenance/_pushedAssets — Delete all push publishing history

Personas

  • Developer Teams — Need REST APIs for Angular Tools tab
  • System Administrators — Need to perform system maintenance, cleanup old data, fix inconsistencies

Legacy Reference

  • DWR Class: CMSMaintenanceAjax.java — fixAssetsInconsistencies, removeOldVersions, cleanAssets, deleteContentletsFromIdList, deletePushedAssets
  • Struts Action: ViewCMSMaintenanceAction.java — searchAndReplace (cmd=searchandreplace)
  • Backend Services: MaintenanceUtil.DBSearchAndReplace(), CMSMaintenanceFactory.deleteOldAssetVersions(), CleanAssetsThread, FixTasksExecutor
  • JSP: view_cms_maintenance.jsp lines 1541–1851 (Tools tab)
  • Target Class: MaintenanceResource.java (/api/v1/maintenance)

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 with MaintenanceResource.java under /api/v1/maintenance, then compare the legacy CMSMaintenanceAjax.java, ViewCMSMaintenanceAction.java, and the listed backend services. Trace how each maintenance operation currently works and how the JSP invokes it. Done means all eight documented REST endpoints exist, with start/poll behavior for the two long-running tasks.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.