When Webform and Feeds Aren't Enough

1,272 views
1,200 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
1,272
On SlideShare
0
From Embeds
0
Number of Embeds
56
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

When Webform and Feeds Aren't Enough

  1. 1. WHEN WEBFORM AND FEEDS AREN’T ENOUGH ^AND NODESMonday, July 30, 2012
  2. 2. WELCOME!2 Monday, July 30, 2012
  3. 3. ABOUT ME / US Keenan  Holloway  ::  Developer FORUM  ONE  ::  forumone.comMonday, July 30, 2012
  4. 4. THIS SESSION WILL COVER: An  overview  of  the  Data  module -­‐  What  it  does,  Strengths,  Weaknesses Various  valuable  uses -­‐  CreaHng/Defining  Data -­‐  ManipulaHng  Data  through  custom  Forms  module,  Direct   database  insert,  and  Views -­‐  InteracHng  with  data  through  Views  and  PanelsMonday, July 30, 2012
  5. 5. WHAT IT DOES Helps  you  model,  manage  and  query  custom   tables. Offers  an  administra@on  interface  and  a  low   level  API  for  manipula@ng  tables  and   accessing  their  contents. Provides  Views  integra@on.Monday, July 30, 2012
  6. 6. STRENGTHS Great  for  flat  simple  data  sets. Great  for  data  that  is  frequently  updated. Great  for  custom  module  interac@on. Simplis@c  table  design. Built  on  en@ty  framework. Integrates  with  views.Monday, July 30, 2012
  7. 7. WEAKNESSES Quite  a  few  bugs  present  most  likely  as  a   result  of  updated  support  modules. Coding  required  for  complex  table   rela@onships. Search  and  Feeds  integra@on  are  a  liLle   buggy  and  require  numerous  patches.Monday, July 30, 2012
  8. 8. DATA VS NODES8 Monday, July 30, 2012
  9. 9. CAPITAL BIKESHARE LETS BUILD IT! capitalbikeshare.com9 Monday, July 30, 2012
  10. 10. 2012 Q1 TRIP HISTORY DATA id;  bikeid;  sta+onid ;W00006    ;  31237 ;W00008    ;  31238 ;W00009    ;  31011 ;W00010    ;  31305 ;W00012    ;  31622 ;W00013    ;  31703 ;W00014    ;  31108 ;  ...  ;  ...Monday, July 30, 2012
  11. 11. MODULE VERSIONS data-­‐7.x-­‐1.x-­‐dev -­‐  Must  Install  Patch -­‐  h;p://drupal.org/node/1412014#comment-­‐5697626 ctools-­‐7.x-­‐1.x-­‐dev views-­‐7.x-­‐3.x-­‐dev panels-­‐7.x-­‐3.x-­‐devMonday, July 30, 2012
  12. 12. WE NEED BIKE STATIONSMonday, July 30, 2012
  13. 13. WE NEED BIKESMonday, July 30, 2012
  14. 14. LETS ADOPT THEMMonday, July 30, 2012
  15. 15. DEMONSTRATION TIME!15 Monday, July 30, 2012
  16. 16. sites/all/modules/contrib/bikes/bikes.info name  =  Bikes descrip/on  =  Form  UI  to  add  addi/onal  bikes. package  =  Bikes core  =  7.x php  =  5.2Monday, July 30, 2012
  17. 17. sites/all/modules/contrib/bikes/bikes.module <?php /**  *  Implements  hook_menu().  */ func/on  bikes_menu()  {    //  Add  menu  item  callback  for  custom  form    $items[bikes/add]  =  array(        type  =>  MENU_CALLBACK,            page  callback  =>  drupal_get_form,            page  arguments  =>  array(bikes_myform),  //  Returns  our  custom  form  item            access  arguments  =>  array(access  content),  //  Sets  access  to  see  this  form        );    return  $items; }Monday, July 30, 2012
  18. 18. sites/all/modules/contrib/bikes/bikes.module  (Con@nued...) /*  *  Defines  the  custom  input  form  */ func/on  bikes_myform()  {    //  Define  form  input  field  for  Bike  ID    $form[id]  =  array(        #type  =>  tex]ield,        #/tle  =>  t(Bike  ID),        #size  =>  30,        #maxlength  =>  64,        #descrip/on  =>  t(Enter  the  ID  of  the  bike.),    );    //  Define  form  input  field  for  Sta/on  ID    $form[sta/on_id]  =  array(        #type  =>  tex]ield,        #/tle  =>  t(Sta/on  ID),        #size  =>  30,        #maxlength  =>  64,        #descrip/on  =>  t(Enter  the  sta/on  ID  of  the  bike.),    );    //  Define  form  submit  bucon    $form[submit]  =  array(#type  =>  submit,  #value  =>  t(Save));    return  $form; }Monday, July 30, 2012
  19. 19. sites/all/modules/contrib/bikes/bikes.module  (Con@nued...) /*  *  Defines  submit  opera/ons  */ func/on  bikes_myform_submit($form,  &$form_state)  {    //  On  submit,  insert  the  Bike  ID  and  Sta/on  ID  fields  into  the  bikes  table    db_insert(bikes)    -­‐>fields(array(        bikeid  =>  $form_state[values][id],        sta/onid  =>  $form_state[values][sta/on_id],    ))    -­‐>execute();    //  Set  the  confirma/on  message    drupal_set_message(t(Your  form  has  been  saved.)); }Monday, July 30, 2012
  20. 20. WHAT WE COVERED: An  overview  of  the  Data  module -­‐  What  it  does,  Strengths,  Weaknesses Various  valuable  uses -­‐  CreaHng/Defining  Data -­‐  ManipulaHng  Data  through  custom  Forms  module,  Direct   database  insert,  and  Views -­‐  InteracHng  with  data  through  Views  and  PanelsMonday, July 30, 2012
  21. 21. THANKS! QUESTIONS AND ANSWERS21 Monday, July 30, 2012
  22. 22. CONTACT / RESOURCES Email:  holloway.keenan@gmail.com Drupal.org:  deviantpixel Presenta@on:  forumone.com/capitalcamp2012 Addi@onal:  forumone.com/blogs/post/drupal-­‐tutorial-­‐pushing-­‐ drupal-­‐6-­‐core-­‐auto-­‐completeMonday, July 30, 2012

×