Package com.onec.ui
Class DocumentCommandService
java.lang.Object
com.onec.ui.DocumentCommandService
Write-side commands for documents — create, update, delete, post, unpost — plus
the document reconstruction needed for posting. Extracted from
GenericDocumentController so the same code path is shared by the REST API
and other callers (e.g. the MCP server), and access control / read-only checks
are enforced in exactly one place.
Every mutating method enforces requireWritable() (global read-only mode)
and UiAccessService.requireWrite(java.security.Principal, com.onec.metadata.CatalogDescriptor) against the caller's Principal, so
callers never bypass the role model.
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentCommandService(MetadataRegistry registry, org.jdbi.v3.core.Jdbi jdbi, UiProperties properties, NumberGenerator numberGenerator, PostingService postingService, DocumentQueryService query, UiAccessService access, org.springframework.context.ApplicationEventPublisher events, SecretCipher secretCipher) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(DocumentDescriptor desc, UUID id, Principal principal) post(DocumentDescriptor desc, UUID id, Principal principal) postingPreview(DocumentDescriptor desc, UUID id, Principal principal) unpost(DocumentDescriptor desc, UUID id, Principal principal)
-
Constructor Details
-
DocumentCommandService
public DocumentCommandService(MetadataRegistry registry, org.jdbi.v3.core.Jdbi jdbi, UiProperties properties, NumberGenerator numberGenerator, PostingService postingService, DocumentQueryService query, UiAccessService access, org.springframework.context.ApplicationEventPublisher events, SecretCipher secretCipher)
-
-
Method Details
-
create
-
update
-
post
-
postingPreview
-
unpost
-
delete
-