consuming the javarosa library
i've cloned the repo and begun assessing the source to try and wrap my head around the way it's intended to be used. the problem is that the library is inconsistently documented within the source code.
from what i have read and subsequently pieced together, it seems as though consumers of the api are to use classes within org/javarosa/form/api
and org/javarosa/formmanager/view
to process xforms, though i can't be sure. i've read this document for further explanation of these classes.
am i on the right track, here? or am i looking in an entirely wrong section of the project? if possible, could someone provide some usage examples of the library?
kind regards
Comments (4)
-
-
@m.sundt thank you for getting back to me on this one!
i'm building a web service that takes (hopefully) well-formed and valid xforms as input. the service is to programmatically append answer data to the
model/instance
part of the xform.i've included a step by step lifecycle of the service for an overview of the process.
example:
- request to web service --> store a provided xform in database.
- parse new xform using
javarosa
and generate a question string for the first unanswered form question. - send unanswered question to consumer of web service as http response.
- serialise
javarosa
instance. - request to web service --> provide answer to question.
- unserialise
javarosa
instance, add provided answer to xform and reserialise. - respond to consumer of web service with the next unanswered question (if any exist) as http response.
- if all xform questions are satisfied, pipe the xform to an external service.
-
judging by the links you provided, your wrapper for
formentrycontroller
is suitable for the problem i described. -
Have you seen https://enketo.org/ ? It provides a full web browser interface to javarosa forms, including, I believe, intermediate saves of results.
Note that javarosa is not a full and complete XForms implementation, and that it deviates from the XForms spec is several ways.
- Log in to comment
I'm not sure what you are trying to accomplish.
An example usage is ODK Collect
http://code.google.com/p/opendatakit/source/browse?repo=collect
(note that this uses the m.sundt fork of javarosa).
This uses the core library, without the extensions for J2ME devices.
Within ODK Collect, this class:
http://code.google.com/p/opendatakit/source/browse/src/org/odk/collect/android/logic/FormController.java?repo=collect
is a wrapper handling most interactions with the javarosa library.