TFORMer SDK - JAVA  7.5
Public Member Functions | List of all members
Repository Class Reference

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

Public Member Functions

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

Detailed Description

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

Overview

A Repository is represented by a master file (extension *.tfr) and a subfolder structure on the file system. It references an arbitrary number of user-defined Project objects. These user-defined Projects are used to divide a Repository into logical areas. Each Project is a container which holds DataField definitions, DataSource definitions and references an arbitrary number of FormLayout objects.

The so-called GlobalProject is allocated by default and is exclusively used to define DataFields which are available for all FormLayouts regardless of their actual Project membership.

Note
In contrast to a stand-alone FormLayout, the GlobalProject of a Repository can not store references to a FormLayout.

Examples

To open a stand-alone FormLayout do the following:

// Create a new Repository instance using a stand-alone FormLayout (extension *.tff)
// Examples are usually installed in
// - Windows Vista or later: C:/Program Data/TEC-IT/TFORMer/7.5/Examples
// - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.5/Examples
Repository repository = new Repository("C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.5/Examples/Command Line/ODBCReportPDF/ODBCReportPDF.tff", false, true);

To open a Repository do the following:

// Create a new Repository instance using a Repository (extension *.tfr)
// Examples are usually installed in
// - Windows Vista: C:/Program Data/TEC-IT/TFORMer/7.5/Examples
// - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.5/Examples
Repository repository = new Repository("C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.5/Examples/Demo Repository/Demos.tfr", false, true);
Note
This class writes only changes to Repository-files (extension *.tfr) to disk. A stand-alone FormLayout cannot be created, saved or permanently modified on disk via this class.
Thread-safety: A single instance of this class must not be used by different threads.

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
sFilenameThe full path of a new or existing Repository (see also Passing Files)
bCreateNewRepositorytrue if a new Repository should be created, false if an existing Repository should be opened
bIsReadOnlytrue if Repository should be opened read-only (only when opening an existing Repository)
See also
Passing Files

Member Function Documentation

JobTrayControl addJobTrayControl ( String  name) throws TFormerException

Creates and adds a new JobTrayControl to the Repository.

For a stand-alone FormLayout this method is not available

Parameters
nameThe name of the JobTrayControl
Returns
The JobTrayControl object
See also
JobTrayControl
Printer addPrinter ( String  sName) throws TFormerException

Creates and adds the Printer to the Repository.

Attention
Internal use only
Parameters
sNameThe name of the Printer
Returns
The Printer
Project addProject ( String  sName) throws TFormerException

Creates and adds the Project in the Repository.

For a stand-alone FormLayout this method is not available. A stand-alone FormLayout contains only a GlobalProject which can't be retrieved by name.

Parameters
sNameThe name of the Project
Returns
The Project
See also
Project
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). Thus you can't create new stand-alone FormLayouts.

Parameters
bCommitChangesIf you call this method with commitChanges = false, all changes will be lost (even if isAutoSave() is enabled)!
void dispose ( ) throws TFormerException

Releases the resources allocated by the instance.

Call this method in every case (even in case of exceptions) is this instance is not required anymore. The Repository will be closed, changes are saved if isAutoSave() is true.

void dump ( PrintStream  s) throws IOException, TFormerException

Dump the current instance into the stream.

Parameters
sInstance of the stream
void finalize ( )

Releases unmanaged resources and performs other cleanup operations before the Repository is reclaimed by garbage collection.

Attention
Internal use only
int getBuildNumber ( ) throws TFormerException

Gets the build number of the Repository.

Returns
The build number of the Repository
String getComment ( ) throws TFormerException

Gets the comment for the Repository.

For a stand-alone FormLayout this property is not available

Returns
The comment for the Repository
DataSource getDefaultDataSource ( ) throws TFormerException

Gets the default DataSource.

Returns
The default DataSource.
See also
DataSource
JobTrayControl getDefaultJobTrayControl ( ) throws TFormerException

Gets the default JobTrayControl in the Repository.

Returns
The default JobTrayControl in the Repository
See also
JobTrayControl
Printer getDefaultPrinter ( ) throws TFormerException

Gets the default Printer of the Repository.

For a stand-alone FormLayout this property is not available

Returns
The default Printer of the Repository
Attention
Internal use only
String getDescription ( ) throws TFormerException

Gets the description of the Repository.

For a stand-alone FormLayout this property is always empty

Returns
The description of the Repository
JobTrayControl getFirstJobTrayControl ( ) throws TFormerException

Gets the first JobTrayControl in the Repository.

Returns
The first JobTrayControl in the Repository
See also
JobTrayControl
Printer getFirstPrinter ( ) throws TFormerException

Gets the first Printer stored in the Repository.

Attention
Internal use only
Returns
The first Printer stored in the Repository.
Project getFirstProject ( ) throws TFormerException

Gets the first Project stored in the Repository.

For a stand-alone FormLayout always null is returned. Use getGlobalProject() instead.

Returns
The first Project stored in the Repository, null if it doesn't exist
See also
Project
String getFullPath ( ) throws TFormerException

Gets the full pathname of the Repository.

Returns
The full pathname of the Repository
Project getGlobalProject ( ) throws TFormerException

Gets the global Project of the Repository.

Returns
The global Project of the Repository
See also
Project
JobTrayControl getJobTrayControl ( String  name) throws TFormerException

Gets a JobTrayControl defined in the Repository.

Parameters
nameThe name of the JobTrayControl
Returns
A valid object instance or null
See also
JobTrayControl
int getNumberOfJobTrayControls ( ) throws TFormerException

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

Returns
The number of JobTrayControl-objects stored in the Repository
See also
JobTrayControl
int getNumberofPrinters ( ) throws TFormerException

Gets the number of Printers defined in the Repository.

Returns
The number of Printers defined in the Repository
int getNumberOfProjects ( ) throws TFormerException

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

The GlobalProject is not counted, so the number of Project-objects is always 0 for stand-alone FormLayouts.

Returns
Gets the number of Project-objects stored in the Repository
See also
Project
Printer getPrinter ( String  name) throws TFormerException

Gets the Printer from the Repository.

Attention
Internal use only
Parameters
nameThe name of the Printer
Returns
A valid object instance or null
Project getProject ( String  name) throws TFormerException

Gets the Project defined in the Repository.

For a stand-alone FormLayout this method is not available. A stand-alone FormLayout contains only a GlobalProject which can't be retrieved by name.

Parameters
nameThe name of the Project
Returns
A valid object instance or null
See also
Project
int getVersionMajor ( ) throws TFormerException

Gets the major version number of the Repository.

Returns
The major version number of the Repository
int getVersionMinor ( ) throws TFormerException

Gets the minor version number of the Repository.

Returns
The minor version number of the Repository
boolean isAutoSave ( )

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

If AutoSave is set to true all changes will be saved even when this instance is disposed without calling Close(). If you call Close() directly with commitChanges = false all changes will be lost!

The state of the AutoSave property is not stored on the hard disk. AutoSave is always true after creating or opening a Repository with read/write access.

Returns
If true changes to the Repository will be saved automatically
boolean isModified ( ) throws TFormerException

Gets/Sets a flag indicating whether this Repository has been modified.

Attention
Internal use only
Returns
true if this Repository was modified
boolean isReadOnly ( ) throws TFormerException

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

Read-only means that the Repository can be changed in memory but changes won't be written to disk.

Returns
true if this instance is read-only
void removeJobTrayControl ( String  name) throws TFormerException

Removes the JobTrayControl from the Repository.

For a stand-alone FormLayout this method is not available

Parameters
nameThe name of the JobTrayControl
See also
JobTrayControl
void removeJobTrayControl ( JobTrayControl  jobTrayControl) throws TFormerException

Removes the JobTrayControl from the Repository.

For a stand-alone FormLayout this method is not available

Parameters
jobTrayControlThe JobTrayControl instance
See also
JobTrayControl
void removePrinter ( String  name) throws TFormerException

Removes the Printer from the Repository.

Attention
Internal use only
Parameters
nameThe name of the Printer
void removePrinter ( Printer  printer) throws TFormerException

Removes the Printer from the Repository.

Parameters
printerThe Printer
void removeProject ( String  name) throws TFormerException

Removes the Project from the Repository.

Parameters
nameThe name of the Project
See also
Project
void removeProject ( Project  project) throws TFormerException

Removes the Project from the Repository.

Parameters
projectThe Project
See also
Project
void save ( ) throws TFormerException

Saves this Repository.

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

void saveAs ( String  sFilename) throws TFormerException

Saves a copy of this Repository.

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

Parameters
sFilenameThe filename of the Repository
void setAutoSave ( boolean  bAutoSave)

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

If AutoSave is set to true all changes will be saved even when this instance is disposed without calling Close(). If you call Close() directly with commitChanges = false all changes will be lost!

The state of the AutoSave property is not stored on the hard disk. AutoSave is always true after creating or opening a Repository with read/write access.

Parameters
bAutoSaveIf true changes to the Repository will be saved automatically
void setComment ( String  sComment) throws TFormerException

Sets the comment for the Repository.

Parameters
sCommentThe comment for the Repository
void setDescription ( String  sDescription) throws TFormerException

Sets the description of the Repository.

Parameters
sDescriptionThe description of the Repository
void setModified ( boolean  bModified) throws TFormerException

Sets a flag indicating whether this Repository has been modified.

Attention
Internal use only
Parameters
bModifiedSet to true if this Repository was modified
String toString ( )

Returns a string representation of the instance.

Returns
A string representation of the instance

© 2006-2017 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Fri Nov 3 2017 07:59:14 for TFORMer SDK - JAVA with doxygen 1.8.9.1