New Data Type

Hi, I'm trying to add a new data type to those Aggregate recognizes.
I want to be able to hand-craft a form in XML with a custom "type"
attribute. I then want ODK Collect to recognize this and start a
widget
corresponding to my new prompt type. However, I'm at a loss as to how
ODK Collect recognizes its existing supported types and starts the
appropriate
widget. Any assistance and/or clarification would be greatly
appreciated.

Thanks,
Andrew

can you describe what this data type is and will do?

··· On Sun, Nov 20, 2011 at 15:07, Andrew wrote: > Hi, I'm trying to add a new data type to those Aggregate recognizes. > I want to be able to hand-craft a form in XML with a custom "type" > attribute. I then want ODK Collect to recognize this and start a > widget > corresponding to my new prompt type. However, I'm at a loss as to how > ODK Collect recognizes its existing supported types and starts the > appropriate > widget. Any assistance and/or clarification would be greatly > appreciated. > > Thanks, > Andrew >

sure, I'm trying to incorporate a "gps_trace" data type that will
allow a user to measure
the area of a region. The information returned to Aggregate will be
the area of the region,
as well as the coordinates of the gps' trace. I haven't looked into
returning information to
Aggregate from Collect yet, but I do need to be able to upload a form
with a question of type "gps_trace"
to Aggregate and have Collect recognize this and start a new type of
widget I will create.

··· On Nov 20, 4:09 pm, Yaw Anokwa wrote: > can you describe what this data type is and will do? > > > > > > > > On Sun, Nov 20, 2011 at 15:07, Andrew wrote: > > Hi, I'm trying to add a new data type to those Aggregate recognizes. > > I want to be able to hand-craft a form in XML with a custom "type" > > attribute. I then want ODK Collect to recognize this and start a > > widget > > corresponding to my new prompt type. However, I'm at a loss as to how > > ODK Collect recognizes its existing supported types and starts the > > appropriate > > widget. Any assistance and/or clarification would be greatly > > appreciated. > > > Thanks, > > Andrew

changing data types in odk is challenging. those changes have to
happen in javarosa-core (especially if you want the data to be
strongly typed) and they will ripple through every part of the odk
pipeline.

the best place to start looking is at the geopoint data type in
javarosa-core and build your geotrace off that. once you have that
working, use odk collect (see widget factory code) to generate a new
widget with that type. you'll also have to make some changes in
aggregate to properly segment and display or export the geo data. for
example in geopoint, we split out lat/log/altitude/accuracy from each
geopoint.

··· On Sun, Nov 20, 2011 at 15:29, Andrew wrote: > sure, I'm trying to incorporate a "gps_trace" data type that will > allow a user to measure > the area of a region. The information returned to Aggregate will be > the area of the region, > as well as the coordinates of the gps' trace. I haven't looked into > returning information to > Aggregate from Collect yet, but I do need to be able to upload a form > with a question of type "gps_trace" > to Aggregate and have Collect recognize this and start a new type of > widget I will create. > > On Nov 20, 4:09 pm, Yaw Anokwa wrote: >> can you describe what this data type is and will do? >> >> >> >> >> >> >> >> On Sun, Nov 20, 2011 at 15:07, Andrew wrote: >> > Hi, I'm trying to add a new data type to those Aggregate recognizes. >> > I want to be able to hand-craft a form in XML with a custom "type" >> > attribute. I then want ODK Collect to recognize this and start a >> > widget >> > corresponding to my new prompt type. However, I'm at a loss as to how >> > ODK Collect recognizes its existing supported types and starts the >> > appropriate >> > widget. Any assistance and/or clarification would be greatly >> > appreciated. >> >> > Thanks, >> > Andrew >

Note that when you upload the form to Aggregate, it constructs the database
tables for the form. So you would need to think about how you want the
data stored on the server. I'd initially punt that.

I'd recommend first gaining clarity on what the data will look like that
ODK Collect would generate before tackling the server changes. I.e.,
perhaps this should be two different fields in the form -- a "geotrace"
type that is just the ordered list of geopoints from the trace and then
calculated field using a new computation function to determine an area
based upon a geotrace.

That would be most useful to other users, I think. And I think the ODK
team would be interested in folding that into the supported set of
datatypes.

Mitch

··· On Sun, Nov 20, 2011 at 10:54 PM, Yaw Anokwa wrote:

changing data types in odk is challenging. those changes have to
happen in javarosa-core (especially if you want the data to be
strongly typed) and they will ripple through every part of the odk
pipeline.

the best place to start looking is at the geopoint data type in
javarosa-core and build your geotrace off that. once you have that
working, use odk collect (see widget factory code) to generate a new
widget with that type. you'll also have to make some changes in
aggregate to properly segment and display or export the geo data. for
example in geopoint, we split out lat/log/altitude/accuracy from each
geopoint.

On Sun, Nov 20, 2011 at 15:29, Andrew aostiles@gmail.com wrote:

sure, I'm trying to incorporate a "gps_trace" data type that will
allow a user to measure
the area of a region. The information returned to Aggregate will be
the area of the region,
as well as the coordinates of the gps' trace. I haven't looked into
returning information to
Aggregate from Collect yet, but I do need to be able to upload a form
with a question of type "gps_trace"
to Aggregate and have Collect recognize this and start a new type of
widget I will create.

On Nov 20, 4:09 pm, Yaw Anokwa yano...@gmail.com wrote:

can you describe what this data type is and will do?

On Sun, Nov 20, 2011 at 15:07, Andrew aosti...@gmail.com wrote:

Hi, I'm trying to add a new data type to those Aggregate recognizes.
I want to be able to hand-craft a form in XML with a custom "type"
attribute. I then want ODK Collect to recognize this and start a
widget
corresponding to my new prompt type. However, I'm at a loss as to how
ODK Collect recognizes its existing supported types and starts the
appropriate
widget. Any assistance and/or clarification would be greatly
appreciated.

Thanks,
Andrew

--
Mitch Sundt
Software Engineer


University of Washington
mitchellsundt@gmail.com