Java interfaces enable you to customize file processing by using Java classes that you write:
InputSorter
InputSource
PreProcessor
PostProcessor
These enhancements to the driver require Java programming. To implement this functionality, complete the following processes:
These interfaces enable you to add extensions, which are optional. The driver continues to function as before without extensions. However, if you want to directly modify the behavior of the driver, but have been unable to make these modifications from a style sheet or DirXML® Script, extending the Delimited Text driver can be useful.
By using Java classes that you write, you can use the interfaces to customize the publish and subscribe processes in the following ways:
Table 5-4 Customizing the Publish and Subscribe Processes
JavaDoc and an example class are included with the driver to help you implement this functionality. Find these files at platform \dirxml\drivers\delimitedtext\extensions.
After you have implemented your class file, create a Java .jar file (Java archive) using the jar tool. The .jar file must contain the class that you have created. Put the .jar file into the novell/nds/lib directory. The path might differ, depending on the platform you’re on, but it should be the same location as DelimitedTextShim.jar and DelimitedTextUtil.jar.
After you have placed the new .jar file in the correct location, configure the driver to use your new class by modifying the driver's properties.
In iManager, select
> .Locate the driver in its driver set.
Click the driver icon to open the
page.Click the driver icon again to open the
page.In the drop-down menu, select
.Scroll to D
, then click .Locate the <publisher-options> section of the file.
This file defines which parameters and values appear in the Driver Parameters section of the D
page.For each class you created that works on the Publisher channel, you enter an additional option in the <publisher-options> section. After you’ve updated this file, you’ll see your new options in the interface.
For each new class you created on the Publisher channel, add an entry corresponding to the interface type. Use the following table as a guide:
Replace com.acme.MyNewClass with the name of the class that you have defined along with a full package identifier.
Replace MY CONFIG PARAMSMY CONFIG PARAMS with any information that you want to pass to the init method of your class.
The init method of your class is then responsible for parsing the information contained in this string. If your class doesn’t require a configuration string to be passed to the init method, you can leave off the whole element, in which case null would be passed to the init method.
If you created a PostProcessor rule, locate the <subscriber-options> section of the file and add the following lines:
<post-processor display-name="PostProcessor Class">com.acme.MyNewClass</post-processor> <post-processor-params display-name="PostProcessor init string">MY CONFIG PARAMS</post-processor-params>
Replace com.acme.MyNewClass with the name of the class that you have defined along with full package information.
Replace MY CONFIG PARAMS with any information that you want to pass to the init method of your class.
The init method of your class is then responsible for parsing the information contained in this string. If your class doesn’t require a configuration string to be passed to the init method, you can leave off the entire element, in which case null would be passed to the init method.
Click
.