adding jsp to generator map so all old jsp will now redirect to generators

This commit is contained in:
briancaruso 2011-11-14 21:28:31 +00:00
parent a54e24779d
commit d3fc45f2c6
12 changed files with 73 additions and 6 deletions

View file

@ -24,7 +24,52 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
<vitro:confirmAuthorization /> <vitro:confirmAuthorization />
<% <%
HashMap<String,String> jspFormToGenerator = new HashMap<String,String>();
HashMap<String,String> map = jspFormToGenerator;
//vitro forms:
map.put("autoCompleteDatapropForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AutoCompleteDatapropForm");
map.put("autoCompleteObjPropForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AutoCompleteObjPropForm");
map.put("datapropStmtDelete.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.DatapropStmtDelete");
map.put("dateTimeIntervalForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.DateTimeIntervalForm");
map.put("dateTimeValueForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.DateTimeValueForm");
map.put("defaultAddMissingIndividualForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.DefaultAddMissingIndividualForm");
map.put("defaultDatapropForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.DefaultDatapropForm");
map.put("defaultObjPropForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.DefaultObjPropForm");
map.put("newIndividualForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.NewIndividualForm");
map.put("propDelete.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PropDelete");
map.put("rdfsLabelForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.RdfsLabelForm");
//vivo forms:
map.put("addAuthorsToInformationResource.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddAuthorsToInformationResource");
map.put("manageWebpagesForIndividual.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividual");
map.put("newIndividualForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.NewIndividualForm");
map.put("organizationHasPositionHistory.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.OrganizationHasPositionHistory");
map.put("personHasEducationalTraining.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasEducationalTraining");
map.put("personHasPositionHistory.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasPositionHistory");
map.put("redirectToPublication.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.RedirectToPublication");
map.put("terminologyAnnotation.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.TerminologyAnnotation");
map.put("unsupportedBrowserMessage.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.UnsupportedBrowserMessage");
//vivo 2 stage role forms:
map.put("addAttendeeRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddAttendeeRoleToPerson");
map.put("addClinicalRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddClinicalRoleToPerson");
map.put("addEditWebpageForm.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddEditWebpageForm");
map.put("addEditorRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddEditorRoleToPerson");
map.put("addGrantRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddGrantRoleToPerson");
map.put("addHeadOfRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddHeadOfRoleToPerson");
map.put("addMemberRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddMemberRoleToPerson");
map.put("addOrganizerRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddOrganizerRoleToPerson");
map.put("addOutreachRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddOutreachRoleToPerson");
map.put("addPresenterRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddPresenterRoleToPerson");
map.put("addPublicationToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddPublicationToPerson");
map.put("addResearcherRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddResearcherRoleToPerson");
map.put("addReviewerRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddReviewerRoleToPerson");
map.put("addRoleToPersonTwoStage.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddRoleToPersonTwoStage");
map.put("addServiceProviderRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddServiceProviderRoleToPerson");
map.put("addTeacherRoleToPerson.jsp", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddTeacherRoleToPerson");
//Check if special model, in which case forward //Check if special model, in which case forward
if(request.getParameter("switchToDisplayModel") != null) { if(request.getParameter("switchToDisplayModel") != null) {
//forward to Edit Request Dispatch Controller //forward to Edit Request Dispatch Controller
@ -39,6 +84,8 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
String queryString = request.getQueryString(); String queryString = request.getQueryString();
response.sendRedirect(request.getContextPath() + "/editRequestDispatch?" + queryString); response.sendRedirect(request.getContextPath() + "/editRequestDispatch?" + queryString);
} }
/* /*
Decide which form to forward to, set subjectUri, subjectUriJson, predicateUri, and predicateUriJson in request. Decide which form to forward to, set subjectUri, subjectUriJson, predicateUri, and predicateUriJson in request.
Also get the Individual for the subjectUri and put it in the request scope. Also get the Individual for the subjectUri and put it in the request scope.
@ -239,6 +286,14 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
//case where a form was passed as a http parameter //case where a form was passed as a http parameter
form = formParam; form = formParam;
} }
String generator = jspFormToGenerator.get(form);
if( generator != null ){
String queryString = request.getQueryString();
response.sendRedirect(request.getContextPath() + "/editRequestDispatch?" + queryString);
return;
}
request.setAttribute("form", form); request.setAttribute("form", form);
%> %>
<jsp:forward page="/edit/forms/${form}" /> <jsp:forward page="/edit/forms/${form}" />

View file

@ -131,6 +131,8 @@
<jsp:param name="useAutoComplete" value="true"/> <jsp:param name="useAutoComplete" value="true"/>
</jsp:include> </jsp:include>
<h1>JSP form, must be removed for the 1.4!</h1>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(this).load($(this).parent().children('a').attr('src')+" .editForm"); $(this).load($(this).parent().children('a').attr('src')+" .editForm");

View file

@ -122,6 +122,7 @@
<jsp:param name="useTinyMCE" value="false"/> <jsp:param name="useTinyMCE" value="false"/>
<jsp:param name="useAutoComplete" value="true"/> <jsp:param name="useAutoComplete" value="true"/>
</jsp:include> </jsp:include>
<h1>JSP form, must be removed for the 1.4!</h1>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(this).load($(this).parent().children('a').attr('src')+" .editForm"); $(this).load($(this).parent().children('a').attr('src')+" .editForm");

View file

@ -99,6 +99,8 @@
<% } else { %> <% } else { %>
<jsp:include page="${preForm}"/> <jsp:include page="${preForm}"/>
<h1>JSP form, must be removed for the 1.4!</h1>
<form action="editDatapropStmtRequestDispatch.jsp" method="get"> <form action="editDatapropStmtRequestDispatch.jsp" method="get">
<label for="submit"><h2>Are you sure you want to delete the following entry from <em>${propertyName}</em>?</h2></label> <label for="submit"><h2>Are you sure you want to delete the following entry from <em>${propertyName}</em>?</h2></label>
<div class="toBeDeleted dataProp"><%=dataValue%></div> <div class="toBeDeleted dataProp"><%=dataValue%></div>

View file

@ -251,7 +251,7 @@
%> %>
<jsp:include page="${preForm}" /> <jsp:include page="${preForm}" />
<h1>JSP form, must be removed for the 1.4!</h1>
<h2>${titleVerb}&nbsp;date time interval for <%= subjectName %></h2> <h2>${titleVerb}&nbsp;date time interval for <%= subjectName %></h2>
<form class="customForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" > <form class="customForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >

View file

@ -179,7 +179,7 @@
<jsp:include page="${preForm}" /> <jsp:include page="${preForm}" />
<h2>${titleVerb} date time value for <%= subjectName %></h2> <h2>${titleVerb} date time value for <%= subjectName %></h2>
<h1>JSP form, must be removed for the 1.4!</h1>
<form class="customForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" > <form class="customForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
<v:input id="dateTimeField" /> <v:input id="dateTimeField" />
@ -187,4 +187,4 @@
<p class="submit"><v:input type="submit" id="submit" value="${submitButtonText}" cancel="true"/></p> <p class="submit"><v:input type="submit" id="submit" value="${submitButtonText}" cancel="true"/></p>
</form> </form>
<jsp:include page="${postForm}"/> <jsp:include page="${postForm}"/>

View file

@ -241,6 +241,7 @@
</jsp:include> </jsp:include>
<h2>${formTitle}</h2> <h2>${formTitle}</h2>
<h1>JSP form, must be removed for the 1.4!</h1>
<form action="<c:url value="/edit/processRdfForm2.jsp"/>" ><br/> <form action="<c:url value="/edit/processRdfForm2.jsp"/>" ><br/>
<v:input type="text" label="name (required)" id="name" size="30"/><br/> <v:input type="text" label="name (required)" id="name" size="30"/><br/>
<v:input type="submit" id="submit" value="<%=submitButtonLabel%>" cancel="true"/> <v:input type="submit" id="submit" value="<%=submitButtonLabel%>" cancel="true"/>

View file

@ -149,6 +149,8 @@
<jsp:param name="useTinyMCE" value="true"/> <jsp:param name="useTinyMCE" value="true"/>
</jsp:include> </jsp:include>
<h1>JSP form, must be removed for the 1.4!</h1>
<h2><%=formTitle%></h2> <h2><%=formTitle%></h2>
<form class="editForm" action="<c:url value="/edit/processDatapropRdfForm.jsp"/>" method="post" > <%-- see VITRO-435 Jira issue: need POST, not GET --%> <form class="editForm" action="<c:url value="/edit/processDatapropRdfForm.jsp"/>" method="post" > <%-- see VITRO-435 Jira issue: need POST, not GET --%>
<c:if test="${!empty predicate.publicDescription}"> <c:if test="${!empty predicate.publicDescription}">

View file

@ -157,7 +157,7 @@
} }
%> %>
<jsp:include page="${preForm}"/> <jsp:include page="${preForm}"/>
<h1>JSP form, must be removed for the 1.4!</h1>
<h2><%=formTitle%></h2> <h2><%=formTitle%></h2>
<c:if test="${requestScope.predicate.selectFromExisting == true }"> <c:if test="${requestScope.predicate.selectFromExisting == true }">

View file

@ -122,7 +122,7 @@ parameter set up by editRequestDispatch.
<c:set var="requiredHint" value="<span class='requiredHint'> *</span>" /> <c:set var="requiredHint" value="<span class='requiredHint'> *</span>" />
<jsp:include page="${preForm}" /> <jsp:include page="${preForm}" />
<h1>JSP form, must be removed for the 1.4!</h1>
<h2>Create a new ${typeName}</h2> <h2>Create a new ${typeName}</h2>
<form class="customForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" > <form class="customForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >

View file

@ -140,6 +140,8 @@ public WebappDaoFactory getUnfilteredDaoFactory() {
<jsp:include page="${preForm}"/> <jsp:include page="${preForm}"/>
<h1>JSP form, must be removed for the 1.4!</h1>
<form action="editRequestDispatch.jsp" method="get"> <form action="editRequestDispatch.jsp" method="get">
<label for="submit"><h2>Are you sure you want to delete the following entry from <em>${propertyName}</em>?</h2></label> <label for="submit"><h2>Are you sure you want to delete the following entry from <em>${propertyName}</em>?</h2></label>
<div class="toBeDeleted objProp">${statementDisplay}</div> <div class="toBeDeleted objProp">${statementDisplay}</div>

View file

@ -163,6 +163,8 @@
<jsp:param name="useTinyMCE" value="false"/> <jsp:param name="useTinyMCE" value="false"/>
</jsp:include> </jsp:include>
<h1>JSP form, must be removed for the 1.4!</h1>
<h2><%= title %></h2> <h2><%= title %></h2>
<form action="<c:url value="/edit/processDatapropRdfForm.jsp"/>" > <form action="<c:url value="/edit/processDatapropRdfForm.jsp"/>" >
<v:input type="text" id="label" size="30" /> <v:input type="text" id="label" size="30" />