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

constraints.json #148

Closed
hallahan opened this issue May 11, 2016 · 4 comments
Closed

constraints.json #148

hallahan opened this issue May 11, 2016 · 4 comments

Comments

@hallahan
Copy link
Contributor

hallahan commented May 11, 2016

I'm breaking this comment out into an issue:

The basic approach with defining constraints will be JSON based. We copy JSON files form the constraints directory in the application assets to openmapkit/constraints in ExternalStorage. This way we will have a default setup, and then the constraints JSON settings can later be altered based on a REST endpoint in OpenMapKitServer (or a definition in XForms).

This approach is more extensible than building constraints into XForms up-front.

constraints.json - default constraints for all surveys
form_id-constraints.json - constraints that just apply to a specific form, overriding constraints.json

We can implement the actual functionality of constraints in OpenMapKit Android via this JSON settings mechanism. Later, we can go in and build XLSForm (pyxform) -> XForm (JavaRosa) -> Constraint JSON.

Doing pyxform and JavaRosa work right now will derail progress in the project as a whole. Also, this approach would lend well for development of a tag editor outside of an ODK context.

By having a set of constraints settings files in the Android application assets, we will have good defaults ship with the app. We can then have a simple OpenMapKit Server REST endpoint with modified constraints, but we won't require OMK Server for constraint functionality to work in Android.

See 0d58f2a showing how we take app assets and move them to ExternalStorage, allowing us to not rely on republishing the app to update an assets setting file. @ccabanero & @shawnaparadee - you can use this code in TechTracker.

@hallahan
Copy link
Contributor Author

This includes parsing the JSON and adding this functionality to the TagEdit model.

hallahan added a commit that referenced this issue May 13, 2016
hallahan added a commit that referenced this issue May 16, 2016
hallahan added a commit that referenced this issue May 16, 2016
hallahan added a commit that referenced this issue May 16, 2016
…ragment and SelectOneTagValueFragment
hallahan added a commit that referenced this issue May 16, 2016
hallahan added a commit that referenced this issue May 17, 2016
@hallahan
Copy link
Contributor Author

Note to self: make sure constraint JSON files get loaded case insensitive.

hallahan added a commit that referenced this issue May 23, 2016
@hallahan
Copy link
Contributor Author

I'm going to close this when we have this documented.

@hallahan
Copy link
Contributor Author

hallahan commented Jun 1, 2016

This has been completed and is documented at:

http://openmapkit.org/docs_constraints.html

@hallahan hallahan closed this as completed Jun 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant