Shindig Apachecon Asia 09
-
Upload
nuwan-bandara -
Category
Technology
-
view
2.586 -
download
0
description
Transcript of Shindig Apachecon Asia 09
![Page 1: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/1.jpg)
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)
![Page 2: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/2.jpg)
Outline
• The Role of Portals in SOA• The Google Gadgets Specification• Apache Shindig• A Case Study
![Page 3: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/3.jpg)
The Role of Portals in Today's Service Oriented World
![Page 4: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/4.jpg)
An SOA is ...
• Essentially a collection of – self contained, – pluggable, – loosely coupled services
• Which have – welldefined interfaces and – functionality
![Page 5: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/5.jpg)
Therefore, a Service is ...
• A function that is – selfcontained and – immune to the context or state of other services
• These services can communicate with each other
![Page 6: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/6.jpg)
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!
![Page 7: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/7.jpg)
A Portal Framework (a)
• Provides presentation capabilities for these software agents
• It is also responsible for providing – the required resources and – environment for proper functioning of the
components plugged into it
![Page 8: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/8.jpg)
A Portal Framework (b)
• Is also an extra layer in the architecture that provides – A standard (presentation) interface for business
logic, that is – Independent of programming languages or
platforms
![Page 9: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/9.jpg)
A Portal Framework (c)
• The portal not only presents the application logic contained in the software agents
• But can be used to coordinate different, loosely coupled services into a single concrete service,– by providing the gluing framework
![Page 10: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/10.jpg)
Ideally ...• A portal should be able to bring together,• services and their presentation logic, created using
any platform– Java– PHP– .Net– Etc.,
• running anywhere in the world,• to provide a single unified view to the end user
![Page 11: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/11.jpg)
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
![Page 12: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/12.jpg)
Then again ...
• Portals are rendered in the browser, aren't they?
• In essence, a Portlet's output finally reaches the user as HTML, Javascript or any browser friendly medium
![Page 13: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/13.jpg)
What If?
• We can write a Portlet and give its URL to the Portal?
• The Portal only needs to know this URL and nothing else?
![Page 14: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/14.jpg)
Then ...
• Let's talk about Gadgets :)
![Page 15: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/15.jpg)
The Google Gadgets Specification
![Page 16: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/16.jpg)
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.
Source: http://code.google.com/apis/gadgets/docs/spec.html
![Page 17: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/17.jpg)
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 ...
![Page 18: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/18.jpg)
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
![Page 19: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/19.jpg)
In a nutshell ...
![Page 20: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/20.jpg)
A Typical Gadget Based Portal
iGoogle, Orkut, Hi5
![Page 21: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/21.jpg)
![Page 22: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/22.jpg)
Apache Shindig
• Apache Shindig (a word meaning party)• Originally started by Google in 2007
• as a reference container for hosting OpenSocial compatible widgets in any website
• A port of Google's iGoogle gadget container• Supports
– The Google Gadgets Specification and– The OpenSocial Specification
![Page 23: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/23.jpg)
Status
Source: https://www.ohloh.net/p/10942/analyses/latest
![Page 24: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/24.jpg)
Who's using it?
• LinkedIn• hi5• Partuza, based on PHP Apache Shindig• WSO2 Gadget Server, based on Java Apache
Shindig• etc.,
![Page 25: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/25.jpg)
Components of Shindig
• Gadget Container Javascript• Gadget Rendering Server
– Used to render the gadget XML into JavaScript and HTML for the container to expose via the container JavaScript
• OpenSocial Container Javascript• OpenSocial Data Server
![Page 26: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/26.jpg)
Gadget Rendering
MetadataMetadata TranslateTranslate PrefsPrefs FeaturesFeatures
![Page 27: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/27.jpg)
Source: http://chrisschalk.com/shindig_docs/rajdeep/shindigoverview/onjavashindigoverviewtidy.html
![Page 28: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/28.jpg)
Our Experience With Apache Shindig
![Page 29: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/29.jpg)
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
![Page 30: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/30.jpg)
The result...
![Page 31: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/31.jpg)
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
![Page 32: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/32.jpg)
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
![Page 33: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/33.jpg)
Finally what we've got• A comprehensive portal server with open
standards• Portlets can be simply written in Javascript, XML and HTML• Write once, run anywhere ability
• A gadget repository and a browser
![Page 34: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/34.jpg)
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
![Page 35: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/35.jpg)
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
![Page 36: Shindig Apachecon Asia 09](https://reader034.fdocuments.us/reader034/viewer/2022042623/547e94a7b4af9fce158b5604/html5/thumbnails/36.jpg)
Q&A