rjy7 2010-07-24 20:24:16 +00:00
parent 7ce437e5bc
commit 7f27c12fce
3 changed files with 36 additions and 31 deletions

View file

@ -58,9 +58,6 @@ This is intended to create a set of statements like:
<c:set var="rdf" value="<%= VitroVocabulary.RDF %>" /> <c:set var="rdf" value="<%= VitroVocabulary.RDF %>" />
<c:set var="label" value="${rdfs}label" /> <c:set var="label" value="${rdfs}label" />
<%-- grantLabel is required if we are doing an update --%>
<c:set var="labelRequired" ><%= request.getAttribute("objectUri")== null?"":"\"nonempty\"," %></c:set>
<% // set role type based on predicate <% // set role type based on predicate
String subjectName = ((Individual) request.getAttribute("subject")).getName(); String subjectName = ((Individual) request.getAttribute("subject")).getName();
if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvestigatorRole") ) { %> if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvestigatorRole") ) { %>
@ -76,6 +73,22 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest
<c:set var="submitButtonLabel">Investigator</c:set> <c:set var="submitButtonLabel">Investigator</c:set>
<c:set var="formHeading">investigator entry for <%= subjectName %></c:set> <c:set var="formHeading">investigator entry for <%= subjectName %></c:set>
<% } %> <% } %>
<c:choose>
<c:when test="<%= request.getAttribute(\"objectUri\")!=null %>">
<c:set var="formHeading" value="Edit ${formHeading}" />
<c:set var="editMode" value="edit" />
<c:set var="submitButtonLabel" value="Edit ${submitButtonLabel}" />
<c:set var="labelRequired" value="" />
<c:set var="disabledVal" value="disabled" />
</c:when>
<c:otherwise>
<c:set var="formHeading" value="Create a new ${formHeading}" />
<c:set var="editMode" value="add" />
<c:set var="labelRequired" value="\"nonempty\"," />
<c:set var="disabledVal" value="" />
</c:otherwise>
</c:choose>
<c:set var="startYearUri" value="${vivoCore}startYear" /> <c:set var="startYearUri" value="${vivoCore}startYear" />
<v:jsonset var="startYearAssertion" > <v:jsonset var="startYearAssertion" >
@ -264,18 +277,6 @@ PREFIX core: <${vivoCore}>
<c:set var="requiredHint" value="<span class='requiredHint'> *</span>" /> <c:set var="requiredHint" value="<span class='requiredHint'> *</span>" />
<c:set var="yearHint" value="<span class='hint'>(YYYY)</span>" /> <c:set var="yearHint" value="<span class='hint'>(YYYY)</span>" />
<c:choose>
<c:when test="<%= request.getAttribute(\"objectUri\")!=null %>">
<c:set var="formHeading" value="Edit ${formHeading}" />
<c:set var="editMode" value="edit" />
<c:set var="submitButtonLabel" value="Edit ${submitButtonLabel}" />
</c:when>
<c:otherwise>
<c:set var="formHeading" value="Create a new ${formHeading}" />
<c:set var="editMode" value="add" />
</c:otherwise>
</c:choose>
<jsp:include page="${preForm}" /> <jsp:include page="${preForm}" />
<h2>${formHeading}</h2> <h2>${formHeading}</h2>
@ -285,8 +286,14 @@ PREFIX core: <${vivoCore}>
<%-- 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="addGrantRoleToPerson" class="noIE67" action="<c:url value="/edit/processRdfForm2.jsp"/>" > <form id="addGrantRoleToPerson" class="noIE67" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
<p><v:input type="text" id="relatedIndLabel" name="grantLabel" label="Name ${requiredHint}" cssClass="acSelector" size="50" /></p> <p><v:input type="text" id="relatedIndLabel" name="grantLabel" label="Name ${requiredHint}" cssClass="acSelector" size="50" disabled="${disabledVal}" /></p>
<%-- Store this value in a hidden field, because the displayed field is disabled and don't submit. This ensures that when
returning from a validation error, we retain the value. --%>
<c:if test="${editMode == 'edit'}">
<v:input type="hidden" id="grantLabel" />
</c:if>
<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>
<v:input type="hidden" id="grant" name="grant" cssClass="acUriReceiver" /> <%-- Field value populated by JavaScript --%> <v:input type="hidden" id="grant" name="grant" cssClass="acUriReceiver" /> <%-- Field value populated by JavaScript --%>

View file

@ -149,7 +149,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
<%-- label and type required if we are doing an add or a repair, but not an edit --%> <%-- label and type required if we are doing an add or a repair, but not an edit --%>
<c:set var="labelRequired" ><%= (mode == 1 || mode == 3) ?"\"nonempty\"," : "" %></c:set> <c:set var="labelRequired" ><%= (mode == 1 || mode == 3) ?"\"nonempty\"," : "" %></c:set>
<c:set var="typeRequired" ><%= (mode == 1 || mode == 3) ?"\"nonempty\"," : "" %></c:set> <c:set var="typeRequired" ><%= (mode == 1 || mode == 3) ?"\"nonempty\"" : "" %></c:set>
<%-- <%--
<c:choose> <c:choose>
@ -259,7 +259,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
"urisInScope" : { "inverseRolePredicate" : "${inversePredicate}" }, "urisInScope" : { "inverseRolePredicate" : "${inversePredicate}" },
"literalsInScope": { }, "literalsInScope": { },
"urisOnForm" : [ "roleActivity", "roleActivityType" ], "urisOnForm" : [ "roleActivity", "roleActivityType" ],
"literalsOnForm" : [ "activityLabel", "roleLabel", "startYear", "endYear", "existingActivityLabel" ], "literalsOnForm" : [ "activityLabel", "roleLabel", "startYear", "endYear" ],
"filesOnForm" : [ ], "filesOnForm" : [ ],
"sparqlForLiterals" : { }, "sparqlForLiterals" : { },
"sparqlForUris" : { }, "sparqlForUris" : { },
@ -377,11 +377,13 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
<c:when test="<%= request.getAttribute(\"objectUri\")!=null %>"> <c:when test="<%= request.getAttribute(\"objectUri\")!=null %>">
<c:set var="titleText" value="Edit" /> <c:set var="titleText" value="Edit" />
<c:set var="submitButtonText" value="Edit ${buttonLabel}" /> <c:set var="submitButtonText" value="Edit ${buttonLabel}" />
<c:set var="disabledVal" value="disabled" />
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<c:set var="titleText" value="Create a new" /> <c:set var="titleText" value="Create a new" />
<c:set var="editMode" value="add" /> <c:set var="editMode" value="add" />
<c:set var="submitButtonText" value="${buttonLabel}" /> <c:set var="submitButtonText" value="${buttonLabel}" />
<c:set var="disabledVal" value="" />
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
@ -393,16 +395,22 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
<% }else{ %> <% }else{ %>
<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="addRoleForm" 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" disabled="${disabledVal}" id="typeSelector" /></p>
<div class="fullViewOnly"> <div class="fullViewOnly">
<p><v:input type="text" id="relatedIndLabel" name="activityLabel" label="Name ${requiredHint}" cssClass="acSelector" size="50" /></p> <p><v:input type="text" id="relatedIndLabel" name="activityLabel" label="Name ${requiredHint}" cssClass="acSelector" disabled="${disabledVal}" size="50" /></p>
<%-- Store these values in hidden fields, because the displayed fields are disabled and don't submit. This ensures that when
returning from a validation error, we retain the values. --%>
<c:if test="${editMode == 'edit'}">
<v:input type="hidden" id="roleActivityType" />
<v:input type="hidden" id="activityLabel" />
</c:if>
<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>

View file

@ -136,10 +136,6 @@ var customForm = {
}, },
initFormFullView: function() { initFormFullView: function() {
if (this.editMode == 'edit') {
this.initFormEditView();
}
this.setType(); this.setType();
this.fullViewOnly.show(); this.fullViewOnly.show();
@ -182,12 +178,6 @@ var customForm = {
}, },
initFormEditView: function() {
// These are not editable: only properties of the role are editable.
this.typeSelector.attr('disabled', 'disabled');
this.relatedIndLabel.attr('disabled', 'disabled');
},
// Bind event listeners that persist over the life of the page. Event listeners // 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. // that depend on the view should be initialized in the view setup method.
bindEventListeners: function() { bindEventListeners: function() {