Writing a new External Service Connection

Hello all, I'm working on connecting ODK Aggregate to an existing survey web
application. I'm working with the web app's API, which accepts JSON and XML,
so I'm thinking the way to go is to write a new External Service Connection.
I've been looking through the source code (I'm new to Java), and my thinking
is that the basic steps would be:

  1. Write a JDO to hold the web app connection info (we use authentication
    tokens) with a "sendSubmissionToRemoteServer" method
  2. Write a servlet to process the "Create Connection to External Service"
    form
  3. Hook the "sendSubmissionToRemoteServer" method into ODK Aggregates
    submission processing machinery

The last step is where I am in reading the source. Questions:

  • Does this sound like the right path, and am I going about it the right
    way?
  • Is there any documentation about this?

Thanks in advance.

··· -- Kevin Harvey Web Developer kcharvey@gmail.com

Generally speaking you are correct but there are some incorrect things
and other things to consider.

First, Aggregate 0.9.x uses JPA not JDO as there were problems
historically with App Engine and JDO and we have not switched back as
the new 1.x code base does not use either.

Unfortunately, there is no documentation on how to do this because
0.9.x code base is approaching the end of it's being the released
version of Aggregate. Development and documentation efforts are put
into 1.x code base. Depending on your time frame you might want to
modify the 1.x code base as in a couple months we will move it out of
alpha to being the released version. Additionally the 1.x code base
has background tasks that upload your data and a watchdog to restart
the upload if something happens. The 0.9.x code base does not have
these background tasks and are subject to app engine timeouts causing
your data to stop transmitting when not necessarily complete.

If you need a deployment in the next two months then you might want to
go with 0.9.x because it stable, but past that we will hopefully have
a stable release of 1.x out. The interfaces for the external service
in the 1.x code branch provide a better abstraction.

Hope this was helpful, feel free to ask more questions.

Cheers,
Waylon

··· On Tue, Mar 22, 2011 at 9:18 AM, Kevin Harvey wrote: > Hello all, I'm working on connecting ODK Aggregate to an existing survey web > application. I'm working with the web app's API, which accepts JSON and XML, > so I'm thinking the way to go is to write a new External Service Connection. > I've been looking through the source code (I'm new to Java), and my thinking > is that the basic steps would be: > > Write a JDO to hold the web app connection info (we use authentication > tokens) with a "sendSubmissionToRemoteServer" method > Write a servlet to process the "Create Connection to External Service" form > Hook the "sendSubmissionToRemoteServer" method into ODK Aggregates > submission processing machinery > > The last step is where I am in reading the source. Questions: > > Does this sound like the right path, and am I going about it the right way? > Is there any documentation about this? > > Thanks in advance. > -- > Kevin Harvey > Web Developer > kcharvey@gmail.com > >

Additionally, Aggregate 0.9.x supports a form of JSON through the Rhiza
Insight external service. The web addresses are hardcoded as this external
service was meant to be a prototype for a trial deployment. We haven't
updated that code in a while and its unclear if it still works with Rhiza
insight. However people have previously modified that bit of code to talk to
JSON servers (that is why we leave the code in the tree as a place to start
for JSON).

In regards to the 1.x code base the JSON code is approximately 90% finished.
We stopped development while we are waiting for our partners to define the
JSON encoding. This unfinished code would be another great place to start.

Hope this was helpful.
Waylon

Generally speaking you are correct but there are some incorrect things
and other things to consider.

First, Aggregate 0.9.x uses JPA not JDO as there were problems
historically with App Engine and JDO and we have not switched back as
the new 1.x code base does not use either.

Unfortunately, there is no documentation on how to do this because
0.9.x code base is approaching the end of it's being the released
version of Aggregate. Development and documentation efforts are put
into 1.x code base. Depending on your time frame you might want to
modify the 1.x code base as in a couple months we will move it out of
alpha to being the released version. Additionally the 1.x code base
has background tasks that upload your data and a watchdog to restart
the upload if something happens. The 0.9.x code base does not have
these background tasks and are subject to app engine timeouts causing
your data to stop transmitting when not necessarily complete.

If you need a deployment in the next two months then you might want to
go with 0.9.x because it stable, but past that we will hopefully have
a stable release of 1.x out. The interfaces for the external service
in the 1.x code branch provide a better abstraction.

Hope this was helpful, feel free to ask more questions.

Cheers,
Waylon

Hello all, I'm working on connecting ODK Aggregate to an existing survey
web

application. I'm working with the web app's API, which accepts JSON and
XML,

so I'm thinking the way to go is to write a new External Service
Connection.

I've been looking through the source code (I'm new to Java), and my
thinking

is that the basic steps would be:

Write a JDO to hold the web app connection info (we use authentication
tokens) with a "sendSubmissionToRemoteServer" method
Write a servlet to process the "Create Connection to External Service"
form

Hook the "sendSubmissionToRemoteServer" method into ODK Aggregates
submission processing machinery

The last step is where I am in reading the source. Questions:

Does this sound like the right path, and am I going about it the right
way?

··· On Mar 22, 2011 11:57 AM, "W. Brunette" wrote: > On Tue, Mar 22, 2011 at 9:18 AM, Kevin Harvey wrote: >> Is there any documentation about this? >> >> Thanks in advance. >> -- >> Kevin Harvey >> Web Developer >> kcharvey@gmail.com >> >>