Class MCRContentServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.mycore.frontend.servlets.MCRServlet
org.mycore.frontend.servlets.MCRContentServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable
Direct Known Subclasses:
MCRDerivateContentTransformerServlet, MCRFileNodeServlet, MCRObjectServlet, MCRPDFThumbnailServlet, MCRQRCodeServlet, MCRVueRootServlet

public abstract class MCRContentServlet extends MCRServlet
Author:
Thomas Scheffler (yagee)
See Also:
  • Constructor Details

    • MCRContentServlet

      public MCRContentServlet()
  • Method Details

    • getContent

      public abstract MCRContent getContent(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException
      Returns MCRContent matching current request.
      Throws:
      IOException
    • init

      public void init() throws jakarta.servlet.ServletException
      Overrides:
      init in class MCRServlet
      Throws:
      jakarta.servlet.ServletException
    • doHead

      protected void doHead(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException
      Handles a HEAD request for the specified content.
      Overrides:
      doHead in class jakarta.servlet.http.HttpServlet
      Throws:
      IOException
      jakarta.servlet.ServletException
    • doOptions

      protected void doOptions(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException
      Overrides:
      doOptions in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException
      IOException
    • render

      protected void render(MCRServletJob job, Exception ex) throws Exception
      Description copied from class: MCRServlet
      2nd phase of doGetPost This method has a seperate transaction and gets the same MCRServletJob from the first phase (think) and any exception that occurs at the first phase. By default this method calls doGetPost(MCRServletJob) as a fallback to the old behaviour.
      Overrides:
      render in class MCRServlet
      Parameters:
      job - same instance as of think(MCRServlet job)
      ex - any exception thrown by think(MCRServletJob) or transaction commit
      Throws:
      Exception - if render could not handle ex to produce a nice user page
    • getConfig

      public MCRServletContentHelper.Config getConfig()