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: 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 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. 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 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}" }, "inverseRolePredicate" : "${inversePredicate}" },
"literalsInScope": { }, "literalsInScope": { },
"urisOnForm" : [ "grant" ], "urisOnForm" : [ "grant" ],
"literalsOnForm" : [ "grantLabel", "startYear", "endYear" ], "literalsOnForm" : [ "grantLabel", "startYear", "endYear", "existingGrantLabel" ],
"filesOnForm" : [ ], "filesOnForm" : [ ],
"sparqlForLiterals" : { }, "sparqlForLiterals" : { },
"sparqlForUris" : { }, "sparqlForUris" : { },
@ -181,14 +181,25 @@ PREFIX core: <${vivoCore}>
"optionsType" : "UNDEFINED", "optionsType" : "UNDEFINED",
"literalOptions" : [ ], "literalOptions" : [ ],
"predicateUri" : "", "predicateUri" : "",
"objectClassUri" : "${personClassUriJson}", "objectClassUri" : "",
"rangeDatatypeUri" : "${stringDatatypeUriJson}", "rangeDatatypeUri" : "${stringDatatypeUriJson}",
"rangeLang" : "", "rangeLang" : "",
"assertions" : ["${n3ForGrantLabel}"] "assertions" : ["${n3ForGrantLabel}"]
}, },
"existingGrantLabel" : { /* Needed iff we return from an invalid submission */
"newResource" : "false",
"validators" : [ ],
"optionsType" : "UNDEFINED",
"literalOptions" : [ ],
"predicateUri" : "",
"objectClassUri" : "",
"rangeDatatypeUri" : "",
"rangeLang" : "",
"assertions" : [ ]
},
"startYear" : { "startYear" : {
"newResource" : "false", "newResource" : "false",
"validators" : [ "datatype:${gYearDatatypeUriJson}" ], "validators" : [ "nonempty", "datatype:${gYearDatatypeUriJson}" ],
"optionsType" : "UNDEFINED", "optionsType" : "UNDEFINED",
"literalOptions" : [ ], "literalOptions" : [ ],
"predicateUri" : "", "predicateUri" : "",
@ -275,8 +286,8 @@ PREFIX core: <${vivoCore}>
<div class="acSelection"> <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> <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. --%> <v:input type="hidden" id="grant" name="grant" cssClass="acUriReceiver" /> <%-- Field value populated by JavaScript --%>
<input type="hidden" id="grant" name="grant" class="acReceiver" value="" /> <!-- Field value populated by JavaScript --> <v:input type="hidden" id="existingGrantLabel" name="existingGrantLabel" cssClass="acLabelReceiver" /> <%-- Needed iff we return from an invalid submission --%>
</div> </div>
<h4>Dates of Participation in Grant</h4> <h4>Dates of Participation in Grant</h4>

View file

@ -218,7 +218,7 @@ SPARQL queries for existing values. --%>
<div class="acSelection"> <div class="acSelection">
<%-- RY maybe make this a label and input field. See what looks best. --%> <%-- 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> <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>
</div> </div>

View file

@ -189,7 +189,7 @@
"urisInScope" : { "inverseRolePredicate" : "${inversePredicate}" }, "urisInScope" : { "inverseRolePredicate" : "${inversePredicate}" },
"literalsInScope": { }, "literalsInScope": { },
"urisOnForm" : [ "roleActivity", "roleActivityType" ], "urisOnForm" : [ "roleActivity", "roleActivityType" ],
"literalsOnForm" : [ "activityLabel", "roleLabel", "startYear", "endYear" ], "literalsOnForm" : [ "activityLabel", "roleLabel", "startYear", "endYear", "existingActivityLabel" ],
"filesOnForm" : [ ], "filesOnForm" : [ ],
"sparqlForLiterals" : { }, "sparqlForLiterals" : { },
"sparqlForUris" : { }, "sparqlForUris" : { },
@ -229,6 +229,17 @@
"rangeLang" : "", "rangeLang" : "",
"assertions" : [ ] "assertions" : [ ]
}, },
"existingActivityLabel" : { /* Needed iff we return from an invalid submission */
"newResource" : "false",
"validators" : [ ],
"optionsType" : "UNDEFINED",
"literalOptions" : [ ],
"predicateUri" : "",
"objectClassUri" : "",
"rangeDatatypeUri" : "",
"rangeLang" : "",
"assertions" : [ ]
},
"roleLabel" : { "roleLabel" : {
"newResource" : "false", "newResource" : "false",
"validators" : [ "nonempty","datatype:${stringDatatypeUriJson}" ], "validators" : [ "nonempty","datatype:${stringDatatypeUriJson}" ],
@ -242,7 +253,7 @@
}, },
"startYear" : { "startYear" : {
"newResource" : "false", "newResource" : "false",
"validators" : [ "datatype:${gYearDatatypeUriJson}" ], "validators" : [ "nonempty", "datatype:${gYearDatatypeUriJson}" ],
"optionsType" : "UNDEFINED", "optionsType" : "UNDEFINED",
"literalOptions" : [ ], "literalOptions" : [ ],
"predicateUri" : "", "predicateUri" : "",
@ -275,9 +286,6 @@
editConfig.addValidator(new StartYearBeforeEndYear("startYear","endYear") ); editConfig.addValidator(new StartYearBeforeEndYear("startYear","endYear") );
Model model = (Model) application.getAttribute("jenaOntModel"); Model model = (Model) application.getAttribute("jenaOntModel");
String objectUri = (String) request.getAttribute("objectUri"); String objectUri = (String) request.getAttribute("objectUri");
if (objectUri != null) { if (objectUri != null) {
@ -324,7 +332,7 @@
<h2>${titleText}&nbsp;${roleActivityTypeLabel} entry for <%= subjectName %></h2> <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! --%> <%-- 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> <p class="inline"><v:input type="select" label="${roleActivityTitleCase} Type ${requiredHint}" name="roleActivityType" id="typeSelector" /></p>
@ -335,7 +343,8 @@
<div class="acSelection"> <div class="acSelection">
<%-- RY maybe make this a label and input field. See what looks best. --%> <%-- 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> <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> </div>
<p><v:input type="text" id="newIndLabel" name="roleLabel" label="Role in ### ${requiredHint}" size="50" /></p> <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.acSelector = this.form.find('.acSelector');
this.acSelection = this.form.find('.acSelection'); this.acSelection = this.form.find('.acSelection');
this.acSelectionInfo = this.form.find('.acSelectionInfo'); 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.verifyMatch = this.form.find('.verifyMatch');
this.verifyMatchBaseHref = this.verifyMatch.attr('href'); this.verifyMatchBaseHref = this.verifyMatch.attr('href');
this.acSelectorWrapper = this.acSelector.parent(); this.acSelectorWrapper = this.acSelector.parent();
@ -86,13 +87,15 @@ var customForm = {
var typeVal = this.typeSelector.val(); var typeVal = this.typeSelector.val();
if (this.formSteps == 1 || this.findValidationErrors()) { if (this.findValidationErrors()) {
this.initFormFullView(); this.initFormWithValidationErrors();
//this.initFormFullView();
} }
// this.formSteps == 1 includes edit mode.
// If type is already selected when the page loads (Firefox retains value // 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 // on a refresh), go directly to full view. Otherwise user has to reselect
// twice to get to full view. // twice to get to full view.
else if (typeVal.length) { else if ( this.formSteps == 1 || typeVal.length ) {
this.initFormFullView(); this.initFormFullView();
} }
else { else {
@ -124,9 +127,9 @@ var customForm = {
this.button.show(); this.button.show();
this.setButtonText('new'); this.setButtonText('new');
this.setLabels(); this.setLabels();
this.cancel.unbind('click');
if( this.formSteps > 1 ){ if( this.formSteps > 1 ){ // NB includes this.editMode == 1
this.cancel.unbind('click');
this.cancel.click(function() { this.cancel.click(function() {
customForm.clearFormData(); // clear any input and validation errors customForm.clearFormData(); // clear any input and validation errors
customForm.initFormTypeView(); 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() { 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.typeSelector.attr('disabled', 'disabled');
this.relatedIndLabel.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() { bindEventListeners: function() {
this.typeSelector.change(function() { this.typeSelector.change(function() {
@ -206,7 +233,7 @@ var customForm = {
}); });
}, },
select: function(event, ui) { select: function(event, ui) {
customForm.showAutocompleteSelection(ui); customForm.showAutocompleteSelection(ui.item.label, ui.item.uri);
} }
}); });
@ -280,9 +307,7 @@ var customForm = {
this.acCache = {}; this.acCache = {};
}, },
showAutocompleteSelection: function(ui) { showAutocompleteSelection: function(label, uri) {
var uri = ui.item.uri;
this.acSelectorWrapper.hide(); this.acSelectorWrapper.hide();
this.acSelector.attr('disabled', 'disabled'); this.acSelector.attr('disabled', 'disabled');
@ -294,8 +319,9 @@ var customForm = {
this.acSelection.show(); this.acSelection.show();
this.acReceiver.val(uri); this.acUriReceiver.val(uri);
this.acSelectionInfo.html(ui.item.label); this.acLabelReceiver.val(label);
this.acSelectionInfo.html(label);
this.verifyMatch.attr('href', this.verifyMatchBaseHref + uri); this.verifyMatch.attr('href', this.verifyMatchBaseHref + uri);
this.setButtonText('existing'); this.setButtonText('existing');
@ -316,7 +342,7 @@ var customForm = {
this.acSelector.attr('disabled', ''); this.acSelector.attr('disabled', '');
this.acSelector.val(''); this.acSelector.val('');
this.hideFields(this.acSelection); this.hideFields(this.acSelection);
this.acReceiver.val(''); this.acUriReceiver.val('');
this.acSelectionInfo.html(''); this.acSelectionInfo.html('');
this.verifyMatch.attr('href', this.verifyMatchBaseHref); this.verifyMatch.attr('href', this.verifyMatchBaseHref);