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

      • 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).
      • 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.
      • 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.
      • 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.