Problem with importing data into XForm

I'm trying to import data from one XML (instanceXML-29.xml, which I'm
attaching) into the form that I've created (formXML-29.xml, also
attached) using ODK-Voice, it does this using the code below
(FormLoader.java lines 64-76). I'm trying to get to a form which
looks like formXML-29-withData.xml, which basically populates with
fields given_name, family_name, patient_id, and dia_de_cumpleanos (day
of birthday).
If I have odk-voice use formXML-29-withData.xml the call is made as it
should, however, if it uses the xform where it uses the code below,
the call is made as though the the value readonly="true()" in the bind
is missing for the value given_name.

I'm trying to figure out if the data is being imported correctly or
not, but I can't figure out a way to see the final xml created after
the import using FormHandler, so I was hoping to get help in

  1. is the formatting of the xmls that I'm attaching correct, or could
    that be the cause of the import error?
  2. how can I see the xml that is created after the import using FormHandler
  3. Any other ideas why this import might not be working.

I've talked with Adam Lerer about this and he suggested that I write
because this was getting into xforms and not so much ODK-Voice.

Thanks,

Joaquin

Code from ODK-Voice
if (instanceId != null) {
byte xml = dba.getInstanceXml(instanceId);
if (xml != null) {
log.warn("--- IMPORTING DATA FROM XML, FROM DATABASE FOR
INSTANCE ID: "+ instanceId);
fh.importData(xml);
}
}
} catch (SQLException e) {
log.error(e);
return null;
} finally {
dba.close();
}

InstanceXML-29.xml (3.39 KB)

formXML-29.xml (37.3 KB)

formXML-29-withData.xml (37.2 KB)

hi joaquin,

take a look at the formloadertask (around line 174) in the collect repo for an example of how we import instance data. you have to do all sorts of setup before you do the import. you might also have to update your core to the version we use in 1.1.7.

hope that helps,

yaw

··· On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote:

I'm trying to import data from one XML (instanceXML-29.xml, which I'm
attaching) into the form that I've created (formXML-29.xml, also
attached) using ODK-Voice, it does this using the code below
(FormLoader.java lines 64-76). I'm trying to get to a form which
looks like formXML-29-withData.xml, which basically populates with
fields given_name, family_name, patient_id, and dia_de_cumpleanos (day
of birthday).
If I have odk-voice use formXML-29-withData.xml the call is made as it
should, however, if it uses the xform where it uses the code below,
the call is made as though the the value readonly="true()" in the bind
is missing for the value given_name.

I'm trying to figure out if the data is being imported correctly or
not, but I can't figure out a way to see the final xml created after
the import using FormHandler, so I was hoping to get help in

  1. is the formatting of the xmls that I'm attaching correct, or could
    that be the cause of the import error?
  2. how can I see the xml that is created after the import using FormHandler
  3. Any other ideas why this import might not be working.

I've talked with Adam Lerer about this and he suggested that I write
because this was getting into xforms and not so much ODK-Voice.

Thanks,

Joaquin

Code from ODK-Voice
if (instanceId != null) {
byte xml = dba.getInstanceXml(instanceId);
if (xml != null) {
log.warn("--- IMPORTING DATA FROM XML, FROM DATABASE FOR
INSTANCE ID: "+ instanceId);
fh.importData(xml);
}
}
} catch (SQLException e) {
log.error(e);
return null;
} finally {
dba.close();
}

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
<InstanceXML-29.xml><formXML-29.xml><formXML-29-withData.xml>

Thanks Yaw, I'll take a look at that. Is there a function to ouput the full
xml after importing to see what's going on?

J

hi joaquin,

take a look at the formloadertask (around line 174) in the collect repo
for an example of how we import instance data. you have to do all sorts of
setup before you do the import. you might also have to update your core to
the version we use in 1.1.7.

hope that helps,

yaw

I'm trying to import data from one XML (instanceXML-29.xml, which I'm
attaching) into the form that I've created (formXML-29.xml, also
attached) using ODK-Voice, it does this using the code below
(FormLoader.java lines 64-76). I'm trying to get to a form which
looks like formXML-29-withData.xml, which basically populates with
fields given_name, family_name, patient_id, and dia_de_cumpleanos (day
of birthday).
If I have odk-voice use formXML-29-withData.xml the call is made as it
should, however, if it uses the xform where it uses the code below,
the call is made as though the the value readonly="true()" in the bind
is missing for the value given_name.

I'm trying to figure out if the data is being imported correctly or
not, but I can't figure out a way to see the final xml created after
the import using FormHandler, so I was hoping to get help in

  1. is the formatting of the xmls that I'm attaching correct, or could
    that be the cause of the import error?
  2. how can I see the xml that is created after the import using
    FormHandler
··· On Jun 7, 2011 9:04 AM, "Yaw Anokwa" wrote: > On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote: >> 3. Any other ideas why this import might not be working. >> >> I've talked with Adam Lerer about this and he suggested that I write >> because this was getting into xforms and not so much ODK-Voice. >> >> Thanks, >> >> Joaquin >> >> >> Code from ODK-Voice >> if (instanceId != null) { >> byte[] xml = dba.getInstanceXml(instanceId); >> if (xml != null) { >> log.warn("--- IMPORTING DATA FROM XML, FROM DATABASE FOR >> INSTANCE ID: "+ instanceId); >> fh.importData(xml); >> } >> } >> } catch (SQLException e) { >> log.error(e); >> return null; >> } finally { >> dba.close(); >> } >> >> -- >> 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

Thanks Yaw, and sorry, but I don't know what updating core to the
version in 1.1.7 means, could you expain it a bit more or point me to
somewhere where there's an explanation.

Joaquin

··· ___________________________________________________________________ Gerente de Desarrollo, eHealth Systems Research Fellow, Escuela de Medicina de Harvard Moderador, GHDOnline.org

On Tue, Jun 7, 2011 at 9:04 AM, Yaw Anokwa yanokwa@gmail.com wrote:

hi joaquin,

take a look at the formloadertask (around line 174) in the collect repo for an example of how we import instance data. you have to do all sorts of setup before you do the import. you might also have to update your core to the version we use in 1.1.7.

hope that helps,

yaw

On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote:

I'm trying to import data from one XML (instanceXML-29.xml, which I'm
attaching) into the form that I've created (formXML-29.xml, also
attached) using ODK-Voice, it does this using the code below
(FormLoader.java lines 64-76). I'm trying to get to a form which
looks like formXML-29-withData.xml, which basically populates with
fields given_name, family_name, patient_id, and dia_de_cumpleanos (day
of birthday).
If I have odk-voice use formXML-29-withData.xml the call is made as it
should, however, if it uses the xform where it uses the code below,
the call is made as though the the value readonly="true()" in the bind
is missing for the value given_name.

I'm trying to figure out if the data is being imported correctly or
not, but I can't figure out a way to see the final xml created after
the import using FormHandler, so I was hoping to get help in

  1. is the formatting of the xmls that I'm attaching correct, or could
    that be the cause of the import error?
  2. how can I see the xml that is created after the import using FormHandler
  3. Any other ideas why this import might not be working.

I've talked with Adam Lerer about this and he suggested that I write
because this was getting into xforms and not so much ODK-Voice.

Thanks,

Joaquin

Code from ODK-Voice
if (instanceId != null) {
byte xml = dba.getInstanceXml(instanceId);
if (xml != null) {
log.warn("--- IMPORTING DATA FROM XML, FROM DATABASE FOR
INSTANCE ID: "+ instanceId);
fh.importData(xml);
}
}
} catch (SQLException e) {
log.error(e);
return null;
} finally {
dba.close();
}

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
<InstanceXML-29.xml><formXML-29.xml><formXML-29-withData.xml>

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

I think you can only output the instance data...

Thanks Yaw, I'll take a look at that. Is there a function to ouput the
full

··· On Jun 7, 2011 4:35 PM, "Joaquín Blaya" wrote: > xml after importing to see what's going on? > > J > On Jun 7, 2011 9:04 AM, "Yaw Anokwa" wrote: >> hi joaquin, >> >> take a look at the formloadertask (around line 174) in the collect repo > for an example of how we import instance data. you have to do all sorts of > setup before you do the import. you might also have to update your core to > the version we use in 1.1.7. >> >> hope that helps, >> >> yaw >> >> >> >> On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote: >> >>> I'm trying to import data from one XML (instanceXML-29.xml, which I'm >>> attaching) into the form that I've created (formXML-29.xml, also >>> attached) using ODK-Voice, it does this using the code below >>> (FormLoader.java lines 64-76). I'm trying to get to a form which >>> looks like formXML-29-withData.xml, which basically populates with >>> fields given_name, family_name, patient_id, and dia_de_cumpleanos (day >>> of birthday). >>> If I have odk-voice use formXML-29-withData.xml the call is made as it >>> should, however, if it uses the xform where it uses the code below, >>> the call is made as though the the value readonly="true()" in the bind >>> is missing for the value given_name. >>> >>> I'm trying to figure out if the data is being imported correctly or >>> not, but I can't figure out a way to see the final xml created after >>> the import using FormHandler, so I was hoping to get help in >>> 1. is the formatting of the xmls that I'm attaching correct, or could >>> that be the cause of the import error? >>> 2. how can I see the xml that is created after the import using > FormHandler >>> 3. Any other ideas why this import might not be working. >>> >>> I've talked with Adam Lerer about this and he suggested that I write >>> because this was getting into xforms and not so much ODK-Voice. >>> >>> Thanks, >>> >>> Joaquin >>> >>> >>> Code from ODK-Voice >>> if (instanceId != null) { >>> byte[] xml = dba.getInstanceXml(instanceId); >>> if (xml != null) { >>> log.warn("--- IMPORTING DATA FROM XML, FROM DATABASE FOR >>> INSTANCE ID: "+ instanceId); >>> fh.importData(xml); >>> } >>> } >>> } catch (SQLException e) { >>> log.error(e); >>> return null; >>> } finally { >>> dba.close(); >>> } >>> >>> -- >>> 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 > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en

somewhere in the odk voice code, there is a javarosa.jar that has all the processing logic. replace it with the latest one from the odk collect repo and you'll have updated the core.

··· On Jun 7, 2011, at 6:15 PM, Joaquín Blaya wrote:

Thanks Yaw, and sorry, but I don't know what updating core to the
version in 1.1.7 means, could you expain it a bit more or point me to
somewhere where there's an explanation.

Joaquin


Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org

On Tue, Jun 7, 2011 at 9:04 AM, Yaw Anokwa yanokwa@gmail.com wrote:

hi joaquin,

take a look at the formloadertask (around line 174) in the collect repo for an example of how we import instance data. you have to do all sorts of setup before you do the import. you might also have to update your core to the version we use in 1.1.7.

hope that helps,

yaw

On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote:

I'm trying to import data from one XML (instanceXML-29.xml, which I'm
attaching) into the form that I've created (formXML-29.xml, also
attached) using ODK-Voice, it does this using the code below
(FormLoader.java lines 64-76). I'm trying to get to a form which
looks like formXML-29-withData.xml, which basically populates with
fields given_name, family_name, patient_id, and dia_de_cumpleanos (day
of birthday).
If I have odk-voice use formXML-29-withData.xml the call is made as it
should, however, if it uses the xform where it uses the code below,
the call is made as though the the value readonly="true()" in the bind
is missing for the value given_name.

I'm trying to figure out if the data is being imported correctly or
not, but I can't figure out a way to see the final xml created after
the import using FormHandler, so I was hoping to get help in

  1. is the formatting of the xmls that I'm attaching correct, or could
    that be the cause of the import error?
  2. how can I see the xml that is created after the import using FormHandler
  3. Any other ideas why this import might not be working.

I've talked with Adam Lerer about this and he suggested that I write
because this was getting into xforms and not so much ODK-Voice.

Thanks,

Joaquin

Code from ODK-Voice
if (instanceId != null) {
byte xml = dba.getInstanceXml(instanceId);
if (xml != null) {
log.warn("--- IMPORTING DATA FROM XML, FROM DATABASE FOR
INSTANCE ID: "+ instanceId);
fh.importData(xml);
}
}
} catch (SQLException e) {
log.error(e);
return null;
} finally {
dba.close();
}

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
<InstanceXML-29.xml><formXML-29.xml><formXML-29-withData.xml>

--
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

It's in war/WEB-INF/lib/javarosa-core.jar

··· On Wed, Jun 8, 2011 at 10:28 AM, Yaw Anokwa wrote:

somewhere in the odk voice code, there is a javarosa.jar that has all the
processing logic. replace it with the latest one from the odk collect repo
and you'll have updated the core.

On Jun 7, 2011, at 6:15 PM, Joaquín Blaya wrote:

Thanks Yaw, and sorry, but I don't know what updating core to the
version in 1.1.7 means, could you expain it a bit more or point me to
somewhere where there's an explanation.

Joaquin


Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org

On Tue, Jun 7, 2011 at 9:04 AM, Yaw Anokwa yanokwa@gmail.com wrote:

hi joaquin,

take a look at the formloadertask (around line 174) in the collect repo
for an example of how we import instance data. you have to do all sorts of
setup before you do the import. you might also have to update your core to
the version we use in 1.1.7.

hope that helps,

yaw

On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote:

I'm trying to import data from one XML (instanceXML-29.xml, which I'm
attaching) into the form that I've created (formXML-29.xml, also
attached) using ODK-Voice, it does this using the code below
(FormLoader.java lines 64-76). I'm trying to get to a form which
looks like formXML-29-withData.xml, which basically populates with
fields given_name, family_name, patient_id, and dia_de_cumpleanos (day
of birthday).
If I have odk-voice use formXML-29-withData.xml the call is made as it
should, however, if it uses the xform where it uses the code below,
the call is made as though the the value readonly="true()" in the bind
is missing for the value given_name.

I'm trying to figure out if the data is being imported correctly or
not, but I can't figure out a way to see the final xml created after
the import using FormHandler, so I was hoping to get help in

  1. is the formatting of the xmls that I'm attaching correct, or could
    that be the cause of the import error?
  2. how can I see the xml that is created after the import using
    FormHandler
  3. Any other ideas why this import might not be working.

I've talked with Adam Lerer about this and he suggested that I write
because this was getting into xforms and not so much ODK-Voice.

Thanks,

Joaquin

Code from ODK-Voice
if (instanceId != null) {
byte xml = dba.getInstanceXml(instanceId);
if (xml != null) {
log.warn("--- IMPORTING DATA FROM XML, FROM
DATABASE FOR
INSTANCE ID: "+ instanceId);
fh.importData(xml);
}
}
} catch (SQLException e) {
log.error(e);
return null;
} finally {
dba.close();
}

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
<InstanceXML-29.xml><formXML-29.xml><formXML-29-withData.xml>

--
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

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

Thanks, I had done that and gotten error messages that some of the
functions were not included in the newest libraries. Now, when I did
it again, I'm not getting those errors, so it might have been an
eclipse thing.

J

··· ___________________________________________________________________ Gerente de Desarrollo, eHealth Systems Research Fellow, Escuela de Medicina de Harvard Moderador, GHDOnline.org

On Wed, Jun 8, 2011 at 12:03 PM, Adam Lerer adam.lerer@gmail.com wrote:

It's in war/WEB-INF/lib/javarosa-core.jar

On Wed, Jun 8, 2011 at 10:28 AM, Yaw Anokwa yanokwa@gmail.com wrote:

somewhere in the odk voice code, there is a javarosa.jar that has all the
processing logic. replace it with the latest one from the odk collect repo
and you'll have updated the core.

On Jun 7, 2011, at 6:15 PM, Joaquín Blaya wrote:

Thanks Yaw, and sorry, but I don't know what updating core to the
version in 1.1.7 means, could you expain it a bit more or point me to
somewhere where there's an explanation.

Joaquin


Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org

On Tue, Jun 7, 2011 at 9:04 AM, Yaw Anokwa yanokwa@gmail.com wrote:

hi joaquin,

take a look at the formloadertask (around line 174) in the collect repo
for an example of how we import instance data. you have to do all sorts of
setup before you do the import. you might also have to update your core to
the version we use in 1.1.7.

hope that helps,

yaw

On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote:

I'm trying to import data from one XML (instanceXML-29.xml, which I'm
attaching) into the form that I've created (formXML-29.xml, also
attached) using ODK-Voice, it does this using the code below
(FormLoader.java lines 64-76). I'm trying to get to a form which
looks like formXML-29-withData.xml, which basically populates with
fields given_name, family_name, patient_id, and dia_de_cumpleanos (day
of birthday).
If I have odk-voice use formXML-29-withData.xml the call is made as it
should, however, if it uses the xform where it uses the code below,
the call is made as though the the value readonly="true()" in the bind
is missing for the value given_name.

I'm trying to figure out if the data is being imported correctly or
not, but I can't figure out a way to see the final xml created after
the import using FormHandler, so I was hoping to get help in

  1. is the formatting of the xmls that I'm attaching correct, or could
    that be the cause of the import error?
  2. how can I see the xml that is created after the import using
    FormHandler
  3. Any other ideas why this import might not be working.

I've talked with Adam Lerer about this and he suggested that I write
because this was getting into xforms and not so much ODK-Voice.

Thanks,

Joaquin

Code from ODK-Voice
if (instanceId != null) {
byte xml = dba.getInstanceXml(instanceId);
if (xml != null) {
log.warn("--- IMPORTING DATA FROM XML, FROM
DATABASE FOR
INSTANCE ID: "+ instanceId);
fh.importData(xml);
}
}
} catch (SQLException e) {
log.error(e);
return null;
} finally {
dba.close();
}

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
<InstanceXML-29.xml><formXML-29.xml><formXML-29-withData.xml>

--
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

--
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

I'm continuing to work on getting the importData funcion to work. One
question, can the instanceXML (that has the data being imported into
the formXML) only have the form part of the XML, like shown below, or
must it be identical to the formXML i.e. include the binds and
selects?

If someone has examples of an XML that they imported as well as the
referenceXML to which they imported to, it'd be great.

Joaquin

··· ___________________________________________________________________ Gerente de Desarrollo, eHealth Systems Research Fellow, Escuela de Medicina de Harvard Moderador, GHDOnline.org

On Wed, Jun 8, 2011 at 4:55 PM, Joaquín Blaya jblaya@ehealthsystems.cl wrote:

Thanks, I had done that and gotten error messages that some of the
functions were not included in the newest libraries. Now, when I did
it again, I'm not getting those errors, so it might have been an
eclipse thing.

J


Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org

On Wed, Jun 8, 2011 at 12:03 PM, Adam Lerer adam.lerer@gmail.com wrote:

It's in war/WEB-INF/lib/javarosa-core.jar

On Wed, Jun 8, 2011 at 10:28 AM, Yaw Anokwa yanokwa@gmail.com wrote:

somewhere in the odk voice code, there is a javarosa.jar that has all the
processing logic. replace it with the latest one from the odk collect repo
and you'll have updated the core.

On Jun 7, 2011, at 6:15 PM, Joaquín Blaya wrote:

Thanks Yaw, and sorry, but I don't know what updating core to the
version in 1.1.7 means, could you expain it a bit more or point me to
somewhere where there's an explanation.

Joaquin


Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org

On Tue, Jun 7, 2011 at 9:04 AM, Yaw Anokwa yanokwa@gmail.com wrote:

hi joaquin,

take a look at the formloadertask (around line 174) in the collect repo
for an example of how we import instance data. you have to do all sorts of
setup before you do the import. you might also have to update your core to
the version we use in 1.1.7.

hope that helps,

yaw

On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote:

I'm trying to import data from one XML (instanceXML-29.xml, which I'm
attaching) into the form that I've created (formXML-29.xml, also
attached) using ODK-Voice, it does this using the code below
(FormLoader.java lines 64-76). I'm trying to get to a form which
looks like formXML-29-withData.xml, which basically populates with
fields given_name, family_name, patient_id, and dia_de_cumpleanos (day
of birthday).
If I have odk-voice use formXML-29-withData.xml the call is made as it
should, however, if it uses the xform where it uses the code below,
the call is made as though the the value readonly="true()" in the bind
is missing for the value given_name.

I'm trying to figure out if the data is being imported correctly or
not, but I can't figure out a way to see the final xml created after
the import using FormHandler, so I was hoping to get help in

  1. is the formatting of the xmls that I'm attaching correct, or could
    that be the cause of the import error?
  2. how can I see the xml that is created after the import using
    FormHandler
  3. Any other ideas why this import might not be working.

I've talked with Adam Lerer about this and he suggested that I write
because this was getting into xforms and not so much ODK-Voice.

Thanks,

Joaquin

Code from ODK-Voice
if (instanceId != null) {
byte xml = dba.getInstanceXml(instanceId);
if (xml != null) {
log.warn("--- IMPORTING DATA FROM XML, FROM
DATABASE FOR
INSTANCE ID: "+ instanceId);
fh.importData(xml);
}
}
} catch (SQLException e) {
log.error(e);
return null;
} finally {
dba.close();
}

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
<InstanceXML-29.xml><formXML-29.xml><formXML-29-withData.xml>

--
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

--
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

instances by definition should only the part of the form.

··· On Mon, Jun 13, 2011 at 21:45, Joaquín Blaya wrote: > I'm continuing to work on getting the importData funcion to work. One > question, can the instanceXML (that has the data being imported into > the formXML) only have the form part of the XML, like shown below, or > must it be identical to the formXML i.e. include the binds and > selects? > > If someone has examples of an XML that they imported as well as the > referenceXML to which they imported to, it'd be great. > > Joaquin > ___________________________________________________________________ > Gerente de Desarrollo, eHealth Systems > Research Fellow, Escuela de Medicina de Harvard > Moderador, GHDOnline.org > > > > > On Wed, Jun 8, 2011 at 4:55 PM, Joaquín Blaya wrote: >> Thanks, I had done that and gotten error messages that some of the >> functions were not included in the newest libraries. Now, when I did >> it again, I'm not getting those errors, so it might have been an >> eclipse thing. >> >> J >> ___________________________________________________________________ >> Gerente de Desarrollo, eHealth Systems >> Research Fellow, Escuela de Medicina de Harvard >> Moderador, GHDOnline.org >> >> >> >> >> On Wed, Jun 8, 2011 at 12:03 PM, Adam Lerer wrote: >>> It's in war/WEB-INF/lib/javarosa-core.jar >>> >>> On Wed, Jun 8, 2011 at 10:28 AM, Yaw Anokwa wrote: >>>> >>>> somewhere in the odk voice code, there is a javarosa.jar that has all the >>>> processing logic. replace it with the latest one from the odk collect repo >>>> and you'll have updated the core. >>>> >>>> On Jun 7, 2011, at 6:15 PM, Joaquín Blaya wrote: >>>> >>>> > Thanks Yaw, and sorry, but I don't know what updating core to the >>>> > version in 1.1.7 means, could you expain it a bit more or point me to >>>> > somewhere where there's an explanation. >>>> > >>>> > Joaquin >>>> > ___________________________________________________________________ >>>> > Gerente de Desarrollo, eHealth Systems >>>> > Research Fellow, Escuela de Medicina de Harvard >>>> > Moderador, GHDOnline.org >>>> > >>>> > >>>> > >>>> > >>>> > On Tue, Jun 7, 2011 at 9:04 AM, Yaw Anokwa wrote: >>>> >> hi joaquin, >>>> >> >>>> >> take a look at the formloadertask (around line 174) in the collect repo >>>> >> for an example of how we import instance data. you have to do all sorts of >>>> >> setup before you do the import. you might also have to update your core to >>>> >> the version we use in 1.1.7. >>>> >> >>>> >> hope that helps, >>>> >> >>>> >> yaw >>>> >> >>>> >> >>>> >> >>>> >> On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote: >>>> >> >>>> >>> I'm trying to import data from one XML (instanceXML-29.xml, which I'm >>>> >>> attaching) into the form that I've created (formXML-29.xml, also >>>> >>> attached) using ODK-Voice, it does this using the code below >>>> >>> (FormLoader.java lines 64-76). I'm trying to get to a form which >>>> >>> looks like formXML-29-withData.xml, which basically populates with >>>> >>> fields given_name, family_name, patient_id, and dia_de_cumpleanos (day >>>> >>> of birthday). >>>> >>> If I have odk-voice use formXML-29-withData.xml the call is made as it >>>> >>> should, however, if it uses the xform where it uses the code below, >>>> >>> the call is made as though the the value readonly="true()" in the bind >>>> >>> is missing for the value given_name. >>>> >>> >>>> >>> I'm trying to figure out if the data is being imported correctly or >>>> >>> not, but I can't figure out a way to see the final xml created after >>>> >>> the import using FormHandler, so I was hoping to get help in >>>> >>> 1. is the formatting of the xmls that I'm attaching correct, or could >>>> >>> that be the cause of the import error? >>>> >>> 2. how can I see the xml that is created after the import using >>>> >>> FormHandler >>>> >>> 3. Any other ideas why this import might not be working. >>>> >>> >>>> >>> I've talked with Adam Lerer about this and he suggested that I write >>>> >>> because this was getting into xforms and not so much ODK-Voice. >>>> >>> >>>> >>> Thanks, >>>> >>> >>>> >>> Joaquin >>>> >>> >>>> >>> >>>> >>> Code from ODK-Voice >>>> >>> if (instanceId != null) { >>>> >>> byte[] xml = dba.getInstanceXml(instanceId); >>>> >>> if (xml != null) { >>>> >>> log.warn("--- IMPORTING DATA FROM XML, FROM >>>> >>> DATABASE FOR >>>> >>> INSTANCE ID: "+ instanceId); >>>> >>> fh.importData(xml); >>>> >>> } >>>> >>> } >>>> >>> } catch (SQLException e) { >>>> >>> log.error(e); >>>> >>> return null; >>>> >>> } finally { >>>> >>> dba.close(); >>>> >>> } >>>> >>> >>>> >>> -- >>>> >>> 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 >>>> >> >>>> > >>>> > -- >>>> > 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 >>> >>> -- >>> 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 >

ok, should that include the instance tags within the xml?

··· ___________________________________________________________________ Gerente de Desarrollo, eHealth Systems Research Fellow, Escuela de Medicina de Harvard Moderador, GHDOnline.org

On Mon, Jun 13, 2011 at 3:14 PM, Yaw Anokwa yanokwa@gmail.com wrote:

instances by definition should only the part of the form.

On Mon, Jun 13, 2011 at 21:45, Joaquín Blaya jblaya@ehealthsystems.cl wrote:

I'm continuing to work on getting the importData funcion to work. One
question, can the instanceXML (that has the data being imported into
the formXML) only have the form part of the XML, like shown below, or
must it be identical to the formXML i.e. include the binds and
selects?

If someone has examples of an XML that they imported as well as the
referenceXML to which they imported to, it'd be great.

Joaquin


Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org

On Wed, Jun 8, 2011 at 4:55 PM, Joaquín Blaya jblaya@ehealthsystems.cl wrote:

Thanks, I had done that and gotten error messages that some of the
functions were not included in the newest libraries. Now, when I did
it again, I'm not getting those errors, so it might have been an
eclipse thing.

J


Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org

On Wed, Jun 8, 2011 at 12:03 PM, Adam Lerer adam.lerer@gmail.com wrote:

It's in war/WEB-INF/lib/javarosa-core.jar

On Wed, Jun 8, 2011 at 10:28 AM, Yaw Anokwa yanokwa@gmail.com wrote:

somewhere in the odk voice code, there is a javarosa.jar that has all the
processing logic. replace it with the latest one from the odk collect repo
and you'll have updated the core.

On Jun 7, 2011, at 6:15 PM, Joaquín Blaya wrote:

Thanks Yaw, and sorry, but I don't know what updating core to the
version in 1.1.7 means, could you expain it a bit more or point me to
somewhere where there's an explanation.

Joaquin


Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org

On Tue, Jun 7, 2011 at 9:04 AM, Yaw Anokwa yanokwa@gmail.com wrote:

hi joaquin,

take a look at the formloadertask (around line 174) in the collect repo
for an example of how we import instance data. you have to do all sorts of
setup before you do the import. you might also have to update your core to
the version we use in 1.1.7.

hope that helps,

yaw

On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote:

I'm trying to import data from one XML (instanceXML-29.xml, which I'm
attaching) into the form that I've created (formXML-29.xml, also
attached) using ODK-Voice, it does this using the code below
(FormLoader.java lines 64-76). I'm trying to get to a form which
looks like formXML-29-withData.xml, which basically populates with
fields given_name, family_name, patient_id, and dia_de_cumpleanos (day
of birthday).
If I have odk-voice use formXML-29-withData.xml the call is made as it
should, however, if it uses the xform where it uses the code below,
the call is made as though the the value readonly="true()" in the bind
is missing for the value given_name.

I'm trying to figure out if the data is being imported correctly or
not, but I can't figure out a way to see the final xml created after
the import using FormHandler, so I was hoping to get help in

  1. is the formatting of the xmls that I'm attaching correct, or could
    that be the cause of the import error?
  2. how can I see the xml that is created after the import using
    FormHandler
  3. Any other ideas why this import might not be working.

I've talked with Adam Lerer about this and he suggested that I write
because this was getting into xforms and not so much ODK-Voice.

Thanks,

Joaquin

Code from ODK-Voice
if (instanceId != null) {
byte xml = dba.getInstanceXml(instanceId);
if (xml != null) {
log.warn("--- IMPORTING DATA FROM XML, FROM
DATABASE FOR
INSTANCE ID: "+ instanceId);
fh.importData(xml);
}
}
} catch (SQLException e) {
log.error(e);
return null;
} finally {
dba.close();
}

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
<InstanceXML-29.xml><formXML-29.xml><formXML-29-withData.xml>

--
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

--
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

--
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

if you save an instance in collect, you can take a look at the xml on
the sdcard. for something like geotagger, it looks like

<?xml version="1.0"?> this is a instance with no image
··· On Mon, Jun 13, 2011 at 22:34, Joaquín Blaya wrote: > ok, should that include the instance tags within the xml? > ___________________________________________________________________ > Gerente de Desarrollo, eHealth Systems > Research Fellow, Escuela de Medicina de Harvard > Moderador, GHDOnline.org > > > > > On Mon, Jun 13, 2011 at 3:14 PM, Yaw Anokwa wrote: >> instances by definition should only the part of the form. >> >> On Mon, Jun 13, 2011 at 21:45, Joaquín Blaya wrote: >>> I'm continuing to work on getting the importData funcion to work. One >>> question, can the instanceXML (that has the data being imported into >>> the formXML) only have the form part of the XML, like shown below, or >>> must it be identical to the formXML i.e. include the binds and >>> selects? >>> >>> If someone has examples of an XML that they imported as well as the >>> referenceXML to which they imported to, it'd be great. >>> >>> Joaquin >>> ___________________________________________________________________ >>> Gerente de Desarrollo, eHealth Systems >>> Research Fellow, Escuela de Medicina de Harvard >>> Moderador, GHDOnline.org >>> >>> >>> >>> >>> On Wed, Jun 8, 2011 at 4:55 PM, Joaquín Blaya wrote: >>>> Thanks, I had done that and gotten error messages that some of the >>>> functions were not included in the newest libraries. Now, when I did >>>> it again, I'm not getting those errors, so it might have been an >>>> eclipse thing. >>>> >>>> J >>>> ___________________________________________________________________ >>>> Gerente de Desarrollo, eHealth Systems >>>> Research Fellow, Escuela de Medicina de Harvard >>>> Moderador, GHDOnline.org >>>> >>>> >>>> >>>> >>>> On Wed, Jun 8, 2011 at 12:03 PM, Adam Lerer wrote: >>>>> It's in war/WEB-INF/lib/javarosa-core.jar >>>>> >>>>> On Wed, Jun 8, 2011 at 10:28 AM, Yaw Anokwa wrote: >>>>>> >>>>>> somewhere in the odk voice code, there is a javarosa.jar that has all the >>>>>> processing logic. replace it with the latest one from the odk collect repo >>>>>> and you'll have updated the core. >>>>>> >>>>>> On Jun 7, 2011, at 6:15 PM, Joaquín Blaya wrote: >>>>>> >>>>>> > Thanks Yaw, and sorry, but I don't know what updating core to the >>>>>> > version in 1.1.7 means, could you expain it a bit more or point me to >>>>>> > somewhere where there's an explanation. >>>>>> > >>>>>> > Joaquin >>>>>> > ___________________________________________________________________ >>>>>> > Gerente de Desarrollo, eHealth Systems >>>>>> > Research Fellow, Escuela de Medicina de Harvard >>>>>> > Moderador, GHDOnline.org >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > On Tue, Jun 7, 2011 at 9:04 AM, Yaw Anokwa wrote: >>>>>> >> hi joaquin, >>>>>> >> >>>>>> >> take a look at the formloadertask (around line 174) in the collect repo >>>>>> >> for an example of how we import instance data. you have to do all sorts of >>>>>> >> setup before you do the import. you might also have to update your core to >>>>>> >> the version we use in 1.1.7. >>>>>> >> >>>>>> >> hope that helps, >>>>>> >> >>>>>> >> yaw >>>>>> >> >>>>>> >> >>>>>> >> >>>>>> >> On Jun 6, 2011, at 7:40 PM, Joaquín Blaya wrote: >>>>>> >> >>>>>> >>> I'm trying to import data from one XML (instanceXML-29.xml, which I'm >>>>>> >>> attaching) into the form that I've created (formXML-29.xml, also >>>>>> >>> attached) using ODK-Voice, it does this using the code below >>>>>> >>> (FormLoader.java lines 64-76). I'm trying to get to a form which >>>>>> >>> looks like formXML-29-withData.xml, which basically populates with >>>>>> >>> fields given_name, family_name, patient_id, and dia_de_cumpleanos (day >>>>>> >>> of birthday). >>>>>> >>> If I have odk-voice use formXML-29-withData.xml the call is made as it >>>>>> >>> should, however, if it uses the xform where it uses the code below, >>>>>> >>> the call is made as though the the value readonly="true()" in the bind >>>>>> >>> is missing for the value given_name. >>>>>> >>> >>>>>> >>> I'm trying to figure out if the data is being imported correctly or >>>>>> >>> not, but I can't figure out a way to see the final xml created after >>>>>> >>> the import using FormHandler, so I was hoping to get help in >>>>>> >>> 1. is the formatting of the xmls that I'm attaching correct, or could >>>>>> >>> that be the cause of the import error? >>>>>> >>> 2. how can I see the xml that is created after the import using >>>>>> >>> FormHandler >>>>>> >>> 3. Any other ideas why this import might not be working. >>>>>> >>> >>>>>> >>> I've talked with Adam Lerer about this and he suggested that I write >>>>>> >>> because this was getting into xforms and not so much ODK-Voice. >>>>>> >>> >>>>>> >>> Thanks, >>>>>> >>> >>>>>> >>> Joaquin >>>>>> >>> >>>>>> >>> >>>>>> >>> Code from ODK-Voice >>>>>> >>> if (instanceId != null) { >>>>>> >>> byte[] xml = dba.getInstanceXml(instanceId); >>>>>> >>> if (xml != null) { >>>>>> >>> log.warn("--- IMPORTING DATA FROM XML, FROM >>>>>> >>> DATABASE FOR >>>>>> >>> INSTANCE ID: "+ instanceId); >>>>>> >>> fh.importData(xml); >>>>>> >>> } >>>>>> >>> } >>>>>> >>> } catch (SQLException e) { >>>>>> >>> log.error(e); >>>>>> >>> return null; >>>>>> >>> } finally { >>>>>> >>> dba.close(); >>>>>> >>> } >>>>>> >>> >>>>>> >>> -- >>>>>> >>> 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 >>>>>> >> >>>>>> > >>>>>> > -- >>>>>> > 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 >>>>> >>>>> -- >>>>> 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 >>> >> >> -- >> 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 >