experiment with XML document as data store

Would it be possible to access an XML file from a Natural program? The XML file will be resident on the JBOSS server that serves the NJX application.

The experiment is storing user preferences in an XML file. When the user wants to specify a preference then the program reads the user preference XML file, parses the file for the user’s info and populates a screen with options. When the user has updates his/her preferences, the Natural program then stores the preferences as an XML file on the server.

Of course I could store the preferences in an ADABAS file, but I am curious to see if a different approach might work.

TIA.

Hi Demos,

In the current NJX-Versions you can use an AdapterListener. What you need to do:

  • Add an xcidatadef control “myxmlvalue” to you layout
  • Implement an AdapterListener and add it to your NATPAGE

In the AdapterListener implementation:

  • Do the reading and writing of the xml-file AdapterListener
  • Serialize the XML and apply the value to the “myxmlvalue” property
  • Access the “myxmlvalue” field in your Natural Adapter

For future NJX versions: We are currently working on support for transfering documents between Natural and the WebApplication.

Best Regards,
Christine