I don't follow. What do you mean by auto-configure? Please elaborate. On Wed, Jun 16, ...
15 years, 10 months ago
(2010-06-17 01:23:19 UTC)
#3
I don't follow. What do you mean by auto-configure? Please elaborate.
On Wed, Jun 16, 2010 at 5:57 PM, <lindner@inuus.com> wrote:
> The osapi endpoints should auto configure when we have the
> GadgetsHandler installed. Not sure if that means some of the osapi code
> can be removed...
>
>
>
> http://codereview.appspot.com/1721042/show
>
gadgets.config code is working now for container javascript. At the end of this request: http://localhost:8080/gadgets/js/osapi.js?c=1 ...
15 years, 10 months ago
(2010-06-17 01:27:42 UTC)
#4
gadgets.config code is working now for container javascript. At the end of
this request:
http://localhost:8080/gadgets/js/osapi.js?c=1
You have osapi.services and gadgets.metadata
gadgets.config.init(
{"shindig.auth":{"authToken":"-1:-1:*::*:0:default"},
"osapi":{"endPoints":["http://%host%/rpc"]},
"osapi.services":{"gadgets.rpc":["container.listMethods"],"http://
%host%/rpc":["samplecontainer.update","activities.supportedFields","activities.update","activities.delete","gadgets.metadata","activities.get","http.put","activitystreams.create","messages.modify","appdata.get","messages.get","system.listMethods","cache.invalidate","samplecontainer.get","people.supportedFields","http.head","http.delete","messages.create","people.get","activitystreams.get","activitystreams.update","messages.delete","appdata.update","http.post","activities.create","samplecontainer.create","http.get","appdata.delete","appdata.create","activitystreams.delete","gadgets.supportedFields","activitystreams.supportedFields"]},
"rpc":{"parentRelayUrl":"/container/rpc_relay.html","useLegacyProtocol":false},
"core.io
":{"proxyUrl":"//%host%/gadgets/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%","jsonProxyUrl":"//%host%/gadgets/makeRequest"}});
On Wed, Jun 16, 2010 at 6:23 PM, Michael Hermanto <mhermanto@gmail.com>wrote:
> I don't follow. What do you mean by auto-configure? Please elaborate.
>
>
> On Wed, Jun 16, 2010 at 5:57 PM, <lindner@inuus.com> wrote:
>
>> The osapi endpoints should auto configure when we have the
>> GadgetsHandler installed. Not sure if that means some of the osapi code
>> can be removed...
>>
>>
>>
>> http://codereview.appspot.com/1721042/show
>>
>
>
Ok. Neat way to register OSAPI methods. I have something working, but I will update ...
15 years, 10 months ago
(2010-06-17 20:58:20 UTC)
#5
Ok. Neat way to register OSAPI methods. I have something working, but I will
update the code review when it's ready. Will let you know. Thanks Paul.
On Wed, Jun 16, 2010 at 6:27 PM, Paul Lindner <lindner@inuus.com> wrote:
> gadgets.config code is working now for container javascript. At the end of
> this request:
>
> http://localhost:8080/gadgets/js/osapi.js?c=1
>
> You have osapi.services and gadgets.metadata
>
>
> gadgets.config.init(
> {"shindig.auth":{"authToken":"-1:-1:*::*:0:default"},
> "osapi":{"endPoints":["http://%host%/rpc"]},
> "osapi.services":{"gadgets.rpc":["container.listMethods"],"http://
>
%host%/rpc":["samplecontainer.update","activities.supportedFields","activities.update","activities.delete","gadgets.metadata","activities.get","http.put","activitystreams.create","messages.modify","appdata.get","messages.get","system.listMethods","cache.invalidate","samplecontainer.get","people.supportedFields","http.head","http.delete","messages.create","people.get","activitystreams.get","activitystreams.update","messages.delete","appdata.update","http.post","activities.create","samplecontainer.create","http.get","appdata.delete","appdata.create","activitystreams.delete","gadgets.supportedFields","activitystreams.supportedFields"]},
>
>
"rpc":{"parentRelayUrl":"/container/rpc_relay.html","useLegacyProtocol":false},
> "core.io
>
":{"proxyUrl":"//%host%/gadgets/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%","jsonProxyUrl":"//%host%/gadgets/makeRequest"}});
>
>
>
> On Wed, Jun 16, 2010 at 6:23 PM, Michael Hermanto <mhermanto@gmail.com>wrote:
>
>> I don't follow. What do you mean by auto-configure? Please elaborate.
>>
>>
>> On Wed, Jun 16, 2010 at 5:57 PM, <lindner@inuus.com> wrote:
>>
>>> The osapi endpoints should auto configure when we have the
>>> GadgetsHandler installed. Not sure if that means some of the osapi code
>>> can be removed...
>>>
>>>
>>>
>>> http://codereview.appspot.com/1721042/show
>>>
>>
>>
>
Thinking back on why we had our own implementation of OSAPI is because we want ...
15 years, 10 months ago
(2010-06-17 22:10:14 UTC)
#6
Thinking back on why we had our own implementation of OSAPI is because we
want to support different transports, depending on the setup in which the
request is made:
1) first-party mode, container host == api host, where we just call
gadgest.io.makeNonProxiedRequest().
2) 3rd party mode, otherwise, where we create a separate/invisible iframe to
allow cross-domain XHR.
3) parent mode. I only saw this in comment.
Do we already support handling for these different setups, in OSAPI, to make
successful XHR calls?
On Thu, Jun 17, 2010 at 1:52 PM, Michael Hermanto <mhermanto@gmail.com>wrote:
> Ok. Neat way to register OSAPI methods. I have something working, but I
> will update the code review when it's ready. Will let you know. Thanks Paul.
>
>
> On Wed, Jun 16, 2010 at 6:27 PM, Paul Lindner <lindner@inuus.com> wrote:
>
>> gadgets.config code is working now for container javascript. At the end
>> of this request:
>>
>> http://localhost:8080/gadgets/js/osapi.js?c=1
>>
>> You have osapi.services and gadgets.metadata
>>
>>
>> gadgets.config.init(
>> {"shindig.auth":{"authToken":"-1:-1:*::*:0:default"},
>> "osapi":{"endPoints":["http://%host%/rpc"]},
>> "osapi.services":{"gadgets.rpc":["container.listMethods"],"http://
>>
%host%/rpc":["samplecontainer.update","activities.supportedFields","activities.update","activities.delete","gadgets.metadata","activities.get","http.put","activitystreams.create","messages.modify","appdata.get","messages.get","system.listMethods","cache.invalidate","samplecontainer.get","people.supportedFields","http.head","http.delete","messages.create","people.get","activitystreams.get","activitystreams.update","messages.delete","appdata.update","http.post","activities.create","samplecontainer.create","http.get","appdata.delete","appdata.create","activitystreams.delete","gadgets.supportedFields","activitystreams.supportedFields"]},
>>
>>
"rpc":{"parentRelayUrl":"/container/rpc_relay.html","useLegacyProtocol":false},
>> "core.io
>>
":{"proxyUrl":"//%host%/gadgets/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%","jsonProxyUrl":"//%host%/gadgets/makeRequest"}});
>>
>>
>>
>> On Wed, Jun 16, 2010 at 6:23 PM, Michael Hermanto <mhermanto@gmail.com>wrote:
>>
>>> I don't follow. What do you mean by auto-configure? Please elaborate.
>>>
>>>
>>> On Wed, Jun 16, 2010 at 5:57 PM, <lindner@inuus.com> wrote:
>>>
>>>> The osapi endpoints should auto configure when we have the
>>>> GadgetsHandler installed. Not sure if that means some of the osapi code
>>>> can be removed...
>>>>
>>>>
>>>>
>>>> http://codereview.appspot.com/1721042/show
>>>>
>>>
>>>
>>
>
The default osapi feature pulls in jsonrpctransport and gadgetsrpctransport. I assume that #1 is json-rpc ...
15 years, 10 months ago
(2010-06-17 22:55:16 UTC)
#7
The default osapi feature pulls in jsonrpctransport and gadgetsrpctransport.
I assume that #1 is json-rpc and #2 and #3 use gadgets.rpc to communicate
with an iframe and/or parent.
There's also a third possibility -- jsonp. I haven't written that transport
yet... Also, for #1 you can also use CORS if you're running on different
domains..
On Thu, Jun 17, 2010 at 3:10 PM, Michael Hermanto <mhermanto@gmail.com>wrote:
> Thinking back on why we had our own implementation of OSAPI is because we
> want to support different transports, depending on the setup in which the
> request is made:
> 1) first-party mode, container host == api host, where we just call
> gadgest.io.makeNonProxiedRequest().
> 2) 3rd party mode, otherwise, where we create a separate/invisible iframe
> to allow cross-domain XHR.
> 3) parent mode. I only saw this in comment.
>
> Do we already support handling for these different setups, in OSAPI, to
> make successful XHR calls?
>
>
> On Thu, Jun 17, 2010 at 1:52 PM, Michael Hermanto <mhermanto@gmail.com>wrote:
>
>> Ok. Neat way to register OSAPI methods. I have something working, but I
>> will update the code review when it's ready. Will let you know. Thanks Paul.
>>
>>
>> On Wed, Jun 16, 2010 at 6:27 PM, Paul Lindner <lindner@inuus.com> wrote:
>>
>>> gadgets.config code is working now for container javascript. At the end
>>> of this request:
>>>
>>> http://localhost:8080/gadgets/js/osapi.js?c=1
>>>
>>> You have osapi.services and gadgets.metadata
>>>
>>>
>>> gadgets.config.init(
>>> {"shindig.auth":{"authToken":"-1:-1:*::*:0:default"},
>>> "osapi":{"endPoints":["http://%host%/rpc"]},
>>> "osapi.services":{"gadgets.rpc":["container.listMethods"],"http://
>>>
%host%/rpc":["samplecontainer.update","activities.supportedFields","activities.update","activities.delete","gadgets.metadata","activities.get","http.put","activitystreams.create","messages.modify","appdata.get","messages.get","system.listMethods","cache.invalidate","samplecontainer.get","people.supportedFields","http.head","http.delete","messages.create","people.get","activitystreams.get","activitystreams.update","messages.delete","appdata.update","http.post","activities.create","samplecontainer.create","http.get","appdata.delete","appdata.create","activitystreams.delete","gadgets.supportedFields","activitystreams.supportedFields"]},
>>>
>>>
"rpc":{"parentRelayUrl":"/container/rpc_relay.html","useLegacyProtocol":false},
>>> "core.io
>>>
":{"proxyUrl":"//%host%/gadgets/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%","jsonProxyUrl":"//%host%/gadgets/makeRequest"}});
>>>
>>>
>>>
>>> On Wed, Jun 16, 2010 at 6:23 PM, Michael Hermanto
<mhermanto@gmail.com>wrote:
>>>
>>>> I don't follow. What do you mean by auto-configure? Please elaborate.
>>>>
>>>>
>>>> On Wed, Jun 16, 2010 at 5:57 PM, <lindner@inuus.com> wrote:
>>>>
>>>>> The osapi endpoints should auto configure when we have the
>>>>> GadgetsHandler installed. Not sure if that means some of the osapi
>>>>> code
>>>>> can be removed...
>>>>>
>>>>>
>>>>>
>>>>> http://codereview.appspot.com/1721042/show
>>>>>
>>>>
>>>>
>>>
>>
>
On Thu, Jun 17, 2010 at 3:55 PM, Paul Lindner <lindner@inuus.com> wrote: > The default ...
15 years, 10 months ago
(2010-06-18 01:27:59 UTC)
#9
On Thu, Jun 17, 2010 at 3:55 PM, Paul Lindner <lindner@inuus.com> wrote:
> The default osapi feature pulls in jsonrpctransport and
> gadgetsrpctransport.
>
> I assume that #1 is json-rpc and #2 and #3 use gadgets.rpc to communicate
> with an iframe and/or parent.
>
> Yes, and yes.
> There's also a third possibility -- jsonp. I haven't written that
> transport yet... Also, for #1 you can also use CORS if you're running on
> different domains..
>
I've maintained a simple caching for gadgets metadata, in service.js,
despite no caching mechanism in osapi. This is needed for gadgets
preloading, via container.preloadGadgets() and site.navigateTo().
I've re-uploaded a new patch. Hopefully, it addressed what you meant. Please
re-review. Thanks!
> On Thu, Jun 17, 2010 at 3:10 PM, Michael Hermanto <mhermanto@gmail.com>wrote:
>
>> Thinking back on why we had our own implementation of OSAPI is because we
>> want to support different transports, depending on the setup in which the
>> request is made:
>> 1) first-party mode, container host == api host, where we just call
>> gadgest.io.makeNonProxiedRequest().
>> 2) 3rd party mode, otherwise, where we create a separate/invisible iframe
>> to allow cross-domain XHR.
>> 3) parent mode. I only saw this in comment.
>>
>> Do we already support handling for these different setups, in OSAPI, to
>> make successful XHR calls?
>>
>>
>> On Thu, Jun 17, 2010 at 1:52 PM, Michael Hermanto <mhermanto@gmail.com>wrote:
>>
>>> Ok. Neat way to register OSAPI methods. I have something working, but I
>>> will update the code review when it's ready. Will let you know. Thanks Paul.
>>>
>>>
>>> On Wed, Jun 16, 2010 at 6:27 PM, Paul Lindner <lindner@inuus.com> wrote:
>>>
>>>> gadgets.config code is working now for container javascript. At the end
>>>> of this request:
>>>>
>>>> http://localhost:8080/gadgets/js/osapi.js?c=1
>>>>
>>>> You have osapi.services and gadgets.metadata
>>>>
>>>>
>>>> gadgets.config.init(
>>>> {"shindig.auth":{"authToken":"-1:-1:*::*:0:default"},
>>>> "osapi":{"endPoints":["http://%host%/rpc"]},
>>>> "osapi.services":{"gadgets.rpc":["container.listMethods"],"http://
>>>>
%host%/rpc":["samplecontainer.update","activities.supportedFields","activities.update","activities.delete","gadgets.metadata","activities.get","http.put","activitystreams.create","messages.modify","appdata.get","messages.get","system.listMethods","cache.invalidate","samplecontainer.get","people.supportedFields","http.head","http.delete","messages.create","people.get","activitystreams.get","activitystreams.update","messages.delete","appdata.update","http.post","activities.create","samplecontainer.create","http.get","appdata.delete","appdata.create","activitystreams.delete","gadgets.supportedFields","activitystreams.supportedFields"]},
>>>>
>>>>
"rpc":{"parentRelayUrl":"/container/rpc_relay.html","useLegacyProtocol":false},
>>>> "core.io
>>>>
":{"proxyUrl":"//%host%/gadgets/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%","jsonProxyUrl":"//%host%/gadgets/makeRequest"}});
>>>>
>>>>
>>>>
>>>> On Wed, Jun 16, 2010 at 6:23 PM, Michael Hermanto
<mhermanto@gmail.com>wrote:
>>>>
>>>>> I don't follow. What do you mean by auto-configure? Please elaborate.
>>>>>
>>>>>
>>>>> On Wed, Jun 16, 2010 at 5:57 PM, <lindner@inuus.com> wrote:
>>>>>
>>>>>> The osapi endpoints should auto configure when we have the
>>>>>> GadgetsHandler installed. Not sure if that means some of the osapi
>>>>>> code
>>>>>> can be removed...
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://codereview.appspot.com/1721042/show
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
Issue 1721042: Gadget-and-container JS framework (part 2)
(Closed)
Created 15 years, 10 months ago by mhermanto
Modified 15 years, 9 months ago
Reviewers: dev-remailer_shindig.apache.org, Paul Lindner
Base URL: http://svn.apache.org/repos/asf/shindig/trunk/
Comments: 0