ARDBC File System Plugin for AR System updated for AR 7.x

Version 1
    Share:|

    The plugin was only an example, but was really useful as it allowed you to expose files in directories on your AR Server.

    This meant you could easily expose log files via AR System Vendor forms. The plugin also allows you to delete files (as long as they are owned by the AR Server user). This then gives you the ability to schedule clean-up of log files. It's a plugin that can be really useful if you have interfaces that produce files (export files, logs, etc).


    This plugin unfortunately does not work with 6.x or 7.x APIs as there was a change in the function call headers.

    Using my rookie C skills and an embarassing amount of time, I've managed to figure out the couple of lines of code that needed to be changed to make this plugin usable.


    I only have the Solaris source code, but source code for other environments is still available on the BMC community downloads site.


    Only one of the files needs to be changed: ardbcfs.c


    I've included the updated file in the attached tar.


    If you need or want to make the change to ardbcfs.c yourself, this is what you need to do:

    ==================================================================================================

    - Info: API calls in 5 used to reference the entryid using the defined type: AREntryIdType. Basically a string that will hold a single Entry Id.

    As of version 6 (I think) the calls were changed to accept a list of entry ids using the type: AREntryIdList.

    What we need to do is change all the appropriate function definitions in ardbcfs to use AREntryIdList instead of AREntryIdType. We then need to extract the entry id as

    a string so that it can be passed to other utility functions that expect AREntryIdType.


    - So, basically whereever you see the following in an ARDBC function declaration in ardbcfs.c:

    AREntryIdType entryId, /* OUT; id of entry just created */

    You need to replace it with:

    AREntryIdList *entryId, /* OUT; id of entry just created */


    - Now we need to define an AREntryIdType variable to hold the entry id:

    AREntryIdType singleEntryId;


    - Finally, we need to update other function calls that were accepting the old "entryId" variable to accept the new "singleEntryId" variable, e.g.

    returnCode = FileCreateFromInfo(tableName, vendorFieldList,

    fieldValueList, entryId, status);

    becomes:

    returnCode = FileCreateFromInfo(tableName, vendorFieldList,

    fieldValueList, singleEntryId, status); ==================================================================================================

    To use the plugin you then:


    - Compile the files. On unix, edit the Makefile file to include your <install_path>/ar/bin directory. Then run make.

    It should compile &quot;ardbcfs.so&quot; (for solaris, check doco for other platform&#39;s extensions)


    - Copy the library file (e.g. ardbcfs.so) to your AR Server bin directory


    - Add an entry to your ar.conf file:

    Plugin: ardbcfs.so


    - Restart AR Server.


    Follow the instructions in FSARDBCPlugin for further instructions and platform specific info.



    I hope everyone finds this useful. If you have any questions about this, I&#39;ll do my best to answer them (but no guarantees).


    If anyone has already fixed this file, please, don&#39;t tell me about it.....


    Regards,


    __________________________________________________

    Joel Guttenberg

    Planwell Technology