Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The main concept of custom forms is that the values submitted by the HTTP request will be substituted into placeholders in RDF N3 strings.  These strings are then parsed to Jena RDF Model objects and that RDF is added to the system.  For the modification of an existing value, a second set of strings is created and parsed which become the RDF statements to remove for the edit.  This substitution is why the editing system is frequently called “N3 Editing”.  In practice, the N3 strings use only the turtle subset of the N3 syntax.

...

Steps of an Edit

Step 1. Getting the link to the edit  

...

When the user clicks the link, the client browser requests the URL of the edit link which will be to the EditRequestDispactchControllEditRequestDispatchControl.  That servlet will set up all that is needed in the session for the edit and respond with the HTML form.  A custom form is setup by the EditConfigurationGenerator which has the sole purpose of making an EditConfiguration object. The EditRequestDispatchController will run getEditConfiguration() on the EditConfigurationGenerator to create the EditConfiguration. The EditConfiguration object has properties to define the characteristics of the edit. The EditConfiguration will specify the FreeMarker template for the form, and the server side instructions for validating the submitted result and instructions for processing the edit. When authoring a custom form, a central task is the coding of the EditConfigurationGenerator to produce an EditConfiguration that encodes logic of how you desire the edit to happen.  The EditConfigurationGenerator is just a java class that creates an EditConfiguration. 

...

Once the EditRequestDispatchController has the EditConfiguration and put it in the session, it will set up some standard values for the template and pass them and the EditConfiguration to the FreeMarker template specified in EditConfiguration.getTemplate().  The HTML form is then generated using the normal FreeMarker process. The HTML form must contain a field with the EditKey so associate the edit with an EditConfiguration in the session.

Step 4. Response From Client

The form will be submitted by the client’s browser to ProcessRdfFormController. This will get the EditConfiguration based on the edit key from the submitted values. It will run validation and then substitute the values from the form into the N3 templates and parse the N3 to RDF. The N3 that gets created will be then added to the VIVO/Vitro models.  If the edit is a change of an existing value, then the RDF for the statements to remove will be created and removed form the VIVO/Vitro models.