Sending device id when calling /formList and /formXml

Hi All

I would like my server to display a different formList and formXml depending
on the client that connects to my server. E.g. I have different forms for
different countries and would like to provide customised forms for each
country. Looking at the code, it looks like all requests are GET. Would it
be a bad idea to add the device id to the querystring?

Adi

That's a lot of custom code for not much benefit. You can certainly do it,
but is it worth it?

An alternative is to deploy one ODK Aggregate appspot instance for each
country and to configure the phones to point to the appropriate instance
based upon the country in which they will be operating. You can also do
this with a Tomcat deployment by using different database names and renaming
the .war file. E.g., rename ODKAggregate.war to "CanadaAggregate.war" and
run a new install, specifying a different database name, to create another
ODKAggregate.war that you rename "USAggregate.war" then have the Canadian
phones point to http://.../CanadaAggregate and the US phones point to
http://.../USAggregate (because the war files have different names, these
can coexist and run on the same Tomcat server; because they store their data
in different databases, your data can coexist on the same MySQL or
PostgreSQL server).

A second alternative is to put conditional logic in the form where the user
can select the country in which they are operating and then see only the
branches of the form appropriate for that country. However, this can
quickly bloat the form if you have very little overlap across the
countries. If different languages are spoken in the two countries, you can
use itext features in the form to support a single common form definition.
Unfortunately, this does not extend to the form name.

Also, note that storing collected data out-of-country can rapidly bump up
against data privacy laws.

Mitch

··· On Tue, Oct 4, 2011 at 10:15 AM, Adi Eyal wrote:

Hi All

I would like my server to display a different formList and formXml
depending on the client that connects to my server. E.g. I have different
forms for different countries and would like to provide customised forms for
each country. Looking at the code, it looks like all requests are GET. Would
it be a bad idea to add the device id to the querystring?

Adi

--
Mitch Sundt
Software Engineer

University of Washington
mitchellsundt@gmail.com

Thanks Mitch

Thanks for the suggestions. In my case I think that the easiest would
be to run multiple instances or even customise the urls on a per-
country basis.

I don't think I was clear in my question though. I'm actually using a
custom Aggregate-like server that I built in Django (once I'm happy
that the code is generic enough, I'll release as open source) as I
needed very little of what the official ODK Aggregate provided.
Customising the backend is not what concerns me. What I'm worried
about is that if I customise ODK Collect to send through a device id
on the querystring, that I would somehow be breaking the OpenRosa
protocol. It probably wouldn't matter to me as I can easily change the
server code but I may want to go back to Aggregate in the future and I
don't want to realise that I broke the client.

Adi

··· On Oct 4, 8:13 pm, Mitch Sundt wrote: > That's a lot of custom code for not much benefit. You can certainly do it, > but is it worth it? > > An alternative is to deploy one ODK Aggregate appspot instance for each > country and to configure the phones to point to the appropriate instance > based upon the country in which they will be operating. You can also do > this with a Tomcat deployment by using different database names and renaming > the .war file. E.g., rename ODKAggregate.war to "CanadaAggregate.war" and > run a new install, specifying a different database name, to create another > ODKAggregate.war that you rename "USAggregate.war" then have the Canadian > phones point tohttp://.../CanadaAggregateand the US phones point tohttp://.../USAggregate(because the war files have different names, these > can coexist and run on the same Tomcat server; because they store their data > in different databases, your data can coexist on the same MySQL or > PostgreSQL server). > > A second alternative is to put conditional logic in the form where the user > can select the country in which they are operating and then see only the > branches of the form appropriate for that country. However, this can > quickly bloat the form if you have very little overlap across the > countries. If different languages are spoken in the two countries, you can > use itext features in the form to support a single common form definition. > Unfortunately, this does not extend to the form name. > > Also, note that storing collected data out-of-country can rapidly bump up > against data privacy laws. > > Mitch > > On Tue, Oct 4, 2011 at 10:15 AM, Adi Eyal wrote: > > Hi All > > > I would like my server to display a different formList and formXml > > depending on the client that connects to my server. E.g. I have different > > forms for different countries and would like to provide customised forms for > > each country. Looking at the code, it looks like all requests are GET. Would > > it be a bad idea to add the device id to the querystring? > > > Adi > > -- > Mitch Sundt > Software Engineerhttp://www.OpenDataKit.org > University of Washington > mitchellsu...@gmail.com

The latest OpenRosa iteration of the FormList specification has the deviceID
being passed as a query parameter.

Note that a deviceID is implementation-specific. The OpenRosa standard
dictates that whatever is passed up to the server on the formList request be
exactly the same string as would populate the OpenRosa metadata block.

Since JavaRosa doesn't yet silently auto-populate the deviceID tag in the
metadata block with the IMEI, ODK Collect doesn't send it up to the server.

Mitch

··· On Tue, Oct 4, 2011 at 9:44 PM, Adi Eyal wrote:

Thanks Mitch

Thanks for the suggestions. In my case I think that the easiest would
be to run multiple instances or even customise the urls on a per-
country basis.

I don't think I was clear in my question though. I'm actually using a
custom Aggregate-like server that I built in Django (once I'm happy
that the code is generic enough, I'll release as open source) as I
needed very little of what the official ODK Aggregate provided.
Customising the backend is not what concerns me. What I'm worried
about is that if I customise ODK Collect to send through a device id
on the querystring, that I would somehow be breaking the OpenRosa
protocol. It probably wouldn't matter to me as I can easily change the
server code but I may want to go back to Aggregate in the future and I
don't want to realise that I broke the client.

Adi

On Oct 4, 8:13 pm, Mitch Sundt msu...@cs.washington.edu wrote:

That's a lot of custom code for not much benefit. You can certainly do
it,
but is it worth it?

An alternative is to deploy one ODK Aggregate appspot instance for each
country and to configure the phones to point to the appropriate instance
based upon the country in which they will be operating. You can also do
this with a Tomcat deployment by using different database names and
renaming
the .war file. E.g., rename ODKAggregate.war to "CanadaAggregate.war" and
run a new install, specifying a different database name, to create
another
ODKAggregate.war that you rename "USAggregate.war" then have the
Canadian
phones point tohttp://.../CanadaAggregateand the US phones point
tohttp://.../USAggregate(because the war files have different names, these
can coexist and run on the same Tomcat server; because they store their
data
in different databases, your data can coexist on the same MySQL or
PostgreSQL server).

A second alternative is to put conditional logic in the form where the
user
can select the country in which they are operating and then see only the
branches of the form appropriate for that country. However, this can
quickly bloat the form if you have very little overlap across the
countries. If different languages are spoken in the two countries, you
can
use itext features in the form to support a single common form
definition.
Unfortunately, this does not extend to the form name.

Also, note that storing collected data out-of-country can rapidly bump up
against data privacy laws.

Mitch

On Tue, Oct 4, 2011 at 10:15 AM, Adi Eyal a...@burgercom.co.za wrote:

Hi All

I would like my server to display a different formList and formXml
depending on the client that connects to my server. E.g. I have
different
forms for different countries and would like to provide customised
forms for
each country. Looking at the code, it looks like all requests are GET.
Would
it be a bad idea to add the device id to the querystring?

Adi

--
Mitch Sundt
Software Engineerhttp://www.OpenDataKit.org
University of Washington
mitchellsu...@gmail.com

--
Mitch Sundt
Software Engineer
http://www.OpenDataKit.org
University of Washington
mitchellsundt@gmail.com