public class TemplateUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static TemplateGenerator |
docxTemplateGenerator |
protected static TemplateGenerator |
ooTemplateGenerator |
protected static TemplateGenerator |
pdfTemplateGenerator |
protected static SimpleDateFormat |
sdf |
static int |
TEMPLATE_TYPE_DOC |
static int |
TEMPLATE_TYPE_DOCX |
static int |
TEMPLATE_TYPE_ODT |
static int |
TEMPLATE_TYPE_PDF |
protected static TemplateGenerator |
wordTemplateGenerator |
| Constructor and Description |
|---|
TemplateUtils() |
| Modifier and Type | Method and Description |
|---|---|
static File |
createTemplate(Form form,
int templateType)
Create a template of specified type with all fields, tables and images of
the form
|
static void |
deleteFolderContent(File folder) |
static void |
fillTemplate(File template,
Form form)
Fill the specified template with current values in the form
|
static Hashtable |
getFieldsValues(Form form)
Get a Hashtable with the values of all fields in the form
|
static Hashtable |
getImagesValues(Form form,
boolean insertEmptyImages)
Get a Hashtable with the values of all Image fields in the form
|
static 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 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 Hashtable |
getTemplateHashtableTranslation(List attrs,
ResourceBundle bundle) |
static Hashtable |
getTemplateImages(Form form)
Get a Hashtable with all attributes of ImageField in the form and their
translations
|
static 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 |
public static final int TEMPLATE_TYPE_ODT
public static final int TEMPLATE_TYPE_DOC
public static final int TEMPLATE_TYPE_PDF
public static final int TEMPLATE_TYPE_DOCX
protected static TemplateGenerator wordTemplateGenerator
protected static TemplateGenerator ooTemplateGenerator
protected static TemplateGenerator pdfTemplateGenerator
protected static TemplateGenerator docxTemplateGenerator
protected static SimpleDateFormat sdf
public static File createTemplate(Form form, int templateType)
form - templateType - (TEMPLATE_TYPE_DOC,TEMPLATE_TYPE_PDF, TEMPLATE_TYPE_ODT,
TEMPLATE_TYPE_DOCX)public static final void deleteFolderContent(File folder) throws Exception
Exceptionpublic static TemplateGenerator getTemplateGenerator(int templateType)
templateType - public static Hashtable getTemplateFields(Form form)
form - public static Hashtable getTemplateTables(Form form)
form - public static Hashtable getTemplateImages(Form form)
form - protected static Hashtable getTemplateHashtableTranslation(List attrs, ResourceBundle bundle)
public static void fillTemplate(File template, Form form)
template - form - public static Hashtable getFieldsValues(Form form)
form - public static Hashtable getTablesValues(Form form)
form - Copyright © 2016 Imatia Innovation S.L.. All rights reserved.