Merge branch 'develop' of https://github.com/vivo-project/VIVO into develop

This commit is contained in:
hudajkhan 2013-10-31 15:08:16 -04:00
commit be7fd0cf21
18 changed files with 573 additions and 31 deletions

View file

@ -349,7 +349,7 @@ selected_conference = Conferencia Seleccionado
years_participation_in = Años de participación en
grant_entry_for = autorizará la entrada de
select_existing_pub_or_enter_new = Por favor seleccione una subvención actual en el campo de título o ingresar uno nuevo.
select_existing_pub_or_enter_new = Por favor seleccione una publicación actual en el campo de título o ingresar uno nuevo.
unable_to_handle_grant_editing = Esta forma no es capaz de manejar la edición de esta subvención, ya que se asocia con múltiples individuos subvención.
grant_type = concesión de la
@ -869,3 +869,7 @@ edit_year_awarded = Editar año concede
publication_date_for = fecha de publicación de
create_publication_date = Crear fecha de publicación
edit_publication_date = Editar fecha de publicación
name_prefix = Prefijo de nombre
name_suffix = Sufijo de nombre
administering_organization_for = administración de la organización para
missing_credential = falta credencial

View file

@ -34,12 +34,11 @@ edu.cornell.mannlib.vitro.webapp.servlet.setup.UpdatePermissionSetUris
edu.cornell.mannlib.vitro.webapp.servlet.setup.FileGraphSetup
edu.cornell.mannlib.vitro.webapp.servlet.setup.SimpleReasonerSetup
# Invokes process to perform updates to align with ontology changes if needed -->
# Needs to run before submodels are attached and Pellet is set up -->
edu.cornell.mannlib.vitro.webapp.servlet.setup.UpdateKnowledgeBase
edu.cornell.mannlib.vitro.webapp.servlet.setup.SimpleReasonerSetup
# Must run after JenaDataSourceSetup
edu.cornell.mannlib.vitro.webapp.servlet.setup.ThemeInfoSetup

View file

@ -199,6 +199,7 @@
?infoResource core:relatedBy ?editorship .
?editorship a core:Editorship .
?editorship core:relates ?editorObj .
?editorObj a foaf:Person .
?editorObj rdfs:label ?editor
} UNION {
?subject ?property ?authorship .

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config>
<query-select>
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX obo: &lt;http://purl.obolibrary.org/obo/&gt;
SELECT DISTINCT ?administratorRole
?organization
?organizationLabel
WHERE {
?subject ?property ?administratorRole .
?administratorRole a core:AdministratorRole .
OPTIONAL { ?administratorRole obo:RO_0000052 ?organization .
?organization a foaf:Organization .
?organization obo:RO_0000053 ?administratorRole .
?organization rdfs:label ?organizationLabel .
}
} ORDER BY ?organizationLabel
</query-select>
<query-construct>
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX obo: &lt;http://purl.obolibrary.org/obo/&gt;
CONSTRUCT {
?subject ?property ?administratorRole .
?administratorRole a core:AdministratorRole .
?administratorRole obo:RO_0000052 ?organization .
?organization a foaf:Organization .
?organization obo:RO_0000053 ?administratorRole .
?organization rdfs:label ?organizationLabel .
} WHERE {
{
?subject ?property ?administratorRole .
?administratorRole a core:AdministratorRole .
} UNION {
?subject ?property ?administratorRole .
?administratorRole a core:AdministratorRole .
?administratorRole obo:RO_0000052 ?organization .
?organization a foaf:Organization .
?organization obo:RO_0000053 ?administratorRole .
?organization rdfs:label ?organizationLabel .
}
}
</query-construct>
<template>propStatement-grantAdministeredBy.ftl</template>
</list-view-config>

View file

@ -0,0 +1,26 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--
This template must be self-contained and not rely on other variables set for the individual page, because it
is also used to generate the property statement during a deletion.
-->
<#import "lib-sequence.ftl" as s>
<#import "lib-datetime.ftl" as dt>
<@showAdministrator statement />
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
next statement -->
<#macro showAdministrator statement>
<#local linkedIndividual>
<#if statement.organization??>
<a href="${profileUrl(statement.uri("organization"))}" title="${i18n().organization_name}">${statement.organizationLabel!""}</a>
<#else>
<a href="${profileUrl(statement.uri("administratorRole"))}" title="${i18n().administering_organization_for}">${i18n().missing_organization}</a>
</#if>
</#local>
${linkedIndividual!}
</#macro>

View file

@ -17,7 +17,7 @@
<#if statement.credential??>
<a href="${profileUrl(statement.uri("credential"))}" title="${i18n().credential_name}">${statement.credentialLabel!statement.issuedCredentialLabel!statement.credentialLocal!}</a>
<#else>
<a href="${profileUrl(statement.uri("issuedCredential"))}" title="${i18n().credential_name}">${statement.issuedCredentialLabel!"missing credential"}</a>
<a href="${profileUrl(statement.uri("issuedCredential"))}" title="${i18n().credential_name}">${statement.issuedCredentialLabel!"${i18n().missing_credential}"}</a>
</#if>
</#local>

View file

@ -13,9 +13,17 @@
<#macro showAddress statement>
<#if statement.street?has_content>
<p class="address-line">
${statement.street}
</p>
<#if statement.street?contains(";") >
<#list statement.street?split("; ") as lines>
<p class="address-line">
${lines}
</p>
</#list>
<#else>
<p class="address-line">
${statement.street}
</p>
</#if>
</#if>
<#if ( statement.country?has_content && (statement.country == "US" || statement.country?contains("United States") || statement.country?contains("U.S.") || statement.country?contains("U.S.A.") || statement.country?contains("USA")))>
@ -23,7 +31,7 @@
<#local cityStateZip><@s.join [ cityState!, statement.postalCode!], "&nbsp;" /></#local>
<#if cityStateZip?has_content>
<p class="address-line">${cityStateZip}</p>
<p class="address-line">${statement.country!}</p>
<p class="address-line" style="float:left; padding-right:20px">${statement.country!}</p>
</#if>
<#else>
<#if statement.locality?has_content>
@ -42,7 +50,7 @@
</p>
</#if>
<#if statement.country?has_content>
<p class="address-line">
<p class="address-line" style="float:left; padding-right:20px">
${statement.country}
</p>
</#if>

View file

@ -65,13 +65,13 @@
<form id="addFullNameToPerson" class="customForm noIE67" action="${submitUrl}" role="add/edit name">
<p>
<label for="firstName">${i18n().first_name} ${requiredHint}<span style="padding-left:300px">name_prefix</span></label>
<label for="firstName">${i18n().first_name} ${requiredHint}<span style="padding-left:300px">${i18n().name_prefix}</span></label>
<input size="25" type="text" id="firstName" name="firstName" value="${firstNameValue}" />
<input style="margin-left:138px" size="12" type="text" id="prefix" name="prefix" value="${prefixValue}" />
</p>
<p>
<label for="middleName">${i18n().middle_name}<span style="padding-left:293px">name_suffix</span></label>
<label for="middleName">${i18n().middle_name}<span style="padding-left:293px">${i18n().name_suffix}</span></label>
<input size="25" type="text" id="middleName" name="middleName" value="${middleNameValue}" />
<input style="margin-left:138px" size="12" type="text" id="suffix" name="suffix" value="${suffixValue}" />
</p>

View file

@ -58,7 +58,8 @@
<p>
<label for="orcidId">ORCID iD ${requiredHint}</label>
<input size="35" type="text" id="orcidId" name="orcidId" value="${orcidIdValue}" />
<input size="35" type="text" id="orcidIdDisplay" name="orcidIdDisplay" value="${orcidIdValue}" />
<input type="hidden" id="orcidId" name="orcidId" value="" />
</p>
<input type="hidden" id="editKey" name="editKey" value="${editKey}"/>

View file

@ -0,0 +1,136 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- this is in request.subject.name -->
<#-- leaving this edit/add mode code in for reference in case we decide we need it -->
<#import "lib-vivo-form.ftl" as lvf>
<#--Retrieve certain edit configuration information-->
<#if editConfiguration.objectUri?has_content>
<#assign editMode = "edit">
<#else>
<#assign editMode = "add">
</#if>
<#--The blank sentinel indicates what value should be put in a URI when no autocomplete result has been selected.
If the blank value is non-null or non-empty, n3 editing for an existing object will remove the original relationship
if nothing is selected for that object-->
<#assign blankSentinel = "" />
<#if editConfigurationConstants?has_content && editConfigurationConstants?keys?seq_contains("BLANK_SENTINEL")>
<#assign blankSentinel = editConfigurationConstants["BLANK_SENTINEL"] />
</#if>
<#--This flag is for clearing the label field on submission for an existing object being selected from autocomplete.
Set this flag on the input acUriReceiver where you would like this behavior to occur. -->
<#assign flagClearLabelForExisting = "flagClearLabelForExisting" />
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
<#--Retrieve variables needed-->
<#assign existingOrgValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingOrganization") />
<#assign orgLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgLabel") />
<#assign orgLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgLabelDisplay") />
<#--If edit submission exists, then retrieve validation errors if they exist-->
<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content>
<#assign submissionErrors = editSubmission.validationErrors/>
</#if>
<#if editMode == "edit">
<#assign titleVerb="${i18n().edit_capitalized}">
<#assign submitButtonText="${i18n().save_changes}">
<#assign disabledVal="disabled">
<#else>
<#assign titleVerb="${i18n().create_capitalized}">
<#assign submitButtonText="${i18n().create_entry}">
<#assign disabledVal=""/>
</#if>
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
<h2>${titleVerb}&nbsp;${i18n().administering_organization_for} ${editConfiguration.subjectName}</h2>
<#--Display error messages if any-->
<#if submissionErrors?has_content>
<#if orgLabelDisplayValue?has_content >
<#assign orgLabelValue = orgLabelDisplayValue />
</#if>
<section id="error-alert" role="alert">
<img src="${urls.images}/iconAlert.png" width="24" height="24" alt="${i18n().error_alert_icon}" />
<p>
<#--Checking if any required fields are empty-->
<#if lvf.submissionErrorExists(editSubmission, "orgLabel")>
${i18n().select_or_create_organization}
</#if>
</p>
</section>
</#if>
<@lvf.unsupportedBrowser urls.base />
<section id="grantAdministeredBy" role="region">
<form id="grantAdministeredBy" class="customForm noIE67" action="${submitUrl}" role="add/edit AdministeredGrant">
<p>
<label for="relatedIndLabel">${i18n().organization_capitalized} ${requiredHint}</label>
<input class="acSelector" size="50" type="text" id="organization" acGroupName="organization" name="orgLabel" value="${orgLabelValue}">
<input class="display" type="hidden" id="organizationDisplay" acGroupName="organization" name="orgLabelDisplay" value="${orgLabelDisplayValue}">
</p>
<div class="acSelection" acGroupName="organization" id="organizationAcSelection">
<p class="inline">
<label>${i18n().selected_organization}:</label>
<span class="acSelectionInfo"></span>
<a href="" class="verifyMatch" title="${i18n().verify_match_capitalized}">(${i18n().verify_match_capitalized}</a> ${i18n().or}
<a href="#" class="changeSelection" id="changeSelection">${i18n().change_selection})</a>
</p>
<input class="acUriReceiver" type="hidden" id="orgUri" name="existingOrganization" value="${existingOrgValue}" ${flagClearLabelForExisting}="true" />
</div>
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
<input type="hidden" id="editKey" name="editKey" value="${editKey}"/>
<p class="submit">
<input type="submit" class="submit" value="${submitButtonText}"/><span class="or"> ${i18n().or} </span>
<a class="cancel" href="${cancelUrl}" title="${i18n().cancel_title}">${i18n().cancel_link}</a>
</p>
<p id="requiredLegend" class="requiredHint">* ${i18n().required_fields}</p>
</form>
<script type="text/javascript">
var customFormData = {
acUrl: '${urls.base}/autocomplete?tokenize=true&stem=true',
acTypes: {organization: 'http://xmlns.com/foaf/0.1/Organization'},
editMode: '${editMode}',
defaultTypeName: 'organization',
baseHref: '${urls.base}/individual?uri=',
blankSentinel: '${blankSentinel}',
flagClearLabelForExisting: '${flagClearLabelForExisting}'
};
var i18nStrings = {
selectAnExisting: '${i18n().select_an_existing}',
orCreateNewOne: '${i18n().or_create_new_one}',
selectedString: '${i18n().selected}',
};
</script>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customForm.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customFormWithAutocomplete.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/customFormUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/extensions/String.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/browserUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.bgiframe.pack.js"></script>',
'<script type="text/javascript" src="${urls.base}/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js"></script>')}

View file

@ -12,6 +12,7 @@ var addOrcidIdToPersonUtils = {
this.form = $('#personHasOrcidId');
this.orcidId = $('#orcidId');
this.orcidIdDisplay = $('#orcidIdDisplay');
},
@ -25,10 +26,10 @@ var addOrcidIdToPersonUtils = {
buildOrcidIdURL: function() {
var orcidBase = "http://www.orcid.org/";
var orcidBase = "http://orcid.org/";
var orcidIdVal = "";
if ( this.orcidId.val().length > 0 ) {
orcidIdVal = orcidBase + this.orcidId.val();
if ( this.orcidIdDisplay.val().length > 0 ) {
orcidIdVal = orcidBase + this.orcidIdDisplay.val();
this.orcidId.val(orcidIdVal);
}
},

View file

@ -0,0 +1,51 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var mailingAddressUtils = {
onLoad: function(editMode) {
this.initObjectReferences();
this.bindEventListeners();
if ( editMode != "add" ) {
this.setStreetAddressDisplayFields();
}
},
initObjectReferences: function() {
this.form = $('#personHasMailingAddress');
this.street1 = $('#streetAddressOne');
this.street2 = $('#streetAddressTwo');
this.streetAddress = $('#streetAddress');
},
bindEventListeners: function() {
this.idCache = {};
this.form.submit(function() {
mailingAddressUtils.setStreetAddressField();
});
},
// the vcard only has one address field, so combine the two
// displayed addresses into the hidden field which gets asserted in the N3
setStreetAddressField: function() {
var tempString = this.street1.val() + "; " + this.street2.val();
this.streetAddress.val(tempString);
},
// in edit mode, take the asserted streetAddress value and parse it into
// the two displayed address fields
setStreetAddressDisplayFields: function() {
var tempString = this.streetAddress.val();
var lineOne = tempString.substring(0,tempString.lastIndexOf(";"));
var lineTwo = tempString.substring(tempString.lastIndexOf(";") + 2);
this.street1.val(lineOne);
this.street2.val(lineTwo);
}
}

View file

@ -53,7 +53,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
<#assign yearHint = "<span class='hint'>(${i18n().year_hint_format})</span>" />
<h2>${titleVerb}&nbsp;${i18n().credentials} ${editConfiguration.subjectName}</h2>
<h2>${titleVerb}&nbsp;${i18n().credentials} ${i18n().for} ${editConfiguration.subjectName}</h2>
<#--Display error messages if any-->
<#if submissionErrors?has_content>

View file

@ -68,11 +68,17 @@
<section id="personHasMailingAddress" role="region">
<form id="personHasMailingAddress" class="customForm noIE67" action="${submitUrl}" role="add/edit educational training">
<form id="personHasMailingAddress" class="customForm noIE67" action="${submitUrl}" role="add/edit mailing address">
<p>
<label for="streetAddress">${i18n().street_address} ${requiredHint}</label>
<input size="50" type="text" id="streetAddress" name="streetAddress" value="${streetAddressValue}" />
<label for="streetAddress">${i18n().street_address} 1 ${requiredHint}</label>
<input size="40" type="text" id="streetAddressOne" name="streetAddressOne" value="" />
</p>
<p>
<label for="streetAddress">${i18n().street_address} 2 ${requiredHint}</label>
<input size="40" type="text" id="streetAddressTwo" name="streetAddressTwo" value="" />
<input type="hidden" id="streetAddress" name="streetAddress" value="${streetAddressValue}" />
</p>
<p>
@ -108,12 +114,19 @@
</section>
<script type="text/javascript">
$(document).ready(function(){
mailingAddressUtils.onLoad('${editMode}');
});
</script>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customForm.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customFormWithAutocomplete.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/extensions/String.js"></script>',
'<script type="text/javascript" src="${urls.base}/templates/freemarker/edit/forms/js/mailingAddressUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/browserUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.bgiframe.pack.js"></script>')}

View file

@ -411,13 +411,29 @@ local:issuedCredentialConfig a :ObjectPropertyDisplayConfig ;
vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasIssuedCredentialGenerator"^^<http://www.w3.org/2001/XMLSchema#string> ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupbiography> .
local:grantAdministeredByContext a :ConfigContext ;
:hasConfiguration local:grantAdministeredByConfig ;
:configContextFor vivo:relates ;
:qualifiedByDomain vivo:Grant ;
:qualifiedBy vivo:AdministratorRole .
local:grantAdministeredByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-grantAdministeredBy.xml"^^xsd:string ;
:displayName "grant administered by" ;
vitro:displayRankAnnot 1;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.GrantAdministeredByGenerator"^^<http://www.w3.org/2001/XMLSchema#string> ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
### vcard properties ###
local:mailingAddressContext a :ConfigContext ;
:hasConfiguration local:mailingAddressConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Address> .
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Address> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> .
local:mailingAddressConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-mailingAddress.xml"^^xsd:string ;
@ -432,6 +448,7 @@ local:mailingAddressContext a :ConfigContext ;
:hasConfiguration local:mailingAddressConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Organization> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Address> .
local:mailingAddressConfig a :ObjectPropertyDisplayConfig ;
@ -447,6 +464,7 @@ local:personTelephoneContext a :ConfigContext ;
:hasConfiguration local:personTelephoneConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Telephone> .
local:personTelephoneConfig a :ObjectPropertyDisplayConfig ;
@ -462,6 +480,7 @@ local:orgTelephoneContext a :ConfigContext ;
:hasConfiguration local:orgTelephoneConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Organization> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Telephone> .
local:orgTelephoneConfig a :ObjectPropertyDisplayConfig ;
@ -477,6 +496,7 @@ local:personFaxContext a :ConfigContext ;
:hasConfiguration local:personFaxConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Fax> .
local:personFaxConfig a :ObjectPropertyDisplayConfig ;
@ -492,6 +512,7 @@ local:orgFaxContext a :ConfigContext ;
:hasConfiguration local:orgFaxConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Organization> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Fax> .
local:orgFaxConfig a :ObjectPropertyDisplayConfig ;
@ -507,6 +528,7 @@ local:additionalEmailContext a :ConfigContext ;
:hasConfiguration local:additionalEmailConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Email> .
local:additionalEmailConfig a :ObjectPropertyDisplayConfig ;
@ -522,6 +544,7 @@ local:primaryEmailContext a :ConfigContext ;
:hasConfiguration local:primaryEmailConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Work> .
local:primaryEmailConfig a :ObjectPropertyDisplayConfig ;
@ -537,6 +560,7 @@ local:webpageContext a :ConfigContext ;
:hasConfiguration local:webpageConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#URL> .
local:webpageConfig a :ObjectPropertyDisplayConfig ;
@ -552,6 +576,7 @@ local:webpageContext a :ConfigContext ;
:hasConfiguration local:webpageConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Organization> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#URL> .
local:webpageConfig a :ObjectPropertyDisplayConfig ;
@ -567,6 +592,7 @@ local:fullNameContext a :ConfigContext ;
:hasConfiguration local:fullNameConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Name> .
local:fullNameConfig a :ObjectPropertyDisplayConfig ;
@ -582,6 +608,7 @@ local:preferredTitleContext a :ConfigContext ;
:hasConfiguration local:preferredTitleConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#Title> .
local:preferredTitleConfig a :ObjectPropertyDisplayConfig ;
@ -637,6 +664,104 @@ local:inEventSeriesConfig a :ObjectPropertyDisplayConfig ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:eventLocationContext a :ConfigContext ;
:hasConfiguration local:eventLocationConfig ;
:configContextFor <http://purl.obolibrary.org/obo/RO_0001025> ;
:qualifiedByDomain <http://purl.org/NET/c4dm/event.owl#Event> ;
:qualifiedBy vivo:GeographicLocation .
local:eventLocationConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "has geographic location" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGrouplocation> .
local:courseOfferedByContext a :ConfigContext ;
:hasConfiguration local:courseOfferedByConfig ;
:configContextFor vivo:offeredBy ;
:qualifiedByDomain vivo:Course ;
:qualifiedBy <http://xmlns.com/foaf/0.1/Organization> .
local:courseOfferedByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "offered by" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:orgOffersCourseContext a :ConfigContext ;
:hasConfiguration local:orgOffersCourseConfig ;
:configContextFor vivo:offers ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Organization> ;
:qualifiedBy vivo:Course .
local:orgOffersCourseConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "offers course" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupother> .
local:collegeOffersDegreeContext a :ConfigContext ;
:hasConfiguration local:collegeOffersDegreeConfig ;
:configContextFor vivo:offers ;
:qualifiedByDomain vivo:College ;
:qualifiedBy vivo:AcademicDegree .
local:collegeOffersDegreeConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "offers degree" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:deptOffersDegreeContext a :ConfigContext ;
:hasConfiguration local:debtOffersDegreeConfig ;
:configContextFor vivo:offers ;
:qualifiedByDomain vivo:AcademicDepartment ;
:qualifiedBy vivo:AcademicDegree .
local:deptOffersDegreeConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "offers degree" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:uniOffersDegreeContext a :ConfigContext ;
:hasConfiguration local:uniOffersDegreeConfig ;
:configContextFor vivo:offers ;
:qualifiedByDomain vivo:University ;
:qualifiedBy vivo:AcademicDegree .
local:uniOffersDegreeConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "offers degree" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:grantAwardedByContext a :ConfigContext ;
:hasConfiguration local:grantAwardedByConfig ;
:configContextFor vivo:assignedBy ;
:qualifiedByDomain vivo:Grant ;
:qualifiedBy <http://xmlns.com/foaf/0.1/Organization> .
local:grantAwardedByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "grant awarded by" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:awardOrHonorReceiptsContext a :ConfigContext ;
:hasConfiguration local:awardOrHonorReceiptsConfig ;
:configContextFor <http://vivoweb.org/ontology/core#relatedBy> ;

View file

@ -0,0 +1,123 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.AutocompleteRequiredInputValidator;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeIntervalValidationVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeWithPrecisionVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesWithParent;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaVClassOptions;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation;
public class GrantAdministeredByGenerator extends VivoBaseGenerator implements
EditConfigurationGenerator {
public GrantAdministeredByGenerator() {}
@Override
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq,
HttpSession session) throws Exception {
EditConfigurationVTwo conf = new EditConfigurationVTwo();
initBasics(conf, vreq);
initPropertyParameters(vreq, session, conf);
initObjectPropForm(conf, vreq);
conf.setTemplate("grantAdministeredBy.ftl");
conf.setVarNameForSubject("grant");
conf.setVarNameForPredicate("predicate");
conf.setVarNameForObject("adminRole");
conf.setN3Required( Arrays.asList( n3ForNewAdminRole) );
conf.setN3Optional( Arrays.asList( n3ForNewAdminOrganization,
n3ForExistingAdminOrganization ) );
conf.addNewResource("newOrganization", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("adminRole", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.setUrisOnform(Arrays.asList("existingOrganization"));
conf.setLiteralsOnForm(Arrays.asList("orgLabel", "orgLabelDisplay" ));
conf.addSparqlForExistingLiteral("orgLabel", orgLabelQuery);
conf.addSparqlForExistingUris("existingOrganization", existingOrganizationQuery);
conf.addField( new FieldVTwo(). // options will be added in browser by auto complete JS
setName("existingOrganization")
);
conf.addField( new FieldVTwo().
setName("orgLabel").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()) )
);
conf.addField( new FieldVTwo().
setName("orgLabelDisplay").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()))
);
conf.addValidator(new AntiXssValidation());
conf.addValidator(new AutocompleteRequiredInputValidator("existingOrganization", "orgLabel"));
// addFormSpecificData(conf, vreq);
prepare(vreq, conf);
return conf;
}
/* N3 assertions */
final static String n3ForNewAdminRole =
"@prefix vivo: <" + vivoCore + "> . \n\n" +
"?grant vivo:relates ?adminRole . \n" +
"?adminRole a vivo:AdministratorRole . \n" +
"?adminRole vivo:relatedBy ?grant . " ;
final static String n3ForNewAdminOrganization =
"@prefix vivo: <" + vivoCore + "> . \n\n" +
"?adminRole <http://purl.obolibrary.org/obo/RO_0000052> ?newOrganization . \n" +
"?newOrganization a <http://xmlns.com/foaf/0.1/Organization> . \n" +
"?newOrganization <http://purl.obolibrary.org/obo/RO_0000053> ?adminRole . \n" +
"?newOrganization <"+ label + "> ?orgLabel .";
final static String n3ForExistingAdminOrganization =
"@prefix vivo: <" + vivoCore + "> . \n\n" +
"?adminRole <http://purl.obolibrary.org/obo/RO_0000052> ?existingOrganization . \n" +
"?existingOrganization a <http://xmlns.com/foaf/0.1/Organization> . \n" +
"?existingOrganization <http://purl.obolibrary.org/obo/RO_0000053> ?adminRole . " ;
/* Queries for editing an existing entry */
final static String existingOrganizationQuery =
"PREFIX vivo: <http://vivoweb.org/ontology/core#> \n" +
"SELECT ?existingOrganization WHERE { \n" +
" ?adminRole <http://purl.obolibrary.org/obo/RO_0000052> ?existingOrganization . \n" +
" ?existingOrganization a <http://xmlns.com/foaf/0.1/Organization> . \n" +
"}";
final static String orgLabelQuery =
"PREFIX vivo: <http://vivoweb.org/ontology/core#> \n" +
"SELECT ?existingOrganizationLabel WHERE { \n" +
" ?adminRole <http://purl.obolibrary.org/obo/RO_0000052> ?existingOrganization . \n" +
" ?existingOrganization a <http://xmlns.com/foaf/0.1/Organization> . \n" +
" ?existingOrganization <" + label + "> ?existingOrganizationLabel . \n" +
"}";
}

View file

@ -117,12 +117,6 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem
setValidators( list("datatype:" + XSD.xstring.toString()))
);
conf.addField( new FieldVTwo().
setName("orgLabelDisplay").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()))
);
conf.addField( new FieldVTwo().
setName("credentialLabelDisplay").
setRangeDatatypeUri(XSD.xstring.toString() ).
@ -184,8 +178,8 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem
final static String n3ForExistingCredentialAssertion =
"@prefix vivo: <" + vivoCore + "> . \n\n" +
"?issuedCredential vivo:relates ?existingCredential . \n" +
"?existingCredential a <" + credentialTypeClass + "> . \n" +
"?credential a ?credentialType . \n" +
/* "?existingCredential a <" + credentialTypeClass + "> . \n" +
"?existingCredential a ?credentialType . \n" + */
"?existingCredential vivo:relatedBy ?issuedCredential . " ;
final static String n3ForYearCredentialed =

View file

@ -355,7 +355,7 @@ selected_conference = Selected Conference
years_participation_in = Years of Participation in
grant_entry_for = grant entry for
select_existing_pub_or_enter_new = Please select an existing grant in the Title field or enter a new one.
select_existing_pub_or_enter_new = Please select an existing publication in the Title field or enter a new one.
unable_to_handle_grant_editing = This form is unable to handle the editing of this grant because it is associated with multiple grant individuals.
grant_type = grant Type
@ -875,4 +875,7 @@ edit_year_awarded = Edit year awarded
publication_date_for = publication date for
create_publication_date = Create publication date
edit_publication_date = Edit publication date
name_prefix = Name Prefix
name_suffix = Name Suffix
administering_organization_for = administering organization for
missing_credential = missing credential