Repository Class Reference

Opens or creates a Repository, Opens a stand-alone FormLayout. More...

List of all members.

Public Member Functions

JobTrayControl addJobTrayControl (String name) throws TFormerException
 Creates and adds a new JobTrayControl to the Repository.
Printer addPrinter (String sName) throws TFormerException
 Creates and adds the Printer to the Repository.
Project addProject (String sName) throws TFormerException
 Creates and adds the Project in the Repository.
void close (boolean bCommitChanges) throws TFormerException
 Close this Repository.
void dispose () throws TFormerException
 Releases the resources allocated into TFORMer runtime by the instance.
void dump (PrintStream s) throws IOException, TFormerException
 Dump the current instance into the stream.
int getBuildNumber () throws TFormerException
 Gets the build number of the Repository.
String getComment () throws TFormerException
 Gets the comment for the Repository.
DataSource getDefaultDataSource () throws TFormerException
 Gets the default DataSource.
JobTrayControl getDefaultJobTrayControl () throws TFormerException
 Gets the default JobTrayControl in the Repository.
Printer getDefaultPrinter () throws TFormerException
 Gets the Default Printer of the Repository.
String getDescription () throws TFormerException
 Gets the description of the Repository.
JobTrayControl getFirstJobTrayControl () throws TFormerException
 Gets the first JobTrayControl in the Repository.
Printer getFirstPrinter () throws TFormerException
 Gets the first Printer stored in the Repository.
Project getFirstProject () throws TFormerException
 Gets the first Project stored in the Repository.
String getFullPath () throws TFormerException
 Gets the path of the Repository.
Project getGlobalProject () throws TFormerException
 Gets the global Project of the Repository.
JobTrayControl getJobTrayControl (String name) throws TFormerException
 Gets a JobTrayControl defined in the Repository.
int getNumberOfJobTrayControls () throws TFormerException
 Gets the number of JobTrayControl-objects stored in the Repository.
int getNumberofPrinters () throws TFormerException
 Gets the number of printers defined in the Repository.
int getNumberOfProjects () throws TFormerException
 Gets the number of Project-objects stored in the Repository.
Printer getPrinter (String name) throws TFormerException
 Gets the Printer from the Repository.
Project getProject (String name) throws TFormerException
 Gets the Project defined in the Repository.
int getVersionMajor () throws TFormerException
 Gets the major version number of the Repository.
int getVersionMinor () throws TFormerException
 Gets the minor version number of the Repository.
boolean isAutoSave ()
 Gets a flag indicating whether to save changes to the Repository automatically.
boolean isModified () throws TFormerException
 Gets a flag indicating whether this Repository has been modified.
boolean isReadOnly () throws TFormerException
 Gets a flag indicating whether this Repository is read-only.
void removeJobTrayControl (JobTrayControl jobTrayControl) throws TFormerException
 Removes the JobTrayControl from the Repository.
void removeJobTrayControl (String name) throws TFormerException
 Removes the JobTrayControl from the Repository by name.
void removePrinter (Printer printer) throws TFormerException
 Removes the Printer from the Repository.
void removePrinter (String name) throws TFormerException
 Removes the Printer from the Repository by name.
void removeProject (Project project) throws TFormerException
 Removes the Project from the Repository.
void removeProject (String name) throws TFormerException
 Removes the Project from the Repository by name.
 Repository (String sFilename, boolean bCreateNewRepository, boolean bIsReadOnly) throws TFormerException
 Constructor for Repository Objects.
void save () throws TFormerException
 Saves this Repository.
void saveAs (String sFilename) throws TFormerException
 Saves a copy of this Repository.
void setAutoSave (boolean bAutoSave)
 Sets a flag indicating whether to save changes to the Repository automatically.
void setComment (String sComment) throws TFormerException
 Sets the comment for the Repository.
void setDescription (String sDescription) throws TFormerException
 Sets the description of the Repository.
void setModified (boolean bModified) throws TFormerException
 Sets a flag indicating whether this Repository has been modified.
String toString ()
 Returns a string representation of the instance.


Detailed Description

Opens or creates a Repository, Opens a stand-alone FormLayout.



The Java API of TFORMer Runtime unifies access to a Repository and to a stand-alone FormLayout using this class.

Refer to the table below to understand the difference between a Repository (or Repository-based FormLayout) and a stand-alone FormLayout.

TypeExample FilenameDescription

Repository

and

Repository-based FormLayout

C:-IT\TFORMer\6.0 Repository\Demos.tfr

Filename extension: *.tfr

A Repository is a data-structure which references an arbitrary number of FormLayout-objects. User-defined Project-objects are used to divide a Repository into logical areas.

Each FormLayout referenced from within a Repository is a member of exactly one Project. Data-fields defined within a Project are only usable by form-layouts which are member of this Project.

The so-called GlobalProject is allocated by default and is exclusively used to define data-fields which are available for all form-layouts (regardless of their actual Project-membership). It can not store references to a FormLayout.

The Repository also stores JobTrayControl-objects. They may be used whenever printing any FormLayout referenced by this Repository (see JobTrayControlName).

When printing a specific FormLayout within a Repository 3 parameters must be specified to identify the FormLayout:

Stand-Alone FormLayout

C: Files\TEC-IT\TFORMer6\Bin\Default_Report_EN.tff

Filename extension: *.tff

A stand-alone FormLayout can be used on its own.

It can be imagined like a very simple type of Repository which contains exactly one GlobalProject which stores the DataField-definitions as well as the FormLayout itself.

A stand-alone FormLayout is not able to share DataField-definitions with other form layouts and can not contain user-defined Project-objects.

The stand-alone FormLayout also stores JobTrayControl-objects. They may be used whenever printing this FormLayout (see JobTrayControlName).

When printing a Job using a stand-alone FormLayout 1 parameter must be specified:

Do not specify ProjectName and FormName when using a stand-alone FormLayout!


To open a stand-alone FormLayout do the following:

    // create a Repository instance (using a stand-alone FormLayout - extension *.tff)
    Repository repo = new Repository("C:\\ProgramData\\TEC-IT\\TFORMer\\6.0\\Examples\\Command Line\\ODBCReportPDF\\ODBCReportPDF.tff", false, true);



To open a Repository do the following:
    // create a Repository instance (using a Repository - extension *.tfr)
    Repository repo = new Repository("C:\\ProgramData\\TEC-IT\\TFORMer\\6.0\\Examples\\Demo Repository\\Demos.tfr", false, true);


Refer to the table below to understand the difference between a Repository (or Repository-based FormLayout) and a stand-alone FormLayout.

Constructor & Destructor Documentation

Repository ( String  sFilename,
boolean  bCreateNewRepository,
boolean  bIsReadOnly 
) throws TFormerException

Constructor for Repository Objects.


Calls native allocation methods and either creates a new Repository or opens an existing Repository or a stand-alone FormLayout.

Parameters:
sFilename the full path of a new or existing Repository
bCreateNewRepository true if a new Repository should be created, false if an existing Repository should be opened
bIsReadOnly true if Repository should be opened as readonly (only when opening an existing Repository)
Exceptions:
TFormerException if an error occurred


Member Function Documentation

JobTrayControl addJobTrayControl ( String  name  )  throws TFormerException

Creates and adds a new JobTrayControl to the Repository.

Parameters:
name The name of the JobTrayControl.
Exceptions:
TFormerException 

Printer addPrinter ( String  sName  )  throws TFormerException

Creates and adds the Printer to the Repository.

Parameters:
sName The name the Printer.
Returns:
The Printer.
Exceptions:
TFormerException 

Project addProject ( String  sName  )  throws TFormerException

Creates and adds the Project in the Repository.

Parameters:
sName The name of the Project.
Returns:
The Project.
Exceptions:
TFormerException 

void close ( boolean  bCommitChanges  )  throws TFormerException

Close this Repository.

Any changes to a stand-alone FormLayout are not written to disk (see Save(), SaveAs() or Repository). This also implies that creating a new and empty stand-alone FormLayout is not supported.

Parameters:
bCommitChanges If you call this method with commitChanges = false, all changes will be lost (even if AutoSave is enabled)!
Exceptions:
TFormerException 

void dispose (  )  throws TFormerException

Releases the resources allocated into TFORMer runtime by the instance.

Remember to call always this method after the use of the instance, also in exception case.
The repository will close saving the changes based on the value of isAutoSave()

Exceptions:
TFormerException error occurred into TFORMer runtime.

void dump ( PrintStream  s  )  throws IOException, TFormerException

Dump the current instance into the stream.

Parameters:
s stream in which write the instance dump
Exceptions:
IOException error in I/O
TFormerException error in TFORMer runtime

int getBuildNumber (  )  throws TFormerException

Gets the build number of the Repository.

Returns:
The build number of the Repository
Exceptions:
TFormerException 

String getComment (  )  throws TFormerException

Gets the comment for the Repository.

Returns:
The comment for the Repository.
Exceptions:
TFormerException 

DataSource getDefaultDataSource (  )  throws TFormerException

Gets the default DataSource.

Returns:
The default DataSource.
Exceptions:
TFormerException 

JobTrayControl getDefaultJobTrayControl (  )  throws TFormerException

Gets the default JobTrayControl in the Repository.

Returns:
The default JobTrayControl in the Repository.
Exceptions:
TFormerException 

Printer getDefaultPrinter (  )  throws TFormerException

Gets the Default Printer of the Repository.

Returns:
The Default Printer of the Repository.
Exceptions:
TFormerException 

String getDescription (  )  throws TFormerException

Gets the description of the Repository.

Returns:
The description of the Repository.
Exceptions:
TFormerException 

JobTrayControl getFirstJobTrayControl (  )  throws TFormerException

Gets the first JobTrayControl in the Repository.

Returns:
The first JobTrayControl in the Repository.
Exceptions:
TFormerException 

Printer getFirstPrinter (  )  throws TFormerException

Gets the first Printer stored in the Repository.

Returns:
The first Printer stored in the Repository.
Exceptions:
TFormerException 

Project getFirstProject (  )  throws TFormerException

Gets the first Project stored in the Repository.

Returns:
The first Project stored in the Repository, null if it doesn't exist
Exceptions:
TFormerException 

String getFullPath (  )  throws TFormerException

Gets the path of the Repository.

Returns:
The path of repository.
Exceptions:
TFormerException 

Project getGlobalProject (  )  throws TFormerException

Gets the global Project of the Repository.

Returns:
The global Project of the Repository.
Exceptions:
TFormerException 

JobTrayControl getJobTrayControl ( String  name  )  throws TFormerException

Gets a JobTrayControl defined in the Repository.

Parameters:
name The name of the JobTrayControl.
Returns:
null if the requested object doesn't exist, otherwise a valid instance
Exceptions:
TFormerException error occurs in TFORMer runtime

int getNumberOfJobTrayControls (  )  throws TFormerException

Gets the number of JobTrayControl-objects stored in the Repository.

Returns:
The number of JobTrayControl-objects stored in the Repository.
Exceptions:
TFormerException 

int getNumberofPrinters (  )  throws TFormerException

Gets the number of printers defined in the Repository.

Returns:
The number of printers defined in the Repository.
Exceptions:
TFormerException 

int getNumberOfProjects (  )  throws TFormerException

Gets the number of Project-objects stored in the Repository.

Returns:
Gets the number of Project-objects stored in the Repository.
Exceptions:
TFormerException 

Printer getPrinter ( String  name  )  throws TFormerException

Gets the Printer from the Repository.

Parameters:
name The name of the Printer.
Returns:
null if the requested object doesn't exist, otherwise a valid instance
Exceptions:
TFormerException error occurs in TFORMer runtime

Project getProject ( String  name  )  throws TFormerException

Gets the Project defined in the Repository.

Parameters:
name The name of the Project.
Returns:
null if the requested object doesn't exist, otherwise a valid instance
Exceptions:
TFormerException error occurs in TFORMer runtime

int getVersionMajor (  )  throws TFormerException

Gets the major version number of the Repository.

Returns:
The major version number of the Repository.
Exceptions:
TFormerException 

int getVersionMinor (  )  throws TFormerException

Gets the minor version number of the Repository.

Returns:
The minor version number of the Repository.
Exceptions:
TFormerException 

boolean isAutoSave (  ) 

Gets a flag indicating whether to save changes to the Repository automatically.

Returns:
If true changes to the Repository are saved automatically.

boolean isModified (  )  throws TFormerException

Gets a flag indicating whether this Repository has been modified.

Returns:
true if this Repository was modified; otherwise, false.
Exceptions:
TFormerException 

boolean isReadOnly (  )  throws TFormerException

Gets a flag indicating whether this Repository is read-only.

Returns:
true if this instance is read-only; otherwise, false.
Exceptions:
TFormerException 

void removeJobTrayControl ( JobTrayControl  jobTrayControl  )  throws TFormerException

Removes the JobTrayControl from the Repository.

Parameters:
jobTrayControl The JobTrayControl instance.
Exceptions:
TFormerException 

void removeJobTrayControl ( String  name  )  throws TFormerException

Removes the JobTrayControl from the Repository by name.

Parameters:
name The name of the JobTrayControl.
Exceptions:
TFormerException 

void removePrinter ( Printer  printer  )  throws TFormerException

Removes the Printer from the Repository.

Parameters:
printer The Printer.
Exceptions:
TFormerException 

void removePrinter ( String  name  )  throws TFormerException

Removes the Printer from the Repository by name.

Parameters:
name The name of the Printer.
Exceptions:
TFormerException 

void removeProject ( Project  project  )  throws TFormerException

Removes the Project from the Repository.

Parameters:
project The Project.
Exceptions:
TFormerException 

void removeProject ( String  name  )  throws TFormerException

Removes the Project from the Repository by name.

Parameters:
name The name of the Project.
Exceptions:
TFormerException 

void save (  )  throws TFormerException

Saves this Repository.

For a stand-alone FormLayout this method is not available.

Exceptions:
TFormerException 

void saveAs ( String  sFilename  )  throws TFormerException

Saves a copy of this Repository.

For a stand-alone FormLayout this method is not available.

Parameters:
sFilename The filename of the Repository.
Exceptions:
TFormerException 

void setAutoSave ( boolean  bAutoSave  ) 

Sets a flag indicating whether to save changes to the Repository automatically.

Parameters:
bAutoSave If true changes to the Repository are saved automatically.

void setComment ( String  sComment  )  throws TFormerException

Sets the comment for the Repository.

Parameters:
sComment The comment for the Repository.
Exceptions:
TFormerException 

void setDescription ( String  sDescription  )  throws TFormerException

Sets the description of the Repository.

Parameters:
sDescription The description of the Repository.
Exceptions:
TFormerException 

void setModified ( boolean  bModified  )  throws TFormerException

Sets a flag indicating whether this Repository has been modified.

Parameters:
bModified true if this Repository was modified; otherwise, false.
Exceptions:
TFormerException 

String toString (  ) 

Returns a string representation of the instance.

Returns:
a string representation of the instance


© 2006-2009 All rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Wed Sep 2 16:01:28 2009 for TFORMer Runtime JAVA Developer Reference with doxygen 1.5.8