Class FileHarvestController

  • All Implemented Interfaces:
    edu.cornell.mannlib.vitro.webapp.controller.MultipartRequestWrapper.ParsingStrategy, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    @WebServlet(name="FileHarvestController",
                urlPatterns="/harvester/harvest")
    public class FileHarvestController
    extends edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet

        edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet.Template
      • Nested classes/interfaces inherited from class edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet

        edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet.PickListSorter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String PATH_TO_HARVESTED_DATA
      Relative path from the Harvester root directory to the directory containing the script templates.
      static String PATH_TO_HARVESTER_SCRIPTS
      Relative path from the Harvester root directory to the directory containing the script templates.
      static String PATH_TO_TEMPLATE_FILES
      Relative path from the Harvester root directory to the directory where user-downloadable template files are stored.
      • Fields inherited from class edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet

        BODY_TEMPLATE_TYPE, PAGE_TEMPLATE_TYPE
      • Fields inherited from class edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet

        HTML_MIMETYPE, JSON_LD_MIMETYPE, JSON_MIMETYPE, N3_MIMETYPE, publicDateFormat, RDFXML_MIMETYPE, TTL_MIMETYPE, XHTML_MIMETYPE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doPost​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static String getFileHarvestRootPath​(javax.servlet.http.HttpServletRequest req)
      Returns the path on this machine of the area within Harvester reserved for File Harvest.
      static String getHarvesterPath​(javax.servlet.http.HttpServletRequest req)
      Returns the root location of the VIVO Harvester on this machine.
      protected String getTitle​(String siteName, edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq)  
      static String getUploadPath​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq)
      Gets the location where we want to save uploaded files.
      long maximumMultipartFileSize()  
      protected edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues processRequest​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq)  
      boolean stashFileSizeException()  
      • Methods inherited from class edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet

        doException, doForward, doGet, doRdf, doRedirect, doResponse, doTemplate, getBeansWrapper, getDisplayModelMenu, getFreemarkerComponentsForJsp, getPageTemplateName, getPageTemplateValues, getThemeDir, handleException, processTemplate, processTemplateToString, requiredActions, wrap, wrap, write, writePage, writeTemplate, writeTemplate
      • Methods inherited from class edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet

        dumpRequestParameters, isAuthorizedToDisplayPage, redirectToInsufficientAuthorizationPage, redirectToLoginPage, redirectUnauthorizedRequest, service, sortForPickList
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
    • Field Detail

      • PATH_TO_TEMPLATE_FILES

        public static final String PATH_TO_TEMPLATE_FILES
        Relative path from the Harvester root directory to the directory where user-downloadable template files are stored. Include final slash.
        See Also:
        Constant Field Values
      • PATH_TO_HARVESTER_SCRIPTS

        public static final String PATH_TO_HARVESTER_SCRIPTS
        Relative path from the Harvester root directory to the directory containing the script templates. Include final slash.
        See Also:
        Constant Field Values
      • PATH_TO_HARVESTED_DATA

        public static final String PATH_TO_HARVESTED_DATA
        Relative path from the Harvester root directory to the directory containing the script templates. Include final slash.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FileHarvestController

        public FileHarvestController()
    • Method Detail

      • maximumMultipartFileSize

        public long maximumMultipartFileSize()
        Specified by:
        maximumMultipartFileSize in interface edu.cornell.mannlib.vitro.webapp.controller.MultipartRequestWrapper.ParsingStrategy
        Overrides:
        maximumMultipartFileSize in class edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet
      • stashFileSizeException

        public boolean stashFileSizeException()
        Specified by:
        stashFileSizeException in interface edu.cornell.mannlib.vitro.webapp.controller.MultipartRequestWrapper.ParsingStrategy
        Overrides:
        stashFileSizeException in class edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet
      • processRequest

        protected edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues processRequest​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq)
        Overrides:
        processRequest in class edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet
      • getTitle

        protected String getTitle​(String siteName,
                                  edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq)
        Overrides:
        getTitle in class edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet
      • getHarvesterPath

        public static String getHarvesterPath​(javax.servlet.http.HttpServletRequest req)
        Returns the root location of the VIVO Harvester on this machine.
        Returns:
        the root location of the VIVO Harvester on this machine
      • getFileHarvestRootPath

        public static String getFileHarvestRootPath​(javax.servlet.http.HttpServletRequest req)
        Returns the path on this machine of the area within Harvester reserved for File Harvest.
        Returns:
        the path on this machine of the area within Harvester reserved for File Harvest
      • getUploadPath

        public static String getUploadPath​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq)
        Gets the location where we want to save uploaded files. This location is in the VIVO uploads directory under "harvester", and then in a directory named by the user's session ID as retrieved from the request. The path returned by this method will end in a slash (/).
        Parameters:
        vreq - the request from which to get the session ID
        Returns:
        the path to the location where uploaded files will be saved. This path will end in a slash (/)
      • doPost

        public void doPost​(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response)
                    throws IOException,
                           javax.servlet.ServletException
        Overrides:
        doPost in class edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet
        Throws:
        IOException
        javax.servlet.ServletException