Class IdentifierResolver

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
io.goobi.viewer.servlets.IdentifierResolver
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class IdentifierResolver extends javax.servlet.http.HttpServlet
This Servlet maps a given lucene field value to a url and then either redirects there or forwards there, depending on the config.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    constructUrl(org.apache.solr.common.SolrDocument targetDoc, boolean pageResolverUrl)
    constructUrl.
    protected void
    doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    For a given lucene field name parameter, this method either forwards or redirects to the target URL.

    Methods inherited from class javax.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IdentifierResolver

      public IdentifierResolver()
  • Method Details

    • doGet

      protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      For a given lucene field name parameter, this method either forwards or redirects to the target URL. The target URL is generated by inserting the target lucene field into the target work url, if a document could be identified by the source field. Otherwise, a document is searched for using the page field; if a document is found in this alternative way, target field and page field of the document are inserted into the target page url. NOTE: If you forward, the target URL must be on the same server and must be below the context root of this servlet, e.g. this servlet can not forward to a target above '/'. A redirect changes the URL displayed in the browser, a forward does not.
      Overrides:
      doGet in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • constructUrl

      public static String constructUrl(org.apache.solr.common.SolrDocument targetDoc, boolean pageResolverUrl)

      constructUrl.

      Parameters:
      targetDoc - a SolrDocument object
      pageResolverUrl - a boolean
      Returns:
      Generated URL