Adding some chagnes to ProcessRdfForm.java
This commit is contained in:
parent
543c1cd945
commit
15f6bbce5c
1 changed files with 13 additions and 11 deletions
|
@ -31,7 +31,6 @@ import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
|
|||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.TemplateProcessingHelper.TemplateProcessingException;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ForwardResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.InsertException;
|
||||
|
@ -49,6 +48,7 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.ModelChangePreprocessor;
|
|||
* This servlet will process EditConfigurations with query parameters
|
||||
* to perform an edit.
|
||||
*
|
||||
* TODO: rename this class ProcessN3Edit
|
||||
*/
|
||||
public class ProcessRdfForm extends FreemarkerHttpServlet{
|
||||
|
||||
|
@ -114,6 +114,7 @@ public class ProcessRdfForm extends FreemarkerHttpServlet{
|
|||
|
||||
/**
|
||||
* Execute any modelChangePreprocessors in the editConfiguration;
|
||||
* Move to EditN3Utils
|
||||
*/
|
||||
protected void preprocessModels(AdditionsAndRetractions changes, EditConfiguration editConfiguration, VitroRequest request){
|
||||
|
||||
|
@ -126,6 +127,7 @@ public class ProcessRdfForm extends FreemarkerHttpServlet{
|
|||
}
|
||||
}
|
||||
|
||||
//Move to EditN3Utils
|
||||
protected AdditionsAndRetractions getMinimalChanges( AdditionsAndRetractions changes ){
|
||||
//make a model with all the assertions and a model with all the
|
||||
//retractions, do a diff on those and then only add those to the jenaOntModel
|
||||
|
@ -149,6 +151,7 @@ public class ProcessRdfForm extends FreemarkerHttpServlet{
|
|||
return changes;
|
||||
}
|
||||
|
||||
|
||||
protected void applyChangesToWriteModel(AdditionsAndRetractions changes, OntModel queryModel, OntModel writeModel, String editorUri) {
|
||||
//side effect: modify the write model with the changes
|
||||
Lock lock = null;
|
||||
|
@ -167,10 +170,8 @@ public class ProcessRdfForm extends FreemarkerHttpServlet{
|
|||
}
|
||||
|
||||
private EditConfiguration getEditConfiguration(HttpServletRequest request) {
|
||||
|
||||
HttpSession session = request.getSession();
|
||||
EditConfiguration editConfiguration = EditConfiguration.getConfigFromSession(session, request);
|
||||
|
||||
return editConfiguration;
|
||||
}
|
||||
|
||||
|
@ -365,8 +366,7 @@ public class ProcessRdfForm extends FreemarkerHttpServlet{
|
|||
requestDispatcher.forward(vreq, response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Move to EditN3Utils but keep make new uris here
|
||||
public static class Utilities {
|
||||
|
||||
private static Log log = LogFactory.getLog(ProcessRdfForm.class);
|
||||
|
@ -485,6 +485,8 @@ public class ProcessRdfForm extends FreemarkerHttpServlet{
|
|||
/**
|
||||
* This is a data structure to allow a method to return
|
||||
* a pair of Model objects for additions and retractions.
|
||||
*
|
||||
* Move this to its own class
|
||||
*/
|
||||
protected class AdditionsAndRetractions {
|
||||
Model additions;
|
||||
|
|
Loading…
Add table
Reference in a new issue