when webform and feeds aren't enough

Post on 07-May-2015

1.079 Views

Category:

Business

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

WHEN WEBFORM AND FEEDS AREN’T ENOUGH^AND NODES

Monday, July 30, 2012

2

WELCOME!

Monday, July 30, 2012

ABOUT ME / USKeenan  Holloway  ::  DeveloperFORUM  ONE  ::  forumone.com

Monday, July 30, 2012

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  Panels

Monday, July 30, 2012

WHAT IT DOESHelps  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

STRENGTHSGreat  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

WEAKNESSESQuite  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

DATA VS NODES

Monday, July 30, 2012

CAPITAL BIKESHARELETS BUILD IT!

9

capitalbikeshare.com

Monday, July 30, 2012

2012 Q1 TRIP HISTORY DATAid;  bikeid;  sta+onid;W00006    ;  31237;W00008    ;  31238;W00009    ;  31011;W00010    ;  31305;W00012    ;  31622;W00013    ;  31703;W00014    ;  31108;  ...  ;  ...

Monday, July 30, 2012

MODULE VERSIONSdata-­‐7.x-­‐1.x-­‐dev-­‐  Must  Install  Patch-­‐  h;p://drupal.org/node/1412014#comment-­‐5697626

ctools-­‐7.x-­‐1.x-­‐devviews-­‐7.x-­‐3.x-­‐devpanels-­‐7.x-­‐3.x-­‐dev

Monday, July 30, 2012

WE NEED BIKE STATIONS

Monday, July 30, 2012

WE NEED BIKES

Monday, July 30, 2012

LETS ADOPT THEM

Monday, July 30, 2012

DEMONSTRATION TIME!

15

Monday, July 30, 2012

sites/all/modules/contrib/bikes/bikes.info

name  =  Bikesdescrip/on  =  Form  UI  to  add  addi/onal  bikes.package  =  Bikescore  =  7.xphp  =  5.2

Monday, July 30, 2012

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

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

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

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  Panels

Monday, July 30, 2012

THANKS!QUESTIONS AND ANSWERS

21

Monday, July 30, 2012

top related