IRISLIB database
Converter Class Reference
Inheritance diagram for Converter:
Collaboration diagram for Converter:

Public Member Functions

_.Library.Status BufferString (_.Library.String data)
 
_.Library.Status Convert ()
 
_.Library.String NextConvertedPart ()
 
_.Library.Status SetParams (_.Library.String params)
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Static Public Member Functions

_.Library.List GetMetadataKeys (_.Library.String params)
 If the Converter extracts metadata, this method should return a list of keys of the metadata fields that are. More...
 
_.Library.String Test (_.Library.String pInput, _.Library.List pParams, _.Library.Status pSC)
 Utility method to test a converter class. More...
 

Public Attributes

 Params
   More...
 

Private Member Functions

_.Library.Status __ReportWarning (_.Library.List ref, _.Library.String message, _.Library.String location)
 
_.Library.Status __SetCurrentMetadataValues (_.Library.List metaValues)
 

Additional Inherited Members

- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

This is the base class for any Converter implementations. Converter classes are used during the processing step to extract textual data and, optionally, source metadata from the context of different file formats. If a converter is defined in the loading process, the processor will call this object to extract the required data before the data is pushed to the iKnow Indexer.

Converter objects are handled by the loading framework automatically and custom code should never instantiate a Converter object or call any of its methods directly.

Member Function Documentation

◆ BufferString()

_.Library.Status BufferString ( _.Library.String  data)

This method takes the raw input text and buffers it internally in the converter. The text is provided in

chunks of 32k. Every custom converter will need to implement this method so that it can take in the raw data.

Reimplemented in TextTransformation, and Html.

◆ Convert()

_.Library.Status Convert ( )

This method is called after all data has been buffered. In this method the converter will need to parse the

raw data and extract/convert it into plain text data. If any metadata is present within the document the converter can extract that metadata here, and provide it to the system. Metadata can be reported by using the <method>SetCurrentMetadataValues</method> function.

Reimplemented in TextTransformation, and Html.

◆ GetMetadataKeys()

_.Library.List GetMetadataKeys ( _.Library.String  params)
static

If the Converter extracts metadata, this method should return a list of keys of the metadata fields that are.

extracted from the contents. The values will be exposed in the <method>Convert</method> method in the same order as they are reported here.

Reimplemented in TextTransformation.

◆ NextConvertedPart()

_.Library.String NextConvertedPart ( )

When conversion is done, this method will be called to fetch the converted data back from the converter. The method

should return the converted text in chuncks of maximum 32k in size. When no more data is available, the method should return the empty string ("") to signal that all data has been transferred.

Reimplemented in TextTransformation, and Html.

◆ __ReportWarning()

_.Library.Status __ReportWarning ( _.Library.List  ref,
_.Library.String  message,
_.Library.String  location 
)
private

Utility method to report warnings for the current source, which won't disrupt further processing.

NOTE: to report errors, simply pass back the error code as the output of <method>Convert</method> or <method>BufferString</method>

◆ __SetCurrentMetadataValues()

_.Library.Status __SetCurrentMetadataValues ( _.Library.List  metaValues)
private

Use this function to report metadata from within the <method>Convert</method> function. The method takes a list of metadata values.

The values should be in the same order as the order of the keys as reported by the <method>GetMetadataKeys</method> method.

◆ SetParams()

_.Library.Status SetParams ( _.Library.String  params)

Utility method called by the <class>iKnow.Source.Processor</class> and <class>iKnow.Source.Loader</class>

logic to register any new or changed parameter values.

Reimplemented in Html.

◆ Test()

_.Library.String Test ( _.Library.String  pInput,
_.Library.List  pParams,
_.Library.Status  pSC 
)
static

Utility method to test a converter class.

pInput can be either a straight string,

or an array of string values that need to be concatenated. The result is a straight string.

Member Data Documentation

◆ Params

Params