Changeset 15913
- Timestamp:
- 04/01/08 14:41:17 (7 months ago)
- Files:
-
- branches/MidCOM_2_8/midcom.helper.replicator/config/config.inc (modified) (1 diff)
- branches/MidCOM_2_8/midcom.helper.replicator/exporter/mirror.php (modified) (1 diff)
- branches/MidCOM_2_8/midcom.helper.replicator/exporter/staging2live.php (modified) (3 diffs)
- branches/MidCOM_2_8/midcom.helper.replicator/exporter/staging2live_typefilter.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/midcom.helper.replicator/config/config.inc
r15780 r15913 1 1 'queue_root_dir' => '/var/spool/midgard/replicator_queue/', 2 2 'log_filename' => "{$GLOBALS['midcom_config']['log_filename']}.replicator", 3 'exporter_staging2live_check_approvals_for' => array 4 ( 5 'midgard_topic', 6 'midgard_article', 7 'midgard_style', 8 'midgard_element', // Style-elements 9 ), 10 'exporter_staging2live_typefilter_pass_types' => array 11 ( 12 0, 13 ), 14 'exporter_staging2live_typefilter_check_types_for' => array 15 ( 16 'midgard_article', 17 ), branches/MidCOM_2_8/midcom.helper.replicator/exporter/mirror.php
r14775 r15913 137 137 function serialize_component_dependencies(&$node) 138 138 { 139 // FIXME: components interface class should have a method to return dependencies 139 140 switch ($node->component) 140 141 { branches/MidCOM_2_8/midcom.helper.replicator/exporter/staging2live.php
r14775 r15913 26 26 * array of classes for which to check the approval for 27 27 * 28 * @todo make configurable 28 * @see configuration key exporter_staging2live_check_approvals_for 29 * @todo configurable on per subscription basis ? 29 30 */ 30 var $check_approvals_for = array 31 ( 32 'midgard_topic', 33 'midgard_article', 34 ); 31 var $check_approvals_for = array(); 35 32 36 33 function midcom_helper_replicator_exporter_staging2live($subscription) 37 34 { 38 35 parent::midcom_helper_replicator_exporter_mirror($subscription); 36 $this->check_approvals_for = $this->_config->get('exporter_staging2live_check_approvals_for'); 37 if (!is_array($this->check_approvals_for)) 38 { 39 // Safety 40 $this->check_approvals_for = array(); 41 } 39 42 } 40 43 … … 219 222 220 223 if ( is_a($object, 'midgard_article') 221 && $object->up)224 && !empty($object->up)) 222 225 { 223 226 // Child articles don't currently have any approval UI, skip approval … … 311 314 $serializations = array_merge($serializations, $dependency_serializations); 312 315 unset($dependency_serializations); 313 314 /* FIXME: This contradicts general tree logic where children *must not* be exported if parent315 is not approved316 // We should export child articles and topics as they may have been approved317 // even while their parent topic wasn't318 $qb = midcom_db_article::new_query_builder();319 $qb->add_constraint('topic', '=', $object->id);320 $articles = $qb->execute();321 foreach ($articles as $article)322 {323 $child_serializations = $this->serialize_object($article);324 $serializations = array_merge($serializations, $child_serializations);325 unset($child_serializations);326 }327 328 $qb = midcom_db_topic::new_query_builder();329 $qb->add_constraint('up', '=', $object->id);330 $topics = $qb->execute();331 foreach ($topics as $topic)332 {333 $child_serializations = $this->serialize_object($topic);334 $serializations = array_merge($serializations, $child_serializations);335 unset($child_serializations);336 }337 */338 316 } 339 317 branches/MidCOM_2_8/midcom.helper.replicator/exporter/staging2live_typefilter.php
r11103 r15913 24 24 * array of $object->type values to allow replication for 25 25 * 26 * @todo make configurable 26 * @see configuration key exporter_staging2live_typefilter_pass_types 27 * @todo configurable on per subscription basis ? 27 28 */ 28 var $pass_types = array 29 ( 30 0, 31 ); 29 var $pass_types = array(); 32 30 33 31 /** 34 32 * array of classes for which to check the type for 35 33 * 36 * @todo make configurable 34 * @see configuration key exporter_staging2live_typefilter_check_types_for 35 * @todo configurable on per subscription basis ? 37 36 */ 38 var $check_types_for = array 39 ( 40 'midgard_article', 41 ); 37 var $check_types_for = array(); 42 38 43 39 function midcom_helper_replicator_exporter_staging2live_typefilter($subscription) 44 40 { 45 41 parent::midcom_helper_replicator_exporter_staging2live($subscription); 42 $this->pass_types = $this->_config->get('exporter_staging2live_typefilter_pass_types'); 43 if (!is_array($this->pass_types)) 44 { 45 // Safety 46 $this->pass_types = array(); 47 } 48 $this->check_types_for = $this->_config->get('exporter_staging2live_typefilter_check_types_for'); 49 if (!is_array($this->check_types_for)) 50 { 51 // Safety 52 $this->check_types_for = array(); 53 } 46 54 } 47 55
