Interface YFormService

  • All Known Implementing Classes:
    DefaultYFormService

    public interface YFormService
    Implements methods for managing yForms.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      YFormDataModel createOrUpdateYFormData​(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content)
      Create or Update YFormDataModel.
      YFormDataModel createYFormData​(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content)
      Creates YFormData if it doesn't exist and assigns it to the corresponding YFormDefinition.
      YFormDataModel createYFormData​(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content, java.lang.String ownerApplicationId, java.lang.String ownerFormId)
      Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.
      YFormDataModel createYFormData​(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content, java.lang.String ownerApplicationId, java.lang.String ownerFormId, boolean system)
      Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.
      YFormDefinitionModel createYFormDefinition​(java.lang.String applicationId, java.lang.String formId, java.lang.String title, java.lang.String description, java.lang.String content, java.lang.String documentId)
      Create a new YFormDefinition with specific parameters.
      YFormDataModel getYFormData​(java.lang.String formDataId, YFormDataTypeEnum type)
      Return form data model with specific id and type.
      YFormDataModel getYFormData​(java.lang.String applicationId, java.lang.String formId, java.lang.String refId, YFormDataTypeEnum type)
      Return the form data model with the specified parameters.
      java.util.List<YFormDataModel> getYFormDataByRefId​(java.lang.String refId)
      Return a list of the form data models with specified reference id.
      YFormDefinitionModel getYFormDefinition​(java.lang.String applicationId, java.lang.String formId)
      For a given applicationId and formId a form definition is returned.
      YFormDefinitionModel getYFormDefinition​(java.lang.String applicationId, java.lang.String formId, int version)
      Only for testing purposes, shouldn't be used to get the latest YFormDefinition
      void setFormDefinitionStatus​(java.lang.String applicationId, java.lang.String formId, YFormDefinitionStatusEnum status)
      Set the status for all the form definitions with specific application id and form id.
      YFormDataModel updateYFormData​(java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String content)
      Update YFormData content of form data with specific id and type.
      YFormDefinitionModel updateYFormDefinition​(java.lang.String applicationId, java.lang.String formId, java.lang.String content, java.lang.String documentId)
      Update YFormDefinition if it exists in the database.
    • Method Detail

      • getYFormDefinition

        YFormDefinitionModel getYFormDefinition​(java.lang.String applicationId,
                                                java.lang.String formId)
                                         throws YFormServiceException
        For a given applicationId and formId a form definition is returned.
        Parameters:
        applicationId - the application id of the form definition
        formId - the form id of the form definition
        Returns:
        form definition with the specific parameters
        Throws:
        YFormServiceException - if definition is not found
      • getYFormDefinition

        YFormDefinitionModel getYFormDefinition​(java.lang.String applicationId,
                                                java.lang.String formId,
                                                int version)
                                         throws YFormServiceException
        Only for testing purposes, shouldn't be used to get the latest YFormDefinition
        Parameters:
        applicationId - the application id of the form definition
        formId - the form id of the form definition
        version - the version of the form definition
        Returns:
        form definition with the specific parameters
        Throws:
        YFormServiceException - if definition is not found
      • updateYFormDefinition

        YFormDefinitionModel updateYFormDefinition​(java.lang.String applicationId,
                                                   java.lang.String formId,
                                                   java.lang.String content,
                                                   java.lang.String documentId)
                                            throws YFormServiceException
        Update YFormDefinition if it exists in the database.
        Parameters:
        applicationId - the application id of the form definition
        formId - the form id of the form definition
        content - the content of the form definition
        documentId - the document id of the form definition
        Returns:
        the updated form definition model
        Throws:
        YFormServiceException - if form definition cannot be saved
      • createYFormDefinition

        YFormDefinitionModel createYFormDefinition​(java.lang.String applicationId,
                                                   java.lang.String formId,
                                                   java.lang.String title,
                                                   java.lang.String description,
                                                   java.lang.String content,
                                                   java.lang.String documentId)
                                            throws YFormServiceException
        Create a new YFormDefinition with specific parameters.
        Parameters:
        applicationId - the application id of the form definition, should exist in a catalog
        formId - the form id of the form definition
        title - the tile of the form definition
        description - the description of the form definition
        content - the content of the form definition
        documentId - the document id of the form definition
        Returns:
        created form definition model
        Throws:
        YFormServiceException - if form definition cannot be created
      • getYFormData

        YFormDataModel getYFormData​(java.lang.String formDataId,
                                    YFormDataTypeEnum type)
                             throws YFormServiceException
        Return form data model with specific id and type.
        Parameters:
        formDataId - the id of the form data
        type - the type of the form data
        Returns:
        form data model with specific parameters
        Throws:
        YFormServiceException - if form data is not found
      • createOrUpdateYFormData

        YFormDataModel createOrUpdateYFormData​(java.lang.String applicationId,
                                               java.lang.String formId,
                                               java.lang.String formDataId,
                                               YFormDataTypeEnum type,
                                               java.lang.String refId,
                                               java.lang.String content)
                                        throws YFormServiceException
        Create or Update YFormDataModel.
        Parameters:
        applicationId - the application id of the form data
        formId - the form id of the form data
        formDataId - the form data id of the form data
        type - the type of the form data
        refId - the reference id of the form data
        content - the content of the form data
        Returns:
        created or updated form data model
        Throws:
        YFormServiceException - if form data cannot be created or updated
      • updateYFormData

        YFormDataModel updateYFormData​(java.lang.String formDataId,
                                       YFormDataTypeEnum type,
                                       java.lang.String content)
                                throws YFormServiceException
        Update YFormData content of form data with specific id and type.
        Parameters:
        formDataId - the id of the form data
        type - the type of the form data
        content - new content of the form data
        Returns:
        updated form data model
        Throws:
        YFormServiceException - if form data cannot be updated
      • createYFormData

        YFormDataModel createYFormData​(java.lang.String applicationId,
                                       java.lang.String formId,
                                       java.lang.String formDataId,
                                       YFormDataTypeEnum type,
                                       java.lang.String refId,
                                       java.lang.String content)
                                throws YFormServiceException
        Creates YFormData if it doesn't exist and assigns it to the corresponding YFormDefinition.
        Parameters:
        applicationId - the application id of the form data
        formId - the form id of the form data
        formDataId - the form data id of the form data
        type - the type of the form data
        refId - the reference id of the form data
        content - the content of the form data
        Returns:
        created form data model with given parameters
        Throws:
        YFormServiceException - if form data cannot be created
      • createYFormData

        YFormDataModel createYFormData​(java.lang.String applicationId,
                                       java.lang.String formId,
                                       java.lang.String formDataId,
                                       YFormDataTypeEnum type,
                                       java.lang.String refId,
                                       java.lang.String content,
                                       java.lang.String ownerApplicationId,
                                       java.lang.String ownerFormId)
                                throws YFormServiceException
        Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.
        Parameters:
        applicationId - the application id of the form data
        formId - the form id of the form data
        formDataId - the form data id of the form data
        type - the type of the form data
        refId - the reference id of the form data
        content - the content of the form data
        ownerApplicationId - the id of the owner application
        ownerFormId - the id of the owner form
        Returns:
        created form data model with given parameters
        Throws:
        YFormServiceException - if form data cannot be created
      • createYFormData

        YFormDataModel createYFormData​(java.lang.String applicationId,
                                       java.lang.String formId,
                                       java.lang.String formDataId,
                                       YFormDataTypeEnum type,
                                       java.lang.String refId,
                                       java.lang.String content,
                                       java.lang.String ownerApplicationId,
                                       java.lang.String ownerFormId,
                                       boolean system)
                                throws YFormServiceException
        Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.
        Parameters:
        applicationId - the application id of the form data
        formId - the form id of the form data
        formDataId - the form data id of the form data
        type - the type of the form data
        refId - the reference id of the form data
        content - the content of the form data
        ownerApplicationId - the id of the owner application
        ownerFormId - the id of the owner form
        system - the system flag of the form data
        Returns:
        created form data model with given parameters
        Throws:
        YFormServiceException - if form data cannot be created
      • getYFormData

        YFormDataModel getYFormData​(java.lang.String applicationId,
                                    java.lang.String formId,
                                    java.lang.String refId,
                                    YFormDataTypeEnum type)
                             throws YFormServiceException
        Return the form data model with the specified parameters.
        Parameters:
        applicationId - the application id of the form data
        formId - the form id of the form data
        refId - the reference id of the form data
        type - the type of the form data
        Returns:
        the form data model with the specified parameters
        Throws:
        YFormServiceException - if form data is not found
      • getYFormDataByRefId

        java.util.List<YFormDataModel> getYFormDataByRefId​(java.lang.String refId)
        Return a list of the form data models with specified reference id.
        Parameters:
        refId - the reference id of the form data models
        Returns:
        the list of the form data models with specified reference id
      • setFormDefinitionStatus

        void setFormDefinitionStatus​(java.lang.String applicationId,
                                     java.lang.String formId,
                                     YFormDefinitionStatusEnum status)
        Set the status for all the form definitions with specific application id and form id.
        Parameters:
        formId - the form id of the form definition
        applicationId - the application id of the form definition
        status - the new status of the form definition