From 285eda8555173324ebce20838c29d0bf7a0ce181 Mon Sep 17 00:00:00 2001 From: j2blake Date: Wed, 20 Apr 2011 16:52:23 +0000 Subject: [PATCH] NIHVIVO-2492 testnetid.jsp is obsolete, using a hard-coded header name and a hard-coded matching ID property. Use /admin/showids.jsp instead. --- webapp/web/admin/testnetid.jsp | 81 ---------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 webapp/web/admin/testnetid.jsp diff --git a/webapp/web/admin/testnetid.jsp b/webapp/web/admin/testnetid.jsp deleted file mode 100644 index b68fc4e00..000000000 --- a/webapp/web/admin/testnetid.jsp +++ /dev/null @@ -1,81 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%@ page import="com.hp.hpl.jena.rdf.model.*" %> -<%@ page import="com.hp.hpl.jena.ontology.OntModel" %> -<%@ page import="com.hp.hpl.jena.shared.Lock" %> -<%@ page import="com.thoughtworks.xstream.XStream" %> -<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.EditLiteral" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Generator" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.Field" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %> -<%@ page import="org.apache.commons.logging.Log" %> -<%@ page import="org.apache.commons.logging.LogFactory" %> -<%@ page import="java.io.StringReader" %> -<%@ page import="java.util.*" %> -<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.SelfEditingIdentifierFactory.NetId"%> -<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.SelfEditingIdentifierFactory.SelfEditing"%> -<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.SelfEditingIdentifierFactory"%> -<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.ArrayIdentifierBundle"%> -<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle"%> -<%@page import="java.io.IOException"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> - - - -Testing getIndividualURIFromNetId() -<% - String[] netids = {"bdc34", "jc55", "bjl24" , "mhd6" , "tpb2" }; - for( String netid : netids){ - %>

Checking <%=netid %>

<% - checkNetId( netid, out, request, (WebappDaoFactory)application.getAttribute("webappDaoFactory")); - } -%> -
- - -<%! - -final String CUWEBAUTH_REMOTE_USER_HEADER = "REMOTE_USER"; - - -private void checkNetId( String inNetId, JspWriter out, HttpServletRequest request, WebappDaoFactory wdf ) throws IOException{ - - if( inNetId != null - && inNetId.length() > 0 - && inNetId.length() < 100 ){ - - SelfEditingIdentifierFactory.NetId netid = new NetId(inNetId); - SelfEditingIdentifierFactory.SelfEditing selfE = null; - - IdentifierBundle idb = new ArrayIdentifierBundle(); - idb.add(netid); - //out.println("added NetId object to IdentifierBundle from CUWEBAUTH header"); - - //VitroRequest vreq = new VitroRequest((HttpServletRequest)request); - String uri = wdf.getIndividualDao().getIndividualURIFromNetId(inNetId); - - - if( uri != null){ - Individual ind = wdf.getIndividualDao().getIndividualByURI(uri); - if( ind != null ){ - selfE = new SelfEditing( ind, null ); - idb.add( selfE ); - out.println("found a URI and an Individual for " + inNetId + " URI: " + ind.getURI()); - }else{ - out.println("found a URI for the netid " + inNetId + " but could not build Individual"); - } - }else{ - out.println("could not find a Individual with the neditd of " + inNetId ); - } - - }else{ - out.println("no remote user value found or value was longer than 100 chars."); - } -} -%> \ No newline at end of file