Reviewers: bobevans, awiner,
Description:
https://issues.apache.org/jira/browse/SHINDIG-1065
According to osapi spec any request can be user mediated. (there is no
more osapi.ui.*). Shindig to support mechanism for user mediated
requests.
Changes:
- Containers can via configuration let shindig JS know which requests it
want to be user mediated.
- Predefined hooks are used to pass the request to the container and get
the response back.
- A new type of request, osapi.newUiRequest is defined to handle user
mediated case. Even though this is in global space, it need not be
visible to the developer directly. Developer uses the osapi as today.
- batch.js is modified to allow handling of user mediated requests.
- So that developer can know which request may get user mediated, every
request exposes a boolean field userMediated (this is not part of
standard but could be good to have something like this for future
version). This would allow developers to write code like below,
var r = osapi.activites.create();
if (r.userMediated) {
// skip creating activity, as I don't want to bug the user.
} else {
r.execute();
}
[Thanks to Shishir for working with me on this change].
Please review this at http://codereview.appspot.com/63110
Affected files:
features/pom.xml
features/src/main/javascript/features/osapi/batch.js
features/src/main/javascript/features/osapi/feature.xml
features/src/main/javascript/features/osapi/jsonrequest.js
features/src/main/javascript/features/osapi/osapi.js
features/src/main/javascript/features/osapi/util.js
features/src/test/javascript/features/alltests.js
features/src/test/javascript/features/osapi/batchtest.js