Class FormsRestServiceController

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.springframework.http.ResponseEntity<io.dialob.api.rest.Response> NOT_MODIFIED_RESPONSE  
      static org.springframework.http.ResponseEntity<io.dialob.api.rest.Response> OK_RESPONSE  
      static String TEMPLATE_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.Form getTemplateForm()  
      protected boolean isTemplateFormId​(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

      • 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

      • 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:
        itemCopy in interface FormsRestService
      • postForm

        public org.springframework.http.ResponseEntity<io.dialob.api.form.Form> postForm​(@Valid @RequestBody
                                                                                         @Valid io.dialob.api.form.Form formDocument)
        Specified by:
        postForm in interface FormsRestService
      • 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:
        putForm in interface FormsRestService
        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:
        deleteForm in interface FormsRestService
        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:
        getForm in interface FormsRestService
        Parameters:
        formId - document id or logical form name
        rev - name of tag
        Returns:
      • getFormTags

        public org.springframework.http.ResponseEntity<List<io.dialob.api.form.FormTag>> getFormTags​(String formId)
        Specified by:
        getFormTags in interface FormsRestService
        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:
        getFormTag in interface FormsRestService
        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:
        putFormTagLatest in interface FormsRestService
        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:
        postFormTag in interface FormsRestService
        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: FormsRestService
        Update tag. Only mutable tag can be modified. Mutable tags can be set to existing tags only.
        Specified by:
        putFormTag in interface FormsRestService
        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()