JhulFramework / PHPServer4ODK

PHP Server for ODK Collect
MIT License
6 stars 3 forks source link

Fully implement OpenRosa Form Discovery API #1

Closed MartijnR closed 6 years ago

MartijnR commented 7 years ago

Nice project!

I didn't check the code, but it seems that the OpenRosa Form Discovery API is not implemented. I only see a very old version that Aggregate supports for backwards compatibility (if I remember correctly) of ancient versions of ODK Collect. In ODK Aggregate the correct version is shown if you supply the special 'X-OpenRosa-Version: 1.0' header.

Ancient: curl https://opendatakit.appspot.com/formList Correct: curl -H "X-OpenRosa-Version: 1.0" https://opendatakit.appspot.com/formList

I'd recommend doing the same as Ona and KoboToolbox and only implement the correct /formList, unless you need support for ancient ODK Collect versions, see e.g. https://kc.kobotoolbox.org/martijnr/formList. Note they show this listing even if the special header is not supplied - very helpful for data-collection-client developers such as myself.

Once this is implemented, I'd be happy to link your demo site with odk.enke.to, so you can view forms, and submit data, in the browser with Enketo. You'd just have to replace the demo forms with modern ones created with XLSForm/Pyxform (many of the ones currently hosted don't have the correct syntax, or have rather exotic syntax that is not supported (any longer) in Enketo).

MartijnR commented 7 years ago

In case this is helpful, here is a JavaScript implementation of /formList (and also of the XFormsManifest): https://github.com/enketo/centro/blob/master/app/controllers/formlist.js

JhulFramework commented 7 years ago

Yes, i'll do that , thank you

JhulFramework commented 7 years ago

implemented formListAPI can you please check. My test server is going to down in 2 months(webhosting is going to expire), so i dont know if you would like to add it. Do you know any free webhost, cant use google app engine , becuase i have not tried storing data there using PHP

MartijnR commented 7 years ago

Will do!

Don't know about free hosting for PHP with a database backend. I like DigitalOcean but that's $5/month at least.

MartijnR commented 7 years ago

Seems to work nicely! 👍 This is a form hosted on your server, run in Enketo: https://odk.enke.to/::YYYc.

I'll send you an email with the API key in case you want to play around with this.

To support forms with media (such as the "Birds" form) or external data files, you'd also have to implement the manifestUrl and publish the manifest.

MartijnR commented 7 years ago

Actually, I don't seem to have access to your email address. Just send me an email if you want this.

martijn @ enketo.org

JhulFramework commented 7 years ago

Thanks, It will be helpful for testing

Right now i have not implemented many features, which i plan to.

I have sent you a mail, here's my email id 1D3N717Y12 @ gmail.com