cultuurnet showcase

100
Showcase Davy Van Den Bremt

Upload: davyvdb

Post on 30-Nov-2014

2.245 views

Category:

Technology


4 download

DESCRIPTION

 

TRANSCRIPT

  • 1. ShowcaseDavy Van Den Bremt
  • 2. What will you learn today? What CultuurNet does How and where they use Drupal How the reusable Drupal solution is built and works Some stuff we learned down the road
  • 3. For the Drupal geeksThis talk is about Drupal sites where the content and users live outside of Drupal. So no nodes and no Drupal users.
  • 4. Who I am Davy Van Den Bremt More than 5 years Drupal Involved in development of multiple CultuurNet solutions over 3 years Working at Krimson
  • 5. What Cultuurnet does ... thats relevant to this talk
  • 6. Gather events (in Flanders) ...
  • 7. Distribute these events ...
  • 8. ... by region ...
  • 9. ... by target audience ...
  • 10. ... on multiple platforms ...
  • 11. iPhone
  • 12. Mobile web
  • 13. Android
  • 14. Philips TV
  • 15. Distribute everywhere On own platforms On other peoples platforms
  • 16. Create an experience ... around that content
  • 17. Enrich content
  • 18. Building a central user prole
  • 19. Let people express what they like and go to
  • 20. Recommend events and users
  • 21. The platform
  • 22. Widgets Drupal websites Drupal modules Custom iPhone, Android, ... API APIUiTdatabank UiTid
  • 23. Widgets Drupal websites Drupal modules Custom iPhone, Android, ... API APIUiTdatabank UiTid
  • 24. UiTdatabank API Rest API XML or JSON response Slice of content based on API key
  • 25. UiTdatabank API Get events Get actors Get productions Get reports Get static values (cities, categories, ...)
  • 26. /events/search?key=1
  • 27. /events/search?key=1&q=madonna&city=gent
  • 28. /event/[CDBID]?key=1
  • 29. /events/report?key=1&city=gent
  • 30. Widgets Drupal websites Drupal modules Custom iPhone, Android, ... API APIUiTdatabank UiTid
  • 31. UiTid API (CultureFeed) Rest API XML or JSON response OAuth authentication
  • 32. UiTid API (CultureFeed) Gebruikers opvragen Gebruikers beheren Acties doen Aanbevelingen opvragen ...
  • 33. createUserupdateUserdeleteUsergetUsersearchUsersgetSimilarUsersuploadUserDepictionresendMboxConfirmationForUserupdateUserPrivacygetUserServiceConsumersrevokeUserServiceConsumerupdateUserOnlineAccountdeleteUserOnlineAccountcreateActivityupdateActivitydeleteActivitysearchActivitiessearchActivityUsersgetTopEventsgetRecommendationsForUsergetRecommendationsForEventevaluateRecommendationgetUrlAddSocialNetworkgetUrlChangePasswordgetUrlLogoutgetServiceConsumerscreateServiceConsumerupdateServiceConsumer
  • 34. /user/search (OAuth tokens!!!)
  • 35. Other systems Tracking(has API and JS suite) Enrichments (has API) Media indexer Agents
  • 36. So, wheres Drupal ?
  • 37. Media sites Media Indexer Youtube Wikipedia Resto.be Cobra CultureFeed UitDatabank Enrichments TrackingUiT in Vlaanderen UiT in Vlaanderen iPhone Android Philips TV Widgets MobileUiT met Vlieg UiT in Gent UiT in Vlaams-Brabant
  • 38. The Drupal solution
  • 39. Module suites CNApi CultureFeed
  • 40. Module suites vision Layered Each layer adds functionality Only use what you need Plug & play Its possible to get a full site out of the box Implements whats used on most sites
  • 41. CNAPIDrupal module suite for UiTdatabank API
  • 42. The CNApi suite modules API layer (cnapi) UI layer(cnapi_ui) Browse, search and lter UI elements (cnapi_browse) Some extra UI elements (cnapi_extras) Tracking (cnap_trackingi) Shadow nodes (cnapi_snode) View 3 integration (cnapi_views)
  • 43. API layer (cnapi) (Drupal) PHP implementation for UiTdatabank API Results parsed in array structures Caching implemented Removes quirks
  • 44. API layer : Example calls // List events UiT met kinderen in Leuven$query = array(city => Leuven,heading => 179);$result = cnapi_get_events($query);// List actors in Limburg$query = array(regio => Provincie Limburg);$result = cnapi_get_actors($query);// List productions in Bioscoop$query = array(locationtype => 8.9.1.0.0, type => 0.50.6.0.0);$result = cnapi_get_productions($query);// Detail eventobject Pukkelpop 2011$result = cnapi_get_event(96f4401d-800a-49ca-8c74-5d6e49b131b3);// Detail actorobject Ancienne Belgique$result = cnapi_get_actor(3b98fcf8-81e4-4cb0-a95a-50ee637a2b91);// Detail productionobject Cars 2: World Grand Prix$result = cnapi_get_production(c6efbab4-5e64-4f96-a26f-c00aa997a0ba);// Bovenstaande functies zijn wrappers rond cnapi_get$request = array(action => list_detail, type => event, query =>array(cityid => 9000_GENT));$result = cnapi_get($request);// Rubrieken$result = cnapi_get_headings();
  • 45. API layer : Example result
  • 46. UI layer (cnapi_ui) Provides result pages (context concept) Provides detail pages Provides RSS feeds Provides Drupal templates Implements tracking Provides helper functions to work with requests
  • 47. UI layer (cnapi_ui) SEO Optimised URL redirects canonical and noindex cnapi_ui_preprocess_link hook_url_(in/out)bound_alter
  • 48. Browse, search and lter UI elements (cnapi_browse)
  • 49. Some extra UI elements (cnapi_extras)
  • 50. Shadow nodes (cnapi_snode)
  • 51. Why create them? A lot of functionality is available that works on nodes Rating Comments Sharing
  • 52. What are shadow nodes? CDBID Create node when used rst time NID DrupalAPI object node Fetch info (in real time) Full when node is viewed CDBID details
  • 53. Why not sync all details? Theres a lot of details Theres a lot of data That can change Syncing is hard (how to detect changes?)
  • 54. How it was done
  • 55. CultureFeedDrupal module suite for UiTid API
  • 56. The CultureFeed suite modules PHP Class library API layer (culturefeed) UI layer(culturefeed_ui)
  • 57. PHP Class library Usable outside of Drupal context Object oriented Results parsed as typed objects
  • 58. Example usage
  • 59. Implements complete API
  • 60. API layer (culturefeed) Provides singleton object to make calls without caring about keys, secrets, ... and ask Drupal specic questions DrupalCultureFeed::doSomething() Implements caching layer Provides OAuth authentication callbacks
  • 61. Example usage
  • 62. Implements OAuth authentication
  • 63. UI layer (culturefeed_ui) Provide login block Provides pages to administer account Provides blocks with recommendation, related users, ...
  • 64. Lessons learned
  • 65. Use SEO as a performance optimisation tool
  • 66. Creating a userprogrammatically is heavy
  • 67. Learn custom url rewriting
  • 68. Pay attention to block caching
  • 69. Lazy content loading (1) Some pages have a lot of API calls to fetch all info. Fetch info using Ajax. Not possible by Drupal out of the box.
  • 70. Lazy content loading (2)
  • 71. Lazy content loading (3)
  • 72. Lazy content loading (3)
  • 73. Get the code http://github.com/davyvandenbremt/cnapi http://github.com/davyvandenbremt/culturefeed
  • 74. Questions?
  • 75. Davy Van Den [email protected]