|
5.
Text PDS Implementation
The whole Implementation of Text PDS is divided in two parts :
1. Implementing the PDS Plugin API
2. Implementation for text File processing 5.1.
Implementing the PDS Plugin API This
part of the code deals with implementing the PDS plugin API. Following are the
PDS plugin API implemented by the Text PDS.
PluginEditor
PluginResultSetMetaData
PluginDataSource
PluginDataSourceFactoryTemplate
PluginDataSourceTemplate
TextDataSourceFactory
| Class
Name | oracle.reports.plugin.datasource.textpds.TextDataSourceFactory |
| Description | This
is a factory class for the Text Plugin Data Source, which is used to create
Plugin Data Source instance as well as to hold the shared or even static
information or behavior of this type of Plugin Data Source. |
| inherits | oracle.reports.plugin.datasource.PluginDataSourceFactoryTemplate,
oracle.reports.plugin.PluginFactoryTemplate | | implements | oracle.reports.plugin.PluginFactory |
TextDataSource
| Class
Name | oracle.reports.plugin.datasource.textpds.TextDataSource |
| Description | This
class overrides all the methods from the Plugin. These methods will be called
by the PDS API at design and Run time. Information is passed to this class by
the PDS. TextDataSource also sends information to the PDS -both runtime and design
time Information. | | inherits | oracle.reports.plugin.datasource.PluginDataSourceTemplate |
| implements | oracle.reports.plugin.datasource.PluginDataSource,
oracle.reports.plugin.Plugin | TextEditor
| Class
Name | oracle.reports.plugin.datasource.textpds.TextEditor |
| Description | This
is a Swing-based top level window class. Responsible for the creation of the UI.
Uses the information in the Plugin(TextDataSource) class passed by the report.
Makes use of TextUIEventHandler class as an ActionListener and store the information
collected by the user. Makes use of the Plugin and the TextConfigFileHandler
class to build a serialized XML string containing the data source, definition
and Reference Parameters, if any. | | inherits | javax.swing.JFrame |
| implements | oracle.reports.plugin.PluginEditor |
TextUIEventHandler
| Class
Name | oracle.reports.plugin.datasource.textpds.TextUIEventHandler |
| Description | This
is a helper class for the TextEditor class. The TextEditor class delegates all
the event handling information to it. And this class, does the appropriate event
handling. Responsible for performing the necessary UI house-keeping activities. |
| inherits | java.awt.event.ActionListener,java.awt.event.WindowListener,
java.awt.event.KeyListener | TextResultSetMetaData
| Class
Name | oracle.reports.plugin.datasource.textpds.TextResultSetMetaData |
| Description | This
provides data structure of resultset meta data of the PDS. Provides default Implementations
for all the APIs of ResultSetMetaData. It is a meta class used by the PDSDriver
to fetch information about the data such as Column name, precision, type. |
| implements | oracle.reports.plugin.PluginResultSetMetaData,
java.sql.ResultSetMetaData | TextResultSet
| Class
Name | oracle.reports.plugin.datasource.textpds.TextResultSet |
| Description | This
is a ResultSet implementation. It returns the log(Data) file contents in a ResultSet
fashion. Each line in the log file, is treated as Row. And each field is treated
as a column. Initially the column position is at 0th row. Use next() method
to iterate thru the rows. | | implements | java.sql.ResultSet |
5.2.
Implementation for text File processing
The implementation for processing the text file can be divided into 3 phases:
Initialization : parsing
the configuration file and fetching the plugin data source information - reference
parameters, query name and other query group information through the PDS Plugin
API. Design time processing
: Based on the format string alias selected and the information obtained during
the initialization, the data definition is extracted and passed to the PDS Plugin
API. Runtime processing :
Reading text file, validating the contents of the file based on the format string
alias and translating the log file contents into a row-based data structure and
finally passing it to the Plugin API. TextSerializedXML
| Class
Name | oracle.reports.plugin.datasource.textpds.TextSerializedXML |
| Description | This
class provides the definition of the PDS include serialization and deserialization
to/from XML. TextSerializedXml class wraps the Serialized XML string which stores
the information about the PDS when it is saved for future use. It contains method
to contruct the XML String using Information entered by the user such as Data
definition,data source, column information, reference parameter names. It also
provides methods to parse the XML string to fetch the elements from it. |
TextFileFormat
| Class
Name | oracle.reports.plugin.datasource.textpds.TextFileFormat |
| Description | This
class wraps details of one "fileFormat".One for Apache, IIS so on. Each "fileFormat"
represents one instance on this class.Each tag <fileFormat> and its subtags
form one instance of this class. It sets all the format attributes like format
name, format Comment Character, Separator,type and Column attributes. |
TextFileFormatColumn
| Class
Name | oracle.reports.plugin.datasource.textpds.TextFileFormatColumn |
| Description | This
class wraps all the data related to the column of a file format.Data
such as column name, type, precision, scale, cellwrapper, ifany and
pattern used by the PluginResultSetMetaData class | TextReferenceColumnHandler
| Class
Name | oracle.reports.plugin.datasource.textpds.TextReferenceColumnHandler |
| Description | This
class processes a string with referenced parameters as lexicals.This should provides
a ready-to-use generic utility for all PDS. | TextConfigFileHandler
| Class
Name | oracle.reports.plugin.datasource.textpds.TextConfigFileHandler |
| Description | This
class parses and processes configuration file and provide fileFormat info. |
TextProxyConfig
| Class
Name | oracle.reports.plugin.datasource.textpds.TextProxyConfig |
| Description | Does
the proxy setting for the Remote URLs which are behind a firewall.The proxy Server
name and port is specified in the textpds.conf as proxyServer The URLs that require
proxy settings are ftp, http and https sites. Also, domain names mentioned
in the textpds.conf as bypassProxy, will be ignored for proxy setting. Different
proxy can be set for different protocol. Proxy will be removed after fetching
the stream from the URL. | TextDataFileHandler
| Class
Name | oracle.reports.plugin.datasource.textpds.TextDataFileHandler |
| Description | This
class wraps the text file object. Is responsible for parsing the log file and
fetching its contents. It also reads the text PDS configuration file to make know
the meaning of the format specifiers. | TextUtility
| Class
Name | oracle.reports.plugin.datasource.textpds.TextUtility |
| Description | TextUtility
is a utility class to deal with parsing and unparsing of Reference Parameter
String. Since Reference Parameter are represented using special characters
such as &, <,> and moreover since XML also treats these as special
characters,there are methods to filter the Strings containing the special
characters.It also has some utility methods like convert Object array to
String array which are used quite often in TextPDS |
TextResource | Class
Name | oracle.reports.plugin.datasource.textpds.TextResource |
| Description | TextResource
maps the messages and error numbers in the TextBundle class with constant String
names to be used in all the classes of TextPDS.All the resources that have been
used in textpds e.g. any labels used by the textpds UI,constant Strings or numbers
are added in this file. The ResourceManager uses ListResourceBundles for the PDS
messages. All new messages should be put into the TextBundle.xml file, and then
XMLMakeBundle tool should be used to generate the .java file. |
TextMap
| Class
Name | oracle.reports.plugin.datasource.textpds.TextMap |
| Description | This
class is an implementation of Map interface with limited features. Provided here
due to lack of an implementation of a Map which maintains the retrieval order
of the keys in the order in which they are put, in the current JDK version. This
class needs to be replaced with the class java.util.LinkedHashMap in JDK
v1.4.0. It is NOT grow able in size. Hence the constructor of this class uses
the capacity as the length of the array. It however, guarantees the working
of some crucial methods like put(), get(), values(), size(); |
TextFilter
| Class
Name | oracle.reports.plugin.datasource.textpds.TextFilter |
| Description | Class
used by the FileChooser in the TextPDS UI to filter the file types |
|