Class N3EditUtils
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3EditUtils
-
public class N3EditUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description N3EditUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<ModelChangePreprocessor>getDefaultModelChangePreprocessors(VitroRequest vreq, org.apache.jena.rdf.model.Model displayModel)Find which default model preprocessors are associated with the application.static StringgetEditorUri(javax.servlet.http.HttpServletRequest request)Several places could give an editor URI.static voidpreprocessModels(AdditionsAndRetractions changes, EditConfigurationVTwo editConfiguration, VitroRequest request)Execute any modelChangePreprocessors in the editConfiguration;static ModelChangePreprocessorpreprocessorForURI(VitroRequest vreq, org.apache.jena.rdf.model.Model displayModel, String preprocessorURI)Returns a DataGetter using information in the displayModel for the individual with the URI given by dataGetterURI to configure it.static StringprocessEntityToReturnTo(EditConfigurationVTwo configuration, MultiValueEditSubmission submission, VitroRequest vreq)Process Entity to Return to - substituting uris etc.static StringstripInvalidXMLChars(String in)Strips from a string any characters that are not valid in XML 1.0static voidupdateEditConfigurationForBackButton(EditConfigurationVTwo editConfig, MultiValueEditSubmission submission, VitroRequest vreq, org.apache.jena.rdf.model.Model writeModel)If the edit was a data property statement edit, then this updates the EditConfiguration to be an edit of the new post-edit statement.
-
-
-
Method Detail
-
preprocessModels
public static void preprocessModels(AdditionsAndRetractions changes, EditConfigurationVTwo editConfiguration, VitroRequest request)
Execute any modelChangePreprocessors in the editConfiguration;
-
getDefaultModelChangePreprocessors
public static List<ModelChangePreprocessor> getDefaultModelChangePreprocessors(VitroRequest vreq, org.apache.jena.rdf.model.Model displayModel)
Find which default model preprocessors are associated with the application. These will be run everytime an edit/addition occurs, i.e. whenever the preprocessModels method is called.
-
preprocessorForURI
public static ModelChangePreprocessor preprocessorForURI(VitroRequest vreq, org.apache.jena.rdf.model.Model displayModel, String preprocessorURI) throws InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException, InvocationTargetException, SecurityException
Returns a DataGetter using information in the displayModel for the individual with the URI given by dataGetterURI to configure it. May return null. This should not throw an exception if the URI exists and has a type that does not implement the DataGetter interface.
-
processEntityToReturnTo
public static String processEntityToReturnTo(EditConfigurationVTwo configuration, MultiValueEditSubmission submission, VitroRequest vreq)
Process Entity to Return to - substituting uris etc. May return null.
-
updateEditConfigurationForBackButton
public static void updateEditConfigurationForBackButton(EditConfigurationVTwo editConfig, MultiValueEditSubmission submission, VitroRequest vreq, org.apache.jena.rdf.model.Model writeModel)
If the edit was a data property statement edit, then this updates the EditConfiguration to be an edit of the new post-edit statement. This allows a back button to the form to get the edit key and be associated with the new edit state. TODO: move this to utils
-
getEditorUri
public static String getEditorUri(javax.servlet.http.HttpServletRequest request)
Several places could give an editor URI. Return the first one.
-
-