NIHVIVO-647 Add name attribute to vitro custom jsp input tag so that the name can differ from the id.
Removed flag1value1 stuff from all vivo custom forms, since no longer needed. Initial setup for publication form javascript.
This commit is contained in:
parent
9b219635a5
commit
95380454af
9 changed files with 93 additions and 72 deletions
|
@ -55,14 +55,6 @@ core:authorInAuthorship (Person : Authorship) - inverse of linkedAuthor
|
|||
VitroRequest vreq = new VitroRequest(request);
|
||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||
vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior
|
||||
|
||||
String flagUri = null;
|
||||
if (wdf.getApplicationDao().isFlag1Active()) {
|
||||
flagUri = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing";
|
||||
} else {
|
||||
flagUri = wdf.getVClassDao().getTopConcept().getURI(); // fall back to owl:Thing if not portal filtering
|
||||
}
|
||||
vreq.setAttribute("flagUri",flagUri);
|
||||
|
||||
vreq.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString()));
|
||||
|
||||
|
@ -106,8 +98,7 @@ SPARQL queries for existing values. --%>
|
|||
<v:jsonset var="n3ForNewAuthorship">
|
||||
@prefix core: <${vivoCore}> .
|
||||
|
||||
?authorshipUri a core:Authorship ,
|
||||
<${flagUri}> ;
|
||||
?authorshipUri a core:Authorship ;
|
||||
core:linkedInformationResource ?infoResource ;
|
||||
core:authorRank ?rank .
|
||||
|
||||
|
@ -124,8 +115,7 @@ SPARQL queries for existing values. --%>
|
|||
@prefix foaf: <${foaf}> .
|
||||
@prefix core: <${vivoCore}> .
|
||||
|
||||
?newPerson a foaf:Person ,
|
||||
<${flagUri}> ;
|
||||
?newPerson a foaf:Person ;
|
||||
<${label}> ?label .
|
||||
|
||||
?authorshipUri core:linkedAuthor ?newPerson .
|
||||
|
|
|
@ -51,14 +51,6 @@ core:informationResourceInAuthorship (InformationResource : Authorship) - invers
|
|||
VitroRequest vreq = new VitroRequest(request);
|
||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||
vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior
|
||||
|
||||
String flagUri = null;
|
||||
if (wdf.getApplicationDao().isFlag1Active()) {
|
||||
flagUri = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing";
|
||||
} else {
|
||||
flagUri = wdf.getVClassDao().getTopConcept().getURI(); // fall back to owl:Thing if not portal filtering
|
||||
}
|
||||
vreq.setAttribute("flagUri",flagUri);
|
||||
|
||||
vreq.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString()));
|
||||
|
||||
|
@ -87,8 +79,7 @@ SPARQL queries for existing values. --%>
|
|||
<v:jsonset var="n3ForNewAuthorship">
|
||||
@prefix core: <${vivoCore}> .
|
||||
|
||||
?authorshipUri a core:Authorship ,
|
||||
<${flagUri}> ;
|
||||
?authorshipUri a core:Authorship ;
|
||||
core:linkedAuthor ?person .
|
||||
|
||||
?person core:authorInAuthorship ?authorshipUri .
|
||||
|
@ -104,8 +95,7 @@ SPARQL queries for existing values. --%>
|
|||
<v:jsonset var="n3ForNewPub">
|
||||
@prefix core: <${vivoCore}> .
|
||||
|
||||
?newPub a ?pubType ,
|
||||
<${flagUri}> ;
|
||||
?newPub a ?pubType ;
|
||||
<${label}> ?title .
|
||||
|
||||
?authorshipUri core:linkedInformationResource ?newPub .
|
||||
|
@ -219,7 +209,7 @@ SPARQL queries for existing values. --%>
|
|||
|
||||
<form id="addPublicationForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
|
||||
|
||||
<v:input type="select" label="Publication type" id="pubType" />
|
||||
<v:input type="select" label="Publication type" name="pubType" id="typeSelector" />
|
||||
|
||||
<v:input type="text" id="title" label="title" cssClass="acInput newIndLabel" size="50" />
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ var addAuthorForm = {
|
|||
vitro.utils.borrowMethods(vitro.customFormUtils, this);
|
||||
},
|
||||
|
||||
// On page load, create references within the addAuthorForm scope to DOM elements.
|
||||
// On page load, create references for easy access to form elements.
|
||||
// NB These must be assigned after the elements have been loaded onto the page.
|
||||
initObjects: function() {
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ var customForm = {
|
|||
vitro.utils.borrowMethods(vitro.customFormUtils, this);
|
||||
},
|
||||
|
||||
// On page load, create references within the customForm scope to DOM elements.
|
||||
// On page load, create references for easy access to form elements.
|
||||
// NB These must be assigned after the elements have been loaded onto the page.
|
||||
initObjects: function() {
|
||||
|
||||
|
|
|
@ -1,2 +1,81 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var customFormWATS = {
|
||||
|
||||
/* *** Initial page setup *** */
|
||||
|
||||
onLoad: function() {
|
||||
this.mixIn();
|
||||
this.initObjects();
|
||||
this.initPage();
|
||||
},
|
||||
|
||||
mixIn: function() {
|
||||
// Mix in the custom form utility methods
|
||||
vitro.utils.borrowMethods(vitro.customFormUtils, this);
|
||||
},
|
||||
|
||||
// On page load, create references for easy access to form elements.
|
||||
// NB These must be assigned after the elements have been loaded onto the page.
|
||||
initObjects: function(){
|
||||
|
||||
this.form = $('#content form');
|
||||
this.button = $('#submit');
|
||||
this.or = $('span.or');
|
||||
this.requiredLegend = $('#requiredLegend');
|
||||
|
||||
this.typeSelector = this.form.find('.typeSelector');
|
||||
this.acInput = this.form.find('.acInput');
|
||||
this.acSelection = this.form.find('.acSelection');
|
||||
this.cancel = this.form.find('cancel');
|
||||
|
||||
},
|
||||
|
||||
// Set up the form on page load
|
||||
initPage: function() {
|
||||
|
||||
this.initFormTypeView();
|
||||
this.bindEventListeners();
|
||||
this.initAutocomplete();
|
||||
|
||||
},
|
||||
|
||||
initFormTypeView: function() {
|
||||
|
||||
this.button.hide();
|
||||
this.or.hide();
|
||||
this.requiredLegend.hide();
|
||||
|
||||
this.cancel.unbind('click');
|
||||
this.cancel('click', function() {
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
initFormFullView: function() {
|
||||
|
||||
this.button.show();
|
||||
this.or.show();
|
||||
this.requiredLegend.show();
|
||||
|
||||
this.cancel.unbind('click');
|
||||
this.cancel('click', function() {
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
// Bind event listeners that apply to all form views
|
||||
bindEventListeners: function() {
|
||||
|
||||
},
|
||||
|
||||
initAutocomplete: function() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
customFormWATS.onLoad();
|
||||
});
|
||||
|
|
|
@ -17,15 +17,7 @@
|
|||
<%
|
||||
VitroRequest vreq = new VitroRequest(request);
|
||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||
vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior
|
||||
|
||||
String flagURI = null;
|
||||
if (vreq.getAppBean().isFlag1Active()) {
|
||||
flagURI = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing";
|
||||
} else {
|
||||
flagURI = wdf.getVClassDao().getTopConcept().getURI(); // fall back to owl:Thing if not portal filtering
|
||||
}
|
||||
vreq.setAttribute("flagURI",flagURI);
|
||||
vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior
|
||||
%>
|
||||
|
||||
<v:jsonset var="personClassUri">http://xmlns.com/foaf/0.1/Person</v:jsonset>
|
||||
|
@ -80,8 +72,7 @@
|
|||
@prefix core: <http://vivoweb.org/ontology/core#>.
|
||||
?organizationUri core:organizationForPosition ?positionUri .
|
||||
?positionUri core:positionInOrganization ?organizationUri .
|
||||
?positionUri rdf:type core:Position .
|
||||
?positionUri rdf:type <${flagURI}> .
|
||||
?positionUri rdf:type core:Position .
|
||||
</v:jsonset>
|
||||
|
||||
<c:set var="editjson" scope="request">
|
||||
|
|
|
@ -32,14 +32,6 @@
|
|||
VitroRequest vreq = new VitroRequest(request);
|
||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||
vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior
|
||||
|
||||
String flagUri = null;
|
||||
if (wdf.getApplicationDao().isFlag1Active()) {
|
||||
flagUri = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing";
|
||||
} else {
|
||||
flagUri = wdf.getVClassDao().getTopConcept().getURI(); // fall back to owl:Thing if not portal filtering
|
||||
}
|
||||
vreq.setAttribute("flagUri",flagUri);
|
||||
|
||||
request.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString()));
|
||||
request.setAttribute("gYearMonthDatatypeUriJson", MiscWebUtils.escape(XSD.gYearMonth.toString()));
|
||||
|
@ -134,8 +126,7 @@
|
|||
|
||||
?activityUri <${labelUri}> ?label ;
|
||||
a <${activityClass}> ;
|
||||
a <${activitySuperClass}> ;
|
||||
a <${flagUri}> ;
|
||||
a <${activitySuperClass}> ;
|
||||
<${inverseUri}> ?person ;
|
||||
<${inverseSuperPropertyUri}> ?person .
|
||||
|
||||
|
|
|
@ -62,14 +62,6 @@ core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision)
|
|||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||
vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior
|
||||
|
||||
String flagUri = null;
|
||||
if (wdf.getApplicationDao().isFlag1Active()) {
|
||||
flagUri = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing";
|
||||
} else {
|
||||
flagUri = wdf.getVClassDao().getTopConcept().getURI(); // fall back to owl:Thing if not portal filtering
|
||||
}
|
||||
vreq.setAttribute("flagUri",flagUri);
|
||||
|
||||
request.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString()));
|
||||
request.setAttribute("gYearDatatypeUriJson", MiscWebUtils.escape(XSD.gYear.toString()));
|
||||
%>
|
||||
|
@ -185,14 +177,12 @@ the org type still gets asserted. --%>
|
|||
?person core:educationalBackground ?edTrainingUri .
|
||||
|
||||
?edTrainingUri core:educationalBackgroundOf ?person ;
|
||||
a core:EducationalTraining ,
|
||||
<${flagUri}> .
|
||||
a core:EducationalTraining .
|
||||
</v:jsonset>
|
||||
|
||||
<v:jsonset var="n3ForNewOrg">
|
||||
?newOrg <${label}> ?newOrgName ;
|
||||
a ?newOrgType ,
|
||||
<${flagUri}> .
|
||||
a ?newOrgType .
|
||||
|
||||
?edTrainingUri <${orgGrantingDegree}> ?newOrg .
|
||||
</v:jsonset>
|
||||
|
|
|
@ -31,14 +31,6 @@
|
|||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||
vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior
|
||||
|
||||
String flagUri = null;
|
||||
if (vreq.getAppBean().isFlag1Active()) {
|
||||
flagUri = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing";
|
||||
} else {
|
||||
flagUri = wdf.getVClassDao().getTopConcept().getURI(); // fall back to owl:Thing if not portal filtering
|
||||
}
|
||||
vreq.setAttribute("flagUri",flagUri);
|
||||
|
||||
request.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString()));
|
||||
request.setAttribute("gYearDatatypeUriJson", MiscWebUtils.escape(XSD.gYear.toString()));
|
||||
%>
|
||||
|
@ -120,16 +112,14 @@
|
|||
?person core:personInPosition ?positionUri .
|
||||
|
||||
?positionUri core:positionForPerson ?person ;
|
||||
a ?positionType ,
|
||||
<${flagUri}> .
|
||||
a ?positionType .
|
||||
</v:jsonset>
|
||||
|
||||
<v:jsonset var="n3ForNewOrg">
|
||||
?positionUri <${positionInOrgPred}> ?newOrg .
|
||||
|
||||
?newOrg <${label}> ?newOrgName ;
|
||||
a ?newOrgType ,
|
||||
<${flagUri}> ;
|
||||
a ?newOrgType ;
|
||||
<${orgForPositionPred}> ?positionUri .
|
||||
|
||||
</v:jsonset>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue