Interface IFormcycleUriManager

  • All Known Implementing Classes:
    FormcycleUriManager

    public interface IFormcycleUriManager
    Manages URLs as used by the formcycle app.
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • formProvide

        IFormProvideUrlBuilder formProvide​(long projectId)
        Gets a builder for configuring and creating the form provide URL that can be used to open a form. Uses the current formcycle base URL.
        Parameters:
        projectId - ID of a project.
        Returns:
        The builder for the form provide URL.
      • formReview

        IFormReviewUrlBuilder formReview​(long projectId,
                                         String processId)
        Gets a builder for configuring and creating the form review URL that can be used to review a form record. Uses the current formcycle base URL.
        Parameters:
        projectId - ID of a project.
        Returns:
        The form review URL for the given project, which uses the current formcycle base URL.
      • getBaseUrl

        URI getBaseUrl()
        Returns:
        The base URL to the running formcycle system.
      • isFormContext

        boolean isFormContext​(URI url)
        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

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

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

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

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

        boolean isFormVerify​(URI url)
        Parameters:
        url - URL to check.
        Returns:
        Whether the URL is a formcycle form verify URL (/form/verify).
      • removeBaseUrl

        default URI removeBaseUrl​(URI url,
                                  URI oldBaseUrl)
        If the URL starts with the base URL, remove that base URL. Essentially this relativizes the given URL with respect to the old base URL.
        Parameters:
        url - URL to process.
        oldBaseUrl - Expected base URL.
        Returns:
        The URL, with the base URL removed.
      • replaceBaseUrl

        default URI replaceBaseUrl​(URI url,
                                   URI oldBaseUrl)
        If the URL starts with the base URL, replaces the base URL with the current formcycle base URL.
        Parameters:
        url - URL to process.
        oldBaseUrl - Old expected base URL of the URL.
        Returns:
        The given URL, with the base URL replaced with the current formcycle base URL.
      • replaceBaseUrl

        URI replaceBaseUrl​(URI url,
                           URI oldBaseUrl,
                           URI newBaseUrl)
        If the URL starts with the base URL, replaces the base URL with the new base URL.
        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

        URI replaceEntityReferences​(URI url)
        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.
        Parameters:
        url - URL to process.
        Returns:
        The URL with all entity references replaced.
      • servletActionPlugin

        default URI servletActionPlugin​(String pluginName)
        URI for a servlet action plugin. The client is taken from the current setup result context.
        Parameters:
        pluginName - Name of the plugin.
        Returns:
        The URL for a servlet action plugin with the given name.
      • servletActionPlugin

        default URI servletActionPlugin​(String pluginName,
                                        Long clientId)
        URI for a servlet action plugin.
        Parameters:
        pluginName - Name of the plugin.
        clientId - ID of the client where the plugin was installed.
        Returns:
        The URL for a servlet action plugin with the given name.
      • servletActionPlugin

        URI servletActionPlugin​(String pluginName,
                                Long clientId,
                                Map<String,​Object> urlParams)
        URI for a servlet action plugin.
        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

        URI servletActionPlugin​(String pluginName,
                                Map<String,​Object> urlParams)
        URI for a servlet action plugin. The client is taken from the current setup result context.
        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

        URI setFormProvideLangIfMissing​(URI url,
                                        String newLanguage)
        Sets the language parameter on a form provide URL.
        Parameters:
        url - 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.