Ontimize 5.2072EN

com.ontimize.util.templates
Class ODFTemplateGenerator

java.lang.Object
  extended bycom.ontimize.util.templates.AbstractTemplateGenerator
      extended bycom.ontimize.util.templates.ODFTemplateGenerator
All Implemented Interfaces:
TemplateGenerator

public class ODFTemplateGenerator
extends AbstractTemplateGenerator

Create ODF (Open Document Format) templates (with or without data). This class uses JooReports library and its dependencies. More information in: http://jooreports.sourceforge.net

Since:
21/06/2007 Fill template, 30/11/2007 Create empty template
Author:
Imatia Innovation

Field Summary
static boolean DEBUG
           
protected  boolean showTableTotals
           
protected  boolean showTemplate
           
 
Fields inherited from class com.ontimize.util.templates.AbstractTemplateGenerator
createLabelsInTemplate, dateFormat, numberFormat
 
Constructor Summary
ODFTemplateGenerator()
           
 
Method Summary
static boolean checkLibraries()
          Check if JOOReports jars are avaliable.
 java.io.File createTemplate(java.util.Hashtable fieldValues, java.util.Hashtable valuesTable, java.util.Hashtable valuesImages)
          Creates an empty template.
 java.io.File fillDocument(java.io.InputStream input, java.lang.String nameFile, java.util.Hashtable fieldValues, java.util.Hashtable valuesTable, java.util.Hashtable valuesImages, java.util.Hashtable valuesPivotTable)
           
 java.io.File fillDocument(java.lang.String resource, java.util.Hashtable fieldValues, java.util.Hashtable valuesTable, java.util.Hashtable valuesImages, java.util.Hashtable valuesPivotTable)
           
protected  void log(java.lang.String log)
           
 java.util.List queryTemplateFields(java.io.File template)
          Creates a list with all data fields included in the template
 java.util.List queryTemplateFields(java.lang.String template)
          Creates a list with all data fields included in the template
 void setShowTableTotals(boolean showTableTotals)
          If true, the table shows a new row with the column totals.
 void setShowTemplate(boolean show)
          Sets the value of the variable show.
 
Methods inherited from class com.ontimize.util.templates.AbstractTemplateGenerator
calculateRecordCount, containsHashtableValue, createFileFieldData, createImageDataFile, createTableDataDefinition, createTableDataDefinition, createTableDataFile, createTableDataFile, exportFieldData, exportFieldData, exportTableData, fillDocument, fillDocument, getKeysOrder, getScreenPoints, parseNumber, savePngImageFile, setCreateLabelsInTemplate, setDateFormat, setNumberFormat, transformFieldData, transformFieldData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG

showTableTotals

protected boolean showTableTotals

showTemplate

protected boolean showTemplate
Constructor Detail

ODFTemplateGenerator

public ODFTemplateGenerator()
Method Detail

log

protected void log(java.lang.String log)

checkLibraries

public static boolean checkLibraries()
Check if JOOReports jars are avaliable.


createTemplate

public java.io.File createTemplate(java.util.Hashtable fieldValues,
                                   java.util.Hashtable valuesTable,
                                   java.util.Hashtable valuesImages)
                            throws java.lang.Exception
Description copied from interface: TemplateGenerator
Creates an empty template.

Parameters:
fieldValues - : This object contains the data fields attributes and labels to show in the template
valuesTable - : The object contains the table information to insert in the template. This map must have the table entity name as key and the value must be other Hashtable with the columns attributes and names to show (column name - column label)
Throws:
java.lang.Exception

fillDocument

public java.io.File fillDocument(java.lang.String resource,
                                 java.util.Hashtable fieldValues,
                                 java.util.Hashtable valuesTable,
                                 java.util.Hashtable valuesImages,
                                 java.util.Hashtable valuesPivotTable)
                          throws java.lang.Exception
Specified by:
fillDocument in interface TemplateGenerator
Overrides:
fillDocument in class AbstractTemplateGenerator
Throws:
java.lang.Exception

fillDocument

public java.io.File fillDocument(java.io.InputStream input,
                                 java.lang.String nameFile,
                                 java.util.Hashtable fieldValues,
                                 java.util.Hashtable valuesTable,
                                 java.util.Hashtable valuesImages,
                                 java.util.Hashtable valuesPivotTable)
                          throws java.lang.Exception
Throws:
java.lang.Exception

setShowTableTotals

public void setShowTableTotals(boolean showTableTotals)
If true, the table shows a new row with the column totals. If the column isn't a numeric value, shows the row count. The default is false.


setShowTemplate

public void setShowTemplate(boolean show)
Description copied from interface: TemplateGenerator
Sets the value of the variable show. When this variable takes the value "true", the template is shown to the user. Elsewhere, the template will not be shown

Parameters:
show -

queryTemplateFields

public java.util.List queryTemplateFields(java.lang.String template)
                                   throws java.lang.Exception
Description copied from interface: TemplateGenerator
Creates a list with all data fields included in the template

Parameters:
template - Template to query
Returns:
List with all data fields included in the template
Throws:
java.lang.Exception

queryTemplateFields

public java.util.List queryTemplateFields(java.io.File template)
                                   throws java.lang.Exception
Description copied from interface: TemplateGenerator
Creates a list with all data fields included in the template

Parameters:
template - Template to query
Returns:
List with all data fields included in the template
Throws:
java.lang.Exception

Ontimize