1. Apache Shindig, from Server Side Portlets to
Open Social Gadgets
Tyrell Perera
(Product Manager WSO2 Gadget Server and WSO2 Mashup Server)
&
Nuwan Bandara
(Software Engineer, WSO2 Gadget Server)
2. Outline
• The Role of Portals in SOA
• The Google Gadgets Specification
• Apache Shindig
• A Case Study
6. Services are ...
• Software agents which are the building blocks
of SOAs
• They are selfcontained, which means they
should not be modified
• Individually, they may or may not have a
presentation layer
• But the end users need a unified view to make
use of all this!
11. But ...
• Most portal technologies restrict developers of
Portlets in to a platform, one way or the other
– If you want your Service to appear in a JSR168
Portal, you better learn JSR168
• Services should be self contained and
• interoperability is a big deal in SOA!
– A Portal is no exception
16. The Google Gadgets Specification
• Gadgets are webbased software components based on HTML,
CSS, and JavaScript
• They allow developers to easily write useful web applications that
work anywhere on the web without modification
• They are defined using a declarative XML syntax that is processed
by a gadget server into a format that allows them to be embedded
into various contexts:
– standalone web pages, web applications, even other gadgets.
• A gadget and its XML are synonymous. The gadget XML contains
all information needed to identify and render a web application.
17. A Gadget Container (Portal)
• A context into which a gadget is embedded is called a
gadget container
• The container is responsible for managing the gadgets'
layout and controls,
• as well as supporting various functionality on behalf of the
gadget
– Maximise (or Canvas view)
– Passing the user's locale (for i18n)
– Storing user preferences
– Authentication ...
18. Gadgets
Gadgets are specified in XML. The first line is the standard way to start an XML file. This must be the first
•
line in the file
The <Module> tag indicates that this XML file contains a gadget
•
The <ModulePrefs> tag contains information about the gadget such as its title, description, author, and other
•
optional features
The line <Content type="html"> indicates that the gadget's content type is HTML
•
<![CDATA[ ...insert HTML here... ]]> is used to enclose HTML when a gadget's content type is html. It tells
•
the gadget parser that the text within the CDATA section should not be treated as XML. The CDATA section
typically contains HTML and JavaScript
</Content> signifies the end of the Content section
•
</Module> signifies the end of the gadget definition
•
29. What we did with shindig
• We used shindig to host our portlets
• The provided XML is rendered in to an HTML and
returned to the browser
• We let shindig do the communication for us
• Shindig handled gadget specific settings, crossdomain
calls etc.
• We made shindig, a component in our server
space
• We bundled it in our OSGi environment
31. Other bits and pieces of Tech we
used
• For thousands of lines of javascript jQuery helped
• With jQuery the rendered iFrames were smoothly
sortable
• We used OSGi to bundle up everything
• Rather than using shindig as a deployed webapp we
OSGified it, so it would work in harmony with other
modules in the portal server
• We heavily used Apache web services stack
32. Tweaks we did to make it fast
• We enabled caching
• We enabled caching in shindig so the gadgets are
refreshed without a delay
• We made the gadget metadata to be fetched in
one go
• The gadget preferences were loaded
asynchronously
34. What's next
• Enable open social features in shindig
• By supporting opensocial features in shindig in the
container level we believe an enterprise portal can be
more interactive
• Provide single signon for all the gadgets in
container level
• By implementing a single signon framework via shindig
features
35. More Information
• Google Gadgets Specification
http://code.google.com/apis/gadgets/docs/spec.html
• Open Social http://code.google.com/apis/opensocial/
• Gadgets Developer Reference
http://code.google.com/apis/gadgets/docs/dev_guide.html
• Apache Shindig Project Page http://incubator.apache.org/shindig/
• WSO2 Gadget Server Project Page http://wso2.org/projects/gadgetserver