Tool

scauwe's picture
tool
Reads:

7039

Score:
2.5
2.5
8
 
Comments:

6

Generic File Driver for IDM, v 0.5

license: 
MPL (Mozilla Public License)

Introduction

The Generic File Driver is similar to the Text Driver shipped with IDM, but has more options, and has the capability to read virtually any file type. Out of the box, the following file types are supported: XML, CSV and XLS (the latter using POI from Apache).

The original version I wrote in 2007 is located at http://www.novell.com/coolsolutions/tools/18671.html. This update comes with an IDM 4 package making the installation simpler and has some new features and fixes.
See the referenced version for a list of the old features.

New features and fixes

version 0.5, 21-JAN-2013

  • Shim bug: Fixed an issue wrt the driver not adding the metadata on the publisher channel.

version 0.4, 24-APR-2012

  • Shim bug: Fixed an issue with the driver schema (appeared to be hard coded).
  • Shim feature: Added beta support for query back. Query back only supported on publisher channel (when reading in a file). Feedback welcome.
  • Package bug: Fixed an issue that caused the driver configuration not to be imported when the package was imported.
  • Package bug: Changed creation policy from validating the Given Name to validating the Surname.
  • Package feature: Added package 'Delimited Text Driver Password Synchronization Package' as an optional package for this driver.
  • Package feature: Added remote loader prompts to the package.

version 0.3, 12-OCT-2011

  • Shim feature: automatic association and src-dn calculation (using ecmascript in the driver configuration). No longer need for style sheets for just creating association and src-dn values. The driver shim now does this for you.
  • Shim bug: fixed missing remove-all-values on the publisher documents.
  • Shim feature: added the ability (csv output files) to flush the file buffer after every record written (useful for when you are developing/testing your driver).
  • Shim feature: when receiving a modify event on the subscriber channel, the shim will query back for all missing attribute values in order to be able to write a complete record (no need for a stylesheet to query for missing attributes and keeping this stylesheet in sync with the schema).
  • Shim bug/feature: the subscriber channel now fully support add, modify and instance events. Instance and add events are assumed to contain all data and do not perform a query back. Only the modify event performs a query back

Installation

The attached zip file (GenFileDriver_0_5.zip) contains 2 jar files. One is the package, one is the shim.
Shim: GenFileDriverShim_0.5.jar
Copy the shim to you eDirectory server (DirXML's classes folder). If you want to use XLS support, also download poi from Apache. Restart eDirectory after this.
Note: if you have an older version of the shim, be sure to delete that jar.
Package: SVCGENFILEB_0.0.4.jar
Import this package into your designer project. Drag and drop the "Delimited Text" driver that is located under "Tools" and select the "Generic File Base" package, answering all the questions as needed.
From this point on, you can use and modify it as any other driver.

Policies

This driver only has 3 policies; all of them on the publisher channel. If required, you could add the password policies as available from the standard text driver (by creating your own copy from Novell's package and adding this to the driver).
SVCGENFILEB-pub-mp
Match on Internet Email Address if any available.
SVCGENFILEB-pub-cp
Checks for mandatory attributes:
Surname: required due to eDir constraints
Internet Email Address: required due to use in matching policy
SVCGENFILEB-pub-pp
Placement based on a driverset GCV (idv.dit.data.users).

AttachmentSize
genericfiledriver_0_5.zip246.22 KB



User Comments

joakim_ganse's picture

Driver config

Submitted by joakim_ganse on 20 February 2012 - 2:46am.

Hi,

The wizard did not create the driver config properly for me.
Had to copy and paste one from your previous version.

scauwe's picture

Issue fixed

Submitted by scauwe on 9 May 2012 - 3:57am.

Issue is fixed in version 0.4

al_b's picture

Question about access to metadata fields (fileName, fileSize...)

Submitted by al_b on 20 January 2013 - 11:41am.

Hi,
Could you advice please, how I can receive access to file metadata?

I added in Publisher option elements of metadata:

<definition display-name="List of meta data elements that should be added:" name="pub_metaData" type="string">
<description>Publisher: List of meta data elements that should be added(recordNumber,isLastRecord,filePath,fileName,fileSize). The schema as given in the driver parameter 'schema' will be extended with all meta data elements listed. Separate each item with a comma.</description>
<value xml:space="preserve">recordNumber,isLastRecord,fileName,fileSize</value>
</definition>

but I can't see in a trace, that any of this elements available for me. :(
I found ugly way to get access to recordNumber information via init-params, but I believe, that you foreseen more elegant and simple way.

00:06:03 914 Drvrs: </add>
<init-params>
<publisher-state filePath="c:\work\2013.01.20_00.06.03\dts.csv" fileReader="info.vancauwenberge.filedriver.filereader.csv.CSVFileReader" recordNumber="1"/>
</init-params>
</input>
</nds>

I tried to use version 0.4 (GenFileDriverShim_0.4.jar, SVCGENFILEB_0.0.4.jar), and may be some bug (or misunderstanding) prevent me from see this info.

Thank you for your help,
Alex

scauwe's picture

Fixed in version 0.5

Submitted by scauwe on 31 January 2013 - 6:58am.

Fixed in version 0.5

joakim_ganse's picture

Windows Remote Loader

Submitted by joakim_ganse on 21 February 2013 - 2:01am.

Hi,

This is a truly brilliant driver :) Starting to replace all text drivers with this one.
One thing I have noticed is that when using it with a Remote Loader on Winows I can not brows for the class.
What I did was to choose a diffrent class and then edit the txt file.
This is not enough though, I got a java Lang error.
So I discovered I had to edit the registry as well, and pase in the classname there to.
After that I could edit the config the normal way, had to put in the passwords again.

The classname is info.vancauwenberge.filedriver.shim.driver.GenericFileDriverShim

Cheers

scauwe's picture

Re: Windows Remote Loader

Submitted by scauwe on 18 June 2013 - 7:03am.

Anyone knows how to extend the drop-down box on the windows remote loader screen? If so, please do let me know...

© 2013 Novell