[VIVO-1375] Upgrade to Servlet 3.0 spec
This commit is contained in:
parent
d0b971f7e6
commit
8bf1b10e53
23 changed files with 98 additions and 1415 deletions
|
@ -38,12 +38,12 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<version>4.3.10.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<version>4.3.10.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -59,8 +59,8 @@
|
|||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -14,6 +14,9 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Exc
|
|||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
|
||||
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
|
||||
@WebServlet(name = "AboutQrCodesController", urlPatterns = {"/qrcode/about"})
|
||||
public class AboutQrCodesController extends FreemarkerHttpServlet {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -28,6 +28,9 @@ import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.VIVOIndivi
|
|||
import freemarker.ext.beans.BeansWrapper;
|
||||
import freemarker.template.DefaultObjectWrapper;
|
||||
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
|
||||
@WebServlet(name = "ExportQrCodeController", urlPatterns = {"/qrcode"})
|
||||
public class ExportQrCodeController extends FreemarkerHttpServlet {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -5,6 +5,7 @@ package edu.cornell.mannlib.vitro.webapp.controller.ajax;
|
|||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -17,6 +18,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.ajax.VitroAjaxController;
|
|||
* Handle the AJAX functions that are specific to the "new" home page sections, at
|
||||
* this point just the mapping of geographic locations.
|
||||
*/
|
||||
@WebServlet(name = "HomePageAjax", urlPatterns = {"/homePageAjax"} )
|
||||
public class HomePageAjaxController extends VitroAjaxController {
|
||||
private static final Log log = LogFactory
|
||||
.getLog(HomePageAjaxController.class);
|
||||
|
|
|
@ -5,6 +5,7 @@ package edu.cornell.mannlib.vitro.webapp.controller.ajax;
|
|||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -17,6 +18,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.ajax.VitroAjaxController;
|
|||
* Handle the AJAX functions that are specific to the "new" home page sections, at
|
||||
* this point just the mapping of geographic locations.
|
||||
*/
|
||||
@WebServlet(name = "QrCodeAjax", urlPatterns = {"/qrCodeAjax"} )
|
||||
public class QrCodeAjaxController extends VitroAjaxController {
|
||||
private static final Log log = LogFactory
|
||||
.getLog(QrCodeAjaxController.class);
|
||||
|
|
|
@ -7,6 +7,7 @@ import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.TBOX_ASSER
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -34,6 +35,7 @@ import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
|
|||
* Custom controller for menu management. This will be replaced later once N3 Editing
|
||||
* has been successfully refactored and integrated with menu management.
|
||||
*/
|
||||
@WebServlet(name = "InstitutionalInternalClassController", urlPatterns = {"/processInstitutionalInternalClass"} )
|
||||
public class InstitutionalInternalClassController extends FreemarkerHttpServlet {
|
||||
private static final Log log = LogFactory.getLog(InstitutionalInternalClassController.class);
|
||||
|
||||
|
|
|
@ -24,7 +24,10 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Tem
|
|||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils;
|
||||
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
|
||||
|
||||
@WebServlet(name = "ManageGrantsForIndividualController", urlPatterns = {"/manageGrants"} )
|
||||
public class ManageGrantsForIndividualController extends FreemarkerHttpServlet {
|
||||
|
||||
private static final Log log = LogFactory.getLog(ManageGrantsForIndividualController.class.getName());
|
||||
|
|
|
@ -24,7 +24,10 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Tem
|
|||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils;
|
||||
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
|
||||
|
||||
@WebServlet(name = "ManagePeopleForOrganizationController", urlPatterns = {"/managePeople"} )
|
||||
public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet {
|
||||
|
||||
private static final Log log = LogFactory.getLog(ManagePeopleForOrganizationController.class.getName());
|
||||
|
|
|
@ -24,7 +24,10 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Tem
|
|||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils;
|
||||
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
|
||||
|
||||
@WebServlet(name = "ManagePublicationsForIndividualController", urlPatterns = {"/managePublications"} )
|
||||
public class ManagePublicationsForIndividualController extends FreemarkerHttpServlet {
|
||||
|
||||
private static final Log log = LogFactory.getLog(ManagePublicationsForIndividualController.class.getName());
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in LICENSE$ */
|
||||
|
||||
package edu.cornell.mannlib.vitro.webapp.controller.freemarker;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.policy.PolicyHelper;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.tools.ToolsRequestHandler;
|
||||
|
||||
public class VIVOSiteAdminController extends BaseSiteAdminController {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Log log = LogFactory.getLog(VIVOSiteAdminController.class);
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> getSiteMaintenanceUrls(VitroRequest vreq) {
|
||||
|
||||
Map<String, Object> urls = super.getSiteMaintenanceUrls(vreq);
|
||||
|
||||
if (PolicyHelper.isAuthorizedForActions(vreq, ToolsRequestHandler.REQUIRED_ACTIONS)) {
|
||||
urls.put("rebuildVisCache", UrlBuilder.getUrl("/vis/tools"));
|
||||
}
|
||||
|
||||
return urls;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> getSiteConfigData(VitroRequest vreq) {
|
||||
|
||||
Map<String, Object> data = super.getSiteConfigData(vreq);
|
||||
|
||||
if (PolicyHelper.isAuthorizedForActions(vreq, InstitutionalInternalClassController.REQUIRED_ACTIONS)) {
|
||||
data.put("internalClass", UrlBuilder.getUrl("/processInstitutionalInternalClass"));
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
|
@ -20,6 +20,7 @@ import java.util.Set;
|
|||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
@ -44,6 +45,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Res
|
|||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.filestorage.impl.FileStorageImplWrapper;
|
||||
|
||||
@WebServlet(name = "FileHarvestController", urlPatterns = {"/harvester/harvest"})
|
||||
public class FileHarvestController extends FreemarkerHttpServlet {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.io.IOException;
|
|||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -32,6 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequ
|
|||
* @author cdtank
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@WebServlet(name = "AjaxVisualizationController", urlPatterns = {"/visualizationAjax"})
|
||||
public class AjaxVisualizationController extends FreemarkerHttpServlet {
|
||||
|
||||
public static final String URL_ENCODING_SCHEME = "UTF-8";
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.io.IOException;
|
|||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -30,6 +31,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequ
|
|||
* @author cdtank
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@WebServlet(name = "DataVisualizationController", urlPatterns = {"/visualizationData"})
|
||||
public class DataVisualizationController extends VitroHttpServlet {
|
||||
|
||||
public static final String URL_ENCODING_SCHEME = "UTF-8";
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -33,6 +34,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequ
|
|||
* @author cdtank
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@WebServlet(name = "ShortURLVisualizationController", urlPatterns = {"/vis/*"})
|
||||
public class ShortURLVisualizationController extends FreemarkerHttpServlet {
|
||||
|
||||
public static final String URL_ENCODING_SCHEME = "UTF-8";
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.controller.visualization;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
@ -27,6 +28,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequ
|
|||
* @author cdtank
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@WebServlet(name = "StandardVisualizationController", urlPatterns = {"/visualizationfm","/visualization"})
|
||||
public class StandardVisualizationController extends FreemarkerHttpServlet {
|
||||
|
||||
public static final String URL_ENCODING_SCHEME = "UTF-8";
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
|||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -25,6 +26,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet;
|
|||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.ConceptSearchService.ConceptSearchServiceUtils;
|
||||
|
||||
@WebServlet(name = "ConceptSearchService", urlPatterns = {"/conceptSearchService"} )
|
||||
public class ConceptSearchServlet extends VitroHttpServlet {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -8,6 +8,7 @@ import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
|
|||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -45,6 +46,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Res
|
|||
* show orcidSuccess.ftl with "return to profile" and "view profile" links.
|
||||
* </pre>
|
||||
*/
|
||||
@WebServlet(name = "OrcidIntegrationController", urlPatterns = {"/orcid/*"})
|
||||
public class OrcidIntegrationController extends FreemarkerHttpServlet {
|
||||
private static final Log log = LogFactory
|
||||
.getLog(OrcidIntegrationController.class);
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.apache.commons.io.IOUtils;
|
|||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -21,6 +22,7 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
@WebServlet(name = "SiteMapServlet", urlPatterns = {"/robots.txt","/sitemap.xml"})
|
||||
public class SiteMapServlet extends VitroHttpServlet {
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package org.vivoweb.webapp.startup;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.InstitutionalInternalClassController;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.SiteAdminController;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.menuManagement.MenuManagementDataUtils;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.menuManagement.VIVOMenuManagementDataUtils;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.tools.ToolsRequestHandler;
|
||||
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
public class SiteAdminSetup implements ServletContextListener {
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent servletContextEvent) {
|
||||
SiteAdminController.registerSiteMaintenanceUrl("rebuildVisCache", UrlBuilder.getUrl("/vis/tools"), ToolsRequestHandler.REQUIRED_ACTIONS);
|
||||
SiteAdminController.registerSiteConfigData("internalClass", UrlBuilder.getUrl("/processInstitutionalInternalClass"), InstitutionalInternalClassController.REQUIRED_ACTIONS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent servletContextEvent) {
|
||||
|
||||
}
|
||||
}
|
12
webapp/src/main/webapp/WEB-INF/applicationContext.xml
Normal file
12
webapp/src/main/webapp/WEB-INF/applicationContext.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-4.3.xsd">
|
||||
|
||||
<context:component-scan base-package="edu.cornell.mannlib" />
|
||||
<context:component-scan base-package="org.vivoweb" />
|
||||
|
||||
</beans>
|
|
@ -61,6 +61,7 @@ org.vivoweb.webapp.startup.DataGetterN3Setup
|
|||
org.vivoweb.webapp.startup.GeneratorSetup
|
||||
org.vivoweb.webapp.startup.JSONWrapperSetup
|
||||
org.vivoweb.webapp.startup.MenuManagementSetup
|
||||
org.vivoweb.webapp.startup.SiteAdminSetup
|
||||
org.vivoweb.webapp.startup.TemplateModelSetup
|
||||
org.vivoweb.webapp.startup.SearchResultTemplateModelSetup
|
||||
|
||||
|
|
12
webapp/src/main/webapp/WEB-INF/springmvc-beans.xml
Normal file
12
webapp/src/main/webapp/WEB-INF/springmvc-beans.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-4.3.xsd">
|
||||
|
||||
<context:component-scan base-package="edu.cornell.mannlib" />
|
||||
<context:component-scan base-package="org.vivoweb" />
|
||||
|
||||
</beans>
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue