Class IndexController

  • All Implemented Interfaces:
    MultipartRequestWrapper.ParsingStrategy, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    @WebServlet(name="IndexController",
                urlPatterns="/SearchIndex")
    public class IndexController
    extends FreemarkerHttpServlet
    Accepts requests to display the current status of the search index, or to initiate a rebuild. A DISPLAY or REBUILD request is handled like any other FreemarkerHttpServlet. A STATUS is an AJAX request, we override doGet() so we can format the template without enclosing it in a body template. When initialized, this servlet adds a listener to the SearchIndexer, so it can maintain a history of activity. This will provide the contents of the display.
    See Also:
    Serialized Form
    • Field Detail

    • Constructor Detail

      • IndexController

        public IndexController()
    • Method Detail

      • init

        public void init()
                  throws javax.servlet.ServletException
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • setHistory

        public static void setHistory​(IndexHistory history)
        Called by SearchIndexerSetup to provide a history that dates from startup, not just from servlet load time.
      • doGet

        public void doGet​(javax.servlet.http.HttpServletRequest req,
                          javax.servlet.http.HttpServletResponse resp)
                   throws IOException,
                          javax.servlet.ServletException
        Description copied from class: VitroHttpServlet
        doGet does nothing.
        Overrides:
        doGet in class FreemarkerHttpServlet
        Throws:
        IOException
        javax.servlet.ServletException
      • requiredActions

        protected AuthorizationRequest requiredActions​(VitroRequest vreq)
        Description copied from class: FreemarkerHttpServlet
        By default, a page requires authorization for no actions. Subclasses that require authorization to process their page will override to return the actions that require authorization. In some cases, the choice of actions will depend on the contents of the request. NB This method can't be static, because then the superclass method gets called rather than the subclass method. For the same reason, it can't refer to a static or instance field REQUIRED_ACTIONS which is overridden in the subclass.
        Overrides:
        requiredActions in class FreemarkerHttpServlet