diff --git a/productMods/templates/freemarker/edit/forms/addPublicationToPerson.ftl b/productMods/templates/freemarker/edit/forms/addPublicationToPerson.ftl index 12ef8289..7a1342c3 100644 --- a/productMods/templates/freemarker/edit/forms/addPublicationToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addPublicationToPerson.ftl @@ -64,6 +64,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <#assign volumeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "volume") /> <#assign numberValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "number") /> <#assign issueValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "issue") /> +<#assign chapterNbrValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "chapterNbr") /> <#assign startPageValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "startPage") /> <#assign endPageValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "endPage") /> @@ -272,11 +273,13 @@ Set this flag on the input acUriReceiver where you would like this behavior to o +
+
<#-- Start/End Pages --> diff --git a/productMods/templates/freemarker/edit/forms/js/publicationToPersonUtils.js b/productMods/templates/freemarker/edit/forms/js/publicationToPersonUtils.js index a5d583b4..b560f758 100644 --- a/productMods/templates/freemarker/edit/forms/js/publicationToPersonUtils.js +++ b/productMods/templates/freemarker/edit/forms/js/publicationToPersonUtils.js @@ -36,6 +36,8 @@ var publicationToPersonUtils = { this.volLabel = $('#volLabel'); this.number = $('#number'); this.nbrLabel = $('#nbrLabel'); + this.chapterNbr = $('#chapterNbr'); + this.chapterNbrLabel = $('#chapterNbrLabel'); this.issue = $('#issue'); this.issueLabel = $('#issueLabel'); this.startPage = $('#startPage'); @@ -133,6 +135,8 @@ var publicationToPersonUtils = { this.nbrLabel.hide(); this.issue.hide(); this.issueLabel.hide(); + this.chapterNbr.hide(); + this.chapterNbrLabel.hide(); this.startPage.parent('p').hide(); this.sPLabel.parent('p').hide(); }, @@ -152,8 +156,6 @@ var publicationToPersonUtils = { } this.volume.show(); this.volLabel.show(); - this.number.show(); - this.nbrLabel.show(); this.issue.show(); this.issueLabel.show(); this.startPage.parent('p').show(); @@ -183,6 +185,8 @@ var publicationToPersonUtils = { } this.locale.val(''); + this.number.val(''); + this.chapterNbr.val(''); } else if ( selectedType == 'Chapter' ) { // if the user has changed type, keep any relevant values and display the @@ -203,8 +207,8 @@ var publicationToPersonUtils = { this.locale.parent('p').show(); this.volume.show(); this.volLabel.show(); - this.number.show(); - this.nbrLabel.show(); + this.chapterNbr.show(); + this.chapterNbrLabel.show(); this.startPage.parent('p').show(); this.sPLabel.parent('p').show(); @@ -263,6 +267,7 @@ var publicationToPersonUtils = { this.issue.val(''); this.startPage.val(''); this.endPage.val(''); + this.chapterNbr.val(''); } else if ( selectedType == 'Conference Paper' ) { // if the user has changed type, keep any relevant values and display the @@ -302,6 +307,7 @@ var publicationToPersonUtils = { this.issue.val(''); this.startPage.val(''); this.endPage.val(''); + this.chapterNbr.val(''); } else if ( selectedType == 'Conference Poster' || selectedType == 'Speech') { // if the user has changed type, keep any relevant values and display the @@ -338,6 +344,7 @@ var publicationToPersonUtils = { this.issue.val(''); this.startPage.val(''); this.endPage.val(''); + this.chapterNbr.val(''); } else { @@ -373,7 +380,7 @@ var publicationToPersonUtils = { this.issue.val(''); this.startPage.val(''); this.endPage.val(''); - + this.chapterNbr.val(''); } }, diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java index 9222d257..98fdcdad 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java @@ -45,6 +45,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement final static String volumePred = bibo + "volume"; final static String numberPred = bibo + "number"; final static String issuePred = bibo + "issue"; + final static String chapterNbrPred = bibo + "chapter"; final static String startPagePred = bibo + "pageStart"; final static String endPagePred = bibo + "pageEnd"; final static String dateTimePred = vivoCore + "dateTimeValue"; @@ -174,6 +175,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement getN3ForVolumeAssertion(), getN3ForNumberAssertion(), getN3ForIssueAssertion(), + getN3ForChapterNbrAssertion(), getN3ForStartPageAssertion(), getN3ForEndPageAssertion(), getN3ForDateTimeAssertion() @@ -405,6 +407,11 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?newPublication <" + issuePred + "> ?issue . "; } + private String getN3ForChapterNbrAssertion() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication <" + chapterNbrPred + "> ?chapterNbr . "; + } + private String getN3ForStartPageAssertion() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?newPublication <" + startPagePred + "> ?startPage . "; @@ -485,6 +492,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement literalsOnForm.add("volume"); literalsOnForm.add("number"); literalsOnForm.add("issue"); + literalsOnForm.add("chapterNbr"); literalsOnForm.add("startPage"); literalsOnForm.add("endPage"); literalsOnForm.add("firstName"); @@ -535,6 +543,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement setVolumeField(editConfiguration); setNumberField(editConfiguration); setIssueField(editConfiguration); + setChapterNbrField(editConfiguration); setStartPageField(editConfiguration); setEndPageField(editConfiguration); setDateTimeField(editConfiguration); @@ -735,6 +744,14 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement setRangeDatatypeUri(stringDatatypeUri)); } + private void setChapterNbrField(EditConfigurationVTwo editConfiguration) { + String stringDatatypeUri = XSD.xstring.toString(); + editConfiguration.addField(new FieldVTwo(). + setName("chapterNbr"). + setValidators(list("datatype:" + stringDatatypeUri)). + setRangeDatatypeUri(stringDatatypeUri)); + } + private void setStartPageField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo().