Comparing xml form versions in Aggregate using compareXml method

The method compareXml in
opendatakit.aggregate/src/main/java/org/opendatakit/aggregate/parser/FormParserForJavaRosa.java
checks for whether incomingParser.rootElementDefn.versionString is null to
determine if the incoming xml form has a similar version to the already
existing xml form but containing different text. Could someone please
explain to me why this is done.

If you are updating a form, you must use a larger version string on the
newer form. This is to prevent people from inadvertently uploading an
older form. If you need to fall back to an earlier form version, you must
take that XLS (or XML) file, manually edit it to give it a bigger version
string, and then upload the resulting XML file to aggregate to revert to
that earlier form version.

Thus, if the form you are trying to upload has a missing version string, it
is clearly NOT an allowable update to the form definition.

Hence the test.

Note that we also allow you to 'update' a form that would string-compare
identical to the existing form (whether or not version == null) without
penalty. That functionality is present to enable you to upload media
attachments over the course of several minutes.

Mitch

··· On Tue, Jan 28, 2014 at 6:19 AM, Jason Rogena wrote:

The method compareXml in opendatakit.aggregate/src/
main/java/org/opendatakit/aggregate/parser/FormParserForJavaRosa.java
checks for whether incomingParser.rootElementDefn.versionString is null
to determine if the incoming xml form has a similar version to the already
existing xml form but containing different text. Could someone please
explain to me why this is done.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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

Thanks Mitch. When I make my xml forms I never specify the form version.
What I specify is the id attribute for the first <instance tag. Is the id
of this instance what is the value of
incomingParser.rootElementDefn.versionString? It's weard that
incomingParser.rootElementDefn.versionString returns null if the two xml
files don't string match but have the same id attribute in the instance
tag.

··· On Tue, Jan 28, 2014 at 10:12 PM, Mitch Sundt wrote:

If you are updating a form, you must use a larger version string on the
newer form. This is to prevent people from inadvertently uploading an
older form. If you need to fall back to an earlier form version, you must
take that XLS (or XML) file, manually edit it to give it a bigger version
string, and then upload the resulting XML file to aggregate to revert to
that earlier form version.

Thus, if the form you are trying to upload has a missing version string,
it is clearly NOT an allowable update to the form definition.

Hence the test.

Note that we also allow you to 'update' a form that would string-compare
identical to the existing form (whether or not version == null) without
penalty. That functionality is present to enable you to upload media
attachments over the course of several minutes.

Mitch

On Tue, Jan 28, 2014 at 6:19 AM, Jason Rogena jasonrogena@gmail.comwrote:

The method compareXml in opendatakit.aggregate/src/
main/java/org/opendatakit/aggregate/parser/FormParserForJavaRosa.java
checks for whether incomingParser.rootElementDefn.versionString is null
to determine if the incoming xml form has a similar version to the already
existing xml form but containing different text. Could someone please
explain to me why this is done.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

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

--
You received this message because you are subscribed to a topic in the
Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/Z2x1C9bkEwo/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

form_id -- the 'id' attribute on the top-level instance node -- defines
the database table that will receive the contents of the submission.

version -- the 'version' attribute on the top-level instance node --
defines the XML file version for tracking textual changes to the form
(e.g., typo corrections, etc.).

These are what are stored in the rootElementDefn structure.

Mitch

··· On Tue, Jan 28, 2014 at 10:31 PM, jasonrogena@gmail.com < jasonrogena@gmail.com> wrote:

Thanks Mitch. When I make my xml forms I never specify the form version.
What I specify is the id attribute for the first <instance tag. Is the id
of this instance what is the value of
incomingParser.rootElementDefn.versionString? It's weard that
incomingParser.rootElementDefn.versionString returns null if the two xml
files don't string match but have the same id attribute in the instance
tag.

On Tue, Jan 28, 2014 at 10:12 PM, Mitch Sundt mitchellsundt@gmail.comwrote:

If you are updating a form, you must use a larger version string on the
newer form. This is to prevent people from inadvertently uploading an
older form. If you need to fall back to an earlier form version, you must
take that XLS (or XML) file, manually edit it to give it a bigger version
string, and then upload the resulting XML file to aggregate to revert to
that earlier form version.

Thus, if the form you are trying to upload has a missing version string,
it is clearly NOT an allowable update to the form definition.

Hence the test.

Note that we also allow you to 'update' a form that would string-compare
identical to the existing form (whether or not version == null) without
penalty. That functionality is present to enable you to upload media
attachments over the course of several minutes.

Mitch

On Tue, Jan 28, 2014 at 6:19 AM, Jason Rogena jasonrogena@gmail.comwrote:

The method compareXml in opendatakit.aggregate/src/
main/java/org/opendatakit/aggregate/parser/FormParserForJavaRosa.java
checks for whether incomingParser.rootElementDefn.versionString is null
to determine if the incoming xml form has a similar version to the already
existing xml form but containing different text. Could someone please
explain to me why this is done.

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

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

--
You received this message because you are subscribed to a topic in the
Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/Z2x1C9bkEwo/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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