Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constraint.json Files as ODK Media Files #156

Closed
jasonrogena opened this issue Aug 8, 2016 · 2 comments
Closed

constraint.json Files as ODK Media Files #156

jasonrogena opened this issue Aug 8, 2016 · 2 comments

Comments

@jasonrogena
Copy link
Contributor

Right now, the form specific configuration files placed in /sdcard/openmapkit/constraints/ have to be manually placed there. It might be a good idea to add functionality for fetching this configuration file from ODK's media directory. This will help in setups where we don't have the luxury of placing this file in all the devices (for instance, in cases where a lot of devices are being used).

I suggest a feature where if OpenMapKit is launched from ODK Collect, for instance, for a form named 'form 1', OMK checks whether a file named 'omk-constraints.json' exists in /sdcard/odk/forms/form 1-media/ and copies this file to /sdcard/openmapkit/constraints/ as 'form 1.json'. This will allow for guys to publish their OMK form specific constraints file alonside the ODK form on ODK Aggregate/Formhub/ona.io

@hallahan hallahan changed the title OMK Configuration Files as ODK Media Files constraint.json Files as ODK Media Files Aug 8, 2016
@hallahan
Copy link
Contributor

hallahan commented Aug 8, 2016

This sounds like a pretty straightforward thing that could be implemented.

I think the initial idea is that custom constraints would be a part of a deployment. When you download MBTiles and OSM files as a part of a deployment, the custom constraint file would come with it. When you're getting your deployment with all that you need, that too would include your constraint.json.

But, looking in the forms media directory in ODK sounds reasonable to me.

jasonrogena added a commit to onaio/OpenMapKit that referenced this issue Aug 9, 2016
Add code for copying over a form's constraints from its ODK media
directory into OMK's constraints directory.

Fix for issue posm#156

Signed-off-by: Jason Rogena <jasonrogena@gmail.com>
jasonrogena added a commit to onaio/OpenMapKit that referenced this issue Aug 10, 2016
Add tests for code that fixes issue posm#156 (copying over constraints.json
from ODK)

Signed-off-by: Jason Rogena <jasonrogena@gmail.com>
jasonrogena added a commit to onaio/OpenMapKit that referenced this issue Aug 10, 2016
Add tests for code that fixes issue posm#156 (copying over constraints.json
from ODK)

Signed-off-by: Jason Rogena <jasonrogena@gmail.com>
jasonrogena added a commit to onaio/OpenMapKit that referenced this issue Aug 10, 2016
Add code for copying over a form's constraints from its ODK media
directory into OMK's constraints directory. OMK now checks whether a
file named omk-constraints.json exists inside the form's media
directory

Fix for issue posm#156

Signed-off-by: Jason Rogena <jasonrogena@gmail.com>
jasonrogena added a commit to onaio/OpenMapKit that referenced this issue Aug 10, 2016
Add tests for code that fixes issue posm#156 (copying over constraints.json
from ODK)

Signed-off-by: Jason Rogena <jasonrogena@gmail.com>
jasonrogena added a commit to onaio/OpenMapKit that referenced this issue Sep 8, 2016
Add logic for fetching the constraints and settings files from the ODK
media directory for the ODK form in question

Fix for issue posm#156 in github.com/americanredcross/openmapkitandroid

Signed-off-by: Jason Rogena <jasonrogena@gmail.com>
@hallahan
Copy link
Contributor

Merged PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants