How to customize ODK Aggregate locally

Hello all!

I was doing a project with ODKCollect. I have tried to customize it so
that in addition to the form instance, other xml files will be sent to
the server. In this case I also want to use ODK aggregate. But to
handle the new XML file and other features in the server-side, I think
customizing the ODK aggregate accordingly is also required.

Can you tell me any information about how I can proceed.

Thanks in advance

andu

Andu,

The code lives at
http://code.google.com/p/opendatakit/source/browse?repo=aggregate

http://code.google.com/p/opendatakit/wiki/AggregateEclipseProjectSetup
walks you through the setup of Eclipse for Aggregate

http://code.google.com/p/opendatakit/w/list?can=2&q=Aggregate has lots
of information about Aggregate

Send any developer questions to opendatakit-developers@googlegroups.com

Yaw

··· On Mon, Jan 30, 2012 at 07:12, andu wrote: > Hello all! > > I was doing a project with ODKCollect. I have tried to customize it so > that in addition to the form instance, other xml files will be sent to > the server. In this case I also want to use ODK aggregate. But to > handle the new XML file and other features in the server-side, I think > customizing the ODK aggregate accordingly is also required. > > Can you tell me any information about how I can proceed. > > Thanks in advance > > andu > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en

First, you would need to be using ODK Aggregate 1.0, as Aggregate 0.9.x and
Collect would need some modifications to enable sending XML attachments to
0.9.x. I assume you are using Aggregate 1.0.

The easiest way to add additional attachments is to leverage the power of
Xforms. You don't need to modify Aggregate to do so.

(1) copy the attachments into the filled-out-form's instance directory.
(2) define binary fields in your Xform that reference the names of the
additional xml files.
These could potentially be read-only fields with fixed filenames if the
attachment-copying process can use a standard fixed naming for the files
(i.e., there are a fixed number of files to upload). Or, if there are
varying numbers of attachments, you need to modify ODK Collect to add
groups to a repeat group containing a binary field specifying each
attachment filename.

The soon-to-be-announced encrypted-submissions capability does just this --
it defines a form structure used by ODK Collect and ODK Aggregate when
one-way encrypting and then transmitting an encrypted form to Aggregate:

http://code.google.com/p/opendatakit/source/browse/src/main/java/org/opendatakit/aggregate/parser/FormParserForJavaRosa.java?repo=aggregate&name=v1_0#87

This Xform wraps an encrypted submission on aggregate without knowing the
details of the form structure itself (how many attachments there are,
etc.). ODK Collect dynamically writes the XML for this wrapping Xform.
This is actually a good example as it contains a fixed naming for the
underlying encrypted Xform data (submission.xml.enc) and variable naming,
using a repeat group, for the attachments associated with that filled-out
XForm (filename.jpg.enc)). This particular
XForm is constructed outside of the underlying JavaRosa engine. You might
want to leverage that engine to attach these additional files during the
gathering of the data. If you just want to post-process the form adding
the additional attachments, the relevant construction for the encrypted
Xform is here:

http://code.google.com/p/opendatakit/source/browse/src/org/odk/collect/android/utilities/EncryptionUtils.java?repo=collect#585

Mitch

··· On Mon, Jan 30, 2012 at 8:00 AM, Yaw Anokwa wrote:

Andu,

The code lives at
http://code.google.com/p/opendatakit/source/browse?repo=aggregate

http://code.google.com/p/opendatakit/wiki/AggregateEclipseProjectSetup
walks you through the setup of Eclipse for Aggregate

http://code.google.com/p/opendatakit/w/list?can=2&q=Aggregate has lots
of information about Aggregate

Send any developer questions to opendatakit-developers@googlegroups.com

Yaw

On Mon, Jan 30, 2012 at 07:12, andu alemfree@yahoo.com wrote:

Hello all!

I was doing a project with ODKCollect. I have tried to customize it so
that in addition to the form instance, other xml files will be sent to
the server. In this case I also want to use ODK aggregate. But to
handle the new XML file and other features in the server-side, I think
customizing the ODK aggregate accordingly is also required.

Can you tell me any information about how I can proceed.

Thanks in advance

andu

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Dear Yaw Anokwa & Mitch S,

Thank you very much for your helpful information. It will help me a
lot.

With Regards,
andu

··· On Jan 30, 7:01 pm, Mitch S wrote: > First, you would need to be using ODK Aggregate 1.0, as Aggregate 0.9.x and > Collect would need some modifications to enable sending XML attachments to > 0.9.x. I assume you are using Aggregate 1.0. > > The easiest way to add additional attachments is to leverage the power of > Xforms. You don't need to modify Aggregate to do so. > > (1) copy the attachments into the filled-out-form's instance directory. > (2) define binary fields in your Xform that reference the names of the > additional xml files. > These could potentially be read-only fields with fixed filenames if the > attachment-copying process can use a standard fixed naming for the files > (i.e., there are a fixed number of files to upload). Or, if there are > varying numbers of attachments, you need to modify ODK Collect to add > groups to a repeat group containing a binary field specifying each > attachment filename. > > The soon-to-be-announced encrypted-submissions capability does just this -- > it defines a form structure used by ODK Collect and ODK Aggregate when > one-way encrypting and then transmitting an encrypted form to Aggregate: > > http://code.google.com/p/opendatakit/source/browse/src/main/java/org/... > > This Xform wraps an encrypted submission on aggregate without knowing the > details of the form structure itself (how many attachments there are, > etc.). ODK Collect dynamically writes the XML for this wrapping Xform. > This is actually a good example as it contains a fixed naming for the > underlying encrypted Xform data (submission.xml.enc) and variable naming, > using a repeat group, for the attachments associated with that filled-out > XForm (filename.jpg.enc)). This particular > XForm is constructed outside of the underlying JavaRosa engine. You might > want to leverage that engine to attach these additional files during the > gathering of the data. If you just want to post-process the form adding > the additional attachments, the relevant construction for the encrypted > Xform is here: > > http://code.google.com/p/opendatakit/source/browse/src/org/odk/collec... > > Mitch > > > > > > > > > > On Mon, Jan 30, 2012 at 8:00 AM, Yaw Anokwa wrote: > > Andu, > > > The code lives at > >http://code.google.com/p/opendatakit/source/browse?repo=aggregate > > >http://code.google.com/p/opendatakit/wiki/AggregateEclipseProjectSetup > > walks you through the setup of Eclipse for Aggregate > > >http://code.google.com/p/opendatakit/w/list?can=2&q=Aggregatehas lots > > of information about Aggregate > > > Send any developer questions to opendatakit-developers@googlegroups.com > > > Yaw > > > On Mon, Jan 30, 2012 at 07:12, andu wrote: > > > Hello all! > > > > I was doing a project with ODKCollect. I have tried to customize it so > > > that in addition to the form instance, other xml files will be sent to > > > the server. In this case I also want to use ODK aggregate. But to > > > handle the new XML file and other features in the server-side, I think > > > customizing the ODK aggregate accordingly is also required. > > > > Can you tell me any information about how I can proceed. > > > > Thanks in advance > > > > andu > > > > -- > > > Post: opendatakit@googlegroups.com > > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > > Options:http://groups.google.com/group/opendatakit?hl=en > > > -- > > Post: opendatakit@googlegroups.com > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > Options:http://groups.google.com/group/opendatakit?hl=en > > -- > Mitch Sundt > Software Engineer > University of Washington > mitchellsu...@gmail.com