SlideShare a Scribd company logo
Batch Scripting with Drupal
(Featuring the EntityFieldQuery API)
Engr.Ranel O.Padon
DrupalCamp Manila 2014
ranel.padon@gmail.com | https://github.com/ranelpadon
About Me
Full-time Drupal developer for CNN Travel
Part-time Python lecturer.
Involved in computational Java and Python projects before.
Plays competitive football and futsal.
TOPICS
Why do batch scripting?
How to leverage Entities and the EntityFieldQuery API.
How to implement a batch module?
Sample Actual Use Cases
Why do batching?
There are things that are hard to teach to robots:
spatial awareness and image interpretation.
But there are things that machines could do and easily beat humans:
doing repetitive tasks.
In Drupal, you don't want your site editors to do repetitive tasks:
e.g. updating a field to the same value.
Why do batching?
Avoids PHP Timeout
For implementating intsallation profiles
Why do batching?
Batch processing is execution of a series of programs on a
computer without manual intervention.
Designed to integrate nicely with the Form API, but can also be used
by non-Form API scripts.
Why do batching?
Avoids PHP Timeout (max_execution_time errors)
For long and complex data processing
You can give the admins real-time feedback or summary of results.
When to do batching?
Implementing installation profiles
Used by Drupal's install.php and update.php
Updating the value of a field for all Event nodes.
Deleting all nodes older than 3 years.
Migrating Column nodes to Column taxonomy terms.
Creating custom nodes upon saving a content with an uploaded Excel file,
Batch API is triggered by hook_node_presave() and
goes through each row of the attached Excel file.
The Rise of Entities
“Oh no, I left my stuff in our house.”
Stuff, just like entities, are useful abstraction.
They could change meaning depending on the context.
The Rise of Entities
In Physics, you could treat each object under study as particles.
In Drupal, they are called entities.
Facilitates a unified way to work
with different data units
Concept simplification contributes
to better modularity,flexibility and maintainability.
http://evolvingweb.ca/story/understanding-entity-api-module
The Rise of Entities
Before D7, users and comments didn't have the same power
that nodes (content) had.
no translations, fields, versioning, and so on.
Views (relies on fields) didn’t work with comments and users.
The Rise of Entities
Field is a reusable piece of content. Each field is a primitive data type,
with custom validators and widgets for editing and formatters for display.
Entity Type group together fields (use Entity API for custom ones):
Nodes (content)
Comments
Taxonomy Terms
User Profiles
The Rise of Entities
Bundles are an implementation of an entity type.
They are subtypes of an entity type.
Bundles (subtypes) like articles, events, blog posts, or products could be
generated from node entity. You could add a file download field on
Basic Pages and a subtitle field on Articles.
You could also assign geographic coordinates field to all bundles/entities.
The Rise of Entities
Entity would be one instance of a particular entity type
(specific article or specific user via entity_load()).
Drupal 7 Core provides entity_load(), while the Entity API contrib
module provides entity_save() and entity_delete().
The Rise of Entities
In terms of Object-Oriented Programming:
An entity type is a base class
A bundle is an extended/derived class
A field is a class member,attribute, or property,
An entity is an object or instance of a base or extended class
EntityFieldQuery API
Tool for querying Entities (compared to db_select())
Can query entity properties and fields
Can query field data across entity types:
Fetch all pages and users tagged with taxonomy term “premium”
Returns entity IDs that you could load using entity_load()
Database-agnostic (no issues when migrating from MySQL to PostgreSQL)
EntityFieldQuery API
Fetch all nodes.
EntityFieldQuery API
Fetch all nodes of type “Article”.
EntityFieldQuery API
Fetch all nodes of type “Article”, Published only.
EntityFieldQuery API
Tool for querying Entities
EntityFieldQuery API
Tool for querying Entities
EntityFieldQuery API
Tool for querying Entities
Custom Batch Module
Form API meets Batch API
Custom Batch Module
Batch 12 things, process 5 things at a time
http://www.ent.iastate.edu/it/Batch_and_Queue.pdf
Custom Batch Module
Form Submit trigger
http://www.ent.iastate.edu/it/Batch_and_Queue.pdf
Custom Batch Module
Multiple callback operations and the dynamic $context array (stored in db)
http://www.ent.iastate.edu/it/Batch_and_Queue.pdf
Custom Batch Module
Post Processing
http://www.ent.iastate.edu/it/Batch_and_Queue.pdf
Custom Batch Module
The usual suspects:
mybatch.info
mybatch.module
Then, enable the module in “admin/modules” or using Drush:
$ drush en -y mybatch
Custom Batch Module
Information required in mybatch.module, without a form:
I. URL that will be utilized.
II. Function callback definition for that URL.
Usually contains the setup for the batch process.
III.The batch operation's function definition.
IV.The function definition that will be called after
the batch operation.
Custom Batch Module
1.The batch module URL (http://localhost/admin/mybatch):
Custom Batch Module
1I. Function callback for the URL, setups the batch process.
Custom Batch Module
III. Define the operation callback.
Custom Batch Module
IV.Define the post-operation callback.
Custom Batch Module
Custom Batch Module
III. Define the operation callback (Enhancement).
III. Define the operation callback (Enhancement).
1I. Function callback for the URL (Enhancement).
Custom Batch Module
Information required in mybatch.module, when using a form:
I. URL that will be utilized.
II. Form callback definition for that URL (hook_form).
III. Form Submit definition.
Usually contains the setup for the batch process.
IV.The batch operation's function definition.
V.The function definition that will be called after the batch operation.
Custom Batch Module
Batch API with Form API:
Custom Batch Module
I. URL that will be utilized.
Custom Batch Module
II. Form callback definition for that URL (hook_form).
Custom Batch Module
III. Form Submit definition.
Custom Batch Module
Part IV and V don't need to be changed:
Our Use Case 1
We need to update the Short Bio field text format of User Profiles
from Full HTML to Editorial Filter:
Our Use Case 1
Using our last batch module example module (with form), all parts
except part IV and V will be almost similar.
IV (1/4):
IV (2/4):
IV (3/4):
IV (4/4):
V:
Our Use Case 2
Preview map images for City/Country taxonomy terms with no set
value: (http://travel.cnn.com/malaysia)
Our Use Case 2
Preview map images for City/Country taxonomy terms with no set
value: (http://travel.cnn.com/japan)
Our Use Case 2
Batch API with Form API (Updating the preview images,
part I and part V are almost similar to that of Use Case 1)
II. Form callback definition for that URL (hook_form).
III. Form Submit definition.
IV.Batch operations callback (highlights only)
IV.Batch operations callback (highlights only)
IV.Batch operations callback (highlights only)
IV.Batch operations callback (highlights only)
Summary
Information required in mybatch.module, without a form:
I. URL that will be utilized.
II. Function callback definition for that URL.
Usually contains the setup for the batch process.
III.The batch operation's function definition.
IV.The function definition that will be called after
the batch operation.
Summary
Information required in mybatch.module, when using a form:
I. URL that will be utilized.
II. Form callback definition for that URL (hook_form).
III. Form Submit definition.
Usually contains the setup for the batch process.
IV.The batch operation's function definition.
V.The function definition that will be called after the batch operation.
Summary
Implementing the Batch API without a form could be also
integrated to Drupal hooks or even Drush.
EntityFieldQuery integration to batch operations callback
will facilitate a more readable, flexible, and maintainable
data fetching in the batch process.
Recommended Links
Batch API Docs:
https://drupal.org/node/180528
Examples Module (Batch API):
http://d7.drupalexamples.info/examples/batch_example
Batch API integration with Drush:
http://www.metaltoad.com/blog/using-drupal-batch-api
EntityFieldQuery Docs:
https://drupal.org/node/1343708
EntityFieldQuery as alternative to Views:
http://treehouseagency.com/blog/tim-cosgrove/2012/02/16/entityfieldquery-let-drupal-do-heavy-lifting-pt-1
Long Live Open-Source!

More Related Content

PDF
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
PDF
Python Programming - III. Controlling the Flow
PDF
Python Programming - I. Introduction
PPTX
Intro To C++ - Class 14 - Midterm Review
PPTX
PPTX
Introduction to functional programming with java 8
PDF
Javanotes
PPT
Introduction to java
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
Python Programming - III. Controlling the Flow
Python Programming - I. Introduction
Intro To C++ - Class 14 - Midterm Review
Introduction to functional programming with java 8
Javanotes
Introduction to java

What's hot (18)

PPT
00 intro to java
PPTX
Insight into java 1.8, OOP VS FP
PPT
Java for C++ programers
PPT
DOC
Grade 8: Introduction To Java
PPTX
Java applet
PPT
C++ to java
PPTX
Programming in Java
PDF
Introduction of c# day3
PPTX
Java seminar
PDF
Hack in the Box GSEC 2016 - Reverse Engineering Swift Applications
PPT
Java for Recruiters
PDF
Java swing 1
PPTX
Java 8 - An Overview
PPT
PDF
Object oriented-programming-in-c-sharp
PDF
Bootstrapping iPhone Development
00 intro to java
Insight into java 1.8, OOP VS FP
Java for C++ programers
Grade 8: Introduction To Java
Java applet
C++ to java
Programming in Java
Introduction of c# day3
Java seminar
Hack in the Box GSEC 2016 - Reverse Engineering Swift Applications
Java for Recruiters
Java swing 1
Java 8 - An Overview
Object oriented-programming-in-c-sharp
Bootstrapping iPhone Development
Ad

Viewers also liked (20)

PDF
Switchable Map APIs with Drupal
PDF
Python Programming - XII. File Processing
PDF
PyCon PH 2014 - GeoComputation
PPT
Operating System Presentation
PDF
Manual clips
PDF
デザイナーがTkinterで遊んでみました。
PDF
Introdução a python módulo c
PPTX
Import python
PPTX
Python IDE Roundup
ODP
Creating masterpieces with raphael
PDF
Python Programming - VII. Customizing Classes and Operator Overloading
PDF
Py S60
PDF
Python Programming - IX. On Randomness
PDF
Virtual Memory
PPT
Understanding operating systems 5th ed ch04
PDF
Python Programming - XI. String Manipulation and Regular Expressions
PDF
Python Programming - VIII. Inheritance and Polymorphism
PDF
Introducción a dr racket
PDF
Power and Elegance - Leaflet + jQuery
Switchable Map APIs with Drupal
Python Programming - XII. File Processing
PyCon PH 2014 - GeoComputation
Operating System Presentation
Manual clips
デザイナーがTkinterで遊んでみました。
Introdução a python módulo c
Import python
Python IDE Roundup
Creating masterpieces with raphael
Python Programming - VII. Customizing Classes and Operator Overloading
Py S60
Python Programming - IX. On Randomness
Virtual Memory
Understanding operating systems 5th ed ch04
Python Programming - XI. String Manipulation and Regular Expressions
Python Programming - VIII. Inheritance and Polymorphism
Introducción a dr racket
Power and Elegance - Leaflet + jQuery
Ad

Similar to Batch Scripting with Drupal (Featuring the EntityFieldQuery API) (20)

PPT
Yii php framework_honey
PPTX
Cetas - Application Development Services
PDF
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
PPTX
Angular2 and You
PPTX
My Very First Zf App Part One
PPT
Understanding and extending p2 for fun and profit
PDF
Html 5 in a big nutshell
PPTX
Global Exception Handling Custom Error Connector In MuleSoft
PDF
.NET Portfolio
PPT
Spring training
PDF
Drupal 8 for site builders
PPT
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
PPT
Introduction to Zend Framework
PPTX
Angular kickstart slideshare
PPTX
Yii framework
PPT
Advanced Web Development
PDF
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
PPTX
mobile development using node js and java
PPTX
Orchard Dynamic Class Extensions
Yii php framework_honey
Cetas - Application Development Services
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Angular2 and You
My Very First Zf App Part One
Understanding and extending p2 for fun and profit
Html 5 in a big nutshell
Global Exception Handling Custom Error Connector In MuleSoft
.NET Portfolio
Spring training
Drupal 8 for site builders
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
Introduction to Zend Framework
Angular kickstart slideshare
Yii framework
Advanced Web Development
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
mobile development using node js and java
Orchard Dynamic Class Extensions

More from Ranel Padon (10)

PDF
CKEditor Widgets with Drupal
PDF
Views Unlimited: Unleashing the Power of Drupal's Views Module
PDF
Python Programming - XIII. GUI Programming
PDF
Python Programming - X. Exception Handling and Assertions
PDF
Python Programming - VI. Classes and Objects
PDF
Python Programming - V. Sequences (List and Tuples) and Dictionaries
PDF
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
PDF
Python Programming - II. The Basics
PDF
Of Nodes and Maps (Web Mapping with Drupal - Part II)
PDF
Web Mapping with Drupal
CKEditor Widgets with Drupal
Views Unlimited: Unleashing the Power of Drupal's Views Module
Python Programming - XIII. GUI Programming
Python Programming - X. Exception Handling and Assertions
Python Programming - VI. Classes and Objects
Python Programming - V. Sequences (List and Tuples) and Dictionaries
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - II. The Basics
Of Nodes and Maps (Web Mapping with Drupal - Part II)
Web Mapping with Drupal

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Modernizing your data center with Dell and AMD
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation_ Review paper, used for researhc scholars
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Network Security Unit 5.pdf for BCA BBA.
Electronic commerce courselecture one. Pdf
Big Data Technologies - Introduction.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Mobile App Security Testing_ A Comprehensive Guide.pdf
Modernizing your data center with Dell and AMD
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation_ Review paper, used for researhc scholars
The AUB Centre for AI in Media Proposal.docx
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
NewMind AI Monthly Chronicles - July 2025
Review of recent advances in non-invasive hemoglobin estimation
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Network Security Unit 5.pdf for BCA BBA.

Batch Scripting with Drupal (Featuring the EntityFieldQuery API)

  • 1. Batch Scripting with Drupal (Featuring the EntityFieldQuery API) Engr.Ranel O.Padon DrupalCamp Manila 2014 ranel.padon@gmail.com | https://github.com/ranelpadon
  • 2. About Me Full-time Drupal developer for CNN Travel Part-time Python lecturer. Involved in computational Java and Python projects before. Plays competitive football and futsal.
  • 3. TOPICS Why do batch scripting? How to leverage Entities and the EntityFieldQuery API. How to implement a batch module? Sample Actual Use Cases
  • 4. Why do batching? There are things that are hard to teach to robots: spatial awareness and image interpretation. But there are things that machines could do and easily beat humans: doing repetitive tasks. In Drupal, you don't want your site editors to do repetitive tasks: e.g. updating a field to the same value.
  • 5. Why do batching? Avoids PHP Timeout For implementating intsallation profiles
  • 6. Why do batching? Batch processing is execution of a series of programs on a computer without manual intervention. Designed to integrate nicely with the Form API, but can also be used by non-Form API scripts.
  • 7. Why do batching? Avoids PHP Timeout (max_execution_time errors) For long and complex data processing You can give the admins real-time feedback or summary of results.
  • 8. When to do batching? Implementing installation profiles Used by Drupal's install.php and update.php Updating the value of a field for all Event nodes. Deleting all nodes older than 3 years. Migrating Column nodes to Column taxonomy terms. Creating custom nodes upon saving a content with an uploaded Excel file, Batch API is triggered by hook_node_presave() and goes through each row of the attached Excel file.
  • 9. The Rise of Entities “Oh no, I left my stuff in our house.” Stuff, just like entities, are useful abstraction. They could change meaning depending on the context.
  • 10. The Rise of Entities In Physics, you could treat each object under study as particles. In Drupal, they are called entities. Facilitates a unified way to work with different data units Concept simplification contributes to better modularity,flexibility and maintainability. http://evolvingweb.ca/story/understanding-entity-api-module
  • 11. The Rise of Entities Before D7, users and comments didn't have the same power that nodes (content) had. no translations, fields, versioning, and so on. Views (relies on fields) didn’t work with comments and users.
  • 12. The Rise of Entities Field is a reusable piece of content. Each field is a primitive data type, with custom validators and widgets for editing and formatters for display. Entity Type group together fields (use Entity API for custom ones): Nodes (content) Comments Taxonomy Terms User Profiles
  • 13. The Rise of Entities Bundles are an implementation of an entity type. They are subtypes of an entity type. Bundles (subtypes) like articles, events, blog posts, or products could be generated from node entity. You could add a file download field on Basic Pages and a subtitle field on Articles. You could also assign geographic coordinates field to all bundles/entities.
  • 14. The Rise of Entities Entity would be one instance of a particular entity type (specific article or specific user via entity_load()). Drupal 7 Core provides entity_load(), while the Entity API contrib module provides entity_save() and entity_delete().
  • 15. The Rise of Entities In terms of Object-Oriented Programming: An entity type is a base class A bundle is an extended/derived class A field is a class member,attribute, or property, An entity is an object or instance of a base or extended class
  • 16. EntityFieldQuery API Tool for querying Entities (compared to db_select()) Can query entity properties and fields Can query field data across entity types: Fetch all pages and users tagged with taxonomy term “premium” Returns entity IDs that you could load using entity_load() Database-agnostic (no issues when migrating from MySQL to PostgreSQL)
  • 18. EntityFieldQuery API Fetch all nodes of type “Article”.
  • 19. EntityFieldQuery API Fetch all nodes of type “Article”, Published only.
  • 20. EntityFieldQuery API Tool for querying Entities
  • 21. EntityFieldQuery API Tool for querying Entities
  • 22. EntityFieldQuery API Tool for querying Entities
  • 23. Custom Batch Module Form API meets Batch API
  • 24. Custom Batch Module Batch 12 things, process 5 things at a time http://www.ent.iastate.edu/it/Batch_and_Queue.pdf
  • 25. Custom Batch Module Form Submit trigger http://www.ent.iastate.edu/it/Batch_and_Queue.pdf
  • 26. Custom Batch Module Multiple callback operations and the dynamic $context array (stored in db) http://www.ent.iastate.edu/it/Batch_and_Queue.pdf
  • 27. Custom Batch Module Post Processing http://www.ent.iastate.edu/it/Batch_and_Queue.pdf
  • 28. Custom Batch Module The usual suspects: mybatch.info mybatch.module Then, enable the module in “admin/modules” or using Drush: $ drush en -y mybatch
  • 29. Custom Batch Module Information required in mybatch.module, without a form: I. URL that will be utilized. II. Function callback definition for that URL. Usually contains the setup for the batch process. III.The batch operation's function definition. IV.The function definition that will be called after the batch operation.
  • 30. Custom Batch Module 1.The batch module URL (http://localhost/admin/mybatch):
  • 31. Custom Batch Module 1I. Function callback for the URL, setups the batch process.
  • 32. Custom Batch Module III. Define the operation callback.
  • 33. Custom Batch Module IV.Define the post-operation callback.
  • 35. Custom Batch Module III. Define the operation callback (Enhancement).
  • 36. III. Define the operation callback (Enhancement).
  • 37. 1I. Function callback for the URL (Enhancement).
  • 38. Custom Batch Module Information required in mybatch.module, when using a form: I. URL that will be utilized. II. Form callback definition for that URL (hook_form). III. Form Submit definition. Usually contains the setup for the batch process. IV.The batch operation's function definition. V.The function definition that will be called after the batch operation.
  • 39. Custom Batch Module Batch API with Form API:
  • 40. Custom Batch Module I. URL that will be utilized.
  • 41. Custom Batch Module II. Form callback definition for that URL (hook_form).
  • 42. Custom Batch Module III. Form Submit definition.
  • 43. Custom Batch Module Part IV and V don't need to be changed:
  • 44. Our Use Case 1 We need to update the Short Bio field text format of User Profiles from Full HTML to Editorial Filter:
  • 45. Our Use Case 1 Using our last batch module example module (with form), all parts except part IV and V will be almost similar.
  • 50. V:
  • 51. Our Use Case 2 Preview map images for City/Country taxonomy terms with no set value: (http://travel.cnn.com/malaysia)
  • 52. Our Use Case 2 Preview map images for City/Country taxonomy terms with no set value: (http://travel.cnn.com/japan)
  • 53. Our Use Case 2 Batch API with Form API (Updating the preview images, part I and part V are almost similar to that of Use Case 1)
  • 54. II. Form callback definition for that URL (hook_form).
  • 55. III. Form Submit definition.
  • 56. IV.Batch operations callback (highlights only)
  • 57. IV.Batch operations callback (highlights only)
  • 58. IV.Batch operations callback (highlights only)
  • 59. IV.Batch operations callback (highlights only)
  • 60. Summary Information required in mybatch.module, without a form: I. URL that will be utilized. II. Function callback definition for that URL. Usually contains the setup for the batch process. III.The batch operation's function definition. IV.The function definition that will be called after the batch operation.
  • 61. Summary Information required in mybatch.module, when using a form: I. URL that will be utilized. II. Form callback definition for that URL (hook_form). III. Form Submit definition. Usually contains the setup for the batch process. IV.The batch operation's function definition. V.The function definition that will be called after the batch operation.
  • 62. Summary Implementing the Batch API without a form could be also integrated to Drupal hooks or even Drush. EntityFieldQuery integration to batch operations callback will facilitate a more readable, flexible, and maintainable data fetching in the batch process.
  • 63. Recommended Links Batch API Docs: https://drupal.org/node/180528 Examples Module (Batch API): http://d7.drupalexamples.info/examples/batch_example Batch API integration with Drush: http://www.metaltoad.com/blog/using-drupal-batch-api EntityFieldQuery Docs: https://drupal.org/node/1343708 EntityFieldQuery as alternative to Views: http://treehouseagency.com/blog/tim-cosgrove/2012/02/16/entityfieldquery-let-drupal-do-heavy-lifting-pt-1