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 into TFORMer runtime 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 of 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 FieldMapping (see 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 instance defined in the Project. | |
int | getNumberOfComputedFields () throws TFormerException |
Gets the number of computed fields (see ComputedField) defined in the DataSource. | |
int | getNumberOfFieldMappings () throws TFormerException |
Gets the number of field mappings (see DSFieldMapping) defined in the DataSource. | |
int | getNumberOfParameters () throws TFormerException |
Gets the number of parameters (see DataSourceParameter) 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 (String name) throws TFormerException |
Removes the ComputedField from the DataSource. | |
void | removeComputedField (ComputedField computedField) throws TFormerException |
Removes the ComputedField from the DataSource. | |
void | removeFieldMapping (String name) throws TFormerException |
Removes the DSFieldMapping from the DataSource. | |
void | removeFieldMapping (DSFieldMapping fieldMapping) throws TFormerException |
Removes the DSFieldMapping from the DataSource. | |
void | removeParameter (String name) throws TFormerException |
Removes the DataSourceParameter from the DataSource. | |
void | removeParameter (DataSourceParameter parameter) throws TFormerException |
Removes the DataSourceParameter from the DataSource. | |
void | setComment (String sComment) throws TFormerException |
Sets the comment of 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. |
TFORMer Designer allows to define DataSources as part of a FormLayout. DataSources define how data is retrieved (e.g. from an ODBC database), the field-mappings ( DSFieldMappings), ComputedFields and optional DataSourceParameters. Each DataSource is identified by its unique name. Optional DataSourceParameters can be defined to control certain aspects (like filenames, SQL statement or an ODBC-DSN) during runtime.
The available DataSource classes are DataSourceCsv, DataSourceOdbc and DataSourceXml. See getNext method for more details.
Sample code that iterates all DataSources of a given Repository.
Repository rep = new Repository (System.getenv("TFORMERSAMPLES") + "Demo Repository\\Demos.tfr", false, false);
// Iterate through Projects
for (Project proj = rep.getFirstProject(); proj != null; proj = proj.getNext())
{
// Iterate through DataSources
for (DataSource ds = proj.getFirstDataSource(); ds != null; ds = ds.getNext())
{
System.out.println(ds.toString());
// Print parameter information
for (DataSourceParameter dsParam = ds.getFirstParameter(); dsParam != null; dsParam = dsParam.getNext())
System.out.println (dsParam.toString());
// Print computedfield information
for (ComputedField dsComp = ds.getFirstComputedField(); dsComp != null; dsComp = dsComp.getNext())
System.out.println (dsComp.toString());
// Print fieldmapping information
for (DSFieldMapping dsFieldmap = ds.getFirstFieldMapping(); dsFieldmap != null; dsFieldmap = dsFieldmap.getNext())
System.out.println (dsFieldmap.toString());
}
}
Sample code that iterates all DataSources of a given stand-alone FormLayout.
Repository rep = new Repository (System.getenv("TFORMERSAMPLES") + "..\\Templates\\(6) Samples_Picking List.tff", false, false);
// Iterate through DataSources
for (DataSource ds = rep.getGlobalProject().getFirstDataSource(); ds != null; ds = ds.getNext())
{
System.out.println(ds.toString());
// Print parameter information
for (DataSourceParameter dsParam = ds.getFirstParameter(); dsParam != null; dsParam = dsParam.getNext())
System.out.println(dsParam.toString());
// Print computedfield information
for (ComputedField dsComp = ds.getFirstComputedField(); dsComp != null; dsComp = dsComp.getNext())
System.out.println(dsComp.toString());
// Print fieldmapping information
for (DSFieldMapping dsFieldmap = ds.getFirstFieldMapping(); dsFieldmap != null; dsFieldmap = dsFieldmap.getNext())
System.out.println(dsFieldmap.toString());
}
Thread-safety: A single instance of this class must not be used by different threads.
ComputedField addComputedField | ( | String | name | ) | throws TFormerException |
Creates and adds a ComputedField to the DataSource.
name | The name of the ComputedField. |
TFormerException | error occurred into TFORMer runtime. |
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. |
TFormerException | error occurred into TFORMer runtime. |
DataSourceParameter addParameter | ( | String | name | ) | throws TFormerException |
Creates and adds a DataSourceParameter to the DataSource.
name | The name of the DataSourceParameter. |
TFormerException | error occurred into TFORMer runtime. |
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
TFormerException | error occurred into TFORMer runtime. |
void dump | ( | PrintStream | s | ) | throws IOException, TFormerException |
Dumps the current instance into a text stream.
s | instance of the stream |
IOException | error in I/O | |
TFormerException | error occurred into TFORMer runtime. |
Reimplemented in DataSourceCsv, DataSourceXml, and DataSourceOdbc.
String getComment | ( | ) | throws TFormerException |
Gets the comment of the DataSource.
TFormerException | error occurred into TFORMer runtime. |
ComputedField getComputedField | ( | String | name | ) | throws TFormerException |
Gets a ComputedField defined in the DataSource.
name | The name of the ComputedField. |
null
if the requested object doesn't exist, otherwise a valid instance TFormerException | error occurred into TFORMer runtime. |
String getCopyColumnName | ( | ) | throws TFormerException |
Gets the CopyColumnName of the DataSource.
TFormerException | error occurred into TFORMer runtime. |
String getDescription | ( | ) | throws TFormerException |
Gets the description of the DataSource.
TFormerException | error occurred into TFORMer runtime. |
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
if the requested object doesn't exist, otherwise a valid instance TFormerException | error occurs in TFORMer runtime |
ComputedField getFirstComputedField | ( | ) | throws TFormerException |
Gets the first ComputedField defined in the DataSource.
null
. TFormerException | error occurred into TFORMer runtime. |
DSFieldMapping getFirstDSFieldMapping | ( | ) | throws TFormerException |
Gets the first FieldMapping (see DSFieldMapping) defined in the DataSource.
null
. TFormerException | error occurred into TFORMer runtime. |
DataSourceParameter getFirstParameter | ( | ) | throws TFormerException |
Gets the first DataSourceParameter defined in the DataSource.
TFormerException | error occurred into TFORMer runtime. |
String getName | ( | ) | throws TFormerException |
Gets the name of the DataSource.
TFormerException | error occurred into TFORMer runtime. |
DataSource getNext | ( | ) | throws TFormerException |
Gets the next instance defined in the Project.
A Project stores a list of DataSource objects. You can use this method to iterate through the list. To retrieve the first DataSource in the Project see Project.getFirstDataSource().
If this instance is the default data source of the repository (see Repository.getDefaultDataSource), this method returns always null
.
null
if there aren't other instances into the project, otherwise a valid instance of the available implementations of this class (DataSourceCsv, DataSourceOdbc or DataSourceXml) TFormerException | error occurred into TFORMer runtime. |
int getNumberOfComputedFields | ( | ) | throws TFormerException |
Gets the number of computed fields (see ComputedField) defined in the DataSource.
TFormerException | error occurred into TFORMer runtime. |
int getNumberOfFieldMappings | ( | ) | throws TFormerException |
Gets the number of field mappings (see DSFieldMapping) defined in the DataSource.
TFormerException | error occurred into TFORMer runtime. |
int getNumberOfParameters | ( | ) | throws TFormerException |
Gets the number of parameters (see DataSourceParameter) defined in the DataSource.
TFormerException | error occurred into TFORMer runtime. |
DataSourceParameter getParameter | ( | String | name | ) | throws TFormerException |
Gets a DataSourceParameter defined in the DataSource.
name | The name of the DataSourceParameter. |
null
if the requested object doesn't exist, otherwise a valid instance TFormerException | error occurred into TFORMer runtime. |
DataSourceType getType | ( | ) | throws TFormerException |
Gets the type of the DataSource.
The DataSourceType is readonly, and is set on creation.
It specifies the concrete type of a DataSource (e.g. DataSourceOdbc, DataSourceCsv, DataSourceXml).
TFormerException | error occurred into TFORMer runtime. |
boolean isDefault | ( | ) | throws TFormerException |
Gets a value indicating whether this object stores the default DataSource.
TFormerException | error occurred into TFORMer runtime. |
boolean isHandleEscapeSequences | ( | ) | throws TFormerException |
Gets if escape sequences should be translated on data retrieval or not.
true
if escape sequences should be translated, otherwise, false
. TFormerException | error occurred into TFORMer runtime. |
void removeComputedField | ( | String | name | ) | throws TFormerException |
Removes the ComputedField from the DataSource.
name | The name of the ComputedField. |
TFormerException | error occurred into TFORMer runtime. |
void removeComputedField | ( | ComputedField | computedField | ) | throws TFormerException |
Removes the ComputedField from the DataSource.
computedField | The ComputedField. |
TFormerException | error occurred into TFORMer runtime. |
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. |
TFormerException | error occurred into TFORMer runtime. |
void removeFieldMapping | ( | DSFieldMapping | fieldMapping | ) | throws TFormerException |
Removes the DSFieldMapping from the DataSource.
fieldMapping | The DSFieldMapping. |
TFormerException | error occurred into TFORMer runtime. |
void removeParameter | ( | String | name | ) | throws TFormerException |
Removes the DataSourceParameter from the DataSource.
name | The name of the DataSourceParameter. |
TFormerException | error occurred into TFORMer runtime. |
void removeParameter | ( | DataSourceParameter | parameter | ) | throws TFormerException |
Removes the DataSourceParameter from the DataSource.
parameter | The DataSourceParameter. |
TFormerException | error occurred into TFORMer runtime. |
void setComment | ( | String | sComment | ) | throws TFormerException |
Sets the comment of the DataSource.
sComment | The comment of the DataSource. |
TFormerException | error occurred into TFORMer runtime. |
void setCopyColumnName | ( | String | sCopyColumnName | ) | throws TFormerException |
Sets the CopyColumnName of the DataSource.
sCopyColumnName | The CopyColumnName of the DataSource. |
TFormerException | error occurred into TFORMer runtime. |
void setDescription | ( | String | sDescription | ) | throws TFormerException |
Sets the description of the DataSource.
sDescription | The description of the DataSource. |
TFormerException | error occurred into TFORMer runtime. |
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, otherwise, false . |
TFormerException | error occurred into TFORMer runtime. |
void setName | ( | String | sName | ) | throws TFormerException |
Sets the name of the DataSource.
sName | The name of the DataSource. |
TFormerException | error occurred into TFORMer runtime. |
String toString | ( | ) |
Returns a string representation of the instance.
© 2006-2009 All rights reserved by TEC-IT Datenverarbeitung GmbH |
![]() |
Generated on Wed Sep 2 16:01:27 2009 for TFORMer Runtime JAVA Developer Reference with doxygen 1.5.8 |