web services and context - drupalcon london 2011 update.pdf · the web services and context core...
TRANSCRIPT
![Page 1: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/1.jpg)
![Page 2: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/2.jpg)
Web Services and Context
Core Initiative
Presented by Larry Garfield
Core Conversations
![Page 3: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/3.jpg)
@Crell✤ Senior Architect, Palantir.net
✤ Web Services & Context Initiative Owner
✤ Architectural Gadfly
✤ Nerf Gunslinger
![Page 4: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/4.jpg)
Web Services and ContextCore Initiative (WSCCI)
http://www.flickr.com/photos/spaterson/4995021726/
![Page 5: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/5.jpg)
"Drupal doesn't have multiple layouts. It has one layout it bends a lot."
--Earl Miles, c.2009
![Page 6: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/6.jpg)
![Page 7: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/7.jpg)
![Page 8: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/8.jpg)
![Page 9: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/9.jpg)
Five Fails
1) No unified context
2) One Layout to Rule them All
3) No plugin mechanism
4) HTML-only
5) Performance
![Page 10: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/10.jpg)
The Butler Project
"Give Drupal a unified, powerful context system that will support smarter, context-sensitive, easily
cacheable block-centric layouts and non-page responses using a robust unified plugin
mechanism."
![Page 11: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/11.jpg)
DrupalCon Chicago
Recast as
Web Services and Context Core Initiative
![Page 12: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/12.jpg)
WSCCI Goals
The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class REST server with a first-class
CMS on top of it.
To do that, we must give Drupal a unified, powerful context system that will support smarter, context-
sensitive, easily cacheable block-centric layouts and non-page responses using a robust unified plugin
mechanism.
![Page 13: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/13.jpg)
1) Unified, powerful context system
2) Unified plugin mechanism
3) Any type of response
4) Smart block-centric layouts
![Page 14: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/14.jpg)
<Insert lots of discussion here>
![Page 15: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/15.jpg)
#0HTTP
![Page 16: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/16.jpg)
HTTP libraries✤ Don't reinvent the wheel.
✤ Tried PECL HTTP... Nyet
✤ 3rd party research
✤ Dave Hall (skwashd)
✤ Dick Olsson (dixon_)
✤ Zend vs. Symfony2: FIGHT!
✤ http://groups.drupal.org/node/167299
![Page 17: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/17.jpg)
![Page 18: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/18.jpg)
http://www.flickr.com/photos/andycarvin/1936753622/
![Page 19: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/19.jpg)
Status
Dries OKed this last night at 2 am.
Patch forthcoming...
![Page 20: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/20.jpg)
#1Context
![Page 21: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/21.jpg)
Mediator Object
The mediator pattern provides a unified interface to a set of interfaces in a subsystem.
--Wikipedia
![Page 22: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/22.jpg)
![Page 23: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/23.jpg)
Work in progress
http://drupal.org/project/butler
... And core sandbox by the end of the week
![Page 24: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/24.jpg)
class Foo { protected $context;
public function __construct($context) { $this->context = $context; } public function behave() { $node = $this->context['node']; $var = $this->context['http:get:var']; // ... }}
![Page 25: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/25.jpg)
function behave() { $context = drupal_get_context(); $language = $context['language']; $foo = $context['http:header:foo'];}
![Page 26: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/26.jpg)
$butler->registerHandler('http:get', 'CtxHandlerHttp', array('query' => 'GET'));
$butler->registerHandler('http:post', 'CtxHandlerHttp', array('query' => 'POST'));
$butler->registerHandler('http:header','CtxHandlerHeader');
![Page 27: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/27.jpg)
$new_ctx = $butler->addLayer();
$new_ctx->registerHandler('og', 'AlternateHandler');$new_ctx['og:nid'] = 5; $new_ctx->lock();$plugin = get_plugin('stuff', 'blah', $new_ctx);
![Page 28: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/28.jpg)
Status✤ Nearly ready to try implementing in core
✤ Come to the code sprint Friday and let's see how far we get!
![Page 29: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/29.jpg)
#2Plugins
![Page 30: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/30.jpg)
We have too many✤ One-off hacks
✤ Alt. include files
✤ Callback functions
✤ Pseudo-hooks
✤ caching system with OO
✤ Views Plugins/Handlers
✤ Ctools Plugins
✤ Webform components
✤ Etc.
![Page 31: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/31.jpg)
![Page 32: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/32.jpg)
![Page 33: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/33.jpg)
Research✤ http://groups.drupal.org/node/137609
✤ Symfony2
✤ Zend Framework 2
✤ Kohana
✤ ctools.module
✤ No one is as good as we want to be...
![Page 34: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/34.jpg)
Status✤ ctools TNG
✤ All OOP
✤ Two skunkworks implementations
✤ Crell
✤ neclimdul
✤ After context is in core...
![Page 35: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/35.jpg)
#3REST Routing
![Page 36: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/36.jpg)
More robust than hook_menu✤ 2 layer routing
✤ Method Path, domain, HTTP contenttype
✤ "Other stuff" Implementation TBD
✤ Maps to response object, not dumb function
✤ Any HTTP return (404, 302, etc.)
✤ Any content type, natively (text/html, text/json, application/pdf)
✤ http://groups.drupal.org/node/148149
![Page 37: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/37.jpg)
#4Smarter block layout
![Page 38: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/38.jpg)
Figure out the UI first...
http://groups.drupal.org/node/137469
![Page 39: Web Services and Context - DrupalCon London 2011 Update.pdf · The Web Services and Context Core Initiative (WSCCI) aims to transform Drupal from a first-class CMS to a first-class](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec83220fe364371072c7c40/html5/thumbnails/39.jpg)
Next steps...
Code sprint Friday!
Discuss here:
http://groups.drupal.org/wscci
Follow here:
http://drupal.org/node/1233232