updated edit request dispatch to allow the use of the java generators instead of the jsps (after ontology/migration updates)

This commit is contained in:
hjkhjk54 2011-11-28 17:10:43 +00:00
parent 67251e55eb
commit 2a07955c10

View file

@ -26,7 +26,6 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
<vitro:confirmAuthorization /> <vitro:confirmAuthorization />
<% <%
Map<String,String> jspFormToGenerator = JspToGeneratorMapping.jspsToGenerators;
//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) {
@ -245,16 +244,24 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
form = formParam; form = formParam;
} }
String generator = jspFormToGenerator.get(form);
String oldEdit = request.getParameter("oldEdit"); String oldEdit = request.getParameter("oldEdit");
if( oldEdit == null){
if( oldEdit == null && generator != null ){
String queryString = request.getQueryString(); String queryString = request.getQueryString();
response.sendRedirect( response.sendRedirect(
request.getContextPath() + request.getContextPath() +
"/editRequestDispatch?" + "/editRequestDispatch?" +
queryString + "&editForm=" + generator); queryString);
return; return;
} else {
//For testing the jsp when test parameter has value,
//Do a reverse mapping from generator to jsp where it exists
for (Map.Entry<String, String> entry: JspToGeneratorMapping.jspsToGenerators.entrySet()) {
if(form.equals(entry.getValue())) {
//Get the jsp corresponding to the Java generator
form = entry.getKey();
break;
}
}
} }
request.setAttribute("form", form); request.setAttribute("form", form);