GSoC/GCI Archive
Google Code-in 2010 Drupal

Views xml query backend

completed by: dmitrig01

mentors: Daniel Wehner

Task description

Write a xml query backend for views.
This would allow to build views and query in a xml. This xml could have any kind of content in it.

For example this could be perhaps used by the migrate module to migrate from xml-based-cm-systems to drupal.

Technical implementation

Write a module which has the following hooks:

hook_views_api: register the module to views
hook_views_plugins: register the query plugin to views.
hook_views_data: register the data structure to views.

The query plugin could build a xpath based on the filter/sort-criterias. http://www.php.net/manual/de/simplexmlelement.xpath.php,
execute it and build up the $view->result array.

It's recommended to look at the yql or twitter_views module which are both quite light-weight examples.
Both gsoc students c&p the existing module and started from it.

The xml data would contain
* fields
There you can select which field/attribute of a xml node you want to get back.
* filters
The user could either input some xpath directly or use a setting which allows to filter-by-attribute or filter-by-value

Deliverables

A module on drupal.org.

Resources

- Xpath Syntax: http://www.w3schools.com/xpath/xpath_syntax.asp
- General views api: Advanced help of views.
- IRC channels: #drupal-views #drupal-contribute
- Examples of existing views query backends
http://drupal.org/project/apachesolr_views
http://drupal.org/project/yql_views_query
http://drupal.org/project/sparql_views
http://drupal.org/project/wbapi
http://drupal.org/project/twitter_views

many more ... :)

Primary Contact

dereine