org.ipdr.test
Class IPDRReadTool

java.lang.Object
  extended by org.ipdr.test.IPDRReadTool

public class IPDRReadTool
extends java.lang.Object

This tool will write all records for one schema in a file called "out_(xdr/xml)_(input_file_name).csv" which will have first line as the schema URI and subsequent lines as comma delimited data values. This tool will also generate blank values for optional attributes which are not present in the xml/xdr file, to make .csv file identical with the input file.


Field Summary
protected static CompositeData dataFromFile_
          Object of CompositeData which will contain the Data after reading from XDR/XML file.
static java.lang.String ipdrVersion_
          String to store the IPDR Version.
static boolean validateSchema_
          Flag indicating validation of Schema.
static int XDR
          Int to represent document type XDR.
static int XML
          Int to represent document type XML.
 
Constructor Summary
IPDRReadTool()
           
 
Method Summary
static void generateRawData(java.lang.String inputFile_, int Doc_Type)
          This method is called by calling application to write CompositeData to a .csv file.
static void main(java.lang.String[] args)
          Entry point to the read tool.
protected  void parameterHandling(java.lang.String[] args)
          Method to handle the command line parameters
 void testFTP(int docType, java.lang.String inputFile, java.lang.String outFileDir)
          This method is used for testing purposes from File based transfer protocol APIs.
protected  void testToolUsage()
          Method which tells about the usage of Read TestTool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataFromFile_

protected static CompositeData dataFromFile_
Object of CompositeData which will contain the Data after reading from XDR/XML file.


XDR

public static final int XDR
Int to represent document type XDR.

See Also:
Constant Field Values

XML

public static final int XML
Int to represent document type XML.

See Also:
Constant Field Values

validateSchema_

public static boolean validateSchema_
Flag indicating validation of Schema.


ipdrVersion_

public static java.lang.String ipdrVersion_
String to store the IPDR Version.

Constructor Detail

IPDRReadTool

public IPDRReadTool()
Method Detail

generateRawData

public static void generateRawData(java.lang.String inputFile_,
                                   int Doc_Type)
                            throws IPDRException,
                                   BadCompositeException
This method is called by calling application to write CompositeData to a .csv file. Attributes of a schema file corresponding to one service URI are collected in a arrayList and then in a array of OpenType. These attributes are compared with the input CompositeData and data is written to .csv file.

Parameters:
inputFile_ - Input file
Doc_Type - Doc Type
Throws:
IPDRException
BadCompositeException

testToolUsage

protected void testToolUsage()
Method which tells about the usage of Read TestTool


parameterHandling

protected void parameterHandling(java.lang.String[] args)
                          throws IPDRException,
                                 BadCompositeException
Method to handle the command line parameters

Throws:
IPDRException
BadCompositeException

main

public static void main(java.lang.String[] args)
Entry point to the read tool.


testFTP

public void testFTP(int docType,
                    java.lang.String inputFile,
                    java.lang.String outFileDir)
This method is used for testing purposes from File based transfer protocol APIs.

Parameters:
docType - Document Type
inputFile - Input file name
outFileDir - Output file directory