Uploading Images in CloudCare

Hi,

Is anyone working on uploading images in CloudCare? My organization
requires the ability to upload images from an internet connected computer.
We're testing android emulators bluestacks and youwave, but it would be
much easier to have this functionality in CloudCare. It would be super
helpful if one of the core developers could take a few minutes to point me
in the right direction by writing a list of files that need to be touched
to add this functionality. From an outsider's perspective, this is such a
complex system :slight_smile:

Thank you!
Craig

Hi Craig,

I’m afraid there is not currently work being done to add the ability to
upload images through CloudCare. However, I can point you in the right
direction in terms of what files might need to be modified.

CloudCare forms are rendered by a “touchforms” daemon process. This is
essentially the standard JavaRosa CommCare core wrapped in Jython. You can
see the github repository here: https://github.com/dimagi/touchforms

One method you might want to look at to get started is this one
(renderQuestions):

You’ll need to create a new control type for the image upload question.
Take a look at the FreeTextEntry for an example:

Best,
Noah

··· On Friday, August 22, 2014 6:02:43 AM UTC+3, Craig A. wrote: > > Hi, > > Is anyone working on uploading images in CloudCare? My organization > requires the ability to upload images from an internet connected computer. > We're testing android emulators bluestacks and youwave, but it would be > much easier to have this functionality in CloudCare. It would be super > helpful if one of the core developers could take a few minutes to point me > in the right direction by writing a list of files that need to be touched > to add this functionality. From an outsider's perspective, this is such a > complex system :) > > Thank you! > Craig >

Thanks Noah,

I want to make sure I’m pulling in the right field in my code. Vellum uses
datatype “binary” and mediatype “image/*”. Is it safe to say that I can use
the following logic to identify images in the renderQuestions function? I
can’t seem to find the datatype that’s passed into touchforms.

} else if (q.datatype == “binary” && q.mediatype == “image/*”) {
control = new ImgEntry();
}

Also, is there anything I need to consider on the submit event? For
example, are images processed differently than the rest of the form? I see
the celeryd worker performing feedback to the commcareODK app
(/corehq/apps/hqmedia/cache.py). Should we replicate this in touchforms or
has it already been handled?

Sincerely,
Craig

··· On Sunday, August 24, 2014 1:33:42 PM UTC+5:45, Noah Carnahan wrote: > > Hi Craig, > > I'm afraid there is not currently work being done to add the ability to > upload images through CloudCare. However, I can point you in the right > direction in terms of what files might need to be modified. > > CloudCare forms are rendered by a "touchforms" daemon process. This is > essentially the standard JavaRosa CommCare core wrapped in Jython. You can > see the github repository here: https://github.com/dimagi/touchforms > > One method you might want to look at to get started is this one > (renderQuestions): > > https://github.com/dimagi/touchforms/blob/1f31c4f7e0940f290c0c5639791090b820f608fc/touchforms/formplayer/static/formplayer/script/entrycontrols_full.js#L764 > > You'll need to create a new control type for the image upload question. > Take a look at the FreeTextEntry for an example: > > https://github.com/dimagi/touchforms/blob/1f31c4f7e0940f290c0c5639791090b820f608fc/touchforms/formplayer/static/formplayer/script/entrycontrols_full.js#L131 > > Best, > Noah > > On Friday, August 22, 2014 6:02:43 AM UTC+3, Craig A. wrote: >> >> Hi, >> >> Is anyone working on uploading images in CloudCare? My organization >> requires the ability to upload images from an internet connected computer. >> We're testing android emulators bluestacks and youwave, but it would be >> much easier to have this functionality in CloudCare. It would be super >> helpful if one of the core developers could take a few minutes to point me >> in the right direction by writing a list of files that need to be touched >> to add this functionality. From an outsider's perspective, this is such a >> complex system :) >> >> Thank you! >> Craig >> >

Craig,

We submit images using the format outlined here:
https://bitbucket.org/javarosa/javarosa/wiki/FormSubmissionAPI

Basically: One Multipart-mixed MIME POST with the images as components of
the outer multipart envelope. The ID of the image in the multipart should
be the same as the inside of the xml element corresponding to the question.

-Clayton

··· On Wed, Sep 24, 2014 at 1:28 PM, Craig A. wrote:

Thanks Noah,

I want to make sure I'm pulling in the right field in my code. Vellum uses
datatype "binary" and mediatype "image/*". Is it safe to say that I can use
the following logic to identify images in the renderQuestions function? I
can't seem to find the datatype that's passed into touchforms.

} else if (q.datatype == "binary" && q.mediatype == "image/*") {
control = new ImgEntry();
}

Also, is there anything I need to consider on the submit event? For
example, are images processed differently than the rest of the form? I see
the celeryd worker performing feedback to the commcareODK app
(/corehq/apps/hqmedia/cache.py). Should we replicate this in touchforms
or has it already been handled?

Sincerely,
Craig

On Sunday, August 24, 2014 1:33:42 PM UTC+5:45, Noah Carnahan wrote:

Hi Craig,

I'm afraid there is not currently work being done to add the ability to
upload images through CloudCare. However, I can point you in the right
direction in terms of what files might need to be modified.

CloudCare forms are rendered by a "touchforms" daemon process. This is
essentially the standard JavaRosa CommCare core wrapped in Jython. You can
see the github repository here: GitHub - dimagi/touchforms: [deprecated] web-based javarosa xforms player built for touchscreen kiosks

One method you might want to look at to get started is this one
(renderQuestions):
https://github.com/dimagi/touchforms/blob/1f31c4f7e0940f290c0c5639791090
b820f608fc/touchforms/formplayer/static/formplayer/
script/entrycontrols_full.js#L764

You'll need to create a new control type for the image upload question.
Take a look at the FreeTextEntry for an example:
https://github.com/dimagi/touchforms/blob/1f31c4f7e0940f290c0c5639791090
b820f608fc/touchforms/formplayer/static/formplayer/
script/entrycontrols_full.js#L131

Best,
Noah

On Friday, August 22, 2014 6:02:43 AM UTC+3, Craig A. wrote:

Hi,

Is anyone working on uploading images in CloudCare? My organization
requires the ability to upload images from an internet connected computer.
We're testing android emulators bluestacks and youwave, but it would be
much easier to have this functionality in CloudCare. It would be super
helpful if one of the core developers could take a few minutes to point me
in the right direction by writing a list of files that need to be touched
to add this functionality. From an outsider's perspective, this is such a
complex system :slight_smile:

Thank you!
Craig

--


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