<?xml version="1.0"?>
<faqs title="Frequently Asked Questions" id="General FAQ">
  <part id="poem">
    <title>Poem</title>
    <faq id="troid">
      <question>What is a troid?</question>
      <answer>
        <p>
A <b>T</b>able <b>R</b>ow <b>O</b>bject <b>ID</b>.
        </p>
        <p>
        A Table Row Object Id is typically the primary key column of a table. 
        </p>
      </answer>
    </faq>
    <faq id="cooked">
      <question>What is a cooked object?</question>
      <answer>
        <p>
A cooked object is one which has attached metadata.
        </p>
      </answer>
    </faq>
  </part>
  <part id="Melati">
    <title>Melati</title>
    <faq id="Velocity">
      <question>How do I use Velocity?</question>
      <answer>
        <p>
        In your <code>org.melati.MelatiServlet.properties</code> set <br/>
        <code>org.melati.MelatiServlet.templateEngine=org.melati.template.velocity.VelocityTemplateEngine</code>.
        </p>
        <p>
        This will set Melati to use <a href="http://jakarta.apache.org/velocity/">Velocity</a> as it's 
        Template Engine. The resource loader used is an extended <code>ClasspathResourceLoader</code> 
        which will do on-the-fly translations of simple webmacro templates as well as handling 
        Velocity templates. This enables you to use the Melati Admin system in conjunction with 
        your velocity templates.
        </p>
        <p>
        Note that you will have to change the code in <code>VelocityTemplateEngine</code> if 
        you wish to use a <code>FileResourceLoader</code>, but the code is available and tested.
        </p>
      </answer>
    </faq>
    <faq id="Widgets">
      <question>How are input widgets rendered?</question>
      <answer>
        <p>
        Input widgets, such as select boxes and popup selections, are  
        rendered using a templet named after their class with an optional classifier 
        called <b>renderInfo</b> in their field attributes.
        </p>
      </answer>
    </faq>
    <faq id="TemplatePath">
      <question>Where are templets located?</question>
      <answer>
        <p>
        Templets are found on the classpath in a sub directory of your configured template engine.
        </p>
        <p>
        The subdirectory is determined by your MarkupLanguage and an optional purpose. 
        </p>
        <table>
        <tr><td>Default Object WebMacro templet for HTML </td>
            <td><code>org/melati/template/webmacro/templets/html/java.lang.Object.wm</code></td></tr>
        <tr><td>Default Object Velocity templet for HTML </td>
            <td><code>org/melati/template/velocity/templets/html/java.lang.Object.wm</code></td></tr>
        <tr><td>Error Exception Velocity templet for HTML </td>
            <td><code>org/melati/template/velocity/templets/html/error/java.lang.Exception.wm</code></td></tr>
        <tr><td>Error Exception Velocity templet for WML </td>
            <td><code>org/melati/template/velocity/templets/wml/error/java.lang.Exception.wm</code></td></tr>
        </table>
        <p>
        If a templet is not found then the templet loader looks for a templet with the same 
        name as the class on the classpath.
        </p>
        <p>
        If a templet is still not found then the process is repeated for each of the superclasses of your 
        class until the default templet is reached. 
        </p>
      </answer>
    </faq>
    <faq id="ContextUtil">
      <question>How do I supply a context utility class to my template?</question>
      <answer>
        <p>
        Ensure your utility class has a constructor which takes a single argument of a Melati 
        and then add something like this to your template:
        <pre>
#set $admin = $melati.ContextUtil("org.melati.admin.AdminUtils")
        </pre>
        </p>
      </answer>
    </faq>
    <faq id="ServletAPI">
      <question>Why do I need the servlet jar in my classpath, even outside a servlet environemt?</question>
      <answer>
        <p>
        Both WebMacro and Velocity use an overly inclusive caching mechanism, 
        where they introspect all methods on an object when checking for the 
        existance of one method. As a Melati object has methods which return 
        objects from the <tt>javax.servlet.http</tt> package the servlets jar 
        is required, even when not used. 
        </p>
      </answer>
    </faq>
  </part>
  <part id="dbs">
    <title>Database problems</title>
    <faq id="AccessTableNotFound">
      <question>Why do I get Table Not Found errors when using an Access Database?</question>
      <answer>
        <p>
        <tt>
        [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'tableinfo'.  Make sure it exists and that its name is spelled correctly.
        </tt>
        </p>
        <p>
        By default MS Access Databases are created with <tt>UserCommitSync</tt> set to <tt>no</tt>, 
        use the ODBC Datasource Administrator or Registry Editor to set this to <tt>yes</tt>.
        </p>
        <p>
        If that does not work, then run the test or application again, it should work on 
        the second occasion.
        </p>
        <p>
        This problem was particularly acute for PreparedStatements, which now wait and 
        try again up to 10 times until the Jet Cache resyncs.
        </p>
      </answer>
    </faq>
  </part>
</faqs>
