TFORMer SDK - JAVA
7.0
|
Abstract class for a DataSource. More...
Public Member Functions | |
ComputedField | addComputedField (String name) throws TFormerException |
Creates and adds a ComputedField to the DataSource. | |
DSFieldMapping | addFieldMapping (String name) throws TFormerException |
Creates and adds a DSFieldMapping to the DataSource. | |
DataSourceParameter | addParameter (String name) throws TFormerException |
Creates and adds a DataSourceParameter to the DataSource. | |
void | dispose () throws TFormerException |
Releases the resources allocated by the instance. | |
void | dump (PrintStream s) throws IOException, TFormerException |
Dumps the current instance into a text stream. | |
String | getComment () throws TFormerException |
Gets the comment for the DataSource. | |
ComputedField | getComputedField (String name) throws TFormerException |
Gets a ComputedField defined in the DataSource. | |
String | getCopyColumnName () throws TFormerException |
Gets the CopyColumnName of the DataSource. | |
String | getDescription () throws TFormerException |
Gets the description of the DataSource. | |
DSFieldMapping | getFieldMapping (String name) throws TFormerException |
Gets a DSFieldMapping defined in the DataSource. | |
ComputedField | getFirstComputedField () throws TFormerException |
Gets the first ComputedField defined in the DataSource. | |
DSFieldMapping | getFirstDSFieldMapping () throws TFormerException |
Gets the first DSFieldMapping defined in the DataSource. | |
DataSourceParameter | getFirstParameter () throws TFormerException |
Gets the first DataSourceParameter defined in the DataSource. | |
String | getName () throws TFormerException |
Gets the name of the DataSource. | |
DataSource | getNext () throws TFormerException |
Gets the next DataSource instance defined in the Project. | |
int | getNumberOfComputedFields () throws TFormerException |
Gets the number of ComputedFields defined in the DataSource. | |
int | getNumberOfFieldMappings () throws TFormerException |
Gets the number of DSFieldMappings defined in the DataSource. | |
int | getNumberOfParameters () throws TFormerException |
Gets the number of DataSourceParameters defined in the DataSource. | |
DataSourceParameter | getParameter (String name) throws TFormerException |
Gets a DataSourceParameter defined in the DataSource. | |
DataSourceType | getType () throws TFormerException |
Gets the type of the DataSource. | |
boolean | isDefault () throws TFormerException |
Gets a value indicating whether this object stores the default DataSource. | |
boolean | isHandleEscapeSequences () throws TFormerException |
Gets if escape sequences should be translated on data retrieval or not. | |
void | removeComputedField (ComputedField computedField) throws TFormerException |
Removes the ComputedField from the DataSource. | |
void | removeComputedField (String name) throws TFormerException |
Removes the ComputedField from the DataSource. | |
void | removeFieldMapping (DSFieldMapping fieldMapping) throws TFormerException |
Removes the DSFieldMapping from the DataSource. | |
void | removeFieldMapping (String name) throws TFormerException |
Removes the DSFieldMapping from the DataSource. | |
void | removeParameter (DataSourceParameter parameter) throws TFormerException |
Removes the DataSourceParameter from the DataSource. | |
void | removeParameter (String name) throws TFormerException |
Removes the DataSourceParameter from the DataSource. | |
void | setComment (String sComment) throws TFormerException |
Sets the comment for the DataSource. | |
void | setCopyColumnName (String sCopyColumnName) throws TFormerException |
Sets the CopyColumnName of the DataSource. | |
void | setDescription (String sDescription) throws TFormerException |
Sets the description of the DataSource. | |
void | setHandleEscapeSequences (boolean bEscapeSequences) throws TFormerException |
Sets if escape sequences should be translated on data retrieval or not. | |
void | setName (String sName) throws TFormerException |
Sets the name of the DataSource. | |
String | toString () |
Returns a string representation of the instance. |
Abstract class for a DataSource.
_Default_
. This DataSource is used for printing as long as neither a DataSource is specified for JobData nor the FormLayout has an active DataSource set in design. This DataSource retrieves the data from the file that is stored along with the FormLayout file (extension .xml) and contains the DataField values entered during the last TFORMer Designer session.The available DataSource-classes are DataSourceCsv, DataSourceOdbc and DataSourceXml.static void IterateDataSourcesProject (Project project) throws TFormerException { // Iterate all DataSources of the Project for (DataSource ds = project.getFirstDataSource(); ds != null; ds = ds.getNext()) { System.out.println (ds.toString()); // Print information for the DataSourceParameters of the DataSource for (DataSourceParameter dsParam = ds.getFirstParameter(); dsParam != null; dsParam = dsParam.getNext()) System.out.println (dsParam.toString()); // Print information for the ComputedFields of the DataSource for (ComputedField dsComp = ds.getFirstComputedField(); dsComp != null; dsComp = dsComp.getNext()) System.out.println (dsComp.toString()); // Print the mapping between source fields and DataFields for (DSFieldMapping dsFieldmap = ds.getFirstDSFieldMapping(); dsFieldmap != null; dsFieldmap = dsFieldmap.getNext()) System.out.println (dsFieldmap.toString()); } }
// Create a new Repository instance using a Repository (extension *.tfr) // Examples are usually installed in // - Windows Vista: C:/Program Data/TEC-IT/TFORMer/7.0/Examples // - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.0/Examples Repository repository = new Repository("C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.0/Examples/Demo Repository/Demos.tfr", false, true);
// Iterate the DataSources of the global Project // If a Repository is used, the global Project and additional user-defined Projects may exist System.out.println ("Global project"); IterateDataSourcesProject (repository.getGlobalProject ()); // Iterate additional Projects // Additional Projects are only possible when using a Repository for (Project project = repository.getFirstProject (); project != null; project = project.getNext()) { System.out.println (project.toString()); // Iterate the DataSources of the Project IterateDataSourcesProject (project); }
Sample code that iterates all DataSource-objects of a given stand-alone FormLayout:
static void IterateDataSourcesProject (Project project) throws TFormerException { // Iterate all DataSources of the Project for (DataSource ds = project.getFirstDataSource(); ds != null; ds = ds.getNext()) { System.out.println (ds.toString()); // Print information for the DataSourceParameters of the DataSource for (DataSourceParameter dsParam = ds.getFirstParameter(); dsParam != null; dsParam = dsParam.getNext()) System.out.println (dsParam.toString()); // Print information for the ComputedFields of the DataSource for (ComputedField dsComp = ds.getFirstComputedField(); dsComp != null; dsComp = dsComp.getNext()) System.out.println (dsComp.toString()); // Print the mapping between source fields and DataFields for (DSFieldMapping dsFieldmap = ds.getFirstDSFieldMapping(); dsFieldmap != null; dsFieldmap = dsFieldmap.getNext()) System.out.println (dsFieldmap.toString()); } }
// 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.0/Examples // - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.0/Examples Repository repository = new Repository("C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/7.0/Examples/Command Line/ODBCReportPDF/ODBCReportPDF.tff", false, true);
// Iterate the DataSources of the global Project // If a stand-alone FormLayout is used, the global Project is the only Project System.out.println ("Global project"); IterateDataSourcesProject (repository.getGlobalProject ());
Related documentation:
ComputedField addComputedField | ( | String | name | ) | throws TFormerException |
Creates and adds a ComputedField to the DataSource.
name | The name of the ComputedField |
DSFieldMapping addFieldMapping | ( | String | name | ) | throws TFormerException |
Creates and adds a DSFieldMapping to the DataSource.
name | The name of the DataField for which a DSFieldMapping should be created. |
DataSourceParameter addParameter | ( | String | name | ) | throws TFormerException |
Creates and adds a DataSourceParameter to the DataSource.
name | The name of the DataSourceParameter |
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.
void dump | ( | PrintStream | s | ) | throws IOException, TFormerException |
Dumps the current instance into a text stream.
s | Instance of the stream |
Reimplemented in DataSourceCsv, DataSourceOdbc, and DataSourceXml.
String getComment | ( | ) | throws TFormerException |
Gets the comment for the DataSource.
ComputedField getComputedField | ( | String | name | ) | throws TFormerException |
Gets a ComputedField defined in the DataSource.
name | The name of the ComputedField |
null
String getCopyColumnName | ( | ) | throws TFormerException |
Gets the CopyColumnName of the DataSource.
String getDescription | ( | ) | throws TFormerException |
Gets the description of the DataSource.
DSFieldMapping getFieldMapping | ( | String | name | ) | throws TFormerException |
Gets a DSFieldMapping defined in the DataSource.
Retrieves the DSFieldMapping for a given DataField name from the DataSource
name | The name of a DataField |
null
ComputedField getFirstComputedField | ( | ) | throws TFormerException |
Gets the first ComputedField defined in the DataSource.
null
DSFieldMapping getFirstDSFieldMapping | ( | ) | throws TFormerException |
Gets the first DSFieldMapping defined in the DataSource.
null
DataSourceParameter getFirstParameter | ( | ) | throws TFormerException |
Gets the first DataSourceParameter defined in the DataSource.
null
String getName | ( | ) | throws TFormerException |
Gets the name of the DataSource.
DataSource getNext | ( | ) | throws TFormerException |
Gets the next DataSource instance defined in the Project.
A Project stores a list of DataSource objects. To retrieve the first DataSource in the Project see Project.getFirstDataSource.
null
if there aren't other instances in the Project, otherwise a valid instance of this class (DataSourceCsv, DataSourceOdbc or DataSourceXml)int getNumberOfComputedFields | ( | ) | throws TFormerException |
Gets the number of ComputedFields defined in the DataSource.
int getNumberOfFieldMappings | ( | ) | throws TFormerException |
Gets the number of DSFieldMappings defined in the DataSource.
int getNumberOfParameters | ( | ) | throws TFormerException |
Gets the number of DataSourceParameters defined in the DataSource.
DataSourceParameter getParameter | ( | String | name | ) | throws TFormerException |
Gets a DataSourceParameter defined in the DataSource.
name | The name of the DataSourceParameter |
null
DataSourceType getType | ( | ) | throws TFormerException |
Gets the type of the DataSource.
The DataSourceType is read-only, and is set on creation. It specifies the type of a DataSource (e.g. DataSourceOdbc, DataSourceCsv, DataSourceXml).
boolean isDefault | ( | ) | throws TFormerException |
Gets a value indicating whether this object stores the default DataSource.
true
if this DataSource is the default DataSource.boolean isHandleEscapeSequences | ( | ) | throws TFormerException |
Gets if escape sequences should be translated on data retrieval or not.
true
if escape sequences should be translated.void removeComputedField | ( | ComputedField | computedField | ) | throws TFormerException |
Removes the ComputedField from the DataSource.
computedField | The ComputedField |
void removeComputedField | ( | String | name | ) | throws TFormerException |
Removes the ComputedField from the DataSource.
name | The name of the ComputedField |
void removeFieldMapping | ( | DSFieldMapping | fieldMapping | ) | throws TFormerException |
Removes the DSFieldMapping from the DataSource.
fieldMapping | The DSFieldMapping |
void removeFieldMapping | ( | String | name | ) | throws TFormerException |
Removes the DSFieldMapping from the DataSource.
name | The name of the DataField for which the mapping should be deleted |
void removeParameter | ( | DataSourceParameter | parameter | ) | throws TFormerException |
Removes the DataSourceParameter from the DataSource.
parameter | The DataSourceParameter |
void removeParameter | ( | String | name | ) | throws TFormerException |
Removes the DataSourceParameter from the DataSource.
name | The name of the DataSourceParameter |
void setComment | ( | String | sComment | ) | throws TFormerException |
Sets the comment for the DataSource.
sComment | The comment for the DataSource |
void setCopyColumnName | ( | String | sCopyColumnName | ) | throws TFormerException |
Sets the CopyColumnName of the DataSource.
sCopyColumnName | The CopyColumnName of the DataSource |
void setDescription | ( | String | sDescription | ) | throws TFormerException |
Sets the description of the DataSource.
sDescription | The description of the DataSource |
void setHandleEscapeSequences | ( | boolean | bEscapeSequences | ) | throws TFormerException |
Sets if escape sequences should be translated on data retrieval or not.
bEscapeSequences | true if escape sequences should be translated. |
void setName | ( | String | sName | ) | throws TFormerException |
Sets the name of the DataSource.
sName | The name of the DataSource |
String toString | ( | ) |
Returns a string representation of the instance.
© 2006-2012 - all rights reserved by TEC-IT Datenverarbeitung GmbH |
![]() |
Generated on Tue Oct 23 2012 16:33:20 for TFORMer SDK - JAVA with doxygen 1.8.0 |