What's To Implement

2007 Dec 06 - Gabrys

After some time studying OpenSocial API it's time for summing up what's to implement in order to get things done.

First of all we need to define five layers of infrastructure:

  1. OpenSocial widget loader module — PHP/JavaScript module that will load any given widget
  2. PHP iframe — this actually displays the widget
  3. WIKIDOT.opensocial and opensocial.WikidotContainer implementation — mostly JavaScript modules and some (PHP) proxy to fetch some content from other websites.
  4. server-side of the OpenSocial data fetch/set methods — PHP modules and actions in terms of OZONE.
  5. database structure — simple structure that follows structure of objects needed by OpenSocial implementation.

Still to come is a user preference panel that enables a user to add some applications to their wikis.

OpenSocial widget loader module (*.wikidot.com)

  • generates id of the iframe containing a widget
  • shows the iframe and passes parameters in the URL of the widget
    • iframe_id
    • app_id
    • widget_id
    • user_id
    • magic_sess_key (unique per user, session_id, application_id)
    • url (at least domain) of the current wiki
  • provides a method to resize a particular widget iframe (in JavaScript)
  • shows a title and the "ADD" link

PHP iframe (os.wikidotsyndication.com)

  • a PHP script that
    • gets the parameters from the URL
    • includes needed JavaScript libraries
      • some of YUI includes, OZONE
      • OpensocialReference.js
      • opensocial-wikidotcontainer.js
    • includes WIKIDOT.opensocial JavaScript object
    • sets user_id, magic_sess_key, domain (*.wikidot.com) to the WIKIDOT.opensocial JavaScript object (based on values passed in URL)
    • attaches proper Wikidot stylesheets
    • sets the proper iframe height on body load (by calling WIKIDOT.opensocial.resizeIframe)
    • displays the widget

WIKIDOT.opensocial & opensocial.WikidotContainer

  • WIKIDOT.opensocial holds all JavaScript functions, objects and vars that WikidotContainer will use
    • this is a place for resizeIframe function that
      • creates a new iframe with URL from WIKIDOT.opensocial.domain containing passed desired height of the current iframe
        • this iframe calls parent.parent.WIKIDOT.modules.OpenSocialModule.resizeIframe(desired height, widget_id)
    • requestData should be implemented here — making a OZONE.ajax.requestModule based connection
  • opensocial.WikidotContainer
    • this is a really simple wrapper object that extends opensocial.Container and uses some functions from Google's opensocial.MockContainer
    • opensocial.Container.setContainer(this) should go here
    • in the same file, register _IG_* functions should be made (outside the opensocial.WikidotContainer body)

server-side of the OpenSocial data fetch/set methods (os.wikidotsyndication.com)

  • a module that implements access to OpenSocial data and checks permissions (based on magic_sess_key)

database structure

to come…

Backlinks

Recent Posts

Comments

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License