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
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

merlinofchaos - February 12, 2009 - 04:59

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

ezra-g - March 19, 2009 - 16:32
Assigned to:Benjamin Melançon» Anonymous

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

Pasqualle - May 1, 2009 - 01:57

queue definition

subscribe

#4

Amitaibu - June 8, 2009 - 14:29

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);
?>

#5

Bevan - November 19, 2009 - 05:52

Thanks Amitaibu. In Drupal 5 this is almost the same;

<?php
function custom_update_N() {
 
$ret = array();

  if (!
function_exists('nodequeue_save')) {
   
$ret[] = array('success' => FALSE, 'query' => 'Enable nodequeue module and re-run custom update N');
    return
$ret;
  }

 
// From drupal.org/node/373174#comment-1678136
 
$queue = new stdClass();
 
$queue->title = 'RS featured video';
 
$queue->subqueue_title = '';
 
$queue->size = 1;
 
$queue->link = 'feature this video on the homepage';
 
$queue->link_remove = NULL;
 
$queue->owner = 'nodequeue';
 
$queue->show_in_links = 0;
 
$queue->show_in_tab = 1;
 
$queue->show_in_ui = 1;
 
$queue->reverse = 0;
 
$queue->reference = 0;
 
nodequeue_save($queue);

 
$ret[] = array('success' => TRUE, 'query' => 'Saved RS Featured video nodequeue');
  return
$ret;
}
?>

#6

mrfelton - December 4, 2009 - 20:15

integration with the features module?

 
 

Drupal is a registered trademark of Dries Buytaert.