Merging r914 through r916 from rel-1.1-maint

This commit is contained in:
rjy7 2010-07-19 21:35:26 +00:00
parent 6f94c047ef
commit c06384d6c2
5 changed files with 79 additions and 33 deletions

View file

@ -295,7 +295,7 @@ Language) extension.
Follow step A or B below, whichever is applicable to your site:
A. If you did not create a customized theme for your site in VIVO 1.0, but used
the vivo-basic theme that shipped with VIVO 1.0, you need not take any action
the 1.0 vivo-basic theme in its original directory, you need not take any action
in order to convert your site to the VIVO 1.1 theme.
B. If you created your own theme directory in VIVO 1.0, follow the steps below

View file

@ -157,7 +157,7 @@ PREFIX core: <${vivoCore}>
"inverseRolePredicate" : "${inversePredicate}" },
"literalsInScope": { },
"urisOnForm" : [ "grant" ],
"literalsOnForm" : [ "grantLabel", "startYear", "endYear" ],
"literalsOnForm" : [ "grantLabel", "startYear", "endYear", "existingGrantLabel" ],
"filesOnForm" : [ ],
"sparqlForLiterals" : { },
"sparqlForUris" : { },
@ -181,14 +181,25 @@ PREFIX core: <${vivoCore}>
"optionsType" : "UNDEFINED",
"literalOptions" : [ ],
"predicateUri" : "",
"objectClassUri" : "${personClassUriJson}",
"objectClassUri" : "",
"rangeDatatypeUri" : "${stringDatatypeUriJson}",
"rangeLang" : "",
"assertions" : ["${n3ForGrantLabel}"]
},
"existingGrantLabel" : { /* Needed iff we return from an invalid submission */
"newResource" : "false",
"validators" : [ ],
"optionsType" : "UNDEFINED",
"literalOptions" : [ ],
"predicateUri" : "",
"objectClassUri" : "",
"rangeDatatypeUri" : "",
"rangeLang" : "",
"assertions" : [ ]
},
"startYear" : {
"newResource" : "false",
"validators" : [ "datatype:${gYearDatatypeUriJson}" ],
"validators" : [ "nonempty", "datatype:${gYearDatatypeUriJson}" ],
"optionsType" : "UNDEFINED",
"literalOptions" : [ ],
"predicateUri" : "",
@ -275,8 +286,8 @@ PREFIX core: <${vivoCore}>
<div class="acSelection">
<p class="inline"><label>Selected Grant:</label><span class="acSelectionInfo"></span><a href="<c:url value="/individual?uri=" />" class="verifyMatch">(Verify this match)</a></p>
<%-- bdc34: for some odd reason id and name should not be grant in this input element. --%>
<input type="hidden" id="grant" name="grant" class="acReceiver" value="" /> <!-- Field value populated by JavaScript -->
<v:input type="hidden" id="grant" name="grant" cssClass="acUriReceiver" /> <%-- Field value populated by JavaScript --%>
<v:input type="hidden" id="existingGrantLabel" name="existingGrantLabel" cssClass="acLabelReceiver" /> <%-- Needed iff we return from an invalid submission --%>
</div>
<h4>Dates of Participation in Grant</h4>

View file

@ -218,7 +218,7 @@ SPARQL queries for existing values. --%>
<div class="acSelection">
<%-- RY maybe make this a label and input field. See what looks best. --%>
<p class="inline"><label></label><span class="acSelectionInfo"></span> <a href="<c:url value="/individual?uri=" />" class="verifyMatch">(Verify this match)</a></p>
<input type="hidden" id="pubUri" name="pubUri" class="acReceiver" value="" /> <!-- Field value populated by JavaScript -->
<input type="hidden" id="pubUri" name="pubUri" class="acUriReceiver" value="" /> <!-- Field value populated by JavaScript -->
</div>
</div>

View file

@ -189,7 +189,7 @@
"urisInScope" : { "inverseRolePredicate" : "${inversePredicate}" },
"literalsInScope": { },
"urisOnForm" : [ "roleActivity", "roleActivityType" ],
"literalsOnForm" : [ "activityLabel", "roleLabel", "startYear", "endYear" ],
"literalsOnForm" : [ "activityLabel", "roleLabel", "startYear", "endYear", "existingActivityLabel" ],
"filesOnForm" : [ ],
"sparqlForLiterals" : { },
"sparqlForUris" : { },
@ -229,6 +229,17 @@
"rangeLang" : "",
"assertions" : [ ]
},
"existingActivityLabel" : { /* Needed iff we return from an invalid submission */
"newResource" : "false",
"validators" : [ ],
"optionsType" : "UNDEFINED",
"literalOptions" : [ ],
"predicateUri" : "",
"objectClassUri" : "",
"rangeDatatypeUri" : "",
"rangeLang" : "",
"assertions" : [ ]
},
"roleLabel" : {
"newResource" : "false",
"validators" : [ "nonempty","datatype:${stringDatatypeUriJson}" ],
@ -242,7 +253,7 @@
},
"startYear" : {
"newResource" : "false",
"validators" : [ "datatype:${gYearDatatypeUriJson}" ],
"validators" : [ "nonempty", "datatype:${gYearDatatypeUriJson}" ],
"optionsType" : "UNDEFINED",
"literalOptions" : [ ],
"predicateUri" : "",
@ -274,10 +285,7 @@
}
editConfig.addValidator(new StartYearBeforeEndYear("startYear","endYear") );
Model model = (Model) application.getAttribute("jenaOntModel");
String objectUri = (String) request.getAttribute("objectUri");
if (objectUri != null) {
@ -324,7 +332,7 @@
<h2>${titleText}&nbsp;${roleActivityTypeLabel} entry for <%= subjectName %></h2>
<%-- DO NOT CHANGE IDS, CLASSES, OR HTML STRUCTURE IN THIS FORM WITHOUT UNDERSTANDING THE IMPACT ON THE JAVASCRIPT! --%>
<form id="addPublicationForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
<form id="addRoleForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
<p class="inline"><v:input type="select" label="${roleActivityTitleCase} Type ${requiredHint}" name="roleActivityType" id="typeSelector" /></p>
@ -335,7 +343,8 @@
<div class="acSelection">
<%-- RY maybe make this a label and input field. See what looks best. --%>
<p class="inline"><label></label><span class="acSelectionInfo"></span> <a href="<c:url value="/individual?uri=" />" class="verifyMatch">(Verify this match)</a></p>
<input type="hidden" id="roleActivityURI" name="roleActivity" class="acReceiver" value="" /> <!-- Field value populated by JavaScript -->
<v:input type="hidden" id="roleActivityURI" name="roleActivity" cssClass="acUriReceiver" /> <!-- Field value populated by JavaScript -->
<v:input type="hidden" id="existingActivityLabel" name="existingActivityLabel" cssClass="acLabelReceiver" /> <%-- Needed iff we return from an invalid submission --%>
</div>
<p><v:input type="text" id="newIndLabel" name="roleLabel" label="Role in ### ${requiredHint}" size="50" /></p>

View file

@ -34,7 +34,8 @@ var customForm = {
this.acSelector = this.form.find('.acSelector');
this.acSelection = this.form.find('.acSelection');
this.acSelectionInfo = this.form.find('.acSelectionInfo');
this.acReceiver = this.form.find('.acReceiver');
this.acUriReceiver = this.form.find('.acUriReceiver');
this.acLabelReceiver = this.form.find('.acLabelReceiver');
this.verifyMatch = this.form.find('.verifyMatch');
this.verifyMatchBaseHref = this.verifyMatch.attr('href');
this.acSelectorWrapper = this.acSelector.parent();
@ -85,14 +86,16 @@ var customForm = {
initFormView: function() {
var typeVal = this.typeSelector.val();
if (this.formSteps == 1 || this.findValidationErrors()) {
this.initFormFullView();
if (this.findValidationErrors()) {
this.initFormWithValidationErrors();
//this.initFormFullView();
}
// this.formSteps == 1 includes edit mode.
// If type is already selected when the page loads (Firefox retains value
// on a refresh), go directly to full view. Otherwise user has to reselect
// twice to get to full view.
else if (typeVal.length) {
// twice to get to full view.
else if ( this.formSteps == 1 || typeVal.length ) {
this.initFormFullView();
}
else {
@ -123,10 +126,10 @@ var customForm = {
this.requiredLegend.show();
this.button.show();
this.setButtonText('new');
this.setLabels();
this.cancel.unbind('click');
this.setLabels();
if( this.formSteps > 1 ){
if( this.formSteps > 1 ){ // NB includes this.editMode == 1
this.cancel.unbind('click');
this.cancel.click(function() {
customForm.clearFormData(); // clear any input and validation errors
customForm.initFormTypeView();
@ -135,8 +138,31 @@ var customForm = {
}
},
initFormWithValidationErrors: function() {
var uri = this.acUriReceiver.val(),
label = this.acLabelReceiver.val();
// Call initFormFullView first, because showAutocompleteSelection needs
// acType, which is set in initFormFullView.
this.initFormFullView();
if (uri) {
this.showAutocompleteSelection(label, uri);
}
this.cancel.unbind('click');
this.cancel.click(function() {
// Cancel back to full view with only type selection showing
customForm.undoAutocompleteSelection();
customForm.clearFields(customForm.fullViewOnly);
customForm.initFormFullView();
return false;
});
},
initFormEditView: function() {
// These should not be editable: only properties of the role are editable.
// These are not editable: only properties of the role are editable.
this.typeSelector.attr('disabled', 'disabled');
this.relatedIndLabel.attr('disabled', 'disabled');
@ -148,7 +174,8 @@ var customForm = {
});
},
// Bind event listeners that persist over the life of the page.
// Bind event listeners that persist over the life of the page. Event listeners
// that depend on the view should be initialized in the view setup method.
bindEventListeners: function() {
this.typeSelector.change(function() {
@ -206,7 +233,7 @@ var customForm = {
});
},
select: function(event, ui) {
customForm.showAutocompleteSelection(ui);
customForm.showAutocompleteSelection(ui.item.label, ui.item.uri);
}
});
@ -280,10 +307,8 @@ var customForm = {
this.acCache = {};
},
showAutocompleteSelection: function(ui) {
var uri = ui.item.uri;
showAutocompleteSelection: function(label, uri) {
this.acSelectorWrapper.hide();
this.acSelector.attr('disabled', 'disabled');
@ -294,8 +319,9 @@ var customForm = {
this.acSelection.show();
this.acReceiver.val(uri);
this.acSelectionInfo.html(ui.item.label);
this.acUriReceiver.val(uri);
this.acLabelReceiver.val(label);
this.acSelectionInfo.html(label);
this.verifyMatch.attr('href', this.verifyMatchBaseHref + uri);
this.setButtonText('existing');
@ -316,7 +342,7 @@ var customForm = {
this.acSelector.attr('disabled', '');
this.acSelector.val('');
this.hideFields(this.acSelection);
this.acReceiver.val('');
this.acUriReceiver.val('');
this.acSelectionInfo.html('');
this.verifyMatch.attr('href', this.verifyMatchBaseHref);