From c53e53c526407d731a8fba0b3e9e457976ddddf3 Mon Sep 17 00:00:00 2001 From: j2blake Date: Fri, 8 Mar 2013 17:48:27 -0500 Subject: [PATCH 1/4] VIVO-2 Fix the URIs of the JSTL taglibs. --- webapp/web/WEB-INF/web.xml | 4 ++-- webapp/web/admin/conceptRepair.jsp | 2 +- webapp/web/admin/gotoIndividual.jsp | 2 +- webapp/web/admin/removeBadRestrictions.jsp | 2 +- webapp/web/admin/removeResourceDescription.jsp | 2 +- webapp/web/admin/syncSesame.jsp | 2 +- webapp/web/error.jsp | 2 +- webapp/web/fileupload/datastreamModification.jsp | 2 +- webapp/web/fileupload/datastreamModificationSuccess.jsp | 2 +- webapp/web/fileupload/md5.jsp | 2 +- webapp/web/jenaIngest/connectDB.jsp | 2 +- webapp/web/jenaIngest/csv2rdfSelectUri.jsp | 2 +- webapp/web/jenaIngest/merge_result.jsp | 2 +- webapp/web/jenaIngest/notfound.jsp | 2 +- webapp/web/jenaIngest/renameResource.jsp | 2 +- webapp/web/jenaIngest/renameResult.jsp | 2 +- webapp/web/jenaIngest/sparqlConstruct.jsp | 2 +- webapp/web/jenaIngest/xmlFileUploadSuccess.jsp | 2 +- webapp/web/templates/alpha/alphaIndex.jsp | 2 +- webapp/web/templates/edit/specific/applicationBean_retry.jsp | 2 +- .../templates/edit/specific/cardinalityRestriction_retry.jsp | 2 +- webapp/web/templates/edit/specific/classes_edit.jsp | 2 +- webapp/web/templates/edit/specific/classgroup_retry.jsp | 2 +- webapp/web/templates/edit/specific/dataprop_retry.jsp | 2 +- webapp/web/templates/edit/specific/dataprops_edit.jsp | 2 +- webapp/web/templates/edit/specific/entity_retry.jsp | 2 +- webapp/web/templates/edit/specific/entity_retry_init.jsp | 2 +- webapp/web/templates/edit/specific/ents_edit.jsp | 4 ++-- .../web/templates/edit/specific/hasValueRestriction_retry.jsp | 2 +- webapp/web/templates/edit/specific/merge_result.jsp | 2 +- webapp/web/templates/edit/specific/moveInstances_retry.jsp | 2 +- .../templates/edit/specific/movePropertyStatements_retry.jsp | 2 +- webapp/web/templates/edit/specific/ontologies_edit.jsp | 2 +- webapp/web/templates/edit/specific/ontology_retry.jsp | 2 +- .../templates/edit/specific/properties2properties_retry.jsp | 2 +- webapp/web/templates/edit/specific/propertyGroup_retry.jsp | 2 +- webapp/web/templates/edit/specific/property_retry.jsp | 2 +- webapp/web/templates/edit/specific/props_edit.jsp | 2 +- webapp/web/templates/edit/specific/renameResource_retry.jsp | 2 +- webapp/web/templates/edit/specific/upload_rdf.jsp | 2 +- webapp/web/templates/edit/specific/upload_rdf_result.jsp | 2 +- webapp/web/templates/edit/specific/user_retry.jsp | 2 +- webapp/web/templates/edit/specific/vclass_retry.jsp | 2 +- webapp/web/templates/entity/entityListForTabs.jsp | 2 +- webapp/web/templates/entity/entityListPages.jsp | 2 +- webapp/web/templates/error/error404content.jsp | 2 +- webapp/web/templates/page/basicPage.jsp | 2 +- webapp/web/templates/page/blankPage.jsp | 2 +- webapp/web/templates/page/headContent.jsp | 2 +- webapp/web/templates/parts/emailUsers.jsp | 2 +- 50 files changed, 52 insertions(+), 52 deletions(-) diff --git a/webapp/web/WEB-INF/web.xml b/webapp/web/WEB-INF/web.xml index 8607ea6f9..5f5407e94 100644 --- a/webapp/web/WEB-INF/web.xml +++ b/webapp/web/WEB-INF/web.xml @@ -1186,12 +1186,12 @@ - http://java.sun.com/jstl/core + http://java.sun.com/jsp/jstl/core /WEB-INF/tlds/c.tld - http://java.sun.com/jstl/functions + http://java.sun.com/jsp/jstl/functions /WEB-INF/tlds/fn.tld diff --git a/webapp/web/admin/conceptRepair.jsp b/webapp/web/admin/conceptRepair.jsp index 87361de87..f8d0796cb 100644 --- a/webapp/web/admin/conceptRepair.jsp +++ b/webapp/web/admin/conceptRepair.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %> diff --git a/webapp/web/admin/gotoIndividual.jsp b/webapp/web/admin/gotoIndividual.jsp index 11786d02f..d01251724 100644 --- a/webapp/web/admin/gotoIndividual.jsp +++ b/webapp/web/admin/gotoIndividual.jsp @@ -3,7 +3,7 @@ <%@page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep"%> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/admin/removeBadRestrictions.jsp b/webapp/web/admin/removeBadRestrictions.jsp index ba059de7f..6954e50d0 100644 --- a/webapp/web/admin/removeBadRestrictions.jsp +++ b/webapp/web/admin/removeBadRestrictions.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/admin/removeResourceDescription.jsp b/webapp/web/admin/removeResourceDescription.jsp index d2868c80c..080fb5f63 100644 --- a/webapp/web/admin/removeResourceDescription.jsp +++ b/webapp/web/admin/removeResourceDescription.jsp @@ -2,7 +2,7 @@ <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/admin/syncSesame.jsp b/webapp/web/admin/syncSesame.jsp index d65966109..d97aa3f56 100644 --- a/webapp/web/admin/syncSesame.jsp +++ b/webapp/web/admin/syncSesame.jsp @@ -11,7 +11,7 @@ <%@page import="java.util.Properties"%> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/error.jsp b/webapp/web/error.jsp index a429ebed2..07a8a2e37 100755 --- a/webapp/web/error.jsp +++ b/webapp/web/error.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ page isErrorPage="true" %> <%@ page import="com.oreilly.servlet.ServletUtils,edu.cornell.mannlib.vitro.webapp.web.*" %> <%@page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%> diff --git a/webapp/web/fileupload/datastreamModification.jsp b/webapp/web/fileupload/datastreamModification.jsp index 15ab6c109..0a134f8f8 100644 --- a/webapp/web/fileupload/datastreamModification.jsp +++ b/webapp/web/fileupload/datastreamModification.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%/* this is used by the FedoraDatastreamController and not by the N3 editing system.*/%> diff --git a/webapp/web/fileupload/datastreamModificationSuccess.jsp b/webapp/web/fileupload/datastreamModificationSuccess.jsp index ca8c7c517..663991cbe 100644 --- a/webapp/web/fileupload/datastreamModificationSuccess.jsp +++ b/webapp/web/fileupload/datastreamModificationSuccess.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
The file ${orginalFileName} was updated. The file received from you had the MD5 checksum ${checksum}.
diff --git a/webapp/web/fileupload/md5.jsp b/webapp/web/fileupload/md5.jsp index a97dffa1f..9ace23a43 100644 --- a/webapp/web/fileupload/md5.jsp +++ b/webapp/web/fileupload/md5.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
${checksum} "${fileName}"
diff --git a/webapp/web/jenaIngest/connectDB.jsp b/webapp/web/jenaIngest/connectDB.jsp index dabf67a66..a1bf3e469 100644 --- a/webapp/web/jenaIngest/connectDB.jsp +++ b/webapp/web/jenaIngest/connectDB.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/jenaIngest/csv2rdfSelectUri.jsp b/webapp/web/jenaIngest/csv2rdfSelectUri.jsp index bcaa75aa0..f7bb72afe 100644 --- a/webapp/web/jenaIngest/csv2rdfSelectUri.jsp +++ b/webapp/web/jenaIngest/csv2rdfSelectUri.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@ page import="com.hp.hpl.jena.ontology.Individual" %> diff --git a/webapp/web/jenaIngest/merge_result.jsp b/webapp/web/jenaIngest/merge_result.jsp index c8752ee46..264ef8a56 100644 --- a/webapp/web/jenaIngest/merge_result.jsp +++ b/webapp/web/jenaIngest/merge_result.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@page import="edu.cornell.mannlib.vitro.webapp.utils.jena.JenaIngestUtils.MergeResult"%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/jenaIngest/notfound.jsp b/webapp/web/jenaIngest/notfound.jsp index f2f187a4b..cbbd0e58d 100644 --- a/webapp/web/jenaIngest/notfound.jsp +++ b/webapp/web/jenaIngest/notfound.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ page import="com.hp.hpl.jena.rdf.model.Model"%>

Individual Not Found

diff --git a/webapp/web/jenaIngest/renameResource.jsp b/webapp/web/jenaIngest/renameResource.jsp index c26f2c65d..3237fff4f 100644 --- a/webapp/web/jenaIngest/renameResource.jsp +++ b/webapp/web/jenaIngest/renameResource.jsp @@ -5,7 +5,7 @@ <%@ page import="java.util.Iterator"%> <%@ page import="java.net.URLEncoder"%> <%@ page import="java.util.List"%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/jenaIngest/renameResult.jsp b/webapp/web/jenaIngest/renameResult.jsp index 00125114a..811fd2901 100644 --- a/webapp/web/jenaIngest/renameResult.jsp +++ b/webapp/web/jenaIngest/renameResult.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/jenaIngest/sparqlConstruct.jsp b/webapp/web/jenaIngest/sparqlConstruct.jsp index 13101bab0..0c1652e59 100644 --- a/webapp/web/jenaIngest/sparqlConstruct.jsp +++ b/webapp/web/jenaIngest/sparqlConstruct.jsp @@ -8,7 +8,7 @@ <%@ page import="java.util.List"%> <%@ page import="java.net.URLEncoder"%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/jenaIngest/xmlFileUploadSuccess.jsp b/webapp/web/jenaIngest/xmlFileUploadSuccess.jsp index 88b32006e..64fcbbae5 100644 --- a/webapp/web/jenaIngest/xmlFileUploadSuccess.jsp +++ b/webapp/web/jenaIngest/xmlFileUploadSuccess.jsp @@ -3,7 +3,7 @@ <%@ page import="com.hp.hpl.jena.rdf.model.ModelMaker" %> <%@ page import="java.util.Iterator" %> <%@ page import="java.net.URLEncoder" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/templates/alpha/alphaIndex.jsp b/webapp/web/templates/alpha/alphaIndex.jsp index fffe1c210..812a491f5 100644 --- a/webapp/web/templates/alpha/alphaIndex.jsp +++ b/webapp/web/templates/alpha/alphaIndex.jsp @@ -2,7 +2,7 @@ <%@ page import="org.apache.commons.logging.Log" %> <%@ page import="org.apache.commons.logging.LogFactory" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><%/* this odd thing points to something in web.xml */ %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%/* this odd thing points to something in web.xml */ %> <%@ page errorPage="/error.jsp"%> <% /*********************************************** alphaIndex.jsp will just display the just the index, no entites. diff --git a/webapp/web/templates/edit/specific/applicationBean_retry.jsp b/webapp/web/templates/edit/specific/applicationBean_retry.jsp index 0d9ca94f5..0262336fa 100644 --- a/webapp/web/templates/edit/specific/applicationBean_retry.jsp +++ b/webapp/web/templates/edit/specific/applicationBean_retry.jsp @@ -3,7 +3,7 @@ <%@ page import="java.util.ArrayList" %> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/templates/edit/specific/cardinalityRestriction_retry.jsp b/webapp/web/templates/edit/specific/cardinalityRestriction_retry.jsp index a0438593a..5effa15e9 100644 --- a/webapp/web/templates/edit/specific/cardinalityRestriction_retry.jsp +++ b/webapp/web/templates/edit/specific/cardinalityRestriction_retry.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> wtffff diff --git a/webapp/web/templates/edit/specific/classes_edit.jsp b/webapp/web/templates/edit/specific/classes_edit.jsp index 64114531c..605810f1f 100644 --- a/webapp/web/templates/edit/specific/classes_edit.jsp +++ b/webapp/web/templates/edit/specific/classes_edit.jsp @@ -3,7 +3,7 @@ diff --git a/webapp/web/templates/edit/specific/classgroup_retry.jsp b/webapp/web/templates/edit/specific/classgroup_retry.jsp index cd01c2263..58e9a25b0 100644 --- a/webapp/web/templates/edit/specific/classgroup_retry.jsp +++ b/webapp/web/templates/edit/specific/classgroup_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> diff --git a/webapp/web/templates/edit/specific/dataprop_retry.jsp b/webapp/web/templates/edit/specific/dataprop_retry.jsp index 803c8e536..94bcccdee 100644 --- a/webapp/web/templates/edit/specific/dataprop_retry.jsp +++ b/webapp/web/templates/edit/specific/dataprop_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%-- colspan set to 4 in DatapropRetryController.java --%> diff --git a/webapp/web/templates/edit/specific/dataprops_edit.jsp b/webapp/web/templates/edit/specific/dataprops_edit.jsp index 61d34714c..904c84122 100644 --- a/webapp/web/templates/edit/specific/dataprops_edit.jsp +++ b/webapp/web/templates/edit/specific/dataprops_edit.jsp @@ -3,7 +3,7 @@
diff --git a/webapp/web/templates/edit/specific/entity_retry.jsp b/webapp/web/templates/edit/specific/entity_retry.jsp index 305795780..73ac96565 100644 --- a/webapp/web/templates/edit/specific/entity_retry.jsp +++ b/webapp/web/templates/edit/specific/entity_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> diff --git a/webapp/web/templates/edit/specific/entity_retry_init.jsp b/webapp/web/templates/edit/specific/entity_retry_init.jsp index 2ab88b284..8fd9fbe43 100644 --- a/webapp/web/templates/edit/specific/entity_retry_init.jsp +++ b/webapp/web/templates/edit/specific/entity_retry_init.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> diff --git a/webapp/web/templates/edit/specific/ents_edit.jsp b/webapp/web/templates/edit/specific/ents_edit.jsp index 3377c525e..75c6e1a99 100644 --- a/webapp/web/templates/edit/specific/ents_edit.jsp +++ b/webapp/web/templates/edit/specific/ents_edit.jsp @@ -3,10 +3,10 @@ <% /* For now, not using XML syntax because the output XHTML is not indented */ %> <% /* */ %> <% /* */ %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.auth.policy.PolicyHelper" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/templates/edit/specific/hasValueRestriction_retry.jsp b/webapp/web/templates/edit/specific/hasValueRestriction_retry.jsp index 9a0d1029b..6dd36ef53 100644 --- a/webapp/web/templates/edit/specific/hasValueRestriction_retry.jsp +++ b/webapp/web/templates/edit/specific/hasValueRestriction_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> diff --git a/webapp/web/templates/edit/specific/merge_result.jsp b/webapp/web/templates/edit/specific/merge_result.jsp index 98ab69f9b..aa165998f 100644 --- a/webapp/web/templates/edit/specific/merge_result.jsp +++ b/webapp/web/templates/edit/specific/merge_result.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

Ingest Home

diff --git a/webapp/web/templates/edit/specific/moveInstances_retry.jsp b/webapp/web/templates/edit/specific/moveInstances_retry.jsp index fb07108bf..2e0f40caf 100644 --- a/webapp/web/templates/edit/specific/moveInstances_retry.jsp +++ b/webapp/web/templates/edit/specific/moveInstances_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%> diff --git a/webapp/web/templates/edit/specific/movePropertyStatements_retry.jsp b/webapp/web/templates/edit/specific/movePropertyStatements_retry.jsp index bfd3f4c8b..225014e76 100644 --- a/webapp/web/templates/edit/specific/movePropertyStatements_retry.jsp +++ b/webapp/web/templates/edit/specific/movePropertyStatements_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> diff --git a/webapp/web/templates/edit/specific/ontologies_edit.jsp b/webapp/web/templates/edit/specific/ontologies_edit.jsp index b7ed9a61c..8fd9a53f8 100644 --- a/webapp/web/templates/edit/specific/ontologies_edit.jsp +++ b/webapp/web/templates/edit/specific/ontologies_edit.jsp @@ -3,7 +3,7 @@ diff --git a/webapp/web/templates/edit/specific/ontology_retry.jsp b/webapp/web/templates/edit/specific/ontology_retry.jsp index 200c5be29..716e8ec0b 100644 --- a/webapp/web/templates/edit/specific/ontology_retry.jsp +++ b/webapp/web/templates/edit/specific/ontology_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> diff --git a/webapp/web/templates/edit/specific/properties2properties_retry.jsp b/webapp/web/templates/edit/specific/properties2properties_retry.jsp index b7c7a92b2..a2c10abec 100644 --- a/webapp/web/templates/edit/specific/properties2properties_retry.jsp +++ b/webapp/web/templates/edit/specific/properties2properties_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> diff --git a/webapp/web/templates/edit/specific/propertyGroup_retry.jsp b/webapp/web/templates/edit/specific/propertyGroup_retry.jsp index c389ebdc5..0dfcaa2c9 100644 --- a/webapp/web/templates/edit/specific/propertyGroup_retry.jsp +++ b/webapp/web/templates/edit/specific/propertyGroup_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> diff --git a/webapp/web/templates/edit/specific/property_retry.jsp b/webapp/web/templates/edit/specific/property_retry.jsp index 00df2d613..0fcb23466 100644 --- a/webapp/web/templates/edit/specific/property_retry.jsp +++ b/webapp/web/templates/edit/specific/property_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%-- colspan set to 6 in PropertyRetryController.java --%> diff --git a/webapp/web/templates/edit/specific/props_edit.jsp b/webapp/web/templates/edit/specific/props_edit.jsp index 10b9261f1..1f55c02f5 100644 --- a/webapp/web/templates/edit/specific/props_edit.jsp +++ b/webapp/web/templates/edit/specific/props_edit.jsp @@ -3,7 +3,7 @@
diff --git a/webapp/web/templates/edit/specific/renameResource_retry.jsp b/webapp/web/templates/edit/specific/renameResource_retry.jsp index 8512ebdd4..4928e1584 100644 --- a/webapp/web/templates/edit/specific/renameResource_retry.jsp +++ b/webapp/web/templates/edit/specific/renameResource_retry.jsp @@ -1,7 +1,7 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> diff --git a/webapp/web/templates/edit/specific/upload_rdf.jsp b/webapp/web/templates/edit/specific/upload_rdf.jsp index 6bd745da1..61852c1b1 100644 --- a/webapp/web/templates/edit/specific/upload_rdf.jsp +++ b/webapp/web/templates/edit/specific/upload_rdf.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %> <%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %> diff --git a/webapp/web/templates/edit/specific/upload_rdf_result.jsp b/webapp/web/templates/edit/specific/upload_rdf_result.jsp index 026a087a6..a5346165a 100644 --- a/webapp/web/templates/edit/specific/upload_rdf_result.jsp +++ b/webapp/web/templates/edit/specific/upload_rdf_result.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
diff --git a/webapp/web/templates/edit/specific/user_retry.jsp b/webapp/web/templates/edit/specific/user_retry.jsp index 27780da69..15ff882f1 100644 --- a/webapp/web/templates/edit/specific/user_retry.jsp +++ b/webapp/web/templates/edit/specific/user_retry.jsp @@ -2,7 +2,7 @@ - + diff --git a/webapp/web/templates/edit/specific/vclass_retry.jsp b/webapp/web/templates/edit/specific/vclass_retry.jsp index 0bf0709fc..e09de9a68 100644 --- a/webapp/web/templates/edit/specific/vclass_retry.jsp +++ b/webapp/web/templates/edit/specific/vclass_retry.jsp @@ -2,7 +2,7 @@ - + diff --git a/webapp/web/templates/entity/entityListForTabs.jsp b/webapp/web/templates/entity/entityListForTabs.jsp index bebb8d9c8..136688b03 100644 --- a/webapp/web/templates/entity/entityListForTabs.jsp +++ b/webapp/web/templates/entity/entityListForTabs.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%><%/* this odd thing points to something in web.xml */ %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%/* this odd thing points to something in web.xml */ %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ page errorPage="/error.jsp"%> <% /*********************************************** diff --git a/webapp/web/templates/entity/entityListPages.jsp b/webapp/web/templates/entity/entityListPages.jsp index 6620e6bc6..22479a7af 100644 --- a/webapp/web/templates/entity/entityListPages.jsp +++ b/webapp/web/templates/entity/entityListPages.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%><%/* this odd thing points to something in web.xml */ %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%/* this odd thing points to something in web.xml */ %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%-- Show pages to select from --%> diff --git a/webapp/web/templates/error/error404content.jsp b/webapp/web/templates/error/error404content.jsp index 00d8dbd71..efaa57f3b 100644 --- a/webapp/web/templates/error/error404content.jsp +++ b/webapp/web/templates/error/error404content.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><%/* this odd thing points to something in web.xml */ %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%/* this odd thing points to something in web.xml */ %>

Page Not Found

diff --git a/webapp/web/templates/page/basicPage.jsp b/webapp/web/templates/page/basicPage.jsp index 07b328d72..e8a4d4754 100644 --- a/webapp/web/templates/page/basicPage.jsp +++ b/webapp/web/templates/page/basicPage.jsp @@ -3,7 +3,7 @@ <%@ page import="edu.cornell.mannlib.vitro.webapp.web.*" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ page errorPage="/error.jsp"%> <%@ page contentType="text/html; charset=UTF-8"%> <%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %> diff --git a/webapp/web/templates/page/blankPage.jsp b/webapp/web/templates/page/blankPage.jsp index 9fec63cb2..383848315 100644 --- a/webapp/web/templates/page/blankPage.jsp +++ b/webapp/web/templates/page/blankPage.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <% /*********************************************** Display a single Page in the most basic fashion. diff --git a/webapp/web/templates/page/headContent.jsp b/webapp/web/templates/page/headContent.jsp index a69690ba0..06b73fe54 100644 --- a/webapp/web/templates/page/headContent.jsp +++ b/webapp/web/templates/page/headContent.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@ page import="javax.servlet.ServletException" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%> diff --git a/webapp/web/templates/parts/emailUsers.jsp b/webapp/web/templates/parts/emailUsers.jsp index 0ae63410b..44b00b313 100644 --- a/webapp/web/templates/parts/emailUsers.jsp +++ b/webapp/web/templates/parts/emailUsers.jsp @@ -1,6 +1,6 @@ <%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
From ba29b0e69a8c73b6d074a6cf501baa424e759485 Mon Sep 17 00:00:00 2001 From: j2blake Date: Fri, 8 Mar 2013 17:49:08 -0500 Subject: [PATCH 2/4] Reduce the logging level - the test should be silent. --- .../rdfservice/filter/LanguageFilteringRDFServiceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/rdfservice/filter/LanguageFilteringRDFServiceTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/rdfservice/filter/LanguageFilteringRDFServiceTest.java index 00f4c4c85..a3da1bd26 100644 --- a/webapp/test/edu/cornell/mannlib/vitro/webapp/rdfservice/filter/LanguageFilteringRDFServiceTest.java +++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/rdfservice/filter/LanguageFilteringRDFServiceTest.java @@ -53,8 +53,8 @@ public class LanguageFilteringRDFServiceTest extends AbstractTestClass { @Before public void setup() { - setLoggerLevel(this.getClass(), Level.DEBUG); - setLoggerLevel(LanguageFilteringRDFService.class, Level.DEBUG); +// setLoggerLevel(this.getClass(), Level.DEBUG); +// setLoggerLevel(LanguageFilteringRDFService.class, Level.DEBUG); } // ---------------------------------------------------------------------- From e1f2832fbdba5a3d8b939bf4bd94d1a9f339314c Mon Sep 17 00:00:00 2001 From: j2blake Date: Mon, 11 Mar 2013 13:29:20 -0400 Subject: [PATCH 3/4] VIVO-25 Check that web.xml is container-neutral Create an Ant target that checks web.xml against the assembled webapp, looking for conditions that violate the Servlet spec or the JSP spec, but that Tomcat does not complain about. This will not be a main-stream target, but must be specifically invoked by developers or by Jenkins in order to be effective. --- .../CheckContainerNeutrality.java | 401 ++++++++++++++++++ webapp/build.xml | 31 +- .../mannlib/vitro/webapp/WebXmlTest.java | 308 -------------- 3 files changed, 426 insertions(+), 314 deletions(-) create mode 100644 utilities/buildutils/src/edu/cornell/mannlib/vitro/utilities/containerneutral/CheckContainerNeutrality.java delete mode 100644 webapp/test/edu/cornell/mannlib/vitro/webapp/WebXmlTest.java diff --git a/utilities/buildutils/src/edu/cornell/mannlib/vitro/utilities/containerneutral/CheckContainerNeutrality.java b/utilities/buildutils/src/edu/cornell/mannlib/vitro/utilities/containerneutral/CheckContainerNeutrality.java new file mode 100644 index 000000000..9475d792e --- /dev/null +++ b/utilities/buildutils/src/edu/cornell/mannlib/vitro/utilities/containerneutral/CheckContainerNeutrality.java @@ -0,0 +1,401 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.utilities.containerneutral; + +import static org.junit.Assert.fail; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import javax.servlet.Filter; +import javax.servlet.ServletContextListener; +import javax.servlet.http.HttpServlet; +import javax.xml.namespace.NamespaceContext; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.apache.commons.lang.StringUtils; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +/** + * Look at web.xml, and check for conditions that violate the Servlet 2.4 spec, + * but that might not be noticed because Tomcat doesn't complain. + * + * ------ + * + * Values of the tag: + * + * The spec permits only these values: "FORWARD", "REQUEST", "INCLUDE", "ERROR", + * but Tomcat also allows the lower-case equivalents. GlassFish or WebLogic will + * barf on lower-case. + * + * Check to see that only the upper-case values are used. + * + * ------ + * + * Existence of Servlet classes: + * + * The spec allows the container to either load all servlets at startup, or to + * load them when requested. Since Tomcat only loads servlet when requested, it + * doesn't notice or complain if web.xml cites a that doesn't + * exist, as long as it is never invoked. On the other hand, WebLogic loads all + * serlvets at startup, and will barf if the class is not found. + * + * Check each to insure that the class can be loaded and + * instantiated and assigned to HttpServlet. + * + * ------ + * + * Embedded URIs in taglibs. + * + * I can't find this definitively in the JSP spec, but some containers complain + * if web.xml specifies a that conflicts with the embedded + * in the taglib itself. As far as I can see in the spec, the embedded + * tag is not required or referenced unless we are using + * "Implicit Map Entries From TLDs", which in turn is only relevant for TLDs + * packaged in JAR files. So, I can't find support for this complaint, but it + * seems a reasonable one. + * + * Check each specified in web.xml. If the taglib has an embedded + * tag, it should match the from web.xml. + * + * ------ + * + * Existence of Listener and Filter classes. + * + * As far as I can tell, there is no ambiguity here, and every container will + * complain if any of the or entries are + * unsuitable. I check them anyway, since the mechanism was already assembled + * for checking entries. + * + * Check each to insure that the class can be loaded and + * instantiated and assigned to ServletContextListener. + * + * Check each to insure that the class can be loaded and + * instantiated and assigned to Filter. + * + * --------------------------------------------------------------------- + * + * Although this class is executed as a JUnit test, it doesn't have the usual + * structure for a unit test. + * + * In order to produce the most diagnostic information, the test does not abort + * on the first failure. Rather, failure messages are accumulated until all + * checks have been performed, and the test list all such messages on failure. + * + * --------------------------------------------------------------------- + * + * Since this is not executed as part of the standard Vitro unit tests, it also + * cannot use the standard logging mechanism. Log4J has not been initialized. + * + */ +public class CheckContainerNeutrality { + private static final String PROPERTY_WEBAPP_DIR = "CheckContainerNeutrality.webapp.dir"; + + private static DocumentBuilder docBuilder; + private static XPath xpath; + + @BeforeClass + public static void createDocBuilder() { + try { + DocumentBuilderFactory factory = DocumentBuilderFactory + .newInstance(); + factory.setNamespaceAware(true); // never forget this! + docBuilder = factory.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + throw new RuntimeException(e); + } + } + + @BeforeClass + public static void createXPath() { + xpath = XPathFactory.newInstance().newXPath(); + xpath.setNamespaceContext(new StupidNamespaceContext()); + } + + private File webappDir; + private File webXmlFile; + private Document webXmlDoc; + private List messages; + + @Before + public void setup() throws SAXException, IOException { + String webappDirPath = System.getProperty(PROPERTY_WEBAPP_DIR); + if (webappDirPath == null) { + fail("System property '" + PROPERTY_WEBAPP_DIR + + "' was not provided."); + } + webappDir = new File(webappDirPath); + if (!webappDir.isDirectory()) { + fail("'" + webappDirPath + "' is not a directory"); + } + webXmlFile = new File(webappDir, "WEB-INF/web.xml"); + if (!webXmlFile.isFile()) { + fail("Can't find '" + webXmlFile.getAbsolutePath() + "'"); + } + + webXmlDoc = docBuilder.parse(webXmlFile); + + messages = new ArrayList(); + } + + // ---------------------------------------------------------------------- + // Tests + // ---------------------------------------------------------------------- + + @Test + public void checkAll() throws IOException { + checkDispatcherValues(); + checkServletClasses(); + checkListenerClasses(); + checkFilterClasses(); + checkTaglibLocations(); + + if (!messages.isEmpty()) { + fail("Found these problems with '" + webXmlFile.getCanonicalPath() + + "'\n " + StringUtils.join(messages, "\n ")); + } + } + + private void checkDispatcherValues() { + List okValues = Arrays.asList(new String[] { "FORWARD", + "REQUEST", "INCLUDE", "ERROR" }); + for (Node n : findNodes("//j2ee:dispatcher")) { + String text = n.getTextContent(); + if (!okValues.contains(text)) { + messages.add("" + text + + " is not valid. Acceptable values are " + + okValues); + } + } + } + + private void checkServletClasses() { + for (Node n : findNodes("//j2ee:servlet-class")) { + String text = n.getTextContent(); + String problem = confirmClassNameIsValid(text, HttpServlet.class); + if (problem != null) { + messages.add("" + text + + " is not valid: " + problem); + } + } + } + + private void checkListenerClasses() { + for (Node n : findNodes("//j2ee:listener-class")) { + String text = n.getTextContent(); + String problem = confirmClassNameIsValid(text, + ServletContextListener.class); + if (problem != null) { + messages.add("" + text + + " is not valid: " + problem); + } + } + } + + private void checkFilterClasses() { + for (Node n : findNodes("//j2ee:filter-class")) { + String text = n.getTextContent(); + String problem = confirmClassNameIsValid(text, Filter.class); + if (problem != null) { + messages.add("" + text + + " is not valid: " + problem); + } + } + } + + private void checkTaglibLocations() { + for (Node n : findNodes("//j2ee:jsp-config/j2ee:taglib")) { + String taglibUri = findNode("j2ee:taglib-uri", n).getTextContent(); + String taglibLocation = findNode("j2ee:taglib-location", n) + .getTextContent(); + // System.out.println("taglibUri='" + taglibUri + // + "', taglibLocation='" + taglibLocation + "'"); + String message = checkTaglibUri(taglibUri, taglibLocation); + if (message != null) { + messages.add(message); + } + } + } + + private String checkTaglibUri(String taglibUri, String taglibLocation) { + File taglibFile = new File(webappDir, taglibLocation); + if (!taglibFile.isFile()) { + return "File '" + taglibLocation + "' can't be found ('" + + taglibFile.getAbsolutePath() + "')"; + } + + Document taglibDoc; + try { + taglibDoc = docBuilder.parse(taglibFile); + } catch (SAXException e) { + return "Failed to parse the taglib file '" + taglibFile + "': " + e; + } catch (IOException e) { + return "Failed to parse the taglib file '" + taglibFile + "': " + e; + } + + List uriNodes = findNodes("/j2ee:taglib/j2ee:uri", + taglibDoc.getDocumentElement()); + // System.out.println("uriNodes: " + uriNodes); + if (uriNodes.isEmpty()) { + return null; + } + if (uriNodes.size() > 1) { + return "taglib '" + taglibLocation + "' contains " + + uriNodes.size() + + " nodes. Expecting no more than 1"; + } + + String embeddedUri = uriNodes.get(0).getTextContent(); + if (taglibUri.equals(embeddedUri)) { + return null; + } else { + return "URI in taglib doesn't match the one in web.xml: taglib='" + + taglibLocation + "', internal URI='" + + uriNodes.get(0).getTextContent() + + "', URI from web.xml='" + taglibUri + "'"; + } + } + + // ---------------------------------------------------------------------- + // Helper methods + // ---------------------------------------------------------------------- + + /** + * Search for an Xpath in web.xml, returning a handy list. + */ + private List findNodes(String pattern) { + return findNodes(pattern, webXmlDoc.getDocumentElement()); + } + + /** + * Search for an Xpath within a node of web.xml, returning a handy list. + */ + private List findNodes(String pattern, Node context) { + try { + XPathExpression xpe = xpath.compile(pattern); + NodeList nodes = (NodeList) xpe.evaluate(context, + XPathConstants.NODESET); + List list = new ArrayList(); + for (int i = 0; i < nodes.getLength(); i++) { + list.add(nodes.item(i)); + } + return list; + } catch (XPathExpressionException e) { + throw new RuntimeException(e); + } + } + + /** + * Search for an Xpath within a node of web.xml, returning a single node or + * throwing an exception. + */ + private Node findNode(String pattern, Node context) { + List list = findNodes(pattern, context); + if (list.size() != 1) { + throw new RuntimeException("Expecting 1 node, but found " + + list.size() + " nodes using '" + pattern + "'"); + } else { + return list.get(0); + } + } + + /** + * Check that the supplied className can be instantiated with a + * zero-argument constructor, and assigned to a variable of the target + * class. + */ + private String confirmClassNameIsValid(String className, + Class targetClass) { + try { + Class specifiedClass = Class.forName(className); + Object o = specifiedClass.newInstance(); + if (!targetClass.isInstance(o)) { + return specifiedClass.getSimpleName() + + " is not a subclass of " + + targetClass.getSimpleName() + "."; + } + } catch (ClassNotFoundException e) { + return "The class does not exist."; + } catch (InstantiationException e) { + return "The class does not have a public constructor " + + "that takes zero arguments."; + } catch (IllegalAccessException e) { + return "The class does not have a public constructor " + + "that takes zero arguments."; + } + return null; + } + + /** + * Dump the first 20 nodes of an XML context, excluding comments and blank + * text nodes. + */ + @SuppressWarnings("unused") + private int dumpXml(Node xmlNode, int... parms) { + int remaining = (parms.length == 0) ? 20 : parms[0]; + int level = (parms.length < 2) ? 1 : parms[1]; + + Node n = xmlNode; + + if (Node.COMMENT_NODE == n.getNodeType()) { + return 0; + } + if (Node.TEXT_NODE == n.getNodeType()) { + if (StringUtils.isBlank(n.getTextContent())) { + return 0; + } + } + + int used = 1; + + System.out.println(StringUtils.repeat("-->", level) + n); + NodeList nl = n.getChildNodes(); + for (int i = 0; (i < nl.getLength() && remaining > used); i++) { + used += dumpXml(nl.item(i), remaining - used, level + 1); + } + return used; + } + + // ---------------------------------------------------------------------- + // Helper classes + // ---------------------------------------------------------------------- + + private static class StupidNamespaceContext implements NamespaceContext { + @Override + public String getNamespaceURI(String prefix) { + if ("j2ee".equals(prefix)) { + return "http://java.sun.com/xml/ns/j2ee"; + } else { + throw new UnsupportedOperationException(); + } + } + + @Override + public String getPrefix(String namespaceURI) { + throw new UnsupportedOperationException(); + } + + @Override + public Iterator getPrefixes(String namespaceURI) { + throw new UnsupportedOperationException(); + } + } + +} diff --git a/webapp/build.xml b/webapp/build.xml index b522e1531..e9cda0354 100644 --- a/webapp/build.xml +++ b/webapp/build.xml @@ -84,8 +84,13 @@ + + + + + - + - + @@ -160,7 +165,7 @@ - + @@ -210,7 +215,7 @@ - + - + @@ -422,6 +427,21 @@ deploy - Deploy the application directly into the Tomcat webapps directory. + + + + + + + + + + + + + ", level) + n); - NodeList nl = n.getChildNodes(); - for (int i = 0; (i < nl.getLength() && remaining > used); i++) { - used += dumpXml(nl.item(i), remaining - used, level + 1); - } - return used; - } - - // ---------------------------------------------------------------------- - // Helper classes - // ---------------------------------------------------------------------- - - private static class StupidNamespaceContext implements NamespaceContext { - @Override - public String getNamespaceURI(String prefix) { - if ("j2ee".equals(prefix)) { - return "http://java.sun.com/xml/ns/j2ee"; - } else { - throw new UnsupportedOperationException(); - } - } - - @Override - public String getPrefix(String namespaceURI) { - throw new UnsupportedOperationException(); - } - - @Override - public Iterator getPrefixes(String namespaceURI) { - throw new UnsupportedOperationException(); - } - } - -} From 811de3ec9f14dc2a3f80d79331c6d7eac4bfd03b Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Mon, 11 Mar 2013 17:08:07 -0400 Subject: [PATCH 4/4] VIVO-33 fix to allow RDB models to be uploaded to via ingest tools --- .../controller/jena/JenaIngestController.java | 18 +++++++++++ .../controller/jena/RDFUploadController.java | 27 +++++++++++------ .../impl/jena/model/RDFServiceModel.java | 30 +++++++++++-------- 3 files changed, 53 insertions(+), 22 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/JenaIngestController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/JenaIngestController.java index adc58c56f..6d1b2c346 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/JenaIngestController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/JenaIngestController.java @@ -116,6 +116,9 @@ public class JenaIngestController extends BaseEditController { private static final String RENAME_RESOURCE = "/jenaIngest/renameResource.jsp"; private static final String RENAME_RESULT = "/jenaIngest/renameResult.jsp"; private static final String CREATED_GRAPH_BASE_URI = "http://vitro.mannlib.cornell.edu/a/graph/"; + public static final boolean MAIN_STORE_STATE = true; + public static final boolean AUXILIARY_STORE_STATE = false; + private static final String INGEST_STORE_ATTR = JenaIngestController.class.getName() + ".isUsingMainStoreForIngest"; private static final Map attachedModels = new HashMap(); @@ -214,15 +217,30 @@ public class JenaIngestController extends BaseEditController { showModelList(vreq, maker, modelType); } + public static boolean isUsingMainStoreForIngest(VitroRequest vreq) { + Boolean storeState = (Boolean) vreq.getSession().getAttribute(INGEST_STORE_ATTR); + if (storeState == null) { + return MAIN_STORE_STATE; + } else { + return storeState; + } + } + + private void setUsingMainStoreForIngest(VitroRequest vreq, boolean storeState) { + vreq.getSession().setAttribute(INGEST_STORE_ATTR, storeState); + } + private void processRDBModelsRequest(VitroRequest vreq, ModelMaker maker, String modelType) { ModelMaker vjmm = (ModelMaker) getServletContext().getAttribute("vitroJenaModelMaker"); vreq.getSession().setAttribute("vitroJenaModelMaker", vjmm); + setUsingMainStoreForIngest(vreq, AUXILIARY_STORE_STATE); showModelList(vreq, vjmm, "rdb"); } private void processSDBModelsRequest(VitroRequest vreq, ModelMaker maker, String modelType) { ModelMaker vsmm = (ModelMaker) getServletContext().getAttribute("vitroJenaSDBModelMaker"); vreq.getSession().setAttribute("vitroJenaModelMaker", vsmm); + setUsingMainStoreForIngest(vreq, MAIN_STORE_STATE); showModelList(vreq, vsmm, "sdb"); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/RDFUploadController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/RDFUploadController.java index b0788456f..ab7052233 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/RDFUploadController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/RDFUploadController.java @@ -53,9 +53,7 @@ public class RDFUploadController extends JenaIngestController { private static int maxFileSizeInBytes = 1024 * 1024 * 2000; //2000mb private static FileItem fileStream = null; - private static final String INGEST_MENU_JSP = "/jenaIngest/ingestMenu.jsp"; private static final String LOAD_RDF_DATA_JSP="/jenaIngest/loadRDFData.jsp"; - private static final String LIST_MODELS_JSP = "/jenaIngest/listModels.jsp"; public void doPost(HttpServletRequest rawRequest, HttpServletResponse response) throws ServletException, IOException { @@ -244,9 +242,11 @@ public class RDFUploadController extends JenaIngestController { String languageStr = request.getParameter("language"); ModelMaker maker = getVitroJenaModelMaker(request); - if (docLoc!=null && modelName != null) { - RDFService rdfService = RDFServiceUtils.getRDFServiceFactory( - getServletContext()).getRDFService(); + if (modelName == null) { + request.setAttribute("title","Load RDF Data"); + request.setAttribute("bodyJsp",LOAD_RDF_DATA_JSP); + } else { + RDFService rdfService = getRDFService(request, maker, modelName); try { doLoadRDFData(modelName, docLoc, filePath, languageStr, rdfService); } finally { @@ -254,10 +254,7 @@ public class RDFUploadController extends JenaIngestController { } String modelType = getModelType(request, maker); showModelList(request, maker, modelType); - } else { - request.setAttribute("title","Load RDF Data"); - request.setAttribute("bodyJsp",LOAD_RDF_DATA_JSP); - } + } RequestDispatcher rd = request.getRequestDispatcher( Controllers.BASIC_JSP); @@ -272,6 +269,18 @@ public class RDFUploadController extends JenaIngestController { } + private RDFService getRDFService(VitroRequest vreq, ModelMaker maker, String modelName) { + if (JenaIngestController.isUsingMainStoreForIngest(vreq)) { + log.debug("Using main RDFService"); + return RDFServiceUtils.getRDFServiceFactory( + getServletContext()).getRDFService(); + } else { + log.debug("Making RDFService for single model from ModelMaker"); + Model m = maker.getModel(modelName); + return new RDFServiceModel(m); + } + } + private long operateOnModel(WebappDaoFactory webappDaoFactory, OntModel mainModel, Model changesModel, diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/jena/model/RDFServiceModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/jena/model/RDFServiceModel.java index 99b41ad85..6e89e5a95 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/jena/model/RDFServiceModel.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/jena/model/RDFServiceModel.java @@ -9,11 +9,12 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.hp.hpl.jena.query.DataSource; import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.query.DatasetFactory; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.shared.Lock; -import com.hp.hpl.jena.sparql.core.DatasetImpl; import edu.cornell.mannlib.vitro.webapp.dao.jena.DatasetWrapper; import edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet; @@ -28,14 +29,25 @@ public class RDFServiceModel extends RDFServiceJena implements RDFService { private final static Log log = LogFactory.getLog(RDFServiceModel.class); private Model model; + private String modelName; + /** + * Create an RDFService to access a single default graph + * @param model + */ public RDFServiceModel(Model model) { this.model = model; } - + @Override protected DatasetWrapper getDatasetWrapper() { - DatasetWrapper datasetWrapper = new DatasetWrapper(new DatasetImpl(model)); + DataSource d = DatasetFactory.create(); + if (modelName == null) { + d.setDefaultModel(this.model); + } else { + d.addNamedModel(this.modelName, model); + } + DatasetWrapper datasetWrapper = new DatasetWrapper(d); return datasetWrapper; } @@ -50,7 +62,7 @@ public class RDFServiceModel extends RDFServiceJena implements RDFService { return false; } - Dataset dataset = getDatasetWrapper().getDataset(); + //Dataset dataset = getDatasetWrapper().getDataset(); try { for (Object o : changeSet.getPreChangeEvents()) { @@ -65,15 +77,7 @@ public class RDFServiceModel extends RDFServiceJena implements RDFService { modelChange.setSerializedModel(new ByteArrayInputStream(bytes)); } modelChange.getSerializedModel().mark(Integer.MAX_VALUE); - dataset.getLock().enterCriticalSection(Lock.WRITE); - try { - Model model = (modelChange.getGraphURI() == null) - ? dataset.getDefaultModel() - : dataset.getNamedModel(modelChange.getGraphURI()); - operateOnModel(model, modelChange, dataset); - } finally { - dataset.getLock().leaveCriticalSection(); - } + operateOnModel(model, modelChange, null); } // notify listeners of triple changes