
|
If you were logged in you would be able to see more operations.
|
|
|
|
Issue Links:
|
Relate
|
|
This issue relates to:
|
|
SAK-16758
Port JSONP support to 1.3.6 for easy inclusion in 2.6 builds
|
|
|
|
|
|
|
|
| 2.6.x Status: |
None
|
| 2.5.x Status: |
None
|
| 2.4.x Status: |
None
|
|
To enable mashup scenarios, it should be possible to wrap a JSON serialization of an entity in a callback (JSONP). Common web APIs provide a default named callback but also allow specifying one as a GET parameter to facilitate usage of various scripting libraries. This functionality should be made available in the default distribution of the Entity Broker so that developers need not implement a custom format when JSONP is desired.
|
|
Description
|
To enable mashup scenarios, it should be possible to wrap a JSON serialization of an entity in a callback (JSONP). Common web APIs provide a default named callback but also allow specifying one as a GET parameter to facilitate usage of various scripting libraries. This functionality should be made available in the default distribution of the Entity Broker so that developers need not implement a custom format when JSONP is desired. |
Show » |
|
After some discussion with Aaron, we decided that a new format extension was the right approach, at least for now. This is intended to preserve the semantics of .json implying a feed that will validate against the JSON spec (via JSONLint or other). It may also allay some security concerns about JSONP in general by requiring an entity developer to opt in to this behavior. By default, using the .jsonp extension will add a call to jsonEntityFeed() around the JSON object. This can be specified with a query parameter of jsonCallback.
For example:
http://sakai/direct/some-entity/some-id.jsonp will use the default callback: jsonEntityFeed({...})
http://sakai/direct/some-entity/some-id.jsonp?jsonCallback=myCustomCallback will call myCustomCallback({...})
None of the default entities have the JSONP format enabled now. We may decide that this is appropriate at some later point. Also, we may decide that the distinction between JSON and JSONP is not ideal and apply the callback parameter to the standard JSON handler, thereby allowing any JSON-compatible entities to be used with or without a JSONP callback based on consumer parameters.