[Laszlo-dev] API for fetching plain text data
Henry Minsky
hminsky at laszlosystems.com
Tue Oct 28 20:42:47 PDT 2008
I was just looking at LPP-4450, which asks about a way to load plain text
data.
We've discussed from time to time in the past if we should make some API for
fetching plain text data at runtime from a URL, but never decided on
anything concrete. I'm not sure if there's pent up demand from developers
who want this
capability, but it seems like to have parity with other platforms, we ought
to support some way to do this.
The alternatives I'm thinking of are
1) Adding some optional flag to LzDataset to indicate that you want unparsed
XML, and then
look for the response text in the dataset.rawdata slot.
2) Tell people to use the LzHTTPDataProvider API
They would use create their own DataRequest objects and pass them to
httpdataprovider.doRequest(), and
set up a callback handler on the onstatus event of the datarequest.
3) Make the LzHTTPLoader API a supported public API
Probably best not to do this unless really necessary, it's so nice
having it private in the kernel now.
I know Tucker was a little skeptical of the first option, I think he said
that it would be cleaner to keep LzDataset as something that will only
consume legal XML.
Option 2) seems pretty straightforward, as it only involves instantiating a
DataRequest, filling in some fields, and
setting up a handler for the "onstatus" event. If we documented an example
someplace, maybe that would
be
In any event, for the proxied case, we'd need to add some capability in the
LPS server proxy protocol to indicate that the server should not attempt to
parse the XML as it proxies it; it currently parses and then re-emits the
XML as it passes through the server, mostly to
translate the character set into UTF-8, since the Java server has a larger
repertoire of character sets that it understands than the Flash client does.
It also does that to strip out the <?xml ..?> declaration, because those
cannot be nested.
--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20081029/db87eb20/attachment.html
More information about the Laszlo-dev
mailing list