A Few More Tags: The OpenSocial Markup Language

The OpenSocial Markup Language, or OSML, is a direct subset of OpenSocial templating. We have already seen many expression tags and custom tag definitions used within the gadget template context, but now we’ll take that a little bit further and explore some of the other functional tags that are available using this functional template subset.

OSML includes several standard tags that may aid you in your development, including:

os:Name

Used to display the name of a particular person

os:PeopleSelector

Used to display a person selector box

os:Badge

Used to display a standard badge for a user

os:Get

Used for loading external HTML content to insert into the gadget

To be able to render and use these tags, the gadget must include a Require statement to pull in the necessary JavaScript functionality:

<Require feature="osml" />

As I already mentioned, OSML is a direct subset of OpenSocial templating. Thus, if we have already included the templating Require element, we will not have to include the OSML feature element just described:

<Require feature="opensocial-templates" />

There are two separate Require statements available for including OSML tags because of the restrictions some containers impose on which views a gadget can implement templating on (due to potential performance issues).

The main value in any container-defined tags like these is that they provide secure access to a user’s personal information without requiring the user’s permission to do so. Since the container will be rendering the content of these tags and the gadget will not be collecting the social data itself, this can give you a quick and easy way to access social details about a user without actually having to handle her personal information.

Let’s explore the functionality of these tags a little bit further.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.240.119