Connected! How we Integrated our Collections in WordPress using the EMu API   Paul Trafford [email_address] October 2011 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
The promise 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
The problem 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15 www.mhs.ox.ac.uk emu.mhs.ox.ac.uk
Outline of a Solution Install WordPress CMS Customise MHS Theme Copy over, tweak, configure EMu PHP API Extend theme by developing library of EMU-specific functions. Reference in WP pages via shortcodes. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
Connected! 1/6 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
Connected! 2/6 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15 WordPress integration of related resources
Connected! 3/6 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15 Same interface as before.  This actually searches across many fields (which we could allow user to define). Same search options as before
Connected! 4/6 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15 Hyperlinks to record details Image thumbnail  links to full size images Combined List and Thumbnail views
Connected! 5/6 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15 Hyperlinks allowing onward navigation
Connected! 6/6 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15 Searched creation place field for  Nuremberg
User Benefits Consistent look and feel Closer Integration Better navigation between objects and exhibits Staff access to internal details (via WordPress login).  E.g. display of images without watermarks. Staff updates/edits possible of EMu-related information pages. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
System Development Benefits One fewer web servers to maintain Code all in one place Great flexibility in developing collections functionality and also in styling output. Allows EMu data to be released according to WordPress sessions. Encourages cross-linking to/from e.g. exhibition sites. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
Caveats Low-level API means quite a lot of coding Uses a copy of the PHP API bundle in a WordPress directory -> manual updates Some sorting queries appear inefficient (as at 4.0.01) Name spaces: rename the EMu  Query  class and  Fetch()  method. Dependence: if WordPress is inaccessible then so is the catalogue. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
WordPress: Search Interface Standard HTML form specified by: <form action=&quot;results-list/&quot; method=&quot;get&quot;>   ... Indicate query type: <input name=&quot;QueryName&quot; type=&quot;hidden&quot; value=&quot; BasicQuery &quot; /> Other options: <input class=&quot;WebInput&quot; name=&quot;ImagesOnly&quot; type=&quot;checkbox&quot; value=&quot;true&quot; /> 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15 One search page for  basic , field, advanced search.  E.g.
WordPress: Results Page - results as a list view  [print_emusearch_results] - display of object records [print_emudisplay_page] - narratives display [print_emunarrative] 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15 A small set of pages, with the display of results data invoked via WordPress shortcodes:
EMu use within WordPress 1/3 EMu functions Include EMu config and query class files: <?php   require_once( TEMPLATEPATH. '/emuphp5/config.php' );   require_once( TEMPLATEPATH. '/emuphp5/query.php' ); ... 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
EMu use within WordPress 2/3 Build the query (as per documentation), e.g. <?php   $query1 = new EMuQuery();  $query1->Table=&quot;ecatalogue&quot;; ... // save resources by specifying the return of only what we need   $query1->StartRec=$list_start;  $query1->EndRec=$list_start+$list_size; // build up the query term and then execute it:   $queryterm=&quot;(TitMainTitle contains '~$query')&quot;;  …   $query1->TexqlTerm($queryterm);  $results=$query1->EMuFetch(); // proceed to process results in $results. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
EMu use within WordPress 3/3 MHS developed a (cheeky?) watermarking solution within WP. Modification of supplied query.php (for security) Uses GD library, doesn’t require ImageMagick Includes session info (via wp-blog-header.php) Modifies Show() function to display watermark depending upon image size and session state. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
Limitations Not much documentation (and it’s not very visible) Use of Texxmlserver means it has no understanding of EMu … Authorisation (as defined in EMu registration) has to be implemented some other way …  For a small organisation like MHS, roles in WordPress may suffice 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
Conclusions WordPress integration is fine Implementation complete, but took some effort Expect to develop further functionality, particularly 2-way linking to/from existing Exhibition sites Will seek to go beyond just object records However, IMu offers a far more advanced (and supported) option – in Web services and APIs. Will investigate IMu concurrently. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15
Any Questions? Paul Trafford Web Officer Museum of the History of Science Oxford OX2 8DD, UK [email_address] 05/10/2011 http://www.mhs.ox.ac.uk/ Slide  /15

KE User Group 2011 showcase: WordPress integration

  • 1.
    Connected! How weIntegrated our Collections in WordPress using the EMu API Paul Trafford [email_address] October 2011 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 2.
    The promise 05/10/2011http://www.mhs.ox.ac.uk/ Slide /15
  • 3.
    The problem 05/10/2011http://www.mhs.ox.ac.uk/ Slide /15 www.mhs.ox.ac.uk emu.mhs.ox.ac.uk
  • 4.
    Outline of aSolution Install WordPress CMS Customise MHS Theme Copy over, tweak, configure EMu PHP API Extend theme by developing library of EMU-specific functions. Reference in WP pages via shortcodes. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 5.
    Connected! 1/6 05/10/2011http://www.mhs.ox.ac.uk/ Slide /15
  • 6.
    Connected! 2/6 05/10/2011http://www.mhs.ox.ac.uk/ Slide /15 WordPress integration of related resources
  • 7.
    Connected! 3/6 05/10/2011http://www.mhs.ox.ac.uk/ Slide /15 Same interface as before. This actually searches across many fields (which we could allow user to define). Same search options as before
  • 8.
    Connected! 4/6 05/10/2011http://www.mhs.ox.ac.uk/ Slide /15 Hyperlinks to record details Image thumbnail links to full size images Combined List and Thumbnail views
  • 9.
    Connected! 5/6 05/10/2011http://www.mhs.ox.ac.uk/ Slide /15 Hyperlinks allowing onward navigation
  • 10.
    Connected! 6/6 05/10/2011http://www.mhs.ox.ac.uk/ Slide /15 Searched creation place field for Nuremberg
  • 11.
    User Benefits Consistentlook and feel Closer Integration Better navigation between objects and exhibits Staff access to internal details (via WordPress login). E.g. display of images without watermarks. Staff updates/edits possible of EMu-related information pages. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 12.
    System Development BenefitsOne fewer web servers to maintain Code all in one place Great flexibility in developing collections functionality and also in styling output. Allows EMu data to be released according to WordPress sessions. Encourages cross-linking to/from e.g. exhibition sites. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 13.
    Caveats Low-level APImeans quite a lot of coding Uses a copy of the PHP API bundle in a WordPress directory -> manual updates Some sorting queries appear inefficient (as at 4.0.01) Name spaces: rename the EMu Query class and Fetch() method. Dependence: if WordPress is inaccessible then so is the catalogue. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 14.
    WordPress: Search InterfaceStandard HTML form specified by: <form action=&quot;results-list/&quot; method=&quot;get&quot;> ... Indicate query type: <input name=&quot;QueryName&quot; type=&quot;hidden&quot; value=&quot; BasicQuery &quot; /> Other options: <input class=&quot;WebInput&quot; name=&quot;ImagesOnly&quot; type=&quot;checkbox&quot; value=&quot;true&quot; /> 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15 One search page for basic , field, advanced search. E.g.
  • 15.
    WordPress: Results Page- results as a list view [print_emusearch_results] - display of object records [print_emudisplay_page] - narratives display [print_emunarrative] 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15 A small set of pages, with the display of results data invoked via WordPress shortcodes:
  • 16.
    EMu use withinWordPress 1/3 EMu functions Include EMu config and query class files: <?php require_once( TEMPLATEPATH. '/emuphp5/config.php' ); require_once( TEMPLATEPATH. '/emuphp5/query.php' ); ... 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 17.
    EMu use withinWordPress 2/3 Build the query (as per documentation), e.g. <?php $query1 = new EMuQuery(); $query1->Table=&quot;ecatalogue&quot;; ... // save resources by specifying the return of only what we need $query1->StartRec=$list_start; $query1->EndRec=$list_start+$list_size; // build up the query term and then execute it: $queryterm=&quot;(TitMainTitle contains '~$query')&quot;; … $query1->TexqlTerm($queryterm); $results=$query1->EMuFetch(); // proceed to process results in $results. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 18.
    EMu use withinWordPress 3/3 MHS developed a (cheeky?) watermarking solution within WP. Modification of supplied query.php (for security) Uses GD library, doesn’t require ImageMagick Includes session info (via wp-blog-header.php) Modifies Show() function to display watermark depending upon image size and session state. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 19.
    Limitations Not muchdocumentation (and it’s not very visible) Use of Texxmlserver means it has no understanding of EMu … Authorisation (as defined in EMu registration) has to be implemented some other way … For a small organisation like MHS, roles in WordPress may suffice 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 20.
    Conclusions WordPress integrationis fine Implementation complete, but took some effort Expect to develop further functionality, particularly 2-way linking to/from existing Exhibition sites Will seek to go beyond just object records However, IMu offers a far more advanced (and supported) option – in Web services and APIs. Will investigate IMu concurrently. 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15
  • 21.
    Any Questions? PaulTrafford Web Officer Museum of the History of Science Oxford OX2 8DD, UK [email_address] 05/10/2011 http://www.mhs.ox.ac.uk/ Slide /15