|
Ontimize 5.2071EN | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ontimize.util.templates.AbstractTemplateGenerator
| Field Summary | |
protected static boolean |
createLabelsInTemplate
Variable used to show labels in the template or not, if createLabelsInTemplate is false only the bookmarks are added to the template, without any label |
protected java.text.DateFormat |
dateFormat
|
static boolean |
DEBUG
|
protected java.text.NumberFormat |
numberFormat
|
| Constructor Summary | |
AbstractTemplateGenerator()
|
|
| Method Summary | |
static int |
calculateRecordCount(java.util.Hashtable data)
Calculates the number of data rows. |
static boolean |
containsHashtableValue(java.util.Hashtable data)
Returns true if some of the values in the input parameter is another hashtable |
static java.io.File |
createFileFieldData(java.io.File directory,
java.lang.String data)
Creates the File 'fielddata.dat' in the specified directory |
static java.io.File |
createImageDataFile(java.io.File directory,
java.util.Hashtable valuesImages)
Creates the data files with image values. |
static java.io.File |
createTableDataDefinition(java.io.File directory,
java.util.Hashtable valuesTable,
java.text.DateFormat df)
Creates table definition files Creates one file for each table and one index file (tableIndex.txt) |
static java.io.File |
createTableDataDefinition(java.io.File directory,
java.util.Hashtable valuesTable,
java.text.DateFormat df,
java.text.NumberFormat numberFormat)
|
static java.io.File |
createTableDataFile(java.io.File directory,
java.util.Hashtable valuesTable)
Creates the data files with table values. |
static java.io.File |
createTableDataFile(java.io.File directory,
java.util.Hashtable valuesTable,
java.lang.String indexFileName)
|
static java.lang.String |
exportFieldData(java.util.Hashtable data,
java.lang.String delimiter,
java.text.DateFormat df)
Creates a String with format: key1 + delimiter + value1 + delimiter + key2 + delimiter + value2 + delimiter + ... + keyN + delimiter + valueN |
static java.lang.String |
exportFieldData(java.util.Hashtable data,
java.lang.String delimiter,
java.text.DateFormat df,
java.text.NumberFormat numberFormat)
Creates a String with format: key1 + delimiter + value1 + delimiter + key2 + delimiter + value2 + delimiter + ... + keyN + delimiter + valueN |
static java.lang.String |
exportTableData(java.util.Hashtable data)
Creates a String with all table data. |
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.lang.String resource,
java.util.Hashtable fieldValues,
java.util.Hashtable valuesTable,
java.util.Hashtable valuesImages)
Fills the specified template |
java.io.File |
fillDocument(java.lang.String resource,
java.util.Hashtable fieldValues,
java.util.Hashtable valuesTable,
java.util.Hashtable valuesImages,
java.util.Hashtable valuesPivotTable)
|
static java.lang.Object[] |
getKeysOrder(java.util.Hashtable data)
|
protected static double |
getScreenPoints(int pixelsValue)
Calculates the screen point for a pixel value |
protected static java.lang.String |
parseNumber(java.lang.Number number,
java.text.NumberFormat numberFormat)
|
static void |
savePngImageFile(java.awt.Image im,
java.io.File fImage)
Save the image in the specified File as a png Image. |
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 |
static java.lang.String |
transformFieldData(java.util.Hashtable dataField,
java.text.DateFormat df)
Creates a String with format: key1 + delimiter + value1 + delimiter + key2 + delimiter + value2 + delimiter + ... + keyN + delimiter + valueN Replace all "\n" for "\r" to delete the carriage return |
static java.lang.String |
transformFieldData(java.util.Hashtable dataField,
java.text.DateFormat df,
java.text.NumberFormat numberFormat)
Creates a String with format: key1 + delimiter + value1 + delimiter + key2 + delimiter + value2 + delimiter + ... + keyN + delimiter + valueN Replace all "\n" for "\r" to delete the carriage return |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.ontimize.util.templates.TemplateGenerator |
createTemplate, fillDocument, queryTemplateFields, queryTemplateFields, setShowTemplate |
| Field Detail |
public static boolean DEBUG
protected static boolean createLabelsInTemplate
protected java.text.DateFormat dateFormat
protected java.text.NumberFormat numberFormat
| Constructor Detail |
public AbstractTemplateGenerator()
| Method Detail |
public java.io.File fillDocument(java.lang.String resource,
java.util.Hashtable fieldValues,
java.util.Hashtable valuesTable,
java.util.Hashtable valuesImages)
throws java.lang.Exception
TemplateGenerator
fillDocument in interface TemplateGeneratorfieldValues - Values for the data fieldsvaluesTable - Table valuesvaluesImages - Image values
java.lang.Exception
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
TemplateGenerator
fillDocument in interface TemplateGeneratorinput - :
Template to fill.nameFile - :
Name used to save the filled templatefieldValues - :
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
EntityResultvaluesImages - :
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.
java.lang.Exception
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
fillDocument in interface TemplateGeneratorjava.lang.Exceptionpublic void setCreateLabelsInTemplate(boolean createLabels)
setCreateLabelsInTemplate in interface TemplateGenerator
public static java.lang.String transformFieldData(java.util.Hashtable dataField,
java.text.DateFormat df)
dataField - df -
exportFieldData(Hashtable, String, DateFormat)
public static java.lang.String transformFieldData(java.util.Hashtable dataField,
java.text.DateFormat df,
java.text.NumberFormat numberFormat)
dataField - df - numberFormat -
exportFieldData(Hashtable, String, DateFormat,NumberFormat)
public static java.io.File createFileFieldData(java.io.File directory,
java.lang.String data)
throws java.lang.Exception
directory - Directorydata - File content
java.lang.Exception
public static java.io.File createTableDataFile(java.io.File directory,
java.util.Hashtable valuesTable)
throws java.lang.Exception
directory - Directory where the files will be created invaluesTable - 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
java.lang.Exception
public static java.io.File createTableDataFile(java.io.File directory,
java.util.Hashtable valuesTable,
java.lang.String indexFileName)
throws java.lang.Exception
directory - Directory where the files will be created invaluesTable - The object contains the table values to insert in the template.
Each key must be the table entity name and value must be an
EntityResultindexFileName - Name of the returned file with the table index
java.lang.Exception
public static java.io.File createTableDataDefinition(java.io.File directory,
java.util.Hashtable valuesTable,
java.text.DateFormat df)
throws java.lang.Exception
directory - Directory where the files will be created invaluesTable - The object contains the table data to create the template. Each
key must be the table entity name and value must be an Hashtable
with column names and labelsdf -
java.lang.Exception
public static java.io.File createTableDataDefinition(java.io.File directory,
java.util.Hashtable valuesTable,
java.text.DateFormat df,
java.text.NumberFormat numberFormat)
throws java.lang.Exception
java.lang.Exception
public static java.io.File createImageDataFile(java.io.File directory,
java.util.Hashtable valuesImages)
throws java.lang.Exception
directory - Directory where the files will be created invaluesImages - 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 .
java.lang.Exceptionprotected static double getScreenPoints(int pixelsValue)
pixelsValue - number of pixels
public static java.lang.String exportFieldData(java.util.Hashtable data,
java.lang.String delimiter,
java.text.DateFormat df)
data - Hashtable with all datadelimiter - Delimiter to separate the fieldsdf - Format to use in date data fields
public static java.lang.String exportFieldData(java.util.Hashtable data,
java.lang.String delimiter,
java.text.DateFormat df,
java.text.NumberFormat numberFormat)
data - Hashtable with all datadelimiter - Delimiter to separate the fieldsdf - Format to use in date data fieldsnumberFormat - Format to use in the numeric fields
protected static java.lang.String parseNumber(java.lang.Number number,
java.text.NumberFormat numberFormat)
public static java.lang.String exportTableData(java.util.Hashtable data)
data - Table data
public static int calculateRecordCount(java.util.Hashtable data)
data -
public static void savePngImageFile(java.awt.Image im,
java.io.File fImage)
throws java.io.IOException
im - Image to savefImage - File
java.io.IOExceptionpublic void setDateFormat(java.text.DateFormat df)
TemplateGenerator
setDateFormat in interface TemplateGeneratordf - Formatpublic void setNumberFormat(java.text.NumberFormat nf)
TemplateGenerator
setNumberFormat in interface TemplateGeneratornf - public static boolean containsHashtableValue(java.util.Hashtable data)
data -
public static java.lang.Object[] getKeysOrder(java.util.Hashtable data)
|
Ontimize | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||