The Secrets of Shindig
OpenSocial
Written by Shannon Quinn   

Of which, there are many.

Let me break this down a little bit first.

*ahemahem*

The folks developing Shindig are, simply put, brilliant people.  They are developing a custom OpenSocial container that is specifically designed to be deployed in just about any environment; as several have told me personally through emails, integrating Shindig with Joomla! just "makes sense."  The hard part is getting the two to actively communicate.

On the Joomla! side: A component (com_opensocial) is acting as the entry point for the Shindig interface.  This component follows all the usual rules of Joomla! components: core and administrative sides, and strict MVC design.  This serves as the pluggable interface for which additional OpenSocial gadgets can be plugged in.  For those gadgets, each will consist of a module or even a plugin (I'm conducting tests right now to determine which is more feasible...suggestions are welcome).  A new external library has also be added to the mix.  Within the "libraries" folder of the Joomla! filesystem, "shindig" has been added, which contains all the library files, though the parallel Java implementation is absent, since it is inconsequential to this particular scenario.

Having the component successfully reference the library is extremely challenging.  I'm looking at how the other libraries are implemented and communicated with as hints to how I should go about jumping this hurdle.  Again, suggestions are welcome.  However, there is more that will have to happen than a simple function call or two, and that is what I have been working on of late.  On that note...

The Shindig side: Shindig is essentially three independent modules working together (for clarification: when I refer to "Shindig", I am speaking only of the PHP implementation.  The parallel Java implementation does not factor into this project).  These three modules are as follows: Gadget Rendering, OpenSocial Server Components, and Persistent Data Access.  The latter two are encapsulated within a single layer of abstraction, the Gadget Data Servlet.  The other is aptly named the Gadget Rendering Servlet.

Essentially, the folks with Shindig have employed the exact architecture Joomla! uses: Model (Data), View (Rendering), and Control (Servlets).  These three modules are independent of one another (DING DING DING).  Yes folks, one of these modules can be swapped out for another implementation of the same functionality, and the other modules wouldn't know the difference.  Nevertheless, this doesn't exactly point to a cakewalk integration process.  As an example, if I wanted to rewrite the Data portion of Shindig (which, actually, is the only module I'm 100% positive at this point that I'm NOT going to touch), I'd have to throw out six PHP classes and rewrite their functionality from scratch within the Joomla! environment.

The other two modules are just as difficult/easy.  Depending on your perspective.

The module I have been spending the most time with is the Gadget Rendering Servlet.  After all, its only job is to render the OpenSocial widgets, after all the data processing has taken place.  For all practical purposes, this is the module I have to concern myself with; everything else can remain as it is.  However, integrating it into Joomla! MVC architecture (or, making it the View) has been very difficult.

A thought I had recently was this: is there some way I can buffer Shindig's gadget rendering, and rather than actively allow Shindig to render the gadget as it would normally, forward that data directly to Joomla!?  I'm not sure if this is even possible.  Even something as simple (but agonizingly annoying) as headers being sent can throw a wrench in this hack of an idea.  Change the way Joomla! echoes HTML the browser and it could break the whole link.

This method might be useful for testing.  But in production, I'll have to continue my work of overriding the default Gadget Rendering Servlet to act as a View within the com_opensocial component.  Fortunately, Joomla! provides a plethora of existing formatting and output functions; my current problem is figuring out exactly what calls from the massive API are appropriate for rendering the gadgets.  This is where I need to sit down and have an e-discussions at some point with a core Joomla! developer and pick their brain on the topic.  I'm pretty sure a simple JText isn't going to cut it.

*pant pant* Whew!  Anyone else having a blast, or is it just me? :)

By the way...anyone know if my book is on its way? *innocent smile*

As a final note, I am departing later today (~8 hours) for a road trip up to Pittsburgh, PA, where I will be hunting for an apartment to live in over the next year (my first at graduate school!).  The upshot is that I will not be readily available on Skype from the 10th through the 13th as I usually am.  I have no idea what my internet access will be during that time.  I have more code to post, but unfortunately I am at my parents' house right now, and I kid you not when I say that hitting the "Insert/Edit Link" button on this wysiwyg editor took a grand total of 15 seconds (I counted).  SVN doesn't play nicely with intarnetz that crawl.

Have a good weekend, fellow Joomla!-ers!

 

Show other articles of this author