metafacture/metafacture-core

Log a hint if handle-generic-xml doesn't find a record so that the user knows to configure "recordtagname"

Opened this issue · 4 comments

dr0i commented

Working on a LIDO document an unconfigured handle-generic-xml flux command doesn't yield anything.
This could somehow be configured to be logged ? -The user should be hinted to configure (recordtagname="lido").
(problem surfaced in the SWIB23 Metafacture workshop)

dr0i commented

Thinking about this, some thoughts surfaced:

  1. If there would be logs they wouldn't be helpful for e.g. playground. One would have to throw an Exception (playground can display that) but it would be disputable to throw an exception only because (one) record in the stream didn't yield any data
  2. So it may be better to improve the documentation, i.e. the flux-commands.md , to point out the importance of the recordtagname, possibly noting the lido example
  3. we also could provide Handlers of their own, like the CGXmlHandler, i.e. a LidoXmlHandler
  4. we could implement LidoXmlHandler just wrapping GenericXmlHandler and setting the proper recordtagname as a convenient shortcut (no need to set a parameter when using GenericXmlHandler instead)
  5. the playground could evaluate the flux and, by finding the usage of handle-generic-xml, printing a note in the Result window, like "If you see this text here after clicking process obviously the result was empty. As you use handle-generic-xml this may be caused by a wrong recordtagname . The default one is record, which couldn't be found in the data. Have a look at the flux-commands.md". Something like this.

WDYT @blackwinter @TobiasNx @fsteeg @maipet ?

I like the generic approach (2) by giving more examples ([onix](url), lido, maybe some more). And would like to see later (5) as a more dynamic help.

Your suggestion 2: Sound good to me! +1

Option 2) is certainly the least intrusive 👍

+1 for 2)