Interface IResourceLinkMapper

  • All Superinterfaces:
    Serializable

    public interface IResourceLinkMapper
    extends Serializable
    Mapper for resource links returned by the user portal rest API. These are usually includes in a resource as a JSON object with the links property.

    The REST API returns links relative to the request URL used when the API call was made. Since we are making the API calls on the server (and not on the client's browser), we need to remap these links to the URL of the client's browser. Only then can we use these links in the client's browser. The main use case is to display images via an HTML image tag with a src property.

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default Map<String,​String> remap​(de.xima.fc.api.rest.pub.client.user_portal.model.FormRecordAttachmentResource resource)
      Remaps the links of a form record attachment resource.
      default String remap​(de.xima.fc.api.rest.pub.client.user_portal.model.FormRecordAttachmentResource resource, String key)
      Remaps a link at a given key in the links of a form record attachment resource.
      default Map<String,​String> remap​(de.xima.fc.api.rest.pub.client.user_portal.model.UserPortalFileResource resource)
      Remaps the links of a user portal file resource.
      default String remap​(de.xima.fc.api.rest.pub.client.user_portal.model.UserPortalFileResource resource, String key)
      Remaps a link at a given key in the links of a user portal file resource.
      String remap​(String link)
      Remaps a single link.
      default Map<String,​String> remap​(Map<String,​String> links)
      Remaps a map of links.
      default String remap​(Map<String,​String> links, String key)
      Remaps a link at a given key in a map of links.
    • Method Detail

      • remap

        String remap​(String link)
        Remaps a single link. See IResourceLinkMapper for more information.
        Parameters:
        link - The link to remap.
        Returns:
        The remapped link.
      • remap

        default String remap​(Map<String,​String> links,
                             String key)
        Remaps a link at a given key in a map of links. See IResourceLinkMapper for more information.
        Parameters:
        links - The map of links.
        key - The key of the link to remap.
        Returns:
        The remapped link.
      • remap

        default Map<String,​String> remap​(de.xima.fc.api.rest.pub.client.user_portal.model.UserPortalFileResource resource)
        Remaps the links of a user portal file resource. See IResourceLinkMapper for more information.
        Parameters:
        resource - The user portal file resource.
        Returns:
        The remapped map of links.
      • remap

        default String remap​(de.xima.fc.api.rest.pub.client.user_portal.model.UserPortalFileResource resource,
                             String key)
        Remaps a link at a given key in the links of a user portal file resource. See IResourceLinkMapper for more information.
        Parameters:
        resource - The user portal file resource.
        key - The key of the link to remap.
        Returns:
        The remapped link.
      • remap

        default Map<String,​String> remap​(de.xima.fc.api.rest.pub.client.user_portal.model.FormRecordAttachmentResource resource)
        Remaps the links of a form record attachment resource. See IResourceLinkMapper for more information.
        Parameters:
        resource - The form record attachment resource.
        Returns:
        The remapped map of links.
      • remap

        default String remap​(de.xima.fc.api.rest.pub.client.user_portal.model.FormRecordAttachmentResource resource,
                             String key)
        Remaps a link at a given key in the links of a form record attachment resource. See IResourceLinkMapper for more information.
        Parameters:
        resource - The form record attachment resource.
        key - The key of the link to remap.
        Returns:
        The remapped link.