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

        default URI formProvide​(long projectId)
        Parameters:
        projectId - ID of a project.
        Returns:
        The form provide URL for the given project, which uses the current FORMCYCLE base URL.
      • formProvide

        URI formProvide​(long projectId,
                        boolean replaceEntityReferences)
        Parameters:
        projectId - ID of a project.
        replaceEntityReferences - If true, process newly created URL via replaceEntityReferences(URI).
        Returns:
        The form provide URL for the given project, which uses the current FORMCYCLE base URL.
      • formProvideUrl

        default String formProvideUrl​(long projectId)
        Parameters:
        projectId - ID of a project.
        Returns:
        The form provide URL for the given project, which uses the current FORMCYCLE base URL.
      • formProvideUrl

        default String formProvideUrl​(long projectId,
                                      boolean replaceEntityReferences)
        Parameters:
        projectId - ID of a project.
        replaceEntityReferences - If true, process newly created URL via replaceEntityReferences(URI).
        Returns:
        The form provide URL for the given project, which uses the current FORMCYCLE base URL.
      • getBaseUrl

        URI getBaseUrl()
        Returns:
        The base URL to the running FORMCYCLE system.
      • 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).
      • 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.
      • 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.
      • 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.