com.qintsoft.joria.runtimeapi
Interface JoriaRuntime


public interface JoriaRuntime

The joria runtime is the central interface that is used to control ReportWeaver when it is integrated in another application. You receive an instance of JoriaRuntime by calling joria.ReportService.create(...)


Field Summary
static java.lang.String formatCsv
          output format CSV (comma separated values) file
static java.lang.String formatEmail
          output format send as email
static java.lang.String formatHtml
          output format HTML file
static java.lang.String formatPdf
          output format PDF-file
static java.lang.String formatPreview
          output format display in preview frame
static java.lang.String formatPrinter
          output format send to printer
static java.lang.String formatXhtml
          output format XHTML file
static java.lang.String formatXml
          output format XML file
static java.lang.String lineSeparatorDefault
          platform csv line separation string
static java.lang.String lineSeparatorMac
          mac csv line separation string (\r)
static java.lang.String lineSeparatorUnix
          unix csv line separation string (\n)
static java.lang.String lineSeparatorWindows
          windows csv line seperation string (\r\n)
static java.lang.String propEncoding
          csv character encoding.
static java.lang.String propFormat
          the secondary property key to specify.
static java.lang.String propIncludeHeaderFooter
          to include header and footes in the csv output.
static java.lang.String propLineSeparator
          csv line separation string.
static java.lang.String propLocale
          The locale to use for this single report run.
static java.lang.String propQuote
          csv qoute charater.
static java.lang.String propRoot
          The root object to use.
static java.lang.String propSeparator
          csv element separator character.
static java.lang.String propTarget
          the main property key to specify.
static java.lang.String propVariables
          key for preset variable values, the value must be a map.
static java.lang.String variables
           
 
Method Summary
 void exportCsv(JoriaTemplate t)
          Run the template with the specified entry point and export it as a ascii file with separators.
 void exportCsv(JoriaTemplate t, java.io.File target, char separator, char quote)
          Run the template with the specified entry point and export it as a ascii file with separators.
 void exportCsv(JoriaTemplate t, java.io.OutputStream target, char separator, char quote)
          Run the template with the specified entry point and export it as a ascii file with separators.
 void exportCsv(JoriaTemplate t, java.lang.String target, char separator, char quote)
          Run the template with the specified entry point and export it as a ascii file with separators.
 void exportFromViewRoot(JoriaViewRoot r, java.util.Map<java.lang.String,java.lang.Object> config)
          Exports data that is defined in a view.
 void exportHtml(JoriaTemplate t)
          Run the template with the specified entry point and export it as an html file.
 void exportHtml(JoriaTemplate t, java.io.File target)
          Run the template with the specified entry point and export it as an html file
 void exportHtml(JoriaTemplate t, java.io.OutputStream target)
          Run the template with the specified entry point and export it as an html file
 void exportHtml(JoriaTemplate t, java.lang.String target)
          Run the template with the specified entry point and export it as an html file
 void exportPdf(JoriaTemplate t)
          Run the template with the specified entry point and print it using the built-in pdf printer driver.
 void exportPdf(JoriaTemplate t, java.io.File out)
          Run the template with the specified entry point and print it using the built-in pdf printer driver.
 void exportPdf(JoriaTemplate t, java.io.OutputStream out)
          Run the template with the specified entry point and print it using the built-in pdf printer driver.
 void exportPdf(JoriaTemplate t, java.lang.String out)
          Run the template with the specified entry point and print it using the built-in pdf printer driver.
 void exportXHtml(JoriaTemplate t, java.io.File target)
          Run the template with the specified entry point and export it as an xml file using the xhtml dtd
 void exportXHtml(JoriaTemplate t, java.io.OutputStream out)
          Run the template with the specified entry point and export it as an xml file using the xhtml dtd
 void exportXHtml(JoriaTemplate t, java.lang.String target)
          Run the template with the specified entry point and export it as an xml file using the xhtml dtd
 void exportXml(JoriaTemplate template, java.io.OutputStream stream)
          Run the template and generate a xml file
 JoriaTemplate findReportTemplate(java.lang.String name)
          Search the list of defined teplates for the specified template name.
 JoriaTemplate findReportTemplateId(java.lang.String id)
          Search the list of defined teplates for the specified template name.
 JoriaViewRoot findUserViewRoot(java.lang.String name)
          Return the entry point with this name
 java.util.Locale getCurrentLocale()
          get the current locale.
 JoriaTemplate[] getReportTemplates()
          Return the list of templates defined in the currently open template set (rwts file)
 JoriaViewRoot[] getUserViewRoots()
          Return the list of entry points defined in the currently open template set (rwts file)
 void printDefault(JoriaTemplate t)
          Run the template with the specified entry point and print it using the defualt printer and settings.
 void printDialog(JoriaTemplate t)
          Run the template with the specified entry point and print it using the printer dialog to ask for the printer and settings.
 void printNamedPrinter(JoriaTemplate t, java.lang.String printer)
          Run the template with the specified entry point and print it to the specified printer.
 void run(JoriaTemplate t, java.util.Map<java.lang.String,java.lang.Object> config)
          Run the template with the specified entry point and pass the output target and other configurations via the config map.
 javax.swing.JFrame runToPreviewFrame(JoriaTemplate t)
          Run the template with the specified entry point and display it in a top level frame
 javax.swing.JFrame runToPreviewFrame(JoriaTemplate t, java.lang.Object rootValue)
          Run the template with the specified entry point and display it in a top level frame
 javax.swing.JComponent runToPreviewPanel(JoriaTemplate t)
          Run the template with the specified entry point and display it in a JComponent which can be added to the application user interface.
 void setCurrentLocale(java.util.Locale loc)
          set the currently reigning locale.
 void setLocalisationDirectory(java.lang.String dir)
          Sets the directory where reportweaver searches for localisation files
 void setMessageCallback(MessageCallback cb)
          register a message callback class that receives logging calls.
 

Field Detail

formatCsv

static final java.lang.String formatCsv
output format CSV (comma separated values) file

See Also:
Constant Field Values

formatEmail

static final java.lang.String formatEmail
output format send as email

See Also:
Constant Field Values

formatHtml

static final java.lang.String formatHtml
output format HTML file

See Also:
Constant Field Values

formatPdf

static final java.lang.String formatPdf
output format PDF-file

See Also:
Constant Field Values

formatPreview

static final java.lang.String formatPreview
output format display in preview frame

See Also:
Constant Field Values

formatPrinter

static final java.lang.String formatPrinter
output format send to printer

See Also:
Constant Field Values

formatXhtml

static final java.lang.String formatXhtml
output format XHTML file

See Also:
Constant Field Values

formatXml

static final java.lang.String formatXml
output format XML file

See Also:
Constant Field Values

lineSeparatorDefault

static final java.lang.String lineSeparatorDefault
platform csv line separation string

See Also:
Constant Field Values

lineSeparatorMac

static final java.lang.String lineSeparatorMac
mac csv line separation string (\r)

See Also:
Constant Field Values

lineSeparatorUnix

static final java.lang.String lineSeparatorUnix
unix csv line separation string (\n)

See Also:
Constant Field Values

lineSeparatorWindows

static final java.lang.String lineSeparatorWindows
windows csv line seperation string (\r\n)

See Also:
Constant Field Values

propEncoding

static final java.lang.String propEncoding
csv character encoding. The value must be a String representing a supported encoding for the JVM. At least these are available: Default, Cp1252, ISO-8859-1, UTF-8, UTF-16, US-ASCII

See Also:
Constant Field Values

propFormat

static final java.lang.String propFormat
the secondary property key to specify. For supported values see the format* Fields

See Also:
Constant Field Values

propIncludeHeaderFooter

static final java.lang.String propIncludeHeaderFooter
to include header and footes in the csv output. Must be a Boolean

See Also:
Constant Field Values

propLineSeparator

static final java.lang.String propLineSeparator
csv line separation string. See lineSeparator* fields

See Also:
Constant Field Values

propLocale

static final java.lang.String propLocale
The locale to use for this single report run. The value must be a Locale object

See Also:
Constant Field Values

propQuote

static final java.lang.String propQuote
csv qoute charater. Must be a Character

See Also:
Constant Field Values

propRoot

static final java.lang.String propRoot
The root object to use. Use this key to pass in the starting value for a report. If you do not use this root value, then ReportWeaver will use the data access trigger to get the root value. The root can be any object in particular it can be a collection or iterator.

See Also:
Constant Field Values

propSeparator

static final java.lang.String propSeparator
csv element separator character. Must be a Character

See Also:
Constant Field Values

propTarget

static final java.lang.String propTarget
the main property key to specify. Where to deliver the generated report. For formats that generate files (pdf, csv, html, xhtml, xml the value can either be a String (filename) or an OutputStream or a File. For the printer format can be either a String (printer name), javax.print.PrintService or unspecified (default printer). For the preview format, this property may be unspecified.

See Also:
Constant Field Values

propVariables

static final java.lang.String propVariables
key for preset variable values, the value must be a map. The key's in the secondary map are the names of the variables to be set and the values the values to be set

See Also:
Constant Field Values

variables

static final java.lang.String variables
See Also:
Constant Field Values
Method Detail

exportCsv

void exportCsv(JoriaTemplate t)
               throws JoriaException
Run the template with the specified entry point and export it as a ascii file with separators. Use the export wizard to ask for the configuration.

Parameters:
t - the template to run
Throws:
JoriaException - in case of problems

exportCsv

void exportCsv(JoriaTemplate t,
               java.io.File target,
               char separator,
               char quote)
               throws JoriaException
Run the template with the specified entry point and export it as a ascii file with separators.

Parameters:
t - the template to run
target - The file where the output will be stored.
separator - The character to separate fields, Typically comma, semicolon or tabulator.
quote - The character to enclose fields in. Typically single or double quotes ('/").
Throws:
JoriaException - in case of problems

exportCsv

void exportCsv(JoriaTemplate t,
               java.io.OutputStream target,
               char separator,
               char quote)
               throws JoriaException
Run the template with the specified entry point and export it as a ascii file with separators.

Parameters:
t - the template to run
target - An output stream where the output will be stored. You can use a ByteArrayOutputStream to kepp the generated data.
separator - The character to separate fields, Typically comma, semicolon or tabulator.
quote - The character to enclose fields in. Typically single or double quotes ('/").
Throws:
JoriaException - in case of problems

exportCsv

void exportCsv(JoriaTemplate t,
               java.lang.String target,
               char separator,
               char quote)
               throws JoriaException
Run the template with the specified entry point and export it as a ascii file with separators.

Parameters:
t - the template to run
target - The file where the output will be stored.
separator - The character to separate fields, Typically comma, semicolon or tabulator.
quote - The character to enclose fields in. Typically single or double quotes ('/").
Throws:
JoriaException - in case of problems

exportFromViewRoot

void exportFromViewRoot(JoriaViewRoot r,
                        java.util.Map<java.lang.String,java.lang.Object> config)
                        throws JoriaException
Exports data that is defined in a view. Create a view and then get a root reference using getUserViewRoots. Configuration of the export settings is via the map config.
The following keys are available:
 Key format="csv":
     key separator: Chracter: the character (byte) that shall be uses to separate fields
     key quote: Chracter: the character (byte) that shall be uses to quote fields that contain special characters. A quote character within a quoted field is escaped with a backslash
     key lineSeparator: String: One of the strings: Default, Mac, Unix, Windows. generates line separators for the specified platform. Default uses the setting of the local platform
     key includeHeaderFooter: Boolean: If true the headers and footers will be exported as well.
     key encoding: String: The character encoding to be used. At least these are available: Default, Cp1252, ISO-8859-1, UTF-8, UTF-16, US-ASCII
                           Which encodings are available is specified by the java documentation and more encodings may be provided by different java implementations.
 

Parameters:
r - the datasource root
config - the configuration
Throws:
JoriaException - in case of problems

exportHtml

void exportHtml(JoriaTemplate t)
                throws JoriaException
Run the template with the specified entry point and export it as an html file. This version will show a file chooser to ask for the file to save in.

Parameters:
t - the template to run
Throws:
JoriaException - in case of problems

exportHtml

void exportHtml(JoriaTemplate t,
                java.io.File target)
                throws JoriaException
Run the template with the specified entry point and export it as an html file

Parameters:
t - the template to run
target - The file where the output will be stored.
Throws:
JoriaException - in case of problems

exportHtml

void exportHtml(JoriaTemplate t,
                java.io.OutputStream target)
                throws JoriaException
Run the template with the specified entry point and export it as an html file

Parameters:
t - the template to run
target - The stream where the output will be stored. You can use a ByteArrayOutputStream to kepp the generated data.
Throws:
JoriaException - in case of problems

exportHtml

void exportHtml(JoriaTemplate t,
                java.lang.String target)
                throws JoriaException
Run the template with the specified entry point and export it as an html file

Parameters:
t - the template to run
target - The filename where the output will be stored.
Throws:
JoriaException - in case of problems

exportPdf

void exportPdf(JoriaTemplate t)
               throws JoriaException
Run the template with the specified entry point and print it using the built-in pdf printer driver. I will show a file chooser to select the file where the output will be stored.

Parameters:
t - the template to run
Throws:
JoriaException - in case of problems

exportPdf

void exportPdf(JoriaTemplate t,
               java.io.File out)
               throws JoriaException
Run the template with the specified entry point and print it using the built-in pdf printer driver.

Parameters:
t - the template to run
out - The filename where the output will be stored.
Throws:
JoriaException - in case of problems

exportPdf

void exportPdf(JoriaTemplate t,
               java.io.OutputStream out)
               throws JoriaException
Run the template with the specified entry point and print it using the built-in pdf printer driver.

Parameters:
t - the template to run
out - The stream where the output will be stored. You can use a ByteArrayOutputStream to kepp the generated data.
Throws:
JoriaException - in case of problems

exportPdf

void exportPdf(JoriaTemplate t,
               java.lang.String out)
               throws JoriaException
Run the template with the specified entry point and print it using the built-in pdf printer driver.

Parameters:
t - the template to run
out - The file where the output will be stored.
Throws:
JoriaException - in case of problems

exportXHtml

void exportXHtml(JoriaTemplate t,
                 java.io.File target)
                 throws JoriaException
Run the template with the specified entry point and export it as an xml file using the xhtml dtd

Parameters:
t - the template to run
target - The file where the output will be stored.
Throws:
JoriaException - in case of problems

exportXHtml

void exportXHtml(JoriaTemplate t,
                 java.io.OutputStream out)
                 throws JoriaException
Run the template with the specified entry point and export it as an xml file using the xhtml dtd

Parameters:
t - the template to run
out - The stream where the output will be stored. You can use a ByteArrayOutputStream to kepp the generated data.
Throws:
JoriaException - in case of problems

exportXHtml

void exportXHtml(JoriaTemplate t,
                 java.lang.String target)
                 throws JoriaException
Run the template with the specified entry point and export it as an xml file using the xhtml dtd

Parameters:
t - the template to run
target - The filename where the output will be stored.
Throws:
JoriaException - in case of problems

exportXml

void exportXml(JoriaTemplate template,
               java.io.OutputStream stream)
               throws JoriaException
Run the template and generate a xml file

Parameters:
template - The template to run
stream - The stream to output the xml file to
Throws:
JoriaException - in case of problems

findReportTemplate

JoriaTemplate findReportTemplate(java.lang.String name)
                                 throws JoriaException
Search the list of defined teplates for the specified template name. return null if no such template could be found.

Parameters:
name - the name of the template
Returns:
the template
Throws:
JoriaException - throws a JoriaException if something fundamental is wrong.

findReportTemplateId

JoriaTemplate findReportTemplateId(java.lang.String id)
                                   throws JoriaException
Search the list of defined teplates for the specified template name. return null if no such template could be found.

Parameters:
id - the id of the template
Returns:
the template
Throws:
JoriaException - throws a JoriaException if something fundamental is wrong.

findUserViewRoot

JoriaViewRoot findUserViewRoot(java.lang.String name)
                               throws JoriaException
Return the entry point with this name

Parameters:
name - of the entry point
Returns:
a JoriaViewRoot with the requested name or null if it doesnt exist
Throws:
JoriaException - throws a JoriaException if something fundamental is wrong.

getCurrentLocale

java.util.Locale getCurrentLocale()
get the current locale.

Returns:
either the default locale or the locale that has been set earlier via setLocale

getReportTemplates

JoriaTemplate[] getReportTemplates()
                                   throws JoriaException
Return the list of templates defined in the currently open template set (rwts file)

Returns:
the templates
Throws:
JoriaException - in case of problems

getUserViewRoots

JoriaViewRoot[] getUserViewRoots()
                                 throws JoriaException
Return the list of entry points defined in the currently open template set (rwts file)

Returns:
the list of entry points defined in the currently open template set (rwts file)
Throws:
JoriaException - in case of problems

printDefault

void printDefault(JoriaTemplate t)
                  throws JoriaException
Run the template with the specified entry point and print it using the defualt printer and settings.

Parameters:
t - The template to print
Throws:
JoriaException - in case of problems

printDialog

void printDialog(JoriaTemplate t)
                 throws JoriaException
Run the template with the specified entry point and print it using the printer dialog to ask for the printer and settings.

Parameters:
t - The template to print
Throws:
JoriaException - in case of problems

printNamedPrinter

void printNamedPrinter(JoriaTemplate t,
                       java.lang.String printer)
                       throws JoriaException
Run the template with the specified entry point and print it to the specified printer.

Parameters:
t - The template to print
printer - the name of the printer
Throws:
JoriaException - in case of problems

run

void run(JoriaTemplate t,
         java.util.Map<java.lang.String,java.lang.Object> config)
         throws JoriaException
Run the template with the specified entry point and pass the output target and other configurations via the config map.

Parameters:
t - the template to run
config - A number of configuration key vale pairs. See the prop* fields. At least format and normally target should be set.
Throws:
JoriaException - in case of problems

runToPreviewFrame

javax.swing.JFrame runToPreviewFrame(JoriaTemplate t)
                                     throws JoriaException
Run the template with the specified entry point and display it in a top level frame

Parameters:
t - the template to run
Returns:
a JFrame which is still invisible. Use setVisible to map it on the screen.
Throws:
JoriaException - in case of problems

runToPreviewFrame

javax.swing.JFrame runToPreviewFrame(JoriaTemplate t,
                                     java.lang.Object rootValue)
                                     throws JoriaException
Run the template with the specified entry point and display it in a top level frame

Parameters:
t - the template to run
rootValue - the value for the root object
Returns:
a JFrame which is still invisible. Use setVisible to map it on the screen.
Throws:
JoriaException - in case of problems

runToPreviewPanel

javax.swing.JComponent runToPreviewPanel(JoriaTemplate t)
                                         throws JoriaException
Run the template with the specified entry point and display it in a JComponent which can be added to the application user interface.

Parameters:
t - the template to run
Returns:
a JComponment with the first page and a navigation toolbar. Add this to your component hierarchy.
Throws:
JoriaException - in case of problems

setCurrentLocale

void setCurrentLocale(java.util.Locale loc)
set the currently reigning locale. ReportWeaver allows to define Templates in a language independent way, and uses the locale to fill in the locale specific text and formatting. When you use internationalisation and yout set the locale, then you might also need to set the localisation directory.

Parameters:
loc - the locale

setLocalisationDirectory

void setLocalisationDirectory(java.lang.String dir)
Sets the directory where reportweaver searches for localisation files

Parameters:
dir - the name of the directory.

setMessageCallback

void setMessageCallback(MessageCallback cb)
register a message callback class that receives logging calls. if the runtime runs without a Gui, these callbacks are used to signal configuration and other problems.

Parameters:
cb - the callback