2. Introductions
Chris Cole
Architect with MySpace Open Platform
co-author of upcoming book
“Building OpenSocial Apps for MySpace”
Max Newbould
Development Manager – OpenSocial Container
2
3. OpenSocial 0.9 and OSML
• Recently ratified by spec group
• OSML & DataPipeline
• oslite Javascript API
3
4. OpenSocial Markup Language (OSML)
• Tag-based language for building apps
• Utilizes GadgetXML format
• Provides full container API support
4
5. OSML – Custom Tag Templates
• Declare and use custom tags for common UI elements
<script type=quot;text/os-templatequot; tag=quot;my:ParamBorderTagquot;>
<div style=quot;margin:20px;border:12px solid
${My.borderColor};padding:20px;width:220px;quot;>
This tag uses borderColor: ${My.borderColor}
</div>
</script>
...
<my:ParamBorderTag>
<borderColor>Green</borderColor>
</my:ParamBorderTag>
5
7. Data Pipeline
• Declare and use data simply
– No need for 20+ lines of Javascript & callback functions
<os:ViewerRequest key=“Viewer” >
...
<h1>Hello, ${Viewer.Name}</h1>
7
8. Data Pipeline
• Not old-style data call
function requestMe() { var req =
opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(
opensocial.DataRequest.PersonId.VIEWER), quot;viewerquot;);
req.send(handleRequestMe);
};
function handleRequestMe(data) {
var viewer = data.get(quot;viewerquot;);
if (viewer.hadError()) { /
/Handle error using viewer.getError()...
return;
}
//No error. Do something with viewer.getData()... }