I'm trying to extend the commoncontainer.  I want to add a couple of new
apis.  I'm trying to do this by introducing a feature that adds the new
functionality.

 

In shindig.properties I have

 

shindig.features.default=res://features/features.txt,res://features/oclc
features.txt

 

referencing my new oclcfeatures.

 

In oclcfeatures.txt I have

 

features/oclccontainer/feature.xml

 

referencing the new feature.

 

In features/oclccontainer/feature.xml I have

 

<?xml version="1.0"?>

<feature>

  <name>oclccontainer</name>

  <dependency>container</dependency>

  <container>

      <script src="oclccontainer.js"/>

  </container>

</feature>

 

And finally in features/oclcontainer/oclccontainer.js I have

 

osapi.container.Container.addMixin("oclc", function(context) {

    return {

        "installGadget" : function() {

            alert('installGadget');

        }

    };

});

 

In my client I'm doing the following (adding the oclccontainer feature)

 

<script type='text/javascript'
src='/opensocial/gadgets/js/container:oclccontainer:rpc.js?c=1&debug=1&n
ocache=1&container=default'>

</script>

 

    var config = {};

    var container = new osapi.container.Container(config);

 

    container.oclc.installGadget('test');

 

However I get osapi undefined.  If I remove the
res://features/oclcfeatures.txt reference from shindig.properties, then
I get past the osapi.container call but then of course container.oclc is
not defined.

 

So two questions.  Am I adding the feature correctly and am I extending
the common container correctly?

 

Any help is appreciated.

 

Thanks,

Doug Davies

OCLC

 

Reply via email to