Drupal syndication UA Webmasters May 8, 2013 Margrit McIntosh Moving content into and out of Drupal sites Drupal site File Other site Drupal site Overview 1. Creating outgoing content – Views: add a Feed (RSS, CSV, XML) 2. Consuming incoming content – Consuming Feeds or files – Migrating content between Drupal sites 3. Use case: Creating nodes from XML feed 4. Use case: Creating nodes from EDS records via LDAP Overview: Modules • Aggregator (optional Drupal core) • Views – Views data export – for creating CSV or XML feeds • Feeds – Feeds Tamper – Feeds XPath Parser – for incoming XML feeds • LDAP • UUID • Services - allows a Drupal site to provide web services via multiple interfaces (REST, XMLRPC, JSON, JSON-RPC, SOAP, AMF, etc.) Not covered: using the LDAP module for user provisioning, user authentication, or user authorization. Overview 1. Creating outgoing content – whole-site RSS publishing http://yoursite.com/rss.xml – Views: add a Feed (RSS, CSV, XML) 2. Consuming incoming content – Consuming Feeds or files – Migrating content between Drupal sites 3. Use case: Creating nodes from XML feed 4. Use case: Creating nodes from EDS records via LDAP Demo: Exporting RSS Feed • Create and populate content type to export via feed • Create a View and use the Feed plugin • If needed, edit content type to add fields to Teaser view mode • Note that all fields will be contained in the <Description> Demo: Exporting CSV and XML Feeds • Install Views Data Export module • In a View, add your fields, then – add Data export (default is CSV) – (or) add Data export and modify to XML If exporting XML, check your feed to make sure it is not malformed. Overview 1. Creating outgoing content – Views: add a Feed (RSS, CSV, XML) 2. Consuming incoming content – Consuming Feeds or files – Migrating content between Drupal sites 3. Use case: Creating nodes from XML feed 4. Use case: Creating nodes from EDS records via LDAP Incoming: Aggregator • Optional core module Aggregator • Does not make nodes • Useful for simple uncomplicated presentation of incoming feeds Incoming: Feeds • Can import or aggregate data as nodes, users, taxonomy terms or simple database records • Receives RSS/Atom, CSV, OPML • Feeds XPathParser lets you map bits from raw XML feed to fields • Feeds ImageGrabber lets you import images to an image field • Feeds Tamper lets you massage fields example: csv file import Overview 1. Creating outgoing content – Views: add a Feed (RSS, CSV, XML) 2. Consuming incoming content – Consuming Feeds – Migrating content between Drupal sites 3. Use case: Creating nodes from XML feed 4. Use case: Creating nodes from EDS records via LDAP Overview 1. Creating outgoing content – Views: add a Feed (RSS, CSV, XML) 2. Consuming incoming content – Consuming Feeds – Migrating content between Drupal sites 3. Use case: Creating nodes from XML feed 4. Use case: Creating nodes from EDS records via LDAP Demo: COM D7 OPA News Overview 1. Creating outgoing content – Views: add a Feed (RSS, CSV, XML) 2. Consuming incoming content – Consuming Feeds – Migrating content between Drupal sites 3. Use case: Creating nodes from XML feed 4. Use case: Creating nodes from EDS records via LDAP A word of warning: Creating a directory from EDS does NOT get rid of these problems: 1. incorrect data 2. disliked data 3. data curation responsibility 4. expiring outdated nodes EDS to nodes via LDAP • You will need to get an account to access EDS: need two people who are FERPA-trained to be account holders. • You will need to have the LDAP Extension to PHP installed on your server. • Multivalue attributes will not get into a multivalue field unless you hack the module So you’ve decided to LDAP your Directory. . . Now that you have your EDS account and your server is set up . . . • Decide what attributes you want http://sia.uits.arizona.edu/eds_attributes • Create content type to hold people • Set up your LDAP Server • Start running some test queries Demo: test query Feed Importer • For testing: create a query that returns a handful of records • Create a new content type just for the Importer to attach to. • Set up the Feed Importer and do your mapping • Test it and see if it creates a handful of nodes Demo: COM D7 People with Feeds Tamper Overview 1. Creating outgoing content – Views: add a Feed (RSS, CSV, XML) 2. Consuming incoming content – Consuming Feeds or files – Migrating content between Drupal sites 3. Use case: Creating nodes from XML feed 4. Use case: Creating nodes from EDS records via LDAP