additional custom form changes to support multiple autocomplete fields

This commit is contained in:
tworrall 2012-03-13 16:17:11 +00:00
parent e1cedc156d
commit 07c9c7c066
9 changed files with 355 additions and 103 deletions

View file

@ -13,6 +13,11 @@
<#assign editMode = "add">
</#if>
<#assign newUriSentinel = "" />
<#if editConfigurationConstants?has_content>
<#assign newUriSentinel = editConfigurationConstants["NEW_URI_SENTINEL"] />
</#if>
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
<#--Retrieve variables needed-->
@ -41,7 +46,7 @@
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
<#assign yearHint = "<span class='hint'>(YYYY)</span>" />
<h2>${titleVerb}&nbsp;award or honor for ${editConfiguration.subjectName}</h2>
<h2>${titleVerb}&nbsp;presentation entry for ${editConfiguration.subjectName}</h2>
<#--Display error messages if any-->
<#if submissionErrors?has_content>
@ -177,7 +182,8 @@ var customFormData = {
editMode: '${editMode}',
defaultTypeName: 'presentation',
multipleTypeNames: {presentation: 'presentation', conference: 'conference'},
baseHref: '${urls.base}/individual?uri='
baseHref: '${urls.base}/individual?uri=',
newUriSentinel : '${newUriSentinel}'
};
</script>

View file

@ -7,6 +7,10 @@
<#--Retrieve certain edit configuration information-->
<#assign editMode = editConfiguration.pageData.editMode />
<#assign newUriSentinel = "" />
<#if editConfigurationConstants?has_content>
<#assign newUriSentinel = editConfigurationConstants["NEW_URI_SENTINEL"] />
</#if>
<#assign sparqlForAcFilter = editConfiguration.pageData.sparqlForAcFilter />
@ -114,7 +118,7 @@
<div class="acSelection" acGroupName="collection" >
<p class="inline">
<label>Selected Venue:</label>
<label>Selected Journal:</label>
<span class="acSelectionInfo"></span>
<a href="" class="verifyMatch" title="verify match">(Verify this match</a> or
<a href="#" class="changeSelection" id="changeSelection">change selection)</a>
@ -130,7 +134,7 @@
<div class="acSelection" acGroupName="book" >
<p class="inline">
<label>Selected Venue:</label>
<label>Selected Book:</label>
<span class="acSelectionInfo"></span>
<a href="" class="verifyMatch" title="verify match">(Verify this match</a> or
<a href="#" class="changeSelection" id="changeSelection">change selection)</a>
@ -146,7 +150,7 @@
<div class="acSelection" acGroupName="conference" >
<p class="inline">
<label>Selected Venue:</label>
<label>Selected Event:</label>
<span class="acSelectionInfo"></span>
<a href="" class="verifyMatch" title="verify match">(Verify this match</a> or
<a href="#" class="changeSelection" id="changeSelection">change selection)</a>
@ -170,6 +174,7 @@
<input class="acUriReceiver" type="hidden" id="eventUri" name="eventUri" value="${eventUriValue}" />
</div>
<#-- Editor -->
<p>
<label for="editor">Editor</label>
@ -261,13 +266,14 @@
editMode: '${editMode}',
defaultTypeName: 'publication', // used in repair mode to generate button text
multipleTypeNames: {collection: 'publication', book: 'book', conference: 'conference', event: 'event', editor: 'editor', publisher: 'publisher'},
baseHref: '${urls.base}/individual?uri='
baseHref: '${urls.base}/individual?uri=',
newUriSentinel : '${newUriSentinel}'
};
</script>
<script type="text/javascript">
$(document).ready(function(){
publicationToPersonUtils.onLoad();
publicationToPersonUtils.onLoad('${urls.base}/individual?uri=', '${newUriSentinel}');
});
</script>
</section>

View file

@ -3,13 +3,14 @@
var awardReceiptUtils = {
onLoad: function(mode) {
onLoad: function(mode, subjectName) {
this.initObjectReferences();
this.bindEventListeners();
// in edit mode, copy the year awarded to the displayed input element
if ( mode == "edit" ) {
this.displayedYear.val(this.yearAwarded.val());
}
this.subjectName = subjectName;
},
initObjectReferences: function() {
@ -35,7 +36,7 @@ var awardReceiptUtils = {
buildAwardReceiptLabel: function() {
var rdfsLabel = this.award.val();
if ( this.yearAwarded.val().length ) {
rdfsLabel += " (" + this.yearAwarded.val() + ")";
rdfsLabel += " (" + this.subjectName + ' - ' + this.yearAwarded.val() + ")";
}
this.recLabel.val(rdfsLabel);
},

View file

@ -82,6 +82,9 @@ var customForm = {
if ( this.multipleTypeNames != undefined || this.multipleTypeNames != null ) {
this.hasMultipleTypeNames = true;
}
// Used with the cancel link. If the user cancels after a type selection, this check
// ensures that any a/c fields (besides the one associated with the type) will be reset
this.clearAcSelections = false;
},
@ -170,6 +173,7 @@ var customForm = {
this.cancel.click(function() {
customForm.clearFormData(); // clear any input and validation errors
customForm.initFormTypeView();
customForm.clearAcSelections = true;
return false;
});
// In one-step forms, if there is a type selection field, but no value is selected,
@ -206,6 +210,7 @@ var customForm = {
this.typeSelector.change(function() {
var typeVal = $(this).val();
this.acCache = {};
// If an autocomplete selection has been made, undo it.
// NEED TO LINK THE TYPE SELECTOR TO THE ACSELECTOR IT'S ASSOCIATED WITH
@ -371,16 +376,6 @@ var customForm = {
customForm.acFilter = customForm.acFilter.concat(this.acFilterForIndividuals);
},
// Reset some autocomplete values after type is changed
resetAutocomplete: function(typeVal) {
// Append the type parameter to the base autocomplete url
var glue = this.baseAcUrl.indexOf('?') > -1 ? '&' : '?';
this.acUrl = this.baseAcUrl + glue + 'type=' + typeVal;
// Flush autocomplete cache when type is reset, since the cached values
// pertain only to the previous type.
this.acCache = {};
},
showAutocompleteSelection: function(label, uri, selectedObj) {
// hide the acSelector field and set it's value to the selected ac item
@ -428,36 +423,73 @@ var customForm = {
// change the type but keep the value. If no new value has been selected, form initialization
// below will correctly empty the value anyway.
// Check to see if the parameter is the typeSelector. If it is, we need to get the acSelection div
// that is associated with it.
var $acSelectionObj = null;
var $acSelector = null;
// Check to see if the parameter is the typeSelector. If it is, we need to get the acSelection div
// that is associated with it. Also, when the type is changed, we need to determine whether the user
// has selected an existing individual in the corresponding name field or typed the label for a new
// individual. If the latter, we do not want to clear the value on type change. The clearAcSelectorVal
// boolean controls whether the acSelector value gets cleared.
var clearAcSelectorVal = true;
if ( $(selectedObj).attr('id') == "typeSelector" ) {
$acSelectionObj = customForm.acSelections[$(selectedObj).attr('acGroupName')];
if ( $acSelectionObj.is(':hidden') ) {
clearAcSelectorVal = false;
}
// if the type is being changed after a cancel, any additional a/c fields that may have been set
// by the user should be "undone". Only loop through these if this is not the initial type selection
if ( customForm.clearAcSelections ) {
$.each(customForm.acSelections, function(i, acS) {
var $checkSelection = customForm.acSelections[i];
if ( $checkSelection.is(':hidden') && $checkSelection.attr('acGroupName') != $acSelectionObj.attr('acGroupName') ) {
customForm.resetAcSelection($checkSelection);
$acSelector = customForm.getAcSelector($checkSelection);
$acSelector.parent("p").show();
}
});
}
}
else {
$acSelectionObj = $(selectedObj);
}
var $acSelector = null;
$.each(this.acSelectors, function() {
if ( $(this).attr('acGroupName') == $acSelectionObj.attr('acGroupName') ) {
$acSelector = $(this);
}
});
$acSelector = this.getAcSelector($acSelectionObj);
$acSelector.parent("p").show();
this.hideFields($acSelectionObj);
$acSelectionObj.removeClass('userSelected');
//Might be useful here to replace the uri with the default "new uri needs to be created" value
//$acSelectionObj.find("input.acUriReceiver").val('');
$acSelectionObj.find("input.acUriReceiver").val(customForm.newUriSentinel);
$acSelectionObj.find("span").text('');
$acSelectionObj.find("a.verifyMatch").attr('href', this.baseHref);
this.resetAcSelection($acSelectionObj);
if ( clearAcSelectorVal == true ) {
$acSelector.val('');
}
customForm.addAcHelpText($acSelector);
//Resetting so disable submit button again for object property autocomplete
if ( this.acSelectOnly ) {
this.disableSubmit();
}
this.clearAcSelections = false;
},
// this is essentially a subtask of undoAutocompleteSelection
resetAcSelection: function(selectedObj) {
this.hideFields($(selectedObj));
$(selectedObj).removeClass('userSelected');
$(selectedObj).find("input.acUriReceiver").val(this.newUriSentinel);
$(selectedObj).find("span").text('');
$(selectedObj).find("a.verifyMatch").attr('href', this.baseHref);
},
// loops through the array of acSelector fields and returns the one
// associated with the selected object
getAcSelector: function(selectedObj){
var $selector = null
$.each(this.acSelectors, function() {
if ( $(this).attr('acGroupName') == $(selectedObj).attr('acGroupName') ) {
$selector = $(this);
}
});
return $selector;
},
// Set type uri for autocomplete, and type name for labels and button text.

View file

@ -3,11 +3,13 @@
var publicationToPersonUtils = {
onLoad: function(mode) {
onLoad: function(href, sentinel) {
this.initObjectReferences();
this.bindEventListeners();
this.autoDateLabel.hide();
this.baseHref = href;
this.newUriSentinel = sentinel;
$.extend(this, vitro.customFormUtils);
},
initObjectReferences: function() {
@ -32,6 +34,8 @@ var publicationToPersonUtils = {
this.endPage = $('#endPage');
this.ePLabel = $('#ePLabel');
this.typeSelector = $('#typeSelector');
this.cancel = $('.cancel');
this.fullViewOnly = $('.fullViewOnly');
this.autoDateLabel = null;
this.form.find('label').each(function() {
@ -50,8 +54,13 @@ var publicationToPersonUtils = {
this.idCache = {};
this.typeSelector.change(function() {
// controls the fieldsForNewPub div. If the user selects an existing pub/title,
// this div gets hidden.
publicationToPersonUtils.showFieldsForPub();
publicationToPersonUtils.displayFieldsForType();
// after a cancel, the first reset of the type selector resulted in all fields being displayed.
// by delaying this function just slightly, the timing issue between this js and the
// customFormWithAutocomplete js is resolved
window.setTimeout('publicationToPersonUtils.displayFieldsForType()', 60);
});
// we need the delay in the next two functions to ensure the correct timing after the user
@ -67,6 +76,7 @@ var publicationToPersonUtils = {
this.changeLink.click( function() {
publicationToPersonUtils.showFieldsForPub();
});
},
hideFieldsForPub: function() {
@ -79,9 +89,21 @@ var publicationToPersonUtils = {
this.fieldsForNewPub.show();
},
displayFieldsForType: function() {
// hide everything, then show what's needed based on type
// simpler in the event the user changes the type
resetAcSelection: function(groupName) {
var $acSelection = this.form.find('div.acSelection').attr('acGroupName', groupName);
this.hideFields($acSelection);
$acSelection.removeClass('userSelected');
$acSelection.find("input.acUriReceiver").val(this.newUriSentinel);
$acSelection.find("span").text('');
$acSelection.find("a.verifyMatch").attr('href', this.baseHref);
},
getAcUriReceiverVal: function(groupName) {
var $collectionDiv = this.form.find('div.acSelection').attr('acGroupName', groupName);
return $collectionDiv.find('input#'+ groupName + 'Uri').val();
},
hideAllFields: function() {
this.collection.parent('p').hide();
this.book.parent('p').hide();
this.presentedAt.parent('p').hide();
@ -97,10 +119,21 @@ var publicationToPersonUtils = {
this.issueLabel.hide();
this.startPage.parent('p').hide();
this.sPLabel.parent('p').hide();
},
displayFieldsForType: function() {
// hide everything, then show what's needed based on type
// simpler in the event the user changes the type
this.hideAllFields();
var selectedType = this.typeSelector.find(':selected').text();
if ( selectedType == 'Academic Article' || selectedType == 'Article' || selectedType == 'Editorial Article' || selectedType == 'Review') {
// if the user has changed type, keep any relevant values and display the
// acSelection as appropriate
var ckForVal = this.getAcUriReceiverVal('collection');
if ( ckForVal == '' || ckForVal == this.newUriSentinel ) {
this.collection.parent('p').show();
}
this.volume.show();
this.volLabel.show();
this.number.show();
@ -109,31 +142,222 @@ var publicationToPersonUtils = {
this.issueLabel.show();
this.startPage.parent('p').show();
this.sPLabel.parent('p').show();
// if the user has changed type, ensure that irrelevant fields are cleared
// and reset an acSelection divs
if ( this.book.val() != '' && this.book.val().substring(0, 18) != "Select an existing" ) {
alert(this.book.val());
this.book.val('');
this.resetAcSelection('book');
alert(this.book.val());
}
if ( this.editor.val() != '' && this.editor.val().substring(0, 18) != "Select an existing" ) {
this.editor.val('');
this.resetAcSelection('editor');
}
if ( this.publisher.val() != '' && this.publisher.val().substring(0, 18) != "Select an existing" ) {
this.publisher.val('');
this.resetAcSelection('publisher');
}
if ( this.presentedAt.val() != '' && this.presentedAt.val().substring(0, 18) != "Select an existing" ) {
this.presentedAt.val('');
this.resetAcSelection('conference');
}
if ( this.proceedingsOf.val() != '' && this.proceedingsOf.val().substring(0, 18) != "Select an existing" ) {
this.proceedingsOf.val('');
this.resetAcSelection('event');
}
this.locale.val('');
}
else if ( selectedType == 'Chapter' ) {
// if the user has changed type, keep any relevant values and display the
// acSelection as appropriate
var ckForVal = this.getAcUriReceiverVal('book');
if ( ckForVal == '' || ckForVal == this.newUriSentinel ) {
this.book.parent('p').show();
}
ckForVal = this.getAcUriReceiverVal('editor');
if ( ckForVal == '' || ckForVal == this.newUriSentinel ) {
this.editor.parent('p').show();
}
ckForVal = this.getAcUriReceiverVal('publisher');
if ( ckForVal == '' || ckForVal == this.newUriSentinel ) {
this.publisher.parent('p').show();
}
this.locale.parent('p').show();
this.volume.show();
this.volLabel.show();
// if the user is changing type, ensure that irrelevant fields are cleared
// and reset an acSelection divs
if ( this.collection.val() != '' && this.collection.val().substring(0, 18) != "Select an existing" ) {
this.collection.val('');
this.resetAcSelection('collection');
}
if ( this.presentedAt.val() != '' && this.presentedAt.val().substring(0, 18) != "Select an existing" ) {
this.presentedAt.val('');
this.resetAcSelection('conference');
}
if ( this.proceedingsOf.val() != '' && this.proceedingsOf.val().substring(0, 18) != "Select an existing" ) {
this.proceedingsOf.val('');
this.resetAcSelection('event');
}
this.number.val('');
this.issue.val('');
this.startPage.val('');
this.endPage.val('');
}
else if ( selectedType == 'Book' || selectedType == 'Edited Book' ) {
// if the user has changed type, keep any relevant values and display the
// acSelection as appropriate
var ckForVal = this.getAcUriReceiverVal('editor');
if ( ckForVal == '' || ckForVal == this.newUriSentinel ) {
this.editor.parent('p').show();
}
ckForVal = this.getAcUriReceiverVal('publisher');
if ( ckForVal == '' || ckForVal == this.newUriSentinel ) {
this.publisher.parent('p').show();
}
this.locale.parent('p').show();
this.volume.show();
this.volLabel.show();
// if the user is changing type, ensure that irrelevant fields are cleared
// and reset an acSelection divs
if ( this.collection.val() != '' && this.collection.val().substring(0, 18) != "Select an existing" ) {
this.collection.val('');
this.resetAcSelection('collection');
}
if ( this.presentedAt.val() != '' && this.presentedAt.val().substring(0, 18) != "Select an existing" ) {
this.presentedAt.val('');
this.resetAcSelection('conference');
}
if ( this.proceedingsOf.val() != '' && this.proceedingsOf.val().substring(0, 18) != "Select an existing" ) {
this.proceedingsOf.val('');
this.resetAcSelection('event');
}
this.number.val('');
this.issue.val('');
this.startPage.val('');
this.endPage.val('');
}
else if ( selectedType == 'Conference Paper' ) {
// this.collection.parent('p').show();
// if the user has changed type, keep any relevant values and display the
// acSelection as appropriate
var ckForVal = this.getAcUriReceiverVal('collection');
if ( ckForVal == '' || ckForVal == this.newUriSentinel ) {
this.collection.parent('p').show();
}
ckForVal = this.getAcUriReceiverVal('conference');
if ( ckForVal == '' || ckForVal == this.newUriSentinel ) {
this.presentedAt.parent('p').show();
// this.startPage.parent('p').show();
// this.sPLabel.parent('p').show();
}
this.startPage.parent('p').show();
this.sPLabel.parent('p').show();
// if the user is changing type, ensure that irrelevant fields are cleared
// and reset an acSelection divs
if ( this.book.val() != '' && this.book.val().substring(0, 18) != "Select an existing" ) {
this.book.val('');
this.resetAcSelection('book');
}
if ( this.editor.val() != '' && this.editor.val().substring(0, 18) != "Select an existing" ) {
this.editor.val('');
this.resetAcSelection('editor');
}
if ( this.publisher.val() != '' && this.publisher.val().substring(0, 18) != "Select an existing" ) {
this.publisher.val('');
this.resetAcSelection('publisher');
}
if ( this.proceedingsOf.val() != '' && this.proceedingsOf.val().substring(0, 18) != "Select an existing" ) {
this.proceedingsOf.val('');
this.resetAcSelection('event');
}
this.number.val('');
this.issue.val('');
this.startPage.val('');
this.endPage.val('');
}
else if ( selectedType == 'Conference Poster' || selectedType == 'Speech') {
// if the user has changed type, keep any relevant values and display the
// acSelection as appropriate
var ckForVal = this.getAcUriReceiverVal('conference');
if ( ckForVal == '' || ckForVal == this.newUriSentinel ) {
this.presentedAt.parent('p').show();
}
// if the user is changing type, ensure that irrelevant fields are cleared
// and reset an acSelection divs
if ( this.collection.val() != '' && this.collection.val().substring(0, 18) != "Select an existing" ) {
this.collection.val('');
this.resetAcSelection('collection');
}
if ( this.book.val() != '' && this.book.val().substring(0, 18) != "Select an existing" ) {
this.book.val('');
this.resetAcSelection('book');
}
if ( this.editor.val() != '' && this.editor.val().substring(0, 18) != "Select an existing" ) {
this.editor.val('');
this.resetAcSelection('editor');
}
if ( this.publisher.val() != '' && this.publisher.val().substring(0, 18) != "Select an existing" ) {
this.publisher.val('');
this.resetAcSelection('publisher');
}
if ( this.proceedingsOf.val() != '' && this.proceedingsOf.val().substring(0, 18) != "Select an existing" ) {
this.proceedingsOf.val('');
this.resetAcSelection('event');
}
this.number.val('');
this.issue.val('');
this.startPage.val('');
this.endPage.val('');
}
else {
// if the user is changing type, ensure that irrelevant fields are cleared
// and reset an acSelection divs
if ( this.collection.val() != '' && this.collection.val().substring(0, 18) != "Select an existing" ) {
this.collection.val('');
this.resetAcSelection('collection');
}
if ( this.book.val() != '' && this.book.val().substring(0, 18) != "Select an existing" ) {
this.book.val('');
this.resetAcSelection('book');
}
if ( this.editor.val() != '' && this.editor.val().substring(0, 18) != "Select an existing" ) {
this.editor.val('');
this.resetAcSelection('editor');
}
if ( this.publisher.val() != '' && this.publisher.val().substring(0, 18) != "Select an existing" ) {
this.publisher.val('');
this.resetAcSelection('publisher');
}
if ( this.proceedingsOf.val() != '' && this.proceedingsOf.val().substring(0, 18) != "Select an existing" ) {
this.proceedingsOf.val('');
this.resetAcSelection('event');
}
if ( this.presentedAt.val() != '' && this.presentedAt.val().substring(0, 18) != "Select an existing" ) {
this.presentedAt.val('');
this.resetAcSelection('conference');
}
this.volume.val('');
this.number.val('');
this.issue.val('');
this.startPage.val('');
this.endPage.val('');
}
}
}

View file

@ -13,6 +13,11 @@
<#assign editMode = "add">
</#if>
<#assign newUriSentinel = "" />
<#if editConfigurationConstants?has_content>
<#assign newUriSentinel = editConfigurationConstants["NEW_URI_SENTINEL"] />
</#if>
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
<#--Retrieve variables needed-->
@ -159,14 +164,15 @@ var customFormData = {
editMode: '${editMode}',
defaultTypeName: 'award',
multipleTypeNames: {award: 'award', org: 'organization'},
baseHref: '${urls.base}/individual?uri='
baseHref: '${urls.base}/individual?uri=',
newUriSentinel : '${newUriSentinel}'
};
</script>
<script type="text/javascript">
$(document).ready(function(){
awardReceiptUtils.onLoad("${editMode}");
awardReceiptUtils.onLoad('${editMode}', '${editConfiguration.subjectName}');
});
</script>

View file

@ -64,7 +64,7 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme
roleLabelAssertion,
presTypeAssertion,
presLabelAssertion ) );
conf.setN3Optional( Arrays.asList( n3ForConference, n3ForConfLabel, n3ForStart, n3ForEnd ) );
conf.setN3Optional( Arrays.asList( n3ForConference, n3ForStart, n3ForEnd ) );
conf.addNewResource("presentation", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("conference", DEFAULT_NS_FOR_NEW_RESOURCE);
@ -178,9 +178,7 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme
final static String n3ForConference =
"?conference a <" + conferenceClass + "> . \n" +
"?conference <" + includesEventPred + "> ?presentation . \n" +
"?presentation <" + eventWithinPred + "> ?conference . ";
final static String n3ForConfLabel =
"?presentation <" + eventWithinPred + "> ?conference . \n" +
"?conference <" + label + "> ?conferenceLabel .";
final static String n3ForStart =

View file

@ -145,17 +145,11 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement
getN3NewPubNameAssertion(),
getN3NewPubTypeAssertion(),
getN3ForCollection(),
getN3CollectionNameAssertion(),
getN3ForBook(),
getN3BookNameAssertion(),
getN3ForConference(),
getN3ConferenceNameAssertion(),
getN3ForEvent(),
getN3EventNameAssertion(),
getN3ForEditor(),
getN3EditorNameAssertion(),
getN3ForPublisher(),
getN3PublisherNameAssertion(),
getN3ForLocaleAssertion(),
getN3ForVolumeAssertion(),
getN3ForNumberAssertion(),
@ -205,66 +199,48 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement
return "@prefix vivo: <" + vivoCore + "> . \n" +
"?pubUri vivo:hasPublicationVenue ?collectionUri . \n" +
"?collectionUri a <" + collectionClass + "> . \n" +
"?collectionUri vivo:publicationVenueFor ?pubUri . ";
}
private String getN3CollectionNameAssertion() {
return "?collectionUri <" + label + "> ?collection .";
"?collectionUri vivo:publicationVenueFor ?pubUri . \n" +
"?collectionUri <" + label + "> ?collection .";
}
private String getN3ForBook() {
return "@prefix vivo: <" + vivoCore + "> . \n" +
"?pubUri vivo:hasPublicationVenue ?bookUri . \n" +
"?bookUri a <" + bookClass + "> . \n" +
"?bookUri vivo:publicationVenueFor ?pubUri . ";
}
private String getN3BookNameAssertion() {
return "?bookUri <" + label + "> ?book .";
"?bookUri vivo:publicationVenueFor ?pubUri . \n " +
"?bookUri <" + label + "> ?book .";
}
private String getN3ForConference() {
return "@prefix vivo: <" + vivoCore + "> . \n" +
"?pubUri <" + presentedAtPred + "> ?conferenceUri . \n" +
"?conferenceUri a <" + conferenceClass + "> . \n" +
"?conferenceUri vivo:includesEvent ?pubUri . ";
}
private String getN3ConferenceNameAssertion() {
return "?conferenceUri <" + label + "> ?conference .";
"?conferenceUri vivo:includesEvent ?pubUri . \n" +
"?conferenceUri <" + label + "> ?conference .";
}
private String getN3ForEvent() {
return "@prefix vivo: <" + vivoCore + "> . \n" +
"?pubUri vivo:proceedingsOf ?eventUri . \n" +
"?eventUri a <" + conferenceClass + "> . \n" +
"?eventUri vivo:hasProceedings ?pubUri . ";
}
private String getN3EventNameAssertion() {
return "?eventUri <" + label + "> ?event .";
"?eventUri vivo:hasProceedings ?pubUri . \n" +
"?eventUri <" + label + "> ?event .";
}
private String getN3ForEditor() {
return "@prefix vivo: <" + vivoCore + "> . \n" +
"?pubUri vivo:editor ?editorUri . \n" +
"?editorUri a <" + editorClass + "> . \n" +
"?editorUri vivo:editorOf ?pubUri . ";
}
private String getN3EditorNameAssertion() {
return "?editorUri <" + label + "> ?editor .";
"?editorUri vivo:editorOf ?pubUri . \n" +
"?editorUri <" + label + "> ?editor .";
}
private String getN3ForPublisher() {
return "@prefix vivo: <" + vivoCore + "> . \n" +
"?pubUri vivo:publisher ?publisherUri . \n" +
"?publisherUri a <" + publisherClass + "> . \n" +
"?publisherUri vivo:publisherOf ?pubUri . ";
}
private String getN3PublisherNameAssertion() {
return "?publisherUri <" + label + "> ?publisher .";
"?publisherUri vivo:publisherOf ?pubUri . \n" +
"?publisherUri <" + label + "> ?publisher .";
}
private String getN3ForLocaleAssertion() {
@ -351,6 +327,12 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement
//activity label and role label are literals on form
List<String> literalsOnForm = new ArrayList<String>();
literalsOnForm.add("title");
literalsOnForm.add("collection");
literalsOnForm.add("book");
literalsOnForm.add("conference");
literalsOnForm.add("event");
literalsOnForm.add("editor");
literalsOnForm.add("publisher");
literalsOnForm.add("locale");
literalsOnForm.add("volume");
literalsOnForm.add("number");

View file

@ -69,7 +69,6 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements
n3ForAwardToReceipt,
descriptionAssertion,
n3ForOrgAssertion,
orgLabelAssertion,
awardLabelAssertion,
n3ForYearAwarded,
n3ForStart,
@ -200,11 +199,9 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements
"?awardReceipt <"+ descriptionPred +"> ?description .";
final static String n3ForOrgAssertion =
"?awardReceipt <" + awardConferredByPred +"> ?org . \n" +
"?award <" + awardConferredByPred +"> ?org . \n" +
"?org a <" + orgClass + "> . \n" +
"?org <" + awardConferredPred + "> ?awardReceipt .";
final static String orgLabelAssertion =
"?org <" + awardConferredPred + "> ?award . \n" +
"?org <"+ label + "> ?orgLabel .";
final static String n3ForYearAwarded =
@ -238,8 +235,8 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements
final static String orgQuery =
"SELECT ?existingOrg WHERE { \n" +
" ?awardReceipt <" + awardConferredByPred + "> ?existingOrg . \n" +
" ?existingOrg <" + awardConferredPred + "> ?awardReceipt . }";
" ?award <" + awardConferredByPred + "> ?existingOrg . \n" +
" ?existingOrg <" + awardConferredPred + "> ?award . }";
final static String awardReceiptLabelQuery =
"SELECT ?existingAwardReceiptLabel WHERE { \n" +