openbuildings/jam-generated-feed

A module to generate xml files based on a jam collection

Installs: 7 186

Dependents: 0

Stars: 1

Watchers: 7

Language: PHP

0.1.4 2015-02-09 16:14 UTC

README

Build Status Coverage Status Latest Stable Version

A module to generate xml files based on a jam collection with a minion task

Usage

You need to add configuration to config/jam-generated-feed.php file:

return array(
    // Each key is a "name" of the feed, will be used when generating a new one
    'products-uk'   => array(

        // Jam model for the collection
        'model' => 'product'

        // Optional filter that will be applied to the collection (in the form of $collection->{$filter_name}())
        'filter' => 'feed_products_uk',

        // What view to use to generate the feed. It would be passed a $collection variable with the Jam Collection
        'view' => 'feeds/products-uk',

        // Where to output the file, prepends DOCROOT, overwrites
        'file' => 'feeds/products-uk.xml',
    ),
);

Using The Task

minion feed:generate --name=products-uk

Generating {"model":"product","filter":"feed_products_uk","view":"feeds\/products-uk","file":"feeds/products-uk.xml","name":"products-uk"}
Done.
Saving feed content to DOCROOT/test_file.xml
Done.

License

Copyright (c) 2012-2013, OpenBuildings Ltd. Developed by Ivan Kerin as part of clippings.com

Under BSD-3-Clause license, read LICENSE file.