Class AutoForm

java.lang.Object
org.dlese.dpc.schemedit.autoform.AutoForm
Direct Known Subclasses:
DcsViewRecord

public class AutoForm extends Object
Class to automatically generate jsp pages (using a Renderer class such as DleseEditorRenderer) for editing and viewing of schemedit-based xml documents.

Called from command line for debugging as well as from MetaDataFramework at start-up time and after run-time reconfiguration.

Author:
ostwald
  • Field Details

    • instanceDocument

      protected org.dom4j.Document instanceDocument
      NOT YET DOCUMENTED
    • writer

      protected org.dom4j.io.XMLWriter writer
      NOT YET DOCUMENTED
    • df

      protected org.dom4j.DocumentFactory df
      NOT YET DOCUMENTED
    • sh

      protected SchemaHelper sh
      NOT YET DOCUMENTED
    • schemaFile

      protected File schemaFile
      NOT YET DOCUMENTED
    • framework

      protected MetaDataFramework framework
      NOT YET DOCUMENTED
    • formBeanName

      protected String formBeanName
      NOT YET DOCUMENTED
  • Constructor Details

    • AutoForm

      public AutoForm(MetaDataFramework framework)
      Constructor for the AutoForm object
      Parameters:
      framework - Description of the Parameter
    • AutoForm

      public AutoForm(String xmlFormat) throws Exception, SchemaHelperException
      Constructor for the Stand-along AutoForm object, meaning it is created from command line rather than via schemedit.
      Parameters:
      xmlFormat - Description of the Parameter
      Throws:
      SchemaHelperException - Description of the Exception
      Exception - NOT YET DOCUMENTED
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      The main program for the AutoForm class. The first argument is command, the second is arg (if nec);
      Parameters:
      args - The command line arguments
      Throws:
      Exception - NOT YET DOCUMENTED
    • renderAndWrite

      public void renderAndWrite(String xpath) throws Exception
      Description of the Method
      Parameters:
      xpath - Description of the Parameter
      Throws:
      Exception - NOT YET DOCUMENTED
    • renderAndWrite

      public void renderAndWrite(String xpath, File dest) throws Exception
      NOT YET DOCUMENTED
      Parameters:
      xpath - NOT YET DOCUMENTED
      dest - NOT YET DOCUMENTED
      Throws:
      Exception - NOT YET DOCUMENTED
    • batchRenderAndWrite

      public void batchRenderAndWrite() throws Exception
      Create a jsp file for each top-level element of the schema
      Throws:
      Exception - NOT YET DOCUMENTED
    • getRendererClassName

      protected String getRendererClassName()
      Gets the rendererClassName attribute of the AutoForm object
      Returns:
      The rendererClassName value
    • render

      public org.dom4j.Element render()
      NOT YET DOCUMENTED
      Returns:
      NOT YET DOCUMENTED
    • render

      public org.dom4j.Element render(String xpath)
      Produce a Element representing an editor for the node at xpath. The Element returned by render is eventually converted to JSP.
      Parameters:
      xpath - XPath to a Node in the Schema
      Returns:
      An Element representing an editor for the given schema node
    • elementToJsp

      public static String elementToJsp(org.dom4j.Element e)
      Perform any modifications to the XML to create legal JSP. Some strings, such as tag-like notation (e.g., "c:set") are not convenient in XML processing, since they are interpreted as namespaces, so they are encoded by the renderer using a convention (e.g., "c__set") and then decoded here to convert to JSP
      Parameters:
      e - Element produced by renderer
      Returns:
      JSP representation of Element
    • getBatchJspDest

      protected File getBatchJspDest(String pageName) throws Exception
      Path for writing component jsp pages.
      Parameters:
      pageName - NOT YET DOCUMENTED
      Returns:
      The batchJspDest value
      Throws:
      Exception - NOT YET DOCUMENTED
    • getJspDest

      protected File getJspDest(String pageName) throws Exception
      Path for writing master jsp files.
      Parameters:
      pageName - NOT YET DOCUMENTED
      Returns:
      The jspDest value
      Throws:
      Exception - NOT YET DOCUMENTED
    • getMasterJspHeader

      protected String getMasterJspHeader()
      JSP code to insert at the top of master jsp files.
      Returns:
      The masterJspHeader value
    • getComponentJspHeader

      protected String getComponentJspHeader()
      JSP code to insert at the top of component jsp files. In the case of AutoForm, where the components are on separate JSP pages, the component and master headers are the same. In subclasses, the component JSP pages maybe included (via jsp:include) in the master, and therefore they may require a different header.
      Returns:
      The componentJspHeader value
    • writeJsp

      protected boolean writeJsp(org.dom4j.Element element, File dest, String jspHeader)
      Writes Element to disk as JSP page to be included in a master page at run time.
      Parameters:
      element - Element representing editor page
      dest - NOT YET DOCUMENTED
      jspHeader - NOT YET DOCUMENTED
      Returns:
      true if JSP was successfully written
    • setLogging

      public static void setLogging(boolean verbose)
      Sets the logging attribute of the AutoForm class
      Parameters:
      verbose - The new logging value
    • prtlnErr

      protected static void prtlnErr(String s)
      NOT YET DOCUMENTED
      Parameters:
      s - NOT YET DOCUMENTED
    • setVerbose

      public static void setVerbose(boolean verbosity)