it.eng.qbe.export
Class BasicTemplateBuilder

java.lang.Object
  extended by it.eng.qbe.export.AbstractTemplateBuilder
      extended by it.eng.qbe.export.BasicTemplateBuilder
All Implemented Interfaces:
ITemplateBuilder
Direct Known Subclasses:
SQLTemplateBuilder

public class BasicTemplateBuilder
extends AbstractTemplateBuilder

The Class BasicTemplateBuilder.

Author:
Andrea Gioia

Field Summary
static java.lang.String DEFAULT_BAND_WIDTH
          The Constant DEFAULT_BAND_WIDTH.
static java.lang.String DEFAULT_DETAIL_EVEN_ROW_BACKCOLOR
          The Constant DEFAULT_DETAIL_EVEN_ROW_BACKCOLOR.
static java.lang.String DEFAULT_DETAIL_EVEN_ROW_FORECOLOR
          The Constant DEFAULT_DETAIL_EVEN_ROW_FORECOLOR.
static java.lang.String DEFAULT_DETAIL_ODD_ROW_BACKCOLOR
          The Constant DEFAULT_DETAIL_ODD_ROW_BACKCOLOR.
static java.lang.String DEFAULT_DETAIL_ODD_ROW_FORECOLOR
          The Constant DEFAULT_DETAIL_ODD_ROW_FORECOLOR.
static java.lang.String DEFAULT_HEADER_BACKCOLOR
          The Constant DEFAULT_HEADER_BACKCOLOR.
static java.lang.String DEFAULT_HEADER_FONT
          The Constant DEFAULT_HEADER_FONT.
static java.lang.String DEFAULT_HEADER_FONT_BOLD
          The Constant DEFAULT_HEADER_FONT_BOLD.
static java.lang.String DEFAULT_HEADER_FONT_ITALIC
          The Constant DEFAULT_HEADER_FONT_ITALIC.
static java.lang.String DEFAULT_HEADER_FONT_SIZE
          The Constant DEFAULT_HEADER_FONT_SIZE.
static java.lang.String DEFAULT_HEADER_FORECOLOR
          The Constant DEFAULT_HEADER_FORECOLOR.
static java.lang.String DEFAULT_HEADER_HEIGHT
          The Constant DEFAULT_HEADER_HEIGHT.
static java.lang.String DEFAULT_MAXLINE_PER_ROW
          The Constant DEFAULT_MAXLINE_PER_ROW.
static java.lang.String DEFAULT_PIXEL_PER_CHAR
          The Constant DEFAULT_PIXEL_PER_CHAR.
static java.lang.String DEFAULT_PIXEL_PER_ROW
          The Constant DEFAULT_PIXEL_PER_ROW.
static java.lang.String DEFAULT_ROW_FONT
          The Constant DEFAULT_ROW_FONT.
static java.lang.String DEFAULT_ROW_FONT_SIZE
          The Constant DEFAULT_ROW_FONT_SIZE.
static int DETAIL_HEIGHT
          The Constant DETAIL_HEIGHT.
static int DETAIL_WIDTH
          The Constant DETAIL_WIDTH.
static java.lang.String HQL_LANGUAGE
          The Constant HQL_LANGUAGE.
static java.lang.String PN_BAND_WIDTH
          The Constant PN_BAND_WIDTH.
static java.lang.String PN_DETAIL_EVEN_ROW_BACKCOLOR
          The Constant PN_DETAIL_EVEN_ROW_BACKCOLOR.
static java.lang.String PN_DETAIL_EVEN_ROW_FORECOLOR
          The Constant PN_DETAIL_EVEN_ROW_FORECOLOR.
static java.lang.String PN_DETAIL_ODD_ROW_BACKCOLOR
          The Constant PN_DETAIL_ODD_ROW_BACKCOLOR.
static java.lang.String PN_DETAIL_ODD_ROW_FORECOLOR
          The Constant PN_DETAIL_ODD_ROW_FORECOLOR.
static java.lang.String PN_HEADER_BACKCOLOR
          The Constant PN_HEADER_BACKCOLOR.
static java.lang.String PN_HEADER_FONT
          The Constant PN_HEADER_FONT.
static java.lang.String PN_HEADER_FONT_BOLD
          The Constant PN_HEADER_FONT_BOLD.
static java.lang.String PN_HEADER_FONT_ITALIC
          The Constant PN_HEADER_FONT_ITALIC.
static java.lang.String PN_HEADER_FONT_SIZE
          The Constant PN_HEADER_FONT_SIZE.
static java.lang.String PN_HEADER_FORECOLOR
          The Constant PN_HEADER_FORECOLOR.
static java.lang.String PN_HEADER_HEIGHT
          The Constant PN_HEADER_HEIGHT.
static java.lang.String PN_MAXLINE_PER_ROW
          The Constant PN_MAXLINE_PER_ROW.
static java.lang.String PN_PIXEL_PER_CHAR
          The Constant PN_PIXEL_PER_CHAR.
static java.lang.String PN_PIXEL_PER_ROW
          The Constant PN_PIXEL_PER_ROW.
static java.lang.String PN_ROW_FONT
          The Constant PN_ROW_FONT.
static java.lang.String PN_ROW_FONT_SIZE
          The Constant PN_ROW_FONT_SIZE.
static java.lang.String SQL_LANGUAGE
          The Constant SQL_LANGUAGE.
 
Constructor Summary
BasicTemplateBuilder(java.lang.String query, java.lang.String queryLanguage, java.util.Vector queryFields, java.util.Map params, java.lang.String orderedFieldList, java.lang.String extractedEntitiesList, Formula formula)
          Instantiates a new basic template builder.
 
Method Summary
 java.lang.String buildTemplate()
          Builds the template.
 java.lang.String calculateQbeJRMappingString()
          Calculate qbe jr mapping string.
 void fillCalculatedFields(java.lang.String savedQueryObjectID)
          Fill calculated fields.
 java.lang.String getColumnHeaderBlock()
          Gets the column header block.
 int[] getColumnWidth(int totalWidth)
          Gets the column width.
 java.lang.String getDetailsBlock()
          Gets the details block.
 java.lang.String getFieldsBlock()
          Gets the fields block.
 Formula getFormula()
          Gets the formula.
 java.lang.String getParamBlock()
          Gets the param block.
 int getRowHeight(int totalWidth)
          Gets the row height.
 void setFormula(Formula formula)
          Sets the formula.
 
Methods inherited from class it.eng.qbe.export.AbstractTemplateBuilder
buildTemplateToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQL_LANGUAGE

public static final java.lang.String SQL_LANGUAGE
The Constant SQL_LANGUAGE.

See Also:
Constant Field Values

HQL_LANGUAGE

public static final java.lang.String HQL_LANGUAGE
The Constant HQL_LANGUAGE.

See Also:
Constant Field Values

PN_BAND_WIDTH

public static final java.lang.String PN_BAND_WIDTH
The Constant PN_BAND_WIDTH.

See Also:
Constant Field Values

PN_HEADER_HEIGHT

public static final java.lang.String PN_HEADER_HEIGHT
The Constant PN_HEADER_HEIGHT.

See Also:
Constant Field Values

PN_PIXEL_PER_CHAR

public static final java.lang.String PN_PIXEL_PER_CHAR
The Constant PN_PIXEL_PER_CHAR.

See Also:
Constant Field Values

PN_PIXEL_PER_ROW

public static final java.lang.String PN_PIXEL_PER_ROW
The Constant PN_PIXEL_PER_ROW.

See Also:
Constant Field Values

PN_MAXLINE_PER_ROW

public static final java.lang.String PN_MAXLINE_PER_ROW
The Constant PN_MAXLINE_PER_ROW.

See Also:
Constant Field Values

PN_HEADER_FONT

public static final java.lang.String PN_HEADER_FONT
The Constant PN_HEADER_FONT.

See Also:
Constant Field Values

PN_HEADER_FONT_SIZE

public static final java.lang.String PN_HEADER_FONT_SIZE
The Constant PN_HEADER_FONT_SIZE.

See Also:
Constant Field Values

PN_HEADER_FONT_BOLD

public static final java.lang.String PN_HEADER_FONT_BOLD
The Constant PN_HEADER_FONT_BOLD.

See Also:
Constant Field Values

PN_HEADER_FONT_ITALIC

public static final java.lang.String PN_HEADER_FONT_ITALIC
The Constant PN_HEADER_FONT_ITALIC.

See Also:
Constant Field Values

PN_HEADER_FORECOLOR

public static final java.lang.String PN_HEADER_FORECOLOR
The Constant PN_HEADER_FORECOLOR.

See Also:
Constant Field Values

PN_HEADER_BACKCOLOR

public static final java.lang.String PN_HEADER_BACKCOLOR
The Constant PN_HEADER_BACKCOLOR.

See Also:
Constant Field Values

PN_ROW_FONT

public static final java.lang.String PN_ROW_FONT
The Constant PN_ROW_FONT.

See Also:
Constant Field Values

PN_ROW_FONT_SIZE

public static final java.lang.String PN_ROW_FONT_SIZE
The Constant PN_ROW_FONT_SIZE.

See Also:
Constant Field Values

PN_DETAIL_EVEN_ROW_FORECOLOR

public static final java.lang.String PN_DETAIL_EVEN_ROW_FORECOLOR
The Constant PN_DETAIL_EVEN_ROW_FORECOLOR.

See Also:
Constant Field Values

PN_DETAIL_EVEN_ROW_BACKCOLOR

public static final java.lang.String PN_DETAIL_EVEN_ROW_BACKCOLOR
The Constant PN_DETAIL_EVEN_ROW_BACKCOLOR.

See Also:
Constant Field Values

PN_DETAIL_ODD_ROW_FORECOLOR

public static final java.lang.String PN_DETAIL_ODD_ROW_FORECOLOR
The Constant PN_DETAIL_ODD_ROW_FORECOLOR.

See Also:
Constant Field Values

PN_DETAIL_ODD_ROW_BACKCOLOR

public static final java.lang.String PN_DETAIL_ODD_ROW_BACKCOLOR
The Constant PN_DETAIL_ODD_ROW_BACKCOLOR.

See Also:
Constant Field Values

DEFAULT_BAND_WIDTH

public static final java.lang.String DEFAULT_BAND_WIDTH
The Constant DEFAULT_BAND_WIDTH.

See Also:
Constant Field Values

DEFAULT_HEADER_HEIGHT

public static final java.lang.String DEFAULT_HEADER_HEIGHT
The Constant DEFAULT_HEADER_HEIGHT.

See Also:
Constant Field Values

DEFAULT_PIXEL_PER_CHAR

public static final java.lang.String DEFAULT_PIXEL_PER_CHAR
The Constant DEFAULT_PIXEL_PER_CHAR.

See Also:
Constant Field Values

DEFAULT_PIXEL_PER_ROW

public static final java.lang.String DEFAULT_PIXEL_PER_ROW
The Constant DEFAULT_PIXEL_PER_ROW.

See Also:
Constant Field Values

DEFAULT_MAXLINE_PER_ROW

public static final java.lang.String DEFAULT_MAXLINE_PER_ROW
The Constant DEFAULT_MAXLINE_PER_ROW.

See Also:
Constant Field Values

DEFAULT_HEADER_FONT

public static final java.lang.String DEFAULT_HEADER_FONT
The Constant DEFAULT_HEADER_FONT.

See Also:
Constant Field Values

DEFAULT_HEADER_FONT_SIZE

public static final java.lang.String DEFAULT_HEADER_FONT_SIZE
The Constant DEFAULT_HEADER_FONT_SIZE.

See Also:
Constant Field Values

DEFAULT_HEADER_FONT_BOLD

public static final java.lang.String DEFAULT_HEADER_FONT_BOLD
The Constant DEFAULT_HEADER_FONT_BOLD.

See Also:
Constant Field Values

DEFAULT_HEADER_FONT_ITALIC

public static final java.lang.String DEFAULT_HEADER_FONT_ITALIC
The Constant DEFAULT_HEADER_FONT_ITALIC.

See Also:
Constant Field Values

DEFAULT_HEADER_FORECOLOR

public static final java.lang.String DEFAULT_HEADER_FORECOLOR
The Constant DEFAULT_HEADER_FORECOLOR.

See Also:
Constant Field Values

DEFAULT_HEADER_BACKCOLOR

public static final java.lang.String DEFAULT_HEADER_BACKCOLOR
The Constant DEFAULT_HEADER_BACKCOLOR.

See Also:
Constant Field Values

DEFAULT_ROW_FONT

public static final java.lang.String DEFAULT_ROW_FONT
The Constant DEFAULT_ROW_FONT.

See Also:
Constant Field Values

DEFAULT_ROW_FONT_SIZE

public static final java.lang.String DEFAULT_ROW_FONT_SIZE
The Constant DEFAULT_ROW_FONT_SIZE.

See Also:
Constant Field Values

DEFAULT_DETAIL_EVEN_ROW_FORECOLOR

public static final java.lang.String DEFAULT_DETAIL_EVEN_ROW_FORECOLOR
The Constant DEFAULT_DETAIL_EVEN_ROW_FORECOLOR.

See Also:
Constant Field Values

DEFAULT_DETAIL_EVEN_ROW_BACKCOLOR

public static final java.lang.String DEFAULT_DETAIL_EVEN_ROW_BACKCOLOR
The Constant DEFAULT_DETAIL_EVEN_ROW_BACKCOLOR.

See Also:
Constant Field Values

DEFAULT_DETAIL_ODD_ROW_FORECOLOR

public static final java.lang.String DEFAULT_DETAIL_ODD_ROW_FORECOLOR
The Constant DEFAULT_DETAIL_ODD_ROW_FORECOLOR.

See Also:
Constant Field Values

DEFAULT_DETAIL_ODD_ROW_BACKCOLOR

public static final java.lang.String DEFAULT_DETAIL_ODD_ROW_BACKCOLOR
The Constant DEFAULT_DETAIL_ODD_ROW_BACKCOLOR.

See Also:
Constant Field Values

DETAIL_HEIGHT

public static final int DETAIL_HEIGHT
The Constant DETAIL_HEIGHT.

See Also:
Constant Field Values

DETAIL_WIDTH

public static final int DETAIL_WIDTH
The Constant DETAIL_WIDTH.

See Also:
Constant Field Values
Constructor Detail

BasicTemplateBuilder

public BasicTemplateBuilder(java.lang.String query,
                            java.lang.String queryLanguage,
                            java.util.Vector queryFields,
                            java.util.Map params,
                            java.lang.String orderedFieldList,
                            java.lang.String extractedEntitiesList,
                            Formula formula)
Instantiates a new basic template builder.

Parameters:
query - the query
queryLanguage - the query language
queryFields - the query fields
params - the params
orderedFieldList - the ordered field list
extractedEntitiesList - the extracted entities list
formula - the formula
Method Detail

buildTemplate

public java.lang.String buildTemplate()
Description copied from interface: ITemplateBuilder
Builds the template.

Returns:
the string

getParamBlock

public java.lang.String getParamBlock()
Gets the param block.

Returns:
the param block

calculateQbeJRMappingString

public java.lang.String calculateQbeJRMappingString()
Calculate qbe jr mapping string.

Returns:
the string

getFieldsBlock

public java.lang.String getFieldsBlock()
Gets the fields block.

Returns:
the fields block

getDetailsBlock

public java.lang.String getDetailsBlock()
Gets the details block.

Returns:
the details block

getColumnHeaderBlock

public java.lang.String getColumnHeaderBlock()
Gets the column header block.

Returns:
the column header block

getColumnWidth

public int[] getColumnWidth(int totalWidth)
Gets the column width.

Parameters:
totalWidth - the total width
Returns:
the column width

getRowHeight

public int getRowHeight(int totalWidth)
Gets the row height.

Parameters:
totalWidth - the total width
Returns:
the row height

fillCalculatedFields

public void fillCalculatedFields(java.lang.String savedQueryObjectID)
Fill calculated fields.

Parameters:
savedQueryObjectID - the saved query object id

getFormula

public Formula getFormula()
Gets the formula.

Returns:
the formula

setFormula

public void setFormula(Formula formula)
Sets the formula.

Parameters:
formula - the new formula