Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First we move into the feature directory:

cd features/src/main/javascript/features

Create a new directory named * learning* and put three files into it.

...

Then edit the file features.txt and add a line:

Code Block
titlefeatures.txt

features/xmlutil/feature.xml

...


features/com.google.gadgets.analytics/feature.xml

...


features/learning/feature.xml

There is a way to update features.txt using a script, but for now, lets just jack-plug in directly.

At this point you need to rebuild Shindig. And you might get syntax errors during the build which you need to fix. The Javascript for features is compiled / processed at mvn time so you may encounter syntax errors causes by your JavaScript.

mvn

once it compiles and installs, start Jetty again

mvn -Prun

And navigate to http://localhost:8080/samplecontainer/samplecontainer.html

You should see the “Social Hello World” gadget. Now lets edit this file:

./target/work/webapp/samplecontainer/examples/SocialHelloWorld.xml

And add two lines:

Code Block
formatxml
titleSocialHelloWorld.xml
   <Require feature="osapi"></Require>
   <Require feature="learning"></Require>
   <Require feature="settitle"/></Require>
...
   gadgets.window.setTitle('Social Hello World');
   alert(gadgets.learning.getContextLabel());
     var hellos = new Array('Hello World', 'Hallo Welt', 'Ciao a tutti',
...

...