Package su.onno.ui
Class GenericCatalogController
java.lang.Object
su.onno.ui.GenericCatalogController
@RestController
@RequestMapping("/api/catalogs")
public class GenericCatalogController
extends Object
-
Constructor Summary
ConstructorsConstructorDescriptionGenericCatalogController(CatalogQueryService query, UiAccessService access, CatalogCommandService commands, RelatedListReader relatedLists, UiMessages messages, BatchRunner batch) -
Method Summary
Modifier and TypeMethodDescriptionSoft-delete a set of records in one request — the list's batch selection posts here instead of firing N single DELETEs.voidCreate a copy of recordid: same description/attributes/parent, fresh identity (new id, next code).Live rows of a related-list panel declared on thenamecatalog's editor (seeRelatedList) — the junction rows whose back-reference points at recordid.Dry-run validation for the form's live (as-you-type) feedback: runs the full write lifecycle — declarative constraints, hooks,Validatedbusiness rules — against the submitted values without persisting, and reports{valid, fieldErrors, formErrors}with 200 either way.
-
Constructor Details
-
GenericCatalogController
public GenericCatalogController(CatalogQueryService query, UiAccessService access, CatalogCommandService commands, RelatedListReader relatedLists, UiMessages messages, BatchRunner batch)
-
-
Method Details
-
children
-
tree
-
get
-
create
-
duplicate
@PostMapping("/{name}/{id}/duplicate") public Map<String,Object> duplicate(@PathVariable String name, @PathVariable UUID id, @RequestParam(defaultValue="logical") String representation, Principal principal) Create a copy of recordid: same description/attributes/parent, fresh identity (new id, next code). Secret attributes are not copied — reads are redacted, so a copy would store the sentinel; the clone starts with them unset. Runs through the normal create path (lifecycle hooks, validation, write access). Powers the list's clipboard paste (⌘C/⌘V). -
update
-
validate
@PostMapping({"/{name}/validate","/{name}/{id}/validate"}) public Map<String,Object> validate(@PathVariable String name, @PathVariable(required=false) UUID id, @RequestBody Map<String, Object> body, Principal principal) Dry-run validation for the form's live (as-you-type) feedback: runs the full write lifecycle — declarative constraints, hooks,Validatedbusiness rules — against the submitted values without persisting, and reports{valid, fieldErrors, formErrors}with 200 either way. The id-less form validates a create; withid, the changes are overlaid onto the stored record first, exactly likePUT. -
delete
-
batchDelete
@PostMapping("/{name}/batch-delete") public Map<String,Object> batchDelete(@PathVariable String name, @RequestBody Map<String, Object> body, Principal principal) Soft-delete a set of records in one request — the list's batch selection posts here instead of firing N single DELETEs. Per-id failures are recorded and the batch continues; returns{ok, failed, total}. Ids run concurrently on the sharedBatchRunnerpool (onno.ui.batch.parallelism). Capped like the action batch (see ActionController.BATCH_LIMIT).
-