[TASK] Implement fix 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/_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 inreturnValueas each task finishes- Tasks loaded from
TaskLocatorUtil.getFixTaskClasses(), sorted by name, each runsshouldRun()+executeFix()in Hibernate transactions - GET is called on page load to recover results from a previous run
- DWR legacy:
CMSMaintenanceAjax.fixAssetsInconsistencies()andgetFixAssetsProgress()
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 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