Ontimize 5.2072EN

com.ontimize.util.templates
Interface TemplateGenerator

All Known Implementing Classes:
AbstractTemplateGenerator, PdfTemplateGenerator

public interface TemplateGenerator


Method Summary
 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)
          Fills the 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 valuesDescriptions, java.util.Hashtable valuesTable, java.util.Hashtable valuesImages)
          Fills the specified template
 java.io.File fillDocument(java.lang.String resource, java.util.Hashtable valuesDescriptions, java.util.Hashtable valuesTable, java.util.Hashtable valuesImages, java.util.Hashtable valuesPivotTable)
           
 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 setCreateLabelsInTemplate(boolean createLabels)
           
 void setDateFormat(java.text.DateFormat df)
          Sets the date format to use in the dates of the document
 void setNumberFormat(java.text.NumberFormat nf)
          Sets the number format to use in the numeric values of the document
 void setShowTemplate(boolean show)
          Sets the value of the variable show.
 

Method Detail

fillDocument

public java.io.File fillDocument(java.lang.String resource,
                                 java.util.Hashtable valuesDescriptions,
                                 java.util.Hashtable valuesTable,
                                 java.util.Hashtable valuesImages)
                          throws java.lang.Exception
Fills the specified template

Parameters:
valuesDescriptions - Values for the data fields
valuesTable - Table values
valuesImages - Image values
Returns:
Throws:
java.lang.Exception

fillDocument

public java.io.File fillDocument(java.lang.String resource,
                                 java.util.Hashtable valuesDescriptions,
                                 java.util.Hashtable valuesTable,
                                 java.util.Hashtable valuesImages,
                                 java.util.Hashtable valuesPivotTable)
                          throws java.lang.Exception
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)
                          throws java.lang.Exception
Fills the template

Parameters:
input - : Template to fill.
nameFile - : Name used to save the filled template
fieldValues - : This object contains the data field values to insert in the template. Keys must be the field names and values must have the data field values to insert.
valuesTable - : The object contains the table values to insert in the template. Each key must be the table entity name and value must be an EntityResult
valuesImages - : The object contains the image values to insert. Key must be the image field name and value must be the image data. The value could be an image object (Image), a BytesBlock or a File.
Returns:
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

setDateFormat

public void setDateFormat(java.text.DateFormat df)
Sets the date format to use in the dates of the document

Parameters:
df - Format

setNumberFormat

public void setNumberFormat(java.text.NumberFormat nf)
Sets the number format to use in the numeric values of the document

Parameters:
nf -

setShowTemplate

public void setShowTemplate(boolean show)
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 -

setCreateLabelsInTemplate

public void setCreateLabelsInTemplate(boolean createLabels)

createTemplate

public java.io.File createTemplate(java.util.Hashtable fieldValues,
                                   java.util.Hashtable valuesTable,
                                   java.util.Hashtable valuesImages)
                            throws java.lang.Exception
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

queryTemplateFields

public java.util.List queryTemplateFields(java.lang.String template)
                                   throws java.lang.Exception
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
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