You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Henry Saputra <he...@gmail.com> on 2012/02/07 03:23:51 UTC

[QUESTION] Any reason why the actions container mixin does not call Container.rpcRegister instead of gadgets.rpc.register?

Hi Guys,

Any reason why the implementation of the actions container mixin does
not call Container.rpcRegister but instead directly call
gadgets.rpc.register?

The osapi.container.Container.prototype.rpcRegister has special code
to inject "gs" key to include the caller gadget site.

Here is the snippet of code in the actions_container.js:

osapi.container.Container.addMixin('actions', function(container) {

    ...

    gadgets.rpc.register('actions.bindAction', bindAction);
    gadgets.rpc.register('actions.get_actions_by_type', getActionsByDataType);
    gadgets.rpc.register('actions.get_actions_by_path', getActionsByPath);
    gadgets.rpc.register('actions.removeAction', removeAction);
    gadgets.rpc.register('actions.runAction', function(id, selection) {
      container.actions.runAction(id, selection);
    });

....



- Henry

Re: [QUESTION] Any reason why the actions container mixin does not call Container.rpcRegister instead of gadgets.rpc.register?

Posted by Ryan J Baxter <rj...@us.ibm.com>.
Henry I think this is probably an oversight in the code review.  I don't 
see why we couldn't use the container's API....






From:   Henry Saputra <he...@gmail.com>
To:     dev@shindig.apache.org, 
Cc:     Dan Dumont/Westford/IBM@Lotus
Date:   02/06/2012 09:23 PM
Subject:        [QUESTION] Any reason why the actions container mixin does 
not call Container.rpcRegister instead of gadgets.rpc.register?



Hi Guys,

Any reason why the implementation of the actions container mixin does
not call Container.rpcRegister but instead directly call
gadgets.rpc.register?

The osapi.container.Container.prototype.rpcRegister has special code
to inject "gs" key to include the caller gadget site.

Here is the snippet of code in the actions_container.js:

osapi.container.Container.addMixin('actions', function(container) {

    ...

    gadgets.rpc.register('actions.bindAction', bindAction);
    gadgets.rpc.register('actions.get_actions_by_type', 
getActionsByDataType);
    gadgets.rpc.register('actions.get_actions_by_path', getActionsByPath);
    gadgets.rpc.register('actions.removeAction', removeAction);
    gadgets.rpc.register('actions.runAction', function(id, selection) {
      container.actions.runAction(id, selection);
    });

....



- Henry



Re: [QUESTION] Any reason why the actions container mixin does not call Container.rpcRegister instead of gadgets.rpc.register?

Posted by Henry Saputra <he...@gmail.com>.
Cool, I'll test and commit the changes.

- Henry

On Tue, Feb 7, 2012 at 5:52 AM, Dan Dumont <dd...@us.ibm.com> wrote:
> I agree, we probably should be using the container api to register the
> endpoints.
>
>
>
> From:   Ryan J Baxter/Westford/IBM@IRIS
> To:     dev@shindig.apache.org,
> Cc:     Dan Dumont/Westford/IBM@Lotus
> Date:   02/06/2012 09:44 PM
> Subject:        Re: [QUESTION] Any reason why the actions container mixin
> does not call Container.rpcRegister instead of gadgets.rpc.register?
>
>
> Henry I think this is probably an oversight in the code review.  I don't
> see why we couldn't use the container's API....
>
>
>
>
>
>
>
> From:   Henry Saputra <he...@gmail.com>
> To:     dev@shindig.apache.org,
> Cc:     Dan Dumont/Westford/IBM@Lotus
> Date:   02/06/2012 09:23 PM
> Subject:        [QUESTION] Any reason why the actions container mixin does
> not call Container.rpcRegister instead of gadgets.rpc.register?
>
>
>
> Hi Guys,
>
> Any reason why the implementation of the actions container mixin does
> not call Container.rpcRegister but instead directly call
> gadgets.rpc.register?
>
> The osapi.container.Container.prototype.rpcRegister has special code
> to inject "gs" key to include the caller gadget site.
>
> Here is the snippet of code in the actions_container.js:
>
> osapi.container.Container.addMixin('actions', function(container) {
>
>    ...
>
>    gadgets.rpc.register('actions.bindAction', bindAction);
>    gadgets.rpc.register('actions.get_actions_by_type',
> getActionsByDataType);
>    gadgets.rpc.register('actions.get_actions_by_path', getActionsByPath);
>    gadgets.rpc.register('actions.removeAction', removeAction);
>    gadgets.rpc.register('actions.runAction', function(id, selection) {
>      container.actions.runAction(id, selection);
>    });
>
> ....
>
>
>
> - Henry
>
>

Re: [QUESTION] Any reason why the actions container mixin does not call Container.rpcRegister instead of gadgets.rpc.register?

Posted by Dan Dumont <dd...@us.ibm.com>.
I agree, we probably should be using the container api to register the 
endpoints.



From:   Ryan J Baxter/Westford/IBM@IRIS
To:     dev@shindig.apache.org, 
Cc:     Dan Dumont/Westford/IBM@Lotus
Date:   02/06/2012 09:44 PM
Subject:        Re: [QUESTION] Any reason why the actions container mixin 
does not call Container.rpcRegister instead of gadgets.rpc.register?


Henry I think this is probably an oversight in the code review.  I don't 
see why we couldn't use the container's API....







From:   Henry Saputra <he...@gmail.com>
To:     dev@shindig.apache.org, 
Cc:     Dan Dumont/Westford/IBM@Lotus
Date:   02/06/2012 09:23 PM
Subject:        [QUESTION] Any reason why the actions container mixin does 
not call Container.rpcRegister instead of gadgets.rpc.register?



Hi Guys,

Any reason why the implementation of the actions container mixin does
not call Container.rpcRegister but instead directly call
gadgets.rpc.register?

The osapi.container.Container.prototype.rpcRegister has special code
to inject "gs" key to include the caller gadget site.

Here is the snippet of code in the actions_container.js:

osapi.container.Container.addMixin('actions', function(container) {

    ...

    gadgets.rpc.register('actions.bindAction', bindAction);
    gadgets.rpc.register('actions.get_actions_by_type', 
getActionsByDataType);
    gadgets.rpc.register('actions.get_actions_by_path', getActionsByPath);
    gadgets.rpc.register('actions.removeAction', removeAction);
    gadgets.rpc.register('actions.runAction', function(id, selection) {
      container.actions.runAction(id, selection);
    });

....



- Henry