Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011

2,793 views
2,620 views

Published on

Slideshow without talk not very useful. Posted for participants future reference.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,793
On SlideShare
0
From Embeds
0
Number of Embeds
35
Actions
Shares
0
Downloads
17
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • http://d7win.education.illinois.edu/ title, body, published, guid (many_nodes), content.csv "guid","title","created","alpha","beta","gamma","delta","body“, users.csv name,mail,since,password
  • https://preview.education.illinois.edu/admin/structure/feeds
  • https://preview.education.illinois.edu/admin/structure/feeds/faculty_taxonomy_importer https://preview.education.illinois.edu/admin/structure/feeds/webtools_listbuilder_importer
  • Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011

    1. 1. Feeds Module for Drupal 7 Use Cases, Overview, and Walktroughs
    2. 2. Who Am I? <ul><li>johnbarclay on drupal.org </li></ul><ul><li>University of Illinois College of Education web developer </li></ul><ul><li>Pixotech.com (Pixo) Consultant </li></ul><ul><li>Maintain LDAP module </li></ul><ul><li>Like drupal community/dev model </li></ul><ul><li>Need to be interrupted </li></ul>
    3. 3. Who are You? <ul><li>Who has used feeds in drupal 6 </li></ul><ul><li>Who has used feed in drupal 7 </li></ul><ul><li>Who knows they have a use case for feeds? </li></ul><ul><li>Who may have a use case for feeds (importing or synching data into drupal) </li></ul><ul><li>Be thinking of these for middle part of talk. </li></ul>
    4. 4. Goals <ul><li>In love with feeds. Using like crazy the last couple of months. </li></ul><ul><li>Want to: </li></ul><ul><li>sell the module it </li></ul><ul><li>give leg up and warnings for new users </li></ul><ul><li>give away a book </li></ul>
    5. 5. Breakdown <ul><li>Terms, Module Features, General Use Cases. 10 minutes. Keep me in check. </li></ul><ul><li>A simple node import walk through. 10 minutes. </li></ul><ul><li>Examples of use cases we’ve implemented or need to implement. 20 minutes. Start thinking. </li></ul><ul><li>Advanced Feeds. Gotchas and Tools. </li></ul>
    6. 6. What is Feeds Module? <ul><li>Feeds is a pluggable system for importing or aggregating content into Drupal. </li></ul><ul><li>Investing time into learning it can make user import, node import, etc. obsolete. </li></ul><ul><li>Very extensible. Class Based with stack of interchangeable plugins + hooks. </li></ul><ul><li>Supports exportables/features. </li></ul>
    7. 8. Use Cases for Site Builders <ul><li>Data Sources: RSS Feeds, XML Feeds, CSV Files, SOAP, WDSL, LDAP, Databases... </li></ul><ul><li>Data Targets: Nodes, Users, Taxonomy, ... </li></ul>
    8. 9. Use Cases For Developers <ul><li>For data ingestion, only need to write plugins for unique data sources or targets. Can leverage other plugins and core feeds functionality (batch, unique identifiers, user interface). </li></ul><ul><li>For migrations and many use cases don’t need any code at all </li></ul><ul><li>Supports exportables/features </li></ul>
    9. 10. Architecture Fetcher Parser Processor Importer mapper
    10. 11. Know the Lingo <ul><li>Feeds Glossary very helpful http://drupal.org/node/622710 </li></ul><ul><li>Key to understanding documentation </li></ul>
    11. 12. Fetcher <ul><li>Fetcher gets data. </li></ul><ul><li>Specific to transport/storage type </li></ul><ul><li>crawling, directory, file upload, http, ldap query, sql, </li></ul>
    12. 13. Parser <ul><li>Parser Normalizes Data. </li></ul><ul><li>Specific to data structure </li></ul><ul><li>Known Data Structures: CSV, RSS, LDAP Entry, OPML, SQL Recordset Customizable Data Structures: Querypath, Xpath, Xpath HTML </li></ul><ul><li>http://drupal.org/node/856644 </li></ul>
    13. 14. Processor <ul><li>Processor “does stuff”. Generally stores feed items in a data structure. Could send out emails or do other obscure use cases. </li></ul><ul><li>Node, Taxonomy Term, User built in. </li></ul><ul><li>Data, Commerce Products, Self Node Processor, etc. </li></ul>
    14. 15. (field) Mappers <ul><li>http://drupal.org/node/856780 </li></ul><ul><li>required to know where data from feed goes into a field. </li></ul><ul><li>basic core field types in Feeds module </li></ul><ul><li>contrib mappers in contrib modules </li></ul>
    15. 16. Other Terms <ul><li>plugin – fetcher, processor, parser </li></ul><ul><li>feed – body of data (csv file) </li></ul><ul><li>feed item – individual item (csv line) </li></ul><ul><li>feed node – confusing. instance of importer stored in node. </li></ul><ul><li>mapping – source to target field mapping </li></ul><ul><li>guid and unique target </li></ul>
    16. 17. Import CSV Example
    17. 18. Examples for Learning <ul><li>In the simpletest folder in feeds are example feeds sources and test configurations </li></ul>
    18. 19. Our Use Cases <ul><li>What are you using feeds for? </li></ul><ul><li>What do you need to either import on a one time basis or synch continually. </li></ul>
    19. 20. My Common Use Cases <ul><li>MSSQL Data Synch to Nodes & Taxonomy </li></ul><ul><li>XML Feed to Nodes </li></ul><ul><li>LDAP Query to User Records </li></ul><ul><li>CSV to Nodes to Taxonomy </li></ul>
    20. 21. Where are Plugins <ul><li>Processors and Mappers: for core structures such as node, user, and taxonomy in feeds module. Outside core, should be in related contrib module or own module. </li></ul><ul><li>http://drupal.org/node/856644 </li></ul>
    21. 22. 7.x version not ready <ul><li>Lots of bugs and RTBC patches </li></ul><ul><li>If it does the job great. Read issues. </li></ul><ul><li>When importing large amounts of data, everything has to work or need an alternative approach. </li></ul><ul><li>my notes: http://drupal.org/node/1301604 </li></ul><ul><li>if you use a patch, RTBC! </li></ul>
    22. 23. Feeds Tamper <ul><li>Handy for edge cases </li></ul><ul><li>trim, regex, explode, etc. </li></ul>
    23. 24. Write Plugins <ul><li>search the sandbox </li></ul><ul><li>use other plugins as templates </li></ul><ul><li>extend other plugins rather than rewriting </li></ul><ul><li>use file logging for debugging because of batch nature of execution. dpm() and tracing problematic. </li></ul>
    24. 25. Add to documentation <ul><li>http://drupal.org/node/1307732 </li></ul><ul><li>feeds are confusing </li></ul>
    25. 26. 7.x-2.x gotchas <ul><li>http://drupal.org/node/1301604 </li></ul>

    ×