dotCMS / dotCMS/core

[TASK] Implement fix assets endpoints

Open
#35,200 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 POST /v1/maintenance/_fixAssets and GET /v1/maintenance/_fixAssets in MaintenanceResource.java. POST starts the fix assets inconsistencies process which runs all registered FixTask classes. GET returns the current/last results for progress checking.

Acceptance Criteria

POST /v1/maintenance/_fixAssets

  • Endpoint must call FixTasksExecutor.getInstance().execute(null) to run all registered fix tasks
  • API caller must receive a list of task results, each containing: total, errorsFixed, initialTime, finalTime, description
  • API caller must receive null/empty entity if no tasks were executed
  • Must require CMS Administrator role and Maintenance portlet access

GET /v1/maintenance/_fixAssets

  • API caller must receive the current task results from FixTasksExecutor.getInstance().getTasksresults()
  • API caller must receive null/empty entity if no results exist
  • Must require CMS Administrator role and Maintenance portlet access
Priority

None

Additional Context
  • FixTasksExecutor.execute() is synchronous — blocks until all tasks complete. Results accumulate incrementally in returnValue as each task finishes
  • Tasks loaded from TaskLocatorUtil.getFixTaskClasses(), sorted by name, each runs shouldRun() + executeFix() in Hibernate transactions
  • GET is called on page load to recover results from a previous run
  • DWR legacy: CMSMaintenanceAjax.fixAssetsInconsistencies() and getFixAssetsProgress()

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 inspect existing maintenance endpoints, then read FixTasksExecutor.execute(null) and getTasksresults() to understand their result behavior. Compare the legacy CMSMaintenanceAjax.fixAssetsInconsistencies() and getFixAssetsProgress() entry points. Done means both endpoints return the specified results or an empty entity and enforce CMS Administrator role and Maintenance portlet access.

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.