Package io.dialob.form.service.rest
Class FormsRestServiceController
- java.lang.Object
-
- io.dialob.form.service.rest.FormsRestServiceController
-
- All Implemented Interfaces:
FormsRestService,FormTagsRestService
@RestController public class FormsRestServiceController extends Object implements FormsRestService, FormTagsRestService
-
-
Field Summary
Fields Modifier and Type Field Description static org.springframework.http.ResponseEntity<io.dialob.api.rest.Response>NOT_MODIFIED_RESPONSEstatic org.springframework.http.ResponseEntity<io.dialob.api.rest.Response>OK_RESPONSEstatic StringTEMPLATE_FORM_ID
-
Constructor Summary
Constructors Constructor Description FormsRestServiceController(org.springframework.context.ApplicationEventPublisher eventPublisher, io.dialob.form.service.api.FormDatabase formDatabase, Optional<io.dialob.form.service.api.FormVersionControlDatabase> formVersionControlDatabase, io.dialob.session.engine.program.FormValidatorExecutor validator, io.dialob.form.service.api.validation.FormIdRenamer renamer, com.fasterxml.jackson.databind.ObjectMapper objectMapper, io.dialob.integration.api.NodeId nodeId, io.dialob.form.service.api.validation.FormItemCopier formItemCopier, CurrentTenant currentTenant, CurrentUserProvider currentUserProvider, Clock clock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<io.dialob.api.rest.Response>deleteForm(String formId)protected org.springframework.http.ResponseEntity<io.dialob.api.rest.Response>fireFormTaggedEvent(Optional<io.dialob.api.form.FormTag> formTag)org.springframework.http.ResponseEntity<io.dialob.api.form.Form>getForm(String formId, String rev)org.springframework.http.ResponseEntity<List<FormListItem>>getForms(String metadata)org.springframework.http.ResponseEntity<io.dialob.api.form.FormTag>getFormTag(String formId, String tagName)org.springframework.http.ResponseEntity<List<io.dialob.api.form.FormTag>>getFormTags(String formId)org.springframework.http.ResponseEntity<List<io.dialob.api.form.FormTag>>getTags(String formName, String formId, String name)protected io.dialob.api.form.FormgetTemplateForm()protected booleanisTemplateFormId(String formId)org.springframework.http.ResponseEntity<io.dialob.api.form.FormPutResponse>itemCopy(String itemId, io.dialob.api.form.Form form)org.springframework.http.ResponseEntity<io.dialob.api.form.Form>postForm(@Valid io.dialob.api.form.Form formDocument)org.springframework.http.ResponseEntity<io.dialob.api.rest.Response>postFormTag(String formId, String rev, boolean snapshot, io.dialob.api.form.FormTag tag)org.springframework.http.ResponseEntity<io.dialob.api.form.FormPutResponse>putForm(String formId, String oldId, String newId, boolean forced, boolean dryRun, @NotNull io.dialob.api.form.Form formBody)org.springframework.http.ResponseEntity<io.dialob.api.rest.Response>putFormTag(String formId, String tagName, io.dialob.api.form.FormTag requestTag)Update tag.org.springframework.http.ResponseEntity<io.dialob.api.rest.Response>putFormTagLatest(String formId, io.dialob.api.form.FormTag tag)
-
-
-
Field Detail
-
TEMPLATE_FORM_ID
public static final String TEMPLATE_FORM_ID
- See Also:
- Constant Field Values
-
NOT_MODIFIED_RESPONSE
public static final org.springframework.http.ResponseEntity<io.dialob.api.rest.Response> NOT_MODIFIED_RESPONSE
-
OK_RESPONSE
public static final org.springframework.http.ResponseEntity<io.dialob.api.rest.Response> OK_RESPONSE
-
-
Constructor Detail
-
FormsRestServiceController
public FormsRestServiceController(org.springframework.context.ApplicationEventPublisher eventPublisher, io.dialob.form.service.api.FormDatabase formDatabase, Optional<io.dialob.form.service.api.FormVersionControlDatabase> formVersionControlDatabase, io.dialob.session.engine.program.FormValidatorExecutor validator, io.dialob.form.service.api.validation.FormIdRenamer renamer, com.fasterxml.jackson.databind.ObjectMapper objectMapper, io.dialob.integration.api.NodeId nodeId, io.dialob.form.service.api.validation.FormItemCopier formItemCopier, CurrentTenant currentTenant, CurrentUserProvider currentUserProvider, Clock clock)
-
-
Method Detail
-
getForms
public org.springframework.http.ResponseEntity<List<FormListItem>> getForms(String metadata)
- Specified by:
getFormsin interfaceFormsRestService
-
itemCopy
public org.springframework.http.ResponseEntity<io.dialob.api.form.FormPutResponse> itemCopy(@RequestParam(name="itemId") String itemId, @Validated @RequestBody io.dialob.api.form.Form form)- Specified by:
itemCopyin interfaceFormsRestService
-
postForm
public org.springframework.http.ResponseEntity<io.dialob.api.form.Form> postForm(@Valid @RequestBody @Valid io.dialob.api.form.Form formDocument)- Specified by:
postFormin interfaceFormsRestService
-
putForm
public org.springframework.http.ResponseEntity<io.dialob.api.form.FormPutResponse> putForm(@PathVariable("formId") String formId, @RequestParam(name="oldId",required=false) String oldId, @RequestParam(name="newId",required=false) String newId, @RequestParam(name="force",required=false,defaultValue="false") boolean forced, @RequestParam(name="dryRun",required=false,defaultValue="false") boolean dryRun, @Validated @NotNull @RequestBody @NotNull io.dialob.api.form.Form formBody)- Specified by:
putFormin interfaceFormsRestService- Parameters:
formId- logical form name or document id- Returns:
-
deleteForm
public org.springframework.http.ResponseEntity<io.dialob.api.rest.Response> deleteForm(@PathVariable("formId") String formId)- Specified by:
deleteFormin interfaceFormsRestService- Parameters:
formId- logical form name or document id- Returns:
-
getForm
public org.springframework.http.ResponseEntity<io.dialob.api.form.Form> getForm(@PathVariable("formId") String formId, @RequestParam(name="rev",required=false) String rev)- Specified by:
getFormin interfaceFormsRestService- Parameters:
formId- document id or logical form namerev- name of tag- Returns:
-
getFormTags
public org.springframework.http.ResponseEntity<List<io.dialob.api.form.FormTag>> getFormTags(String formId)
- Specified by:
getFormTagsin interfaceFormsRestService- Parameters:
formId- logical form name or document id- Returns:
- list of tags
-
getFormTag
public org.springframework.http.ResponseEntity<io.dialob.api.form.FormTag> getFormTag(String formId, String tagName)
- Specified by:
getFormTagin interfaceFormsRestService- Parameters:
formId- logical form name- Returns:
-
putFormTagLatest
public org.springframework.http.ResponseEntity<io.dialob.api.rest.Response> putFormTagLatest(String formId, io.dialob.api.form.FormTag tag)
- Specified by:
putFormTagLatestin interfaceFormsRestService- Parameters:
formId- logical form name- Returns:
-
postFormTag
public org.springframework.http.ResponseEntity<io.dialob.api.rest.Response> postFormTag(String formId, String rev, boolean snapshot, io.dialob.api.form.FormTag tag)
- Specified by:
postFormTagin interfaceFormsRestService- Parameters:
formId- logical form name- Returns:
-
putFormTag
public org.springframework.http.ResponseEntity<io.dialob.api.rest.Response> putFormTag(String formId, String tagName, io.dialob.api.form.FormTag requestTag)
Description copied from interface:FormsRestServiceUpdate tag. Only mutable tag can be modified. Mutable tags can be set to existing tags only.- Specified by:
putFormTagin interfaceFormsRestService- Parameters:
formId- logical form name- Returns:
- updated tag
-
fireFormTaggedEvent
protected org.springframework.http.ResponseEntity<io.dialob.api.rest.Response> fireFormTaggedEvent(Optional<io.dialob.api.form.FormTag> formTag)
-
isTemplateFormId
protected boolean isTemplateFormId(String formId)
-
getTemplateForm
protected io.dialob.api.form.Form getTemplateForm()
-
-