Class FormVersionAPI

    • Constructor Detail

      • FormVersionAPI

        public FormVersionAPI()
    • Method Detail

      • getByVersionNumber

        public FormVersion getByVersionNumber​(UserContext uc,
                                              Integer formVersionNumber,
                                              Long projectId)
        Gets a form version by its version number. Defaults to the project's current version if the version number is null or no form version with the given version number exists.
        Parameters:
        uc - The user context of the user who requests the form version.
        formVersionNumber - The version number of the form version to get.
        projectId - ID of the project to get the form version for.
        Returns:
        The form version with the given version number or the project's current version if the version number is null or no form version with the given version number exists.
        Since:
        8.3.0
      • getFormAsJSON

        public com.alibaba.fastjson.JSONObject getFormAsJSON​(UserContext uc,
                                                             FormVersion fv)
                                                      throws IOException,
                                                             com.alibaba.fastjson.JSONException
        This method deliver the JSON for creating a XForm without any styles. This functionality is used for internal processing and ensures that the FD2 project remains independent.
        Parameters:
        uc - UserContext the user context in which the action is to be performed.
        fv - the FormVersion which indicates which JSON should be loaded.
        Returns:
        The form as JSON.
        Throws:
        IOException - Error reading the form file.
        com.alibaba.fastjson.JSONException - Error converting form file content to a JSON.