Class FormcycleUriManager

    • Constructor Detail

      • FormcycleUriManager

        public FormcycleUriManager​(URI baseUrl,
                                   FormcycleSetupResult setupResult)
        Parameters:
        baseUrl - Base URL of the formcycle app.
        setupResult - Result of running the test setup.
    • Method Detail

      • formProvide

        public URI formProvide​(long projectId,
                               String processId,
                               boolean replaceEntityReferences)
        Specified by:
        formProvide in interface IFormcycleUriManager
        Parameters:
        projectId - ID of a project.
        processId - Process ID of the form record to provide.
        replaceEntityReferences - If true, process newly created URL via IFormcycleUriManager.replaceEntityReferences(URI).
        Returns:
        The form provide URL for the given project, which uses the current formcycle base URL.
      • formReview

        public URI formReview​(long projectId,
                              String processId,
                              boolean replaceEntityReferences)
        Specified by:
        formReview in interface IFormcycleUriManager
        Parameters:
        projectId - ID of a project.
        processId - Process ID of the form record to review.
        replaceEntityReferences - If true, process newly created URL via IFormcycleUriManager.replaceEntityReferences(URI).
        Returns:
        The form review URL for the given project, which uses the current formcycle base URL.
      • isFormContext

        public boolean isFormContext​(URI url)
        Specified by:
        isFormContext in interface IFormcycleUriManager
        Parameters:
        url - URL to check.
        Returns:
        Whether the URL is a formcycle form URL such as /form/provide, /form/process, /form/review, /form/preview etc.
      • isFormPreview

        public boolean isFormPreview​(URI url)
        Specified by:
        isFormPreview in interface IFormcycleUriManager
        Parameters:
        url - URL to check.
        Returns:
        Whether the URL is a formcycle form preview URL (/form/preview).
      • isFormProcess

        public boolean isFormProcess​(URI url)
        Specified by:
        isFormProcess in interface IFormcycleUriManager
        Parameters:
        url - URL to check.
        Returns:
        Whether the URL is a formcycle form process URL (/form/process).
      • isFormProvide

        public boolean isFormProvide​(URI url)
        Specified by:
        isFormProvide in interface IFormcycleUriManager
        Parameters:
        url - URL to check.
        Returns:
        Whether the URL is a formcycle form provide URL (/form/provide).
      • isFormReview

        public boolean isFormReview​(URI url)
        Specified by:
        isFormReview in interface IFormcycleUriManager
        Parameters:
        url - URL to check.
        Returns:
        Whether the URL is a formcycle form review URL (/form/review).
      • isFormVerify

        public boolean isFormVerify​(URI url)
        Specified by:
        isFormVerify in interface IFormcycleUriManager
        Parameters:
        url - URL to check.
        Returns:
        Whether the URL is a formcycle form verify URL (/form/verify).
      • replaceBaseUrl

        public URI replaceBaseUrl​(URI url,
                                  URI oldBaseUrl,
                                  URI newBaseUrl)
        Description copied from interface: IFormcycleUriManager
        If the URL starts with the base URL, replaces the base URL with the new base URL.
        Specified by:
        replaceBaseUrl in interface IFormcycleUriManager
        Parameters:
        url - URL to process.
        oldBaseUrl - Old expected base URL of the URL.
        newBaseUrl - New base URL to use.
        Returns:
        The given URL, with the base URL replaced with the new base URL.
      • replaceEntityReferences

        public URI replaceEntityReferences​(URI url)
        Description copied from interface: IFormcycleUriManager
        Replaces all entity references in the given URL. For example, the project ID [@code 431} in form/provide/431 is replaced with the new project ID (from when the client was created). This requires that a setup method was used that supports entity reference mapping.
        Specified by:
        replaceEntityReferences in interface IFormcycleUriManager
        Parameters:
        url - URL to process.
        Returns:
        The URL with all entity references replaced.
      • servletActionPlugin

        public URI servletActionPlugin​(String pluginName,
                                       Long clientId,
                                       Map<String,​Object> urlParams)
        Description copied from interface: IFormcycleUriManager
        URI for a servlet action plugin.
        Specified by:
        servletActionPlugin in interface IFormcycleUriManager
        Parameters:
        pluginName - Name of the plugin.
        clientId - ID of the client where the plugin was installed.
        urlParams - Optional URL parameters for the URL.
        Returns:
        The URL for a servlet action plugin with the given name.
      • servletActionPlugin

        public URI servletActionPlugin​(String pluginName,
                                       Map<String,​Object> urlParams)
        Description copied from interface: IFormcycleUriManager
        URI for a servlet action plugin. The client is taken from the current setup result context.
        Specified by:
        servletActionPlugin in interface IFormcycleUriManager
        Parameters:
        pluginName - Name of the plugin.
        urlParams - Optional URL parameters for the URL.
        Returns:
        The URL for a servlet action plugin with the given name.
      • setFormProvideLangIfMissing

        public URI setFormProvideLangIfMissing​(URI uri,
                                               String newLanguage)
        Description copied from interface: IFormcycleUriManager
        Sets the language parameter on a form provide URL.
        Specified by:
        setFormProvideLangIfMissing in interface IFormcycleUriManager
        Parameters:
        uri - URL to adjust.
        newLanguage - New language.
        Returns:
        The URL with the language parameter set, or the given URL without changes when the language parameter is set already.