Class DefaultURLBuilder

java.lang.Object
io.goobi.viewer.modules.interfaces.DefaultURLBuilder
All Implemented Interfaces:
IURLBuilder

public class DefaultURLBuilder extends Object implements IURLBuilder
Default implementation of the URL builder interface, constructing standard viewer page URLs.
Author:
Florian Alpers
  • Constructor Details

    • DefaultURLBuilder

      public DefaultURLBuilder()
  • Method Details

    • generateURL

      public String generateURL(BrowseElement ele)
      generateURL.
      Specified by:
      generateURL in interface IURLBuilder
      Parameters:
      ele - The browseElement for which we want to build a url
      Returns:
      The url the the given BrowseElement should link to
    • buildPageUrl

      public String buildPageUrl(String pi, int imageNo, String logId, PageType pageType, boolean topStruct)
      buildPageUrl.
      Specified by:
      buildPageUrl in interface IURLBuilder
      Parameters:
      pi - The record persistent identifier
      imageNo - the page number (1-based)
      logId - The METS identifier of the logical struct element
      pageType - the type of viewer page the url should open
      topStruct - if false, the url should point to a page or struct element within the record, so imageNo and logId must be considered
      Returns:
      A URL to the object in the view given by pageType
    • getPageType

      protected PageType getPageType(BrowseElement ele)
      getPageType.
      Parameters:
      ele - browse element whose page type to determine
      Returns:
      the PageType appropriate for the given browse element, adjusted for UGC and TEI records
    • buildSearchUrl

      protected String buildSearchUrl(String fieldName, String fieldValue)
      buildSearchUrl.
      Parameters:
      fieldName - Solr field name to search in
      fieldValue - field value to search for
      Returns:
      the viewer search URL for the given Solr field and value