From 8e15b5e20c0009f55a605329222893db0d8716fc Mon Sep 17 00:00:00 2001 From: rjy7 Date: Fri, 26 Mar 2010 20:19:16 +0000 Subject: [PATCH] NIHVIVO-193 Preliminary code cleanup before making functional modifications. --- webapp/web/edit/forms/defaultLinkForm.new.jsp | 176 ------------------ 1 file changed, 176 deletions(-) delete mode 100644 webapp/web/edit/forms/defaultLinkForm.new.jsp diff --git a/webapp/web/edit/forms/defaultLinkForm.new.jsp b/webapp/web/edit/forms/defaultLinkForm.new.jsp deleted file mode 100644 index 565dfc729..000000000 --- a/webapp/web/edit/forms/defaultLinkForm.new.jsp +++ /dev/null @@ -1,176 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%@ page import="com.hp.hpl.jena.rdf.model.Literal" %> -<%@ page import="com.hp.hpl.jena.rdf.model.Model" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.VClass" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %> -<%@ 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.beans.DataProperty" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary" %> - -<%@ page import="java.util.List" %> - -<%@ page import="org.apache.commons.logging.Log" %> -<%@ page import="org.apache.commons.logging.LogFactory" %> - -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> -<%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %> -<%! - public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.forms.defaultLinkForm.jsp"); -%> - - - - - -<%-- Enter here any class names to be used for constructing INDIVIDUALS_VIA_VCLASS pick lists - These are then referenced in the field's ObjectClassUri but not elsewhere. - NOTE that this class may not exist in the model, in which the only choice of type - that will show up is "web page", which will insert no new statements and just create - links of type vitro:Link --%> - -<%-- Then enter a SPARQL query for each field, by convention concatenating the field id with "Existing" - to convey that the expression is used to retrieve any existing value for the field in an existing individual. - Each of these must then be referenced in the sparqlForExistingLiterals section of the JSON block below - and in the literalsOnForm --%> - - SELECT ?urlExisting - WHERE { ?link <${predicateUri}> ?urlExisting } - -<%-- Pair the "existing" query with the skeleton of what will be asserted for a new statement involving this field. - The actual assertion inserted in the model will be created via string substitution into the ? variables. - NOTE the pattern of punctuation (a period after the prefix URI and after the ?field) --%> - - ?link <${predicateUri}> ?url . - - - - PREFIX vitro: <${vitroUri}> - SELECT ?anchorExisting - WHERE { ?link vitro:linkAnchor ?anchorExisting } - - - @prefix vitro: <${vitroUri}> . - ?link vitro:linkAnchor ?anchor . - - -<%-- When not retrieving a literal via a datatype property, put the SPARQL statement into - the SparqlForExistingUris --%> - - - @prefix rdf: <${rdfUri}> . - @prefix vitro: <${vitroUri}> . - - ?subject <${predicateUri}> ?link . - - ?link rdf:type vitro:Link . - - ?link - vitro:linkURL ?url ; - vitro:linkAnchor ?anchor . - - - - - @prefix rdf: <${rdfUri}> . - - ?link rdf:type ?type . - - - - { - "formUrl" : "${formUrl}", - "editKey" : "${editKey}", - "urlPatternToReturnTo" : "/entity", - - "subject" : ["subject", "${subjectUriJson}" ], - "predicate" : ["predicate", "${predicateUriJson}" ], - "object" : ["link", "${objectUriJson}", "URI" ], - - "n3required" : [ "${n3ForEdit}" ], - "n3optional" : [ "${n3Optional}" ], - "newResources" : { }, - "urisInScope" : { }, - "literalsInScope" : { }, - "urisOnForm" : [ ], - "literalsOnForm" : [ "url", "anchor" ], - "filesOnForm" : [ ], - "sparqlForLiterals" : { }, - "sparqlForUris" : { }, - "sparqlForExistingLiterals" : { - "url" : "${urlExisting}", - "anchor" : "${anchorExisting}" - }, - "sparqlForExistingUris" : { }, - "fields" : { - "url" : { - "newResource" : "false", - "validators" : [ "nonempty" ], - "optionsType" : "UNDEFINED", - "literalOptions" : [ ], - "predicateUri" : "", - "objectClassUri" : "", - "rangeDatatypeUri" : "", - "rangeLang" : "", - "assertions" : [ "${urlAssertion}" ] - }, - "anchor" : { - "newResource" : "false", - "validators" : [ "nonempty" ], - "optionsType" : "UNDEFINED", - "literalOptions" : [ ], - "predicateUri" : "", - "objectClassUri" : "", - "rangeDatatypeUri" : "", - "rangeLang" : "", - "assertions" : [ "${anchorAssertion}" ] - } - } - } - -<% - log.debug(request.getAttribute("editjson")); - - EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request); - if( editConfig == null ){ - editConfig = new EditConfiguration((String)request.getAttribute("editjson")); - EditConfiguration.putConfigInSession(editConfig, session); - } - - - Model model = (Model)application.getAttribute("jenaOntModel"); - String objectUri = (String)request.getAttribute("objectUri"); - if( objectUri != null ){ - editConfig.prepareForObjPropUpdate(model); - }else{ - editConfig.prepareForNonUpdate(model); - } - - /* get some data to make the form more useful */ - Individual subject = (Individual)request.getAttribute("subject"); - - String submitLabel=""; - String title = ""; - if (objectUri != null) { - title = "Edit url for " + subject.getName(); - submitLabel = "Save changes"; - } else { - title = "Create a new url for " + subject.getName(); - submitLabel = "Create new url"; - } - -%> - - - -

<%= title %>

-
" > - -
- - - -