In-memory datasets

Hello, humans.

I have a question regarding something I am trying to do… I am trying to GET an XML document from a remote server (which I can do), and then attach that as if it was a datasource and edit it locally, and then POST the results.

I can GET and post files, but I seem to have difficulty attaching the results from the GET as if they were a dataset… in other words, I can do this:
form.setDataSource(hostmapDS);

In hostmapDS:
…define fields…
setID(id);
setRecordXPath(“//OTA”);
DataSourceTextField hostAddressField = new DataSourceTextField(
“hostAddress”, “hostAddress”, 128);
hostAddressField.setValueXPath(“../../@address”);
DataSourceTextField hostPortField = new DataSourceTextField(“hostPort”,
“hostPort”, 128);
hostPortField.setValueXPath(“../../@port”);
… etc…
setDataURL(“ds/test_data/hostmap.xml”);

But I want to do a GET and grab the resulting xml in a String s, and then say:
setDataURL(s);

Can I GET the data, tie my data to an in-memory source, edit it locally, and then POST the results?

Not sure which part(s) you’re missing, but take a look at DataSource.setClientOnly and look at the RPCManager if you want to do a single XML POST of a String you’ve put together.

Okay, how about some advice: what I have are XML files located on another server than my back-end server… so I need to send proxy requests to that server in order to get the data… I can do this but I am really unsure as to how to link the setDataURL(…) into the appropriate chain such that I can get the data out…

Do I need to use one of your servers to do it?

This is why I would like to link the setDataURL to a string which I get back after much machination…

There’s an HTTPProxy servlet in SmartGWT EE that is automatically used when necessary (URL is not the origin server). It’s completely transparent to the code using the DataSource.