SgCodeJam24 Workshop Extract


Published on

An extract of the full deck of the SgCodeJame24 Workshop about SciVerse and OpenSocial platform and applications

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

SgCodeJam24 Workshop Extract

  1. 1. Developer Network<br />INTRODUCTION<br />
  2. 2. Developer Network<br />Elsevier and SciVerse<br />Elsevier publishes 25% of the world’s Scientific, Technical and Medical (STM) content, with more than 10 million full-text articles from 2600 journals in ScienceDirect, and more than 40 million abstracts and author, affiliation information in Scopus. In SciVerse Hub you can access all content from Elsevier plus scientific content from the web. <br />SciVerse lets you embed applications within the content, giving developers and apps access to framework and content APIs. <br />SciVerse is an extension of Apache Shindig, an implementation of OpenSocial. Sciverse apps can access content via APIs.<br />Keywords: <br />Services Oriented Architecture (SOA)<br />Web 2.0<br />Cloud based computing<br />Distributed Services<br />Web Services<br />Open Data<br />REST <br />OAuth<br />
  3. 3. Developer Network<br />Elsevier SciVerse – science, there’s an app for that<br />Browser Apps <br />iPhone Apps<br />1 billion downloads<br />350,000 apps<br />Facebook Apps<br />500 million users<br />
  4. 4. Developer Network<br />Elsevier | Developer Network<br />Hub Search Results with SciVerse APPS (search result analysis app)<br />
  5. 5. Developer Network<br />PART 1 – TECHNOLOGY PLATFORM <br />
  6. 6. Developer Network<br />OpenSocial Architecture<br />IFRAME<br />http request<br />HTTP SERVER<br />Shindig Server<br />Gadget Renderer Servlet<br />Data Service Servlet<br />Apache Shindig is an implementation of the OpenSocial specification.<br />Gadget Server<br />Data Handler<br />Container<br />People<br />Activities<br />Gadget <br />App Data<br />DB1<br />DB2<br />Javascript Libraries<br />Gadget.xml<br />
  7. 7. Developer Network<br />SciVerse – Integration Points<br />Apps appear as iframes in so-called views or integration points in the webpage.<br />7<br />
  8. 8. Developer Network<br />What is a Gadget? The IFRAME Revolution<br />OpenSocial Gadgets<br />A gadget is a client-side application in the form of an HTML iFrame that appears in the context of a webpage and uses client-side scripting languages like JavaScript.<br />IFRAME<br /><iframesrc="iframe1.html" width=“400" height=“200"><br />Hello World!<br /></iframe><br />GADGET.XML (example 1)<br /><?xml version="1.0" encoding="UTF-8"?><br /><Module><br /> <ModulePrefs title=“HellowWorld1" author_email=“"><br /> <Require feature="opensocial-0.9" /><br /> </ModulePrefs><br /> <Content type="html" view="profile"><![CDATA[<br /> <script type=‘text/javascript’> <br />function fnWrite() {<br />getElementById(‘content-div’).innerHTML = “Hello World”;<br />}<br /> </script><br /> <div id=‘content-div’></div><br /> ]]></Content><br /></Module><br />
  9. 9. Developer Network<br />PART 2 – GADGET PROGRAMMING<br />
  10. 10. Developer Network<br />SciVerse APIs<br />There are two main APIs for SciVerse:<br />Framework API – with access to context and methods on the page<br />Content API – for search and retrieval of articles, authors and affiliations<br />
  11. 11. Developer Network<br />SciVerse – Framework API - ContextInfo<br />Most of the information visible on the page, is accessible by the gadget via the Framework API. The ContextInfo object returns among other the following information:<br />accountId, artNum, au1, au1First, au1Init, au1Suffix, au1Sur, auCorp, <br />authorKeywords, date, docTitle, doi, entitlement, genre, <br />indexTerms, individualUser, isbn, issn, issue, keywords, offset, originPage, <br />otherKeywords, pageContentDivTagName, pages, pageType, part, partTitle, <br />partValue, pii, platform, scDocId, scopusFlag, searchQuery, searchTerms, <br />secureAuthToken, sortOrder, sPage, srcTitle, ssn, timestamp, volume, year<br />// retrieving the authToken via the GetContextInfo method’s callback<br />function getContextInfoCallback(result){<br /> // get authtoken for content API call<br />varauthtoken = result.secureAuthtoken;<br />varsearchterm = result.searchTerms;<br />}<br />// retrieving the authToken via the gadget preferences<br /><script type="text/javascript"><br />varprefs = new gadgets.Prefs();<br />varauthToken = prefs.getString("secureAuthtoken");                               <br /></script><br />
  12. 12. Developer Network<br />Example - How to retrieve the authToken for the Content API call?<br />function init(){<br />gadgets.sciverse.getContextInfo(getContextInfoCallback); // this parameter is the callback method<br />}<br />function getContextInfoCallback(result){<br /> // get authtoken for content API call<br />varauthtoken = result.secureAuthtoken;<br />varsearchterm = result.searchTerms;<br />}<br />// after pageload finishes, this executes the init method, which will trigger following functions<br />gadgets.util.registerOnLoadHandler(init);<br />OR <br /><UserPref name="contentApiKey" datatype="hidden" default_value="your-api-key-here" /> <br /><UserPref name="secureAuthtoken" datatype="hidden" /> <br />…<br /><script type="text/javascript"><br />varprefs = new gadgets.Prefs();<br />varauthToken = prefs.getString("secureAuthtoken"); <br /></script><br />Also, see the example code at <br /><br />
  13. 13. Developer Network<br />VIEWS and FIELDS<br />The {content-category} identifies the type of content. This is divided into:<br />article–Serial and non-serial full text documents from journals and books published by Elsevier<br />abstract– Abstracts from Scopus<br />author– Author profiles generated from Scopus data.<br />affiliation – Affiliation profiles generated from Scopus data.<br />The {identifier_label}distinguishes the type of identifier :<br />DOI - for full-text documents, <br />SCOPUS_ID, <br />AUTHOD_ID - Elsevier identifier tied to an individual author, AFFIL_ID -Elsevier identifier tied to an institution (for use as an affiliation)<br />Other available unique identifiers available for use:<br />PII - Publisher Item Identifier , <br />PUBMED_ID<br />