OSML and OpenSocial 0.9

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    OSML and OpenSocial 0.9 - Presentation Transcript

    1. OpenSocial 0.9 and OSML
    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=\"text/os-template\" tag=\"my:ParamBorderTag\"> <div style=\"margin:20px;border:12px solid ${My.borderColor};padding:20px;width:220px;\"> This tag uses borderColor: ${My.borderColor} </div> </script> ... <my:ParamBorderTag> <borderColor>Green</borderColor> </my:ParamBorderTag> 5
    6. OSML – Internationalization Support <Locale> <MessageBundle> <Msg name=\"helloworld\">Hello World</Msg> <Msg name=\"congrats\">Congratulations on using OSML</Msg> </MessageBundle> </Locale> <Locale lang=\"de\"> <h1>${Msg.helloworld}</h1> <MessageBundle> <Msg name=\"helloworld\">Hallo Welt</Msg> <Msg name=\"congrats\">Herzlichen Glückwunsch zur Verwendung OSML</Msg> </MessageBundle> </Locale> <Locale lang=\"ja\"> <MessageBundle> <Msg name=\"helloworld\"> </Msg> <Msg name=\"congrats\"> OSML </Msg> </MessageBundle> </Locale>
    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), \"viewer\"); req.send(handleRequestMe); }; function handleRequestMe(data) { var viewer = data.get(\"viewer\"); if (viewer.hadError()) { / /Handle error using viewer.getError()... return; } //No error. Do something with viewer.getData()... }
    9. HTML Fragment Rendering • Simple <os:Get href=\"http://example.org/stuff/${vwr.id}\" /> • Rich <myspace:RenderRequest src=\"http://example.org/stuff/showit\" method=\"post\" target=\"xDiv\" > <id>${vwr.id}</id> <name>${vwr.name}</name> <stuffCount>4</stuffCount> </myspace:RenderRequest> • Full content <Content href=\"http://example.org/stuff> <os:ViewerRequest key=\"vwr\" fields=\"id,name\" /> </Content> 9
    10. oslite API • Shortened and cleaned Javascript API • Provides 1:1 mapping between JS calls and REST calls var batch = osapi.newBatch(); osapi.people.getViewer({fields: ['name', 'birthday']}, batch('viewer')); osapi.people.get({userId: '@owner', groupId: '@friends', batch('ownerFriends')); batch.execute(function(result) { alert('Your name is ' + result.viewer.name + '!'); alert('You have ' + result.ownerFriends.length + ' friends!'); }); 10
    11. Demo 11
    12. Questions?
    SlideShare Zeitgeist 2009

    + MySpaceDevTeamMySpaceDevTeam Nominate

    custom

    718 views, 0 favs, 0 embeds more stats

    See the technical aspects of OpenSocial 0.9 and OSM more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 718
      • 718 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 4
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories