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 Nameoracle.reports.plugin.datasource.textpds.TextDataSourceFactory
DescriptionThis 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. 
inheritsoracle.reports.plugin.datasource.PluginDataSourceFactoryTemplate, oracle.reports.plugin.PluginFactoryTemplate
implementsoracle.reports.plugin.PluginFactory

TextDataSource
Class Nameoracle.reports.plugin.datasource.textpds.TextDataSource
DescriptionThis 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.
inheritsoracle.reports.plugin.datasource.PluginDataSourceTemplate
implementsoracle.reports.plugin.datasource.PluginDataSource, oracle.reports.plugin.Plugin

TextEditor
Class Nameoracle.reports.plugin.datasource.textpds.TextEditor
DescriptionThis 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.
inheritsjavax.swing.JFrame
implementsoracle.reports.plugin.PluginEditor

TextUIEventHandler
Class Nameoracle.reports.plugin.datasource.textpds.TextUIEventHandler
DescriptionThis 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.
inheritsjava.awt.event.ActionListener,java.awt.event.WindowListener, java.awt.event.KeyListener

TextResultSetMetaData
Class Nameoracle.reports.plugin.datasource.textpds.TextResultSetMetaData
DescriptionThis 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.
implementsoracle.reports.plugin.PluginResultSetMetaData, java.sql.ResultSetMetaData

TextResultSet
Class Nameoracle.reports.plugin.datasource.textpds.TextResultSet
DescriptionThis 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 Nameoracle.reports.plugin.datasource.textpds.TextSerializedXML
DescriptionThis 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 Nameoracle.reports.plugin.datasource.textpds.TextFileFormat
DescriptionThis 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 Nameoracle.reports.plugin.datasource.textpds.TextFileFormatColumn
DescriptionThis 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 Nameoracle.reports.plugin.datasource.textpds.TextReferenceColumnHandler
DescriptionThis class processes a string with referenced parameters as lexicals.This should provides a ready-to-use generic utility for all PDS.

TextConfigFileHandler
Class Nameoracle.reports.plugin.datasource.textpds.TextConfigFileHandler
DescriptionThis class parses and processes configuration file and provide fileFormat info. 

TextProxyConfig
Class Nameoracle.reports.plugin.datasource.textpds.TextProxyConfig
DescriptionDoes 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 Nameoracle.reports.plugin.datasource.textpds.TextDataFileHandler
DescriptionThis 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 Nameoracle.reports.plugin.datasource.textpds.TextUtility
DescriptionTextUtility 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 Nameoracle.reports.plugin.datasource.textpds.TextResource
DescriptionTextResource 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 Nameoracle.reports.plugin.datasource.textpds.TextMap
DescriptionThis 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 Nameoracle.reports.plugin.datasource.textpds.TextFilter
DescriptionClass used by the FileChooser in the TextPDS UI to filter the file types

 


Copyright © 2002, Oracle Corporation. All rights reserved.