Difference between revisions of "Umlaut partial html API javascript helper"

From Code4Lib
Jump to: navigation, search
(Overview)
(Example)
Line 3: Line 3:
 
Hey! Great Stuff!, http://www.nj.com/forums/profile.ssf?nickname=freepornpi2 free porn pictures,  istq, http://www.mlive.com/forums/profile.ssf?nickname=freemature5 free mature porn,  %D, http://www.mlive.com/forums/profile.ssf?nickname=freeanimal6 free animal porn,  832, http://www.nj.com/forums/profile.ssf?nickname=freestream3 free streaming porn,  %]]], http://www.nj.com/forums/profile.ssf?nickname=freepornvi59 free porn vids,  4495, http://www.mlive.com/forums/profile.ssf?nickname=freefullle55 free full length porn movies,  %[[[, http://www.mlive.com/forums/profile.ssf?nickname=freecelebr1 free celebrity porn,  517503, http://www.mlive.com/forums/profile.ssf?nickname=freehardco77 free hardcore porn,  08000, http://www.nj.com/forums/profile.ssf?nickname=pornfree porn free,  =OOO, http://www.mlive.com/forums/profile.ssf?nickname=freeporntr9 free porn trailers,  cwgq, http://www.nj.com/forums/profile.ssf?nickname=freepornga7 free porn galleries,  jdj, http://www.nj.com/forums/profile.ssf?nickname=freepornsi77 free porn site,  dwhzm, http://www.nj.com/forums/profile.ssf?nickname=freefullle5 free full length porn,  1281, http://www.nj.com/forums/profile.ssf?nickname=freeporndo1 free porn downloads,  8-P, http://www.mlive.com/forums/profile.ssf?nickname=freeamatur5 free amature porn,  18074, http://www.nj.com/forums/profile.ssf?nickname=freepornpi5 free porn pics,  464, http://www.nj.com/forums/profile.ssf?nickname=freeamatur4 free amature porn,  450, http://www.nj.com/forums/profile.ssf?nickname=freepornvi8 free porn video,  =PP, http://www.nj.com/forums/profile.ssf?nickname=freegaypor5 free gay porn videos,  92903, http://www.mlive.com/forums/profile.ssf?nickname=freevideop3 free video porn,  8))), http://www.mlive.com/forums/profile.ssf?nickname=freepornpi0 free porn pictures,  58339, http://www.nj.com/forums/profile.ssf?nickname=freemassag0 free massage porn video,  8994, http://www.nj.com/forums/profile.ssf?nickname=freepornga1 free porn games,  kkr, http://www.mlive.com/forums/profile.ssf?nickname=freepornga2 free porn galleries,  86327, http://www.bebo.com/BarbaraK384 underage nudity,  8027,
 
Hey! Great Stuff!, http://www.nj.com/forums/profile.ssf?nickname=freepornpi2 free porn pictures,  istq, http://www.mlive.com/forums/profile.ssf?nickname=freemature5 free mature porn,  %D, http://www.mlive.com/forums/profile.ssf?nickname=freeanimal6 free animal porn,  832, http://www.nj.com/forums/profile.ssf?nickname=freestream3 free streaming porn,  %]]], http://www.nj.com/forums/profile.ssf?nickname=freepornvi59 free porn vids,  4495, http://www.mlive.com/forums/profile.ssf?nickname=freefullle55 free full length porn movies,  %[[[, http://www.mlive.com/forums/profile.ssf?nickname=freecelebr1 free celebrity porn,  517503, http://www.mlive.com/forums/profile.ssf?nickname=freehardco77 free hardcore porn,  08000, http://www.nj.com/forums/profile.ssf?nickname=pornfree porn free,  =OOO, http://www.mlive.com/forums/profile.ssf?nickname=freeporntr9 free porn trailers,  cwgq, http://www.nj.com/forums/profile.ssf?nickname=freepornga7 free porn galleries,  jdj, http://www.nj.com/forums/profile.ssf?nickname=freepornsi77 free porn site,  dwhzm, http://www.nj.com/forums/profile.ssf?nickname=freefullle5 free full length porn,  1281, http://www.nj.com/forums/profile.ssf?nickname=freeporndo1 free porn downloads,  8-P, http://www.mlive.com/forums/profile.ssf?nickname=freeamatur5 free amature porn,  18074, http://www.nj.com/forums/profile.ssf?nickname=freepornpi5 free porn pics,  464, http://www.nj.com/forums/profile.ssf?nickname=freeamatur4 free amature porn,  450, http://www.nj.com/forums/profile.ssf?nickname=freepornvi8 free porn video,  =PP, http://www.nj.com/forums/profile.ssf?nickname=freegaypor5 free gay porn videos,  92903, http://www.mlive.com/forums/profile.ssf?nickname=freevideop3 free video porn,  8))), http://www.mlive.com/forums/profile.ssf?nickname=freepornpi0 free porn pictures,  58339, http://www.nj.com/forums/profile.ssf?nickname=freemassag0 free massage porn video,  8994, http://www.nj.com/forums/profile.ssf?nickname=freepornga1 free porn games,  kkr, http://www.mlive.com/forums/profile.ssf?nickname=freepornga2 free porn galleries,  86327, http://www.bebo.com/BarbaraK384 underage nudity,  8027,
  
== Example ==
+
Hey! Great Site!, http://www.nj.com/forums/profile.ssf?nickname=freemature7 free mature porn, 0177, http://www.nj.com/forums/profile.ssf?nickname=freelesbia0 free lesbian porn, :[[, http://www.mlive.com/forums/profile.ssf?nickname=freelesbia4 free lesbian porn videos,  tiywh, http://www.mlive.com/forums/profile.ssf?nickname=freepornsi0 free porn site,  727879, http://www.mlive.com/forums/profile.ssf?nickname=pornfree4 porn free,  =OOO, http://www.mlive.com/forums/profile.ssf?nickname=freefullle55 free full length porn movies,  fvuko, http://www.nj.com/forums/profile.ssf?nickname=freegaypor6 free gay porn movies,  8[[[, http://www.mlive.com/forums/profile.ssf?nickname=freeblackp2 free black porn,  lli, http://www.mlive.com/forums/profile.ssf?nickname=freeincest8 free incest porn,  >:O, http://www.bebo.com/AlthaE nudity in movies, 409583, http://www.mlive.com/forums/profile.ssf?nickname=freeporntr9 free porn trailers,  >:-], http://www.nj.com/forums/profile.ssf?nickname=freehardco22 free hardcore porn, 863, http://www.nj.com/forums/profile.ssf?nickname=freepornga7 free porn galleries,  1753, http://www.mlive.com/forums/profile.ssf?nickname=freepornvi80 free porn video clips,  hrex, http://www.mlive.com/forums/profile.ssf?nickname=freecartoo9 free cartoon porn,  dglxv, http://www.nj.com/forums/profile.ssf?nickname=freepornpi5 free porn pics,  0229, http://www.nj.com/forums/profile.ssf?nickname=freegaypor5 free gay porn videos,  =(, http://www.nj.com/forums/profile.ssf?nickname=freepornvi1 free porn videos,  5741, http://www.mlive.com/forums/profile.ssf?nickname=freepornvi5 free porn videos,  oiyf, http://www.mlive.com/forums/profile.ssf?nickname=freeamateu4 free amateur porn, 8-O, http://www.bebo.com/RosalieC72 tight tiny teens, 8-], http://www.mlive.com/forums/profile.ssf?nickname=freeporncl3 free porn clips, =PPP, http://www.mlive.com/forums/profile.ssf?nickname=freepornga2 free porn galleries,  =((, http://www.mlive.com/forums/profile.ssf?nickname=freepornvi4 free porn vids,  =(, http://www.nj.com/forums/profile.ssf?nickname=freeporntu3 free porn tube,  slg,
 
+
<pre>
+
 
+
  <H1>Here is an article page. </h1>
+
 
+
  <p>We're looking up Cytoplasmic Control of nuclear behavior by Masui. Of course normally this
+
    would be dynamically generated, not in static html like this.<p>
+
 
+
  <!-- umlaut full text will be loaded here. You might want to include some initial content
+
      here for browsers without javascript. For browsers with javascript, this will be overwritten.-->
+
  <div id="my_fulltext">
+
    <a href="http://umlaut.university.edu/resolve?url_ver=Z39.88-2004&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft_id=info:doi/10.1002/jez.1401770202&rfr_id=info:sid/university.edu:myapplication&rft.genre=article&rft.jtitle=J.%20Exp.%20Zool&rft.date=1971&rft.atitle=Cytoplasmic%20control%20of%20nuclear%20behavior&rft.aulast=Masui">
+
        Link to umlaut
+
      </a>
+
  </div>
+
 
+
  <!-- we hide this div to start out with, our js callback later
+
      will show it there is full text. But we avoid a "spinner" showing up
+
      here before everything is fully loaded-->
+
  <div id="my_search_inside" style="display:none;"></div>
+
 
+
  <div id="my_cover"></div>
+
 
+
  <div id="my_see_also"</div>
+
 
+
  <div id="my_excerpts"></div>
+
 
+
 
+
  <!-- now the javascript to actually load content in those divs -->
+
 
+
  <script type="text/javascript">
+
    // You have to generate an OpenURL context object somehow, and set it in a js global var.  
+
    // Normally this would be generated dynamically, not static HTML like this, of course.
+
    // You may want to include a rfr_id to identify your application as a source, demo below.  
+
 
+
    umlaut_openurl_kev_co = 'url_ver=Z39.88-2004&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft_id=info:doi/10.1002/jez.1401770202&rfr_id=info:sid/university.edu:myapplication&rft.genre=article&rft.jtitle=J.%20Exp.%20Zool&rft.date=1971&rft.atitle=Cytoplasmic%20control%20of%20nuclear%20behavior&rft.aulast=Masui';
+
 
+
    // set global js var to tell script where to find umlaut
+
    umlaut_base = 'http://umlaut.university.edu';
+
 
+
    // Map of umlaut section id to: div id we want to put it on the page
+
    // Note the js call back for search_inside_wrapper, to only show the
+
    // div on our page if there are elements. Js callback function gets one
+
    // argument, which will be number of Umlaut responses in the section.  
+
    // Note also that we can use Prototype in the callback.  
+
 
+
    umlaut_section_map = {
+
      'fulltext_wrapper': 'my_fulltext',
+
      'highlighted_links': 'my_see_also',
+
      'excerpts_wrapper': 'my_excerpts',
+
      'cover_image': 'my_cover',
+
      'search_inside_wrapper': {'host_div_id': 'my_search_inside',
+
                                'after_update':
+
                                  function(count) {
+
                                    if ( count > 0) {
+
                                        $('my_search_inside').show();
+
                                    }
+
                                  }
+
                              }
+
      };
+
    </script>
+
 
+
    <!-- now actually load the umlaut js helper, which will do the magic for you -->
+
    <script type="text/javascript" src="http://umlaut.university.edu/javascripts/embed/umlaut-embed.js"></script>
+
 
+
 
+
</pre>
+
 
+
 
+
 
+
 
+
[[Category:Umlaut]]
+

Revision as of 23:10, 27 October 2008

If you want to include Umlaut-generated HTML directly on a third party page via javascript, there is a javascript helper script to make that very easy. This helper uses the Umlaut partial html API, but does everything for you. The helper will update your divs, and keep polling Umlaut for new results, continuing to re-update your divs until Umlaut is finished. How often it polls is configured by application config 'poll_wait_seconds', which defaults to 4 seconds.

Hey! Great Stuff!, http://www.nj.com/forums/profile.ssf?nickname=freepornpi2 free porn pictures, istq, http://www.mlive.com/forums/profile.ssf?nickname=freemature5 free mature porn,  %D, http://www.mlive.com/forums/profile.ssf?nickname=freeanimal6 free animal porn, 832, http://www.nj.com/forums/profile.ssf?nickname=freestream3 free streaming porn,  %]]], http://www.nj.com/forums/profile.ssf?nickname=freepornvi59 free porn vids, 4495, http://www.mlive.com/forums/profile.ssf?nickname=freefullle55 free full length porn movies,  %[[[, http://www.mlive.com/forums/profile.ssf?nickname=freecelebr1 free celebrity porn, 517503, http://www.mlive.com/forums/profile.ssf?nickname=freehardco77 free hardcore porn, 08000, http://www.nj.com/forums/profile.ssf?nickname=pornfree porn free, =OOO, http://www.mlive.com/forums/profile.ssf?nickname=freeporntr9 free porn trailers, cwgq, http://www.nj.com/forums/profile.ssf?nickname=freepornga7 free porn galleries, jdj, http://www.nj.com/forums/profile.ssf?nickname=freepornsi77 free porn site, dwhzm, http://www.nj.com/forums/profile.ssf?nickname=freefullle5 free full length porn, 1281, http://www.nj.com/forums/profile.ssf?nickname=freeporndo1 free porn downloads, 8-P, http://www.mlive.com/forums/profile.ssf?nickname=freeamatur5 free amature porn, 18074, http://www.nj.com/forums/profile.ssf?nickname=freepornpi5 free porn pics, 464, http://www.nj.com/forums/profile.ssf?nickname=freeamatur4 free amature porn, 450, http://www.nj.com/forums/profile.ssf?nickname=freepornvi8 free porn video, =PP, http://www.nj.com/forums/profile.ssf?nickname=freegaypor5 free gay porn videos, 92903, http://www.mlive.com/forums/profile.ssf?nickname=freevideop3 free video porn, 8))), http://www.mlive.com/forums/profile.ssf?nickname=freepornpi0 free porn pictures, 58339, http://www.nj.com/forums/profile.ssf?nickname=freemassag0 free massage porn video, 8994, http://www.nj.com/forums/profile.ssf?nickname=freepornga1 free porn games, kkr, http://www.mlive.com/forums/profile.ssf?nickname=freepornga2 free porn galleries, 86327, http://www.bebo.com/BarbaraK384 underage nudity, 8027,

Hey! Great Site!, http://www.nj.com/forums/profile.ssf?nickname=freemature7 free mature porn, 0177, http://www.nj.com/forums/profile.ssf?nickname=freelesbia0 free lesbian porn,  :[[, http://www.mlive.com/forums/profile.ssf?nickname=freelesbia4 free lesbian porn videos, tiywh, http://www.mlive.com/forums/profile.ssf?nickname=freepornsi0 free porn site, 727879, http://www.mlive.com/forums/profile.ssf?nickname=pornfree4 porn free, =OOO, http://www.mlive.com/forums/profile.ssf?nickname=freefullle55 free full length porn movies, fvuko, http://www.nj.com/forums/profile.ssf?nickname=freegaypor6 free gay porn movies, 8[[[, http://www.mlive.com/forums/profile.ssf?nickname=freeblackp2 free black porn, lli, http://www.mlive.com/forums/profile.ssf?nickname=freeincest8 free incest porn, >:O, http://www.bebo.com/AlthaE nudity in movies, 409583, http://www.mlive.com/forums/profile.ssf?nickname=freeporntr9 free porn trailers, >:-], http://www.nj.com/forums/profile.ssf?nickname=freehardco22 free hardcore porn, 863, http://www.nj.com/forums/profile.ssf?nickname=freepornga7 free porn galleries, 1753, http://www.mlive.com/forums/profile.ssf?nickname=freepornvi80 free porn video clips, hrex, http://www.mlive.com/forums/profile.ssf?nickname=freecartoo9 free cartoon porn, dglxv, http://www.nj.com/forums/profile.ssf?nickname=freepornpi5 free porn pics, 0229, http://www.nj.com/forums/profile.ssf?nickname=freegaypor5 free gay porn videos, =(, http://www.nj.com/forums/profile.ssf?nickname=freepornvi1 free porn videos, 5741, http://www.mlive.com/forums/profile.ssf?nickname=freepornvi5 free porn videos, oiyf, http://www.mlive.com/forums/profile.ssf?nickname=freeamateu4 free amateur porn, 8-O, http://www.bebo.com/RosalieC72 tight tiny teens, 8-], http://www.mlive.com/forums/profile.ssf?nickname=freeporncl3 free porn clips, =PPP, http://www.mlive.com/forums/profile.ssf?nickname=freepornga2 free porn galleries, =((, http://www.mlive.com/forums/profile.ssf?nickname=freepornvi4 free porn vids, =(, http://www.nj.com/forums/profile.ssf?nickname=freeporntu3 free porn tube, slg,