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 <henry.sapu...@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


Reply via email to