Export and import capability for nodequeue
Benjamin Melançon - February 12, 2009 - 04:43
| Project: | Nodequeue |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
For power users of Drupal being able to export and import nodequeues would be great. Presumably the same capability could be used under the hood for a queue "clone" capability.
(It seems there are parts of the Nodequeue webservice proposal that may overlap?)
I'm looking at Views for a model of export and import functionality. Guidance always welcome.
benjamin, Agaric Design Collective

#1
I've abstracted the ability to do export/import into a library as part of the ctools package. I'm not sure if adding reliance on ctools is a good idea or not.
Also, while doing the export/import trick woudl be *very* valuable, it does add some burdensome restrictions -- most notably that you must always load all queues any time you need to sort them; you can no longer rely on pagers (or at least the default pager) and it can become a little more memory intensive.
But it sure is handy for deployment.
#2
Which aspects of a queue would you export? The queue definition? All the subqueues and the nids?
I'll check out merlinofchaos's ctools import/export functionality. We could probably make import/export an optional feature with that as a dependency if you're going to use it.
#3
queue definition
subscribe
#4
Just for documentation, the way that I add nodequeue in hook_update_N() is:
<?php
// Add simple patterns nodequeue.
$queue = array(
'title' => 'my queue',
'size' => 0,
'reverse' => 0,
'roles' => array(),
'types' => array('story'),
'i18n' => 1,
'show_in_links' => FALSE,
'show_in_tab' => TRUE,
'show_in_ui' => TRUE,
'subqueues' => array(),
'add_subqueue' => array('my queue'),
'new' => TRUE,
);
$queue = (object) $queue;
$qid = nodequeue_save(&$queue);
?>