DrupalCon SF 2010 Day Two Notes

Batch vs. Queue : An API Smackdown

Drupal 7 will use OO for cache and queue systems.

- createQueue
- createItem
- claimItem
- releaseItem

SystemQueue => MySQL
MemoryQueue => in-memory one request
BatchQueue extends SystemQueue

Use Drush for cron-based batch operations

Use queue to queue for later

I think the "Batch" API is somewhat misnamed. It's intent is to "batch up" and provide feedback DURING AN INTERACTIVE SESSION (ex. upgrading a site). To really batch big jobs, use the Queue API.

Leveraging the Chaos Tool Suite for Module Development

CTools will not have any other dependencies. It's meant to be 'Core plus'.

Strongarm is one module that exports db variables. Stongarm provides a way to override the default variable values that Drupal core.

CTools has good modal dialog and form wizard.

CT has great AJAX responder framework. CTools AJAX framework provides a type of macro language for AJAX handling.

CTools provides a handy non-volatile object cache. Useful when you have unsaved changes to a page.

CTools provides "context". However, I think this is different from the "Context Module" which Open Atrium uses.

- You can add context manually.

- Look thru Page Manager for contexts

CTools also provides dependent form fields.

CTools also has drop down menu tools - gear drop down seen in Views.

See the CTools "example" module for good examples.

Views for Developers

Use "Views Attachment" to prepend or append data to a view.

The Faceted Search module provides "Faceted Search Views" sub-module which allows one to use Views to display the results. Solr may not be needed for this.

Larry Garfield has nice tree view plugin which is a good example of how to code for Views API.

Views 3 is for Drupal 6. Views 3 is not yet in D7

Views_data is the hook to tell about tables.

How Drupal 7 Fields are Changing the Way You Write Modules

In Drupal 6, you use hook_nodeapi to control CRUD for your table. In hook_nodeapi, you insert into tables you made etc.

The fields provided by Drupal are very suitable for smaller field sets where users enter data through a web form.

Fields have or provide :
- schema
- widget
- formatter
- settings

A developer should definitely consider using fields when a good one is provided via a module. For example, if there's an Amazon product or a URL, you may want to use it and save yourself coding for validation etc.

"Entities are the new nodes". You can think of entities as tables in a conventional RDBMS. You should structure content around entities, not nodes.

You can think of "bundles" views in the traditional RDBMS context.

DrupalEntityControllerInterface - common interface in Drupal 7.

Taxonomy is an entity in D7.

The Entity module provides save, delete etc. to entities.

The Future of MySQL : Forks, Patches & Decisions

MySQL 5.1 is a good product, but it took a while to be shipped. MySQL 5.1 has a nice InnoDB plugin, but it won't scale vertically well.

MySQL 5.1 with patches from Percona is a current favorite MySQL variant.

MariaDB has XtraDB and thread pooling which are nice.

MySQL AB's 5.5 version looks very good.

Panels Everywhere

Don't install Panels Everywhere on an existing site that already has a lot of "legacy" blocks. It works best on a new site designed from the ground up.

Here are good themes to work with Panels Everywhere :
- Fusion
- Skinr
- Zen
- Adaptive Theme

Much of the Panels code has shifted to Page Manager.

How Page Manager handles wildcards :

/term becomes a variable

Chaos Tools provides a "context.inc" file which is worth looking into.

Variants - different content based on contextual data.

Path auto may not play well with Panels everywhere. I think it will work, but you must remember to use the underlying path, not the visible aliased path.