schema2template.example.odf
Class OdfHelper

java.lang.Object
  extended by schema2template.example.odf.OdfHelper

public class OdfHelper
extends Object

Three ODF examples in one: 1) Create an ODF Reference in HTMLl 2) Create Source Code 3) Create simple ODF Python source


Field Summary
static Boolean DEBUG
           
static String INPUT_ROOT
           
static String ODF10_RNG_FILE_NAME
           
static String odf10RngFile
           
static int ODF11_ATTRIBUTE_NUMBER
          Expresses the amount of attributes in ODF 1.1.
static int ODF11_ELEMENT_NUMBER
          Expresses the amount of elements in ODF 1.1.
static String ODF11_RNG_FILE_NAME
           
static String odf11RngFile
           
static int ODF12_ATTRIBUTE_NUMBER
           
static int ODF12_ELEMENT_NUMBER
           
static String ODF12_RNG_FILE_NAME
           
static String odf12RngFile
           
static String odfResourceDir
           
static String outputRoot
           
static String TEST_INPUT_ROOT
           
 
Constructor Summary
OdfHelper(String resourceRoot, String targetRoot, String odf12SchemaFile, String odf11SchemaFile, String configFile)
           
 
Method Summary
static com.sun.msv.grammar.Expression loadSchema(File rngFile)
          Load and parse a Schema from File.
static com.sun.msv.grammar.Expression loadSchemaODF10()
          Load and parse the ODF 1.0 Schema.
static com.sun.msv.grammar.Expression loadSchemaODF11()
          Load and parse the ODF 1.1 Schema.
static com.sun.msv.grammar.Expression loadSchemaODF12()
          Load and parse the ODF 1.2 Schema.
static void main(String[] args)
           
static void processFileList(org.apache.velocity.app.VelocityEngine ve, com.sun.msv.grammar.Expression root)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final Boolean DEBUG

ODF11_ELEMENT_NUMBER

public static final int ODF11_ELEMENT_NUMBER
Expresses the amount of elements in ODF 1.1. There are some issues in the schema that have to be fixed before the full number can be returned by MSV: Reference table-table-template is never used, therefore several elements are not taking into account:: "table:body" "table:even-columns" "table:even-rows" "table:first-column" "table:first-row" "table:last-column" "table:last-row" "table:odd-columns" "table:odd-rows" "table:table-template" NOTE: Ignoring the '*' there can be 525 elements parsed, but with fixed schema it should be 535.

See Also:
Constant Field Values

ODF12_ELEMENT_NUMBER

public static final int ODF12_ELEMENT_NUMBER
See Also:
Constant Field Values

ODF11_ATTRIBUTE_NUMBER

public static final int ODF11_ATTRIBUTE_NUMBER
Expresses the amount of attributes in ODF 1.1. There are some issues in the schema that have to be fixed before the full number can be returned by MSV: Following references are never used, therefore its attribute is not taking into account:: draw-glue-points-attlist with "draw:escape-direction" office-process-content with "office:process-content" (DEPRECATED in ODF1.2 only on foreign elements) Following attributes are member of the not referenced element "table:table-template": "text:first-row-end-column" "text:first-row-start-column" "text:last-row-end-column" "text:last-row-start-column" "text:paragraph-style-name" NOTE: Ignoring the '*' there can be 1162 elements parsed, but with fixed schema it should be 1169.

See Also:
Constant Field Values

ODF12_ATTRIBUTE_NUMBER

public static final int ODF12_ATTRIBUTE_NUMBER
See Also:
Constant Field Values

odfResourceDir

public static String odfResourceDir

outputRoot

public static String outputRoot

INPUT_ROOT

public static final String INPUT_ROOT

TEST_INPUT_ROOT

public static final String TEST_INPUT_ROOT

ODF10_RNG_FILE_NAME

public static final String ODF10_RNG_FILE_NAME
See Also:
Constant Field Values

ODF11_RNG_FILE_NAME

public static final String ODF11_RNG_FILE_NAME
See Also:
Constant Field Values

ODF12_RNG_FILE_NAME

public static final String ODF12_RNG_FILE_NAME
See Also:
Constant Field Values

odf12RngFile

public static String odf12RngFile

odf11RngFile

public static String odf11RngFile

odf10RngFile

public static String odf10RngFile
Constructor Detail

OdfHelper

public OdfHelper(String resourceRoot,
                 String targetRoot,
                 String odf12SchemaFile,
                 String odf11SchemaFile,
                 String configFile)
Method Detail

start

public void start()
           throws Exception
Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

loadSchemaODF10

public static com.sun.msv.grammar.Expression loadSchemaODF10()
                                                      throws Exception
Load and parse the ODF 1.0 Schema.

Returns:
MSV Expression Tree of ODF 1.0 RelaxNG schema (more specific: The tree's MSV root expression)
Throws:
Exception

loadSchemaODF11

public static com.sun.msv.grammar.Expression loadSchemaODF11()
                                                      throws Exception
Load and parse the ODF 1.1 Schema.

Returns:
MSV Expression Tree of ODF 1.1 RelaxNG schema (more specific: The tree's MSV root expression)
Throws:
Exception

loadSchemaODF12

public static com.sun.msv.grammar.Expression loadSchemaODF12()
                                                      throws Exception
Load and parse the ODF 1.2 Schema.

Returns:
MSV Expression Tree of ODF 1.2 RelaxNG schema (more specific: The tree's MSV root expression)
Throws:
Exception

loadSchema

public static com.sun.msv.grammar.Expression loadSchema(File rngFile)
                                                 throws Exception
Load and parse a Schema from File.

Parameters:
rngFile -
Returns:
MSV Expression Tree (more specific: The tree's MSV root expression)
Throws:
Exception

processFileList

public static void processFileList(org.apache.velocity.app.VelocityEngine ve,
                                   com.sun.msv.grammar.Expression root)
                            throws Exception
Throws:
Exception


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.