Quoting Bradley Peters <[email protected]>:

There appears to be a bunch of repetition in there, but I don't
understand why. Is the structure of that payload outlined anywhere?

Bradley,

Your question sounds a lot like a question that I got answered in IRC yesterday.

The solution to my problem was to use the Fieldmapper.

Add the following lines to your Perl code near the top:

use OpenILS::Utils::Fieldmapper;
Fieldmapper->import("/openils/conf/fm_IDL.xml");

If you've installed Evergreen somewhere other than where the directions recommend, then you'll need to adjust the path in the import call above.

After doing the above any data returned from OpenSRF calls that use the Fieldmapper will be turned into objects that you can easily access from Perl. Use Data::Dumper before and after adding that code to see the difference that it makes.

In your subject, you say you are using the "gateway." If so, I'd assume you're writing your code in JavaScript. The above is easy to do from JavaScript as well. Dan Scott's workshop tutorial at

http://evergreen-ils.org/~denials/workshop.html

shows how to do this in the setion entitled "Accessing classes defined in the IDL via Fieldmapper." That subsection doesn't have a named anchor or I'd provide a URL directly to it.

Also worth reading is Dan's two part article at Code4Lib:

http://journal.code4lib.org/articles/3284
http://journal.code4lib.org/articles/3365

HtH,
Jason Stephenson
MVLC



Reply via email to