Home > Class Reference > %SYS namespace > %iKnow.Source.Converter

%iKnow.Source.Converter

abstract class %iKnow.Source.Converter extends %Library.RegisteredObject

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.

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property Params as %String;
Property methods: ParamsDisplayToLogical(), ParamsGet(), ParamsIsValid(), ParamsLogicalToDisplay(), ParamsLogicalToOdbc(), ParamsNormalize(), ParamsSet()

Methods (Including Private)

private method %OnNew(params As %String) as %Status
Inherited description: This callback method is invoked by the %New() method to provide notification that a new instance of an object is being created.

If this method returns an error then the object will not be created.

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

method BufferString(data As %String) as %Status

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.

method Convert() as %Status

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 SetCurrentMetadataValues() function.

classmethod GetMetadataKeys(params As %String) as %List
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 Convert() method in the same order as they are reported here.
method NextConvertedPart() as %String

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.

private final method ReportWarning(ref As %List, message As %String, location As %String = "") as %Status

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 Convert() or BufferString()

private final method SetCurrentMetadataValues(metaValues As %List) as %Status

Use this function to report metadata from within the Convert() 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 GetMetadataKeys() method.

method SetParams(params As %String) as %Status

Utility method called by the %iKnow.Source.Processor and %iKnow.Source.Loader logic to register any new or changed parameter values.

classmethod Test(ByRef pInput As %String, pParams As %List = "", Output pSC As %Status) as %String
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.

Inherited Members

Inherited Methods (Including Private)

Subclasses