Ontimize 5.2072EN

com.ontimize.util.templates
Class TemplateUtils

java.lang.Object
  extended bycom.ontimize.util.templates.TemplateUtils

public class TemplateUtils
extends java.lang.Object


Field Summary
protected static TemplateGenerator ooTemplateGenerator
           
protected static TemplateGenerator pdfTemplateGenerator
           
protected static java.text.SimpleDateFormat sdf
           
static int TEMPLATE_TYPE_DOC
           
static int TEMPLATE_TYPE_ODT
           
static int TEMPLATE_TYPE_PDF
           
protected static TemplateGenerator wordTemplateGenerator
           
 
Constructor Summary
TemplateUtils()
           
 
Method Summary
static java.io.File createTemplate(Form form, int templateType)
          Create a template of specified type with all fields, tables and images of the form
static void fillTemplate(java.io.File template, Form form)
          Fill the specified template with current values in the form
static java.util.Hashtable getFieldsValues(Form form)
          Get a Hashtable with the values of all fields in the form
static java.util.Hashtable getImagesValues(Form form, boolean insertEmptyImages)
          Get a Hashtable with the values of all Image fields in the form
static java.util.Hashtable getTablesValues(Form form)
          Get a Hashtable with the values of all tables in the form
key - table entity name
value - EntityResult with the table value
static java.util.Hashtable getTemplateFields(Form form)
          Get a Hashtable with the names of form's fields and their translations
key - Field name
value - key translation
static TemplateGenerator getTemplateGenerator(int templateType)
          Get the TemplateGenerator of the specified type
protected static java.util.Hashtable getTemplateHashtableTranslation(java.util.List attrs, java.util.ResourceBundle bundle)
           
static java.util.Hashtable getTemplateImages(Form form)
          Get a Hashtable with all attributes of ImageField in the form and their translations
static java.util.Hashtable getTemplateTables(Form form)
          Get the list of tables to insert in the template
key - Table entity
value - Hashtable with the names of the visible cols and their translations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE_TYPE_ODT

public static final int TEMPLATE_TYPE_ODT
See Also:
Constant Field Values

TEMPLATE_TYPE_DOC

public static final int TEMPLATE_TYPE_DOC
See Also:
Constant Field Values

TEMPLATE_TYPE_PDF

public static final int TEMPLATE_TYPE_PDF
See Also:
Constant Field Values

wordTemplateGenerator

protected static TemplateGenerator wordTemplateGenerator

ooTemplateGenerator

protected static TemplateGenerator ooTemplateGenerator

pdfTemplateGenerator

protected static TemplateGenerator pdfTemplateGenerator

sdf

protected static java.text.SimpleDateFormat sdf
Constructor Detail

TemplateUtils

public TemplateUtils()
Method Detail

createTemplate

public static java.io.File createTemplate(Form form,
                                          int templateType)
Create a template of specified type with all fields, tables and images of the form

Parameters:
form -
templateType - (TEMPLATE_TYPE_DOC,TEMPLATE_TYPE_PDF, TEMPLATE_TYPE_ODT)
Returns:

getTemplateGenerator

public static TemplateGenerator getTemplateGenerator(int templateType)
Get the TemplateGenerator of the specified type

Parameters:
templateType -
Returns:

getTemplateFields

public static java.util.Hashtable getTemplateFields(Form form)
Get a Hashtable with the names of form's fields and their translations
key - Field name
value - key translation

Parameters:
form -
Returns:

getTemplateTables

public static java.util.Hashtable getTemplateTables(Form form)
Get the list of tables to insert in the template
key - Table entity
value - Hashtable with the names of the visible cols and their translations

Parameters:
form -
Returns:

getTemplateImages

public static java.util.Hashtable getTemplateImages(Form form)
Get a Hashtable with all attributes of ImageField in the form and their translations

Parameters:
form -
Returns:

getTemplateHashtableTranslation

protected static java.util.Hashtable getTemplateHashtableTranslation(java.util.List attrs,
                                                                     java.util.ResourceBundle bundle)

fillTemplate

public static void fillTemplate(java.io.File template,
                                Form form)
Fill the specified template with current values in the form

Parameters:
template -
form -

getFieldsValues

public static java.util.Hashtable getFieldsValues(Form form)
Get a Hashtable with the values of all fields in the form

Parameters:
form -
Returns:

getTablesValues

public static java.util.Hashtable getTablesValues(Form form)
Get a Hashtable with the values of all tables in the form
key - table entity name
value - EntityResult with the table value

Parameters:
form -
Returns:

getImagesValues

public static java.util.Hashtable getImagesValues(Form form,
                                                  boolean insertEmptyImages)
Get a Hashtable with the values of all Image fields in the form

Parameters:
form -
insertEmptyImages -
Returns:

Ontimize