Repository class
Package: com.tecit.TFORMer.Repository
Opens or creates a Repository, opens a stand-alone FormLayout.
Usage and notes
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 used to define DataFields and DataSources 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/9/Examples
// - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/9/Examples
Repository repository = new Repository("C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/9/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/9/Examples
// - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/9/Examples
Repository repository = new Repository("C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/9/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.
Note
Thread-safety: A single instance of this class must not be used by different threads.
Constructors
| Member | Description |
|---|---|
| Repository(String, boolean, boolean) | Constructor for Repository objects. |
Methods
| Member | Description |
|---|---|
| addJobTrayControl(String) | Creates and adds a new JobTrayControl to the Repository. |
| addPrinter(String) | Creates and adds the Printer to the Repository. |
| addProject(String) | Creates and adds the Project in the Repository. |
| close(boolean) | Close this Repository. |
| dispose() | Releases the resources allocated by the instance. |
| dump(PrintStream) | Dump the current instance into the stream. |
| finalize() | Releases unmanaged resources and performs other cleanup operations before the Repository is reclaimed by garbage collection. |
| getBuildNumber() | Gets the build number of the Repository. |
| getComment() | Gets the comment for the Repository. |
| getDefaultDataSource() | Gets the default DataSource. |
| getDefaultJobTrayControl() | Gets the default JobTrayControl in the Repository. |
| getDefaultPrinter() | Gets the default Printer of the Repository. |
| getDescription() | Gets the description of the Repository. |
| getFirstJobTrayControl() | Gets the first JobTrayControl in the Repository. |
| getFirstPrinter() | Gets the first Printer stored in the Repository. |
| getFirstProject() | Gets the first Project stored in the Repository. |
| getFullPath() | Gets the full pathname of the Repository. |
| getGlobalProject() | Gets the global Project of the Repository. |
| getJobTrayControl(String) | Gets a JobTrayControl defined in the Repository. |
| getNumberOfJobTrayControls() | Gets the number of JobTrayControl-objects stored in the Repository. |
| getNumberofPrinters() | Gets the number of Printers defined in the Repository. |
| getNumberOfProjects() | Gets the number of Project-objects stored in the Repository. |
| getPrinter(String) | Gets the Printer from the Repository. |
| getProject(String) | Gets the Project defined in the Repository. |
| getVersionMajor() | Gets the major version number of the Repository. |
| getVersionMinor() | Gets the minor version number of the Repository. |
| isAutoSave() | Gets a flag indicating whether to save changes to the Repository automatically. |
| isModified() | Gets/Sets a flag indicating whether this Repository has been modified. |
| isReadOnly() | Gets a flag indicating whether this Repository is read-only. |
| removeJobTrayControl(JobTrayControl) | Removes the JobTrayControl from the Repository. |
| removeJobTrayControl(String) | Removes the JobTrayControl from the Repository. |
| removePrinter(Printer) | Removes the Printer from the Repository. |
| removePrinter(String) | Removes the Printer from the Repository. |
| removeProject(Project) | Removes the Project from the Repository. |
| removeProject(String) | Removes the Project from the Repository. |
| save() | Saves this Repository. |
| saveAs(String) | Saves a copy of this Repository. |
| setAutoSave(boolean) | Sets a flag indicating whether to save changes to the Repository automatically. |
| setComment(String) | Sets the comment for the Repository. |
| setDescription(String) | Sets the description of the Repository. |
| setModified(boolean) | Sets a flag indicating whether this Repository has been modified. |
| toString() | Returns a string representation of the instance. |