Fixing RDF edit on session experation. VIVO-186
This commit is contained in:
parent
68284acd99
commit
38e6146390
2 changed files with 30 additions and 1 deletions
|
@ -61,7 +61,7 @@ public class ProcessRdfFormController extends FreemarkerHttpServlet{
|
|||
//get the EditConfiguration
|
||||
EditConfigurationVTwo configuration = EditConfigurationUtils.getEditConfiguration(vreq);
|
||||
if(configuration == null)
|
||||
throw new Error("No edit configuration found.");
|
||||
return handleMissingConfiguration(vreq);
|
||||
|
||||
//get the EditSubmission
|
||||
MultiValueEditSubmission submission = new MultiValueEditSubmission(vreq.getParameterMap(), configuration);
|
||||
|
@ -177,6 +177,17 @@ public class ProcessRdfFormController extends FreemarkerHttpServlet{
|
|||
}
|
||||
return null; //no errors
|
||||
}
|
||||
|
||||
/**
|
||||
* If the edit configuration cannot be found in the Session,
|
||||
* show a message and display any request parameters so that the user's
|
||||
* efforts won't be lost.
|
||||
*/
|
||||
protected ResponseValues handleMissingConfiguration(VitroRequest vreq){
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
map.put("params",vreq.getParameterMap());
|
||||
return new TemplateResponseValues( "missingEditConfig.ftl", map );
|
||||
}
|
||||
|
||||
//Move to EditN3Utils but keep make new uris here
|
||||
public static class Utilities {
|
||||
|
@ -313,4 +324,5 @@ public class ProcessRdfFormController extends FreemarkerHttpServlet{
|
|||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
17
webapp/web/templates/freemarker/edit/missingEditConfig.ftl
Normal file
17
webapp/web/templates/freemarker/edit/missingEditConfig.ftl
Normal file
|
@ -0,0 +1,17 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<p>Unable to process the edit, possibly due to session experation.</p>
|
||||
|
||||
<#list params?keys as key>
|
||||
<#if key != "editKey">
|
||||
|
||||
<div id=${key}>
|
||||
<h2>${key}</h2>
|
||||
<#list params[key] as value>
|
||||
<p>${value}</p>
|
||||
</#list>
|
||||
</div>
|
||||
|
||||
</#if>
|
||||
</#list>
|
||||
|
Loading…
Add table
Reference in a new issue