Hoping to read a Configuration file in an XLATE

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Hoping to read a Configuration file in an XLATE

  • Creator
    Topic
  • #52904
    Dan Drury
    Participant

      I have the need to allow users to specify some configuration data that might change from deployment to deployment and I am hoping to keep everyone out of Cloverleaf.  My thought is to have a configuration.ini file in the root of the site that will contain a bunch of name value pairs that if we can use in the xlate.

      An example would be if we needed to set a specific MSH SEQ(5) depending on some data content so the configuration file would contain a vlaue pair of:

      MSH5=TextToBeWrittenToMSH5

      I have some tcl that I use to read a configuration file to determine file output format like filename and extension.  We use this if we need to create an output file with a name that contains data from the message.

      Any ideas on how to implement something like this via an xlate or is there another way to pick up user data during the xlate?

    Viewing 0 reply threads
    • Author
      Replies
      • #75850
        Jim Kosloskey
        Participant

          Dan,

          One way si to have the user maintain the 2 column data in a Db or spreadsheet, or ???

          Then once the user thinks the data is correct, export to a delimited file.

          Then using Fileset protocol pick up that file and run a Tcl proc (I have one called Table Builder) that converts the delimited file to a Cloverleaf Lookup Table.

          Then inside the Xlate use the builtin LOOKUP Action to find the appropriate keys as needed.

          Another option is if you have ODBC (either the Data Integrator addin or if Windows MS ODBC) use SQL (either via a Stored Procedure or SQL statements) to retrieve directly from the DB.

          Yet another option if you are Cloverleaf 5.8 is to investicate deploying SqLite to the problem.

          I don’t think you want to add file I/O overhead to your Xlate with opening/reading/closing the file yourself (although the ODBC overhead can be something to be concerned about if the target DB is badly implelemted).

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.