Skip to main content

A simple example of how to use collective.transmogrifier

Project description

Introduction

This package shows you how to use collective.transmogrifier to import news items into Plone.

By default, it uses dummy values that are hard-coded in the product itself to create some News Items, so you can see how to even use transmogrifier.

The main idea is that you can use this product as a skeleton for migrating content from other systems to Plone, since you only need to pass in correct data instead of hard-coded dummy values.

Examples of real-life parsing HTML to extract data you need can be found in /branches folder of the product’s repository at http://svn.plone.org/svn/collective/niteoweb.transmogrifier.simpleusage/branches/.

The product sets the following fields on newly created News Items:

  • title

  • text

  • date

  • category

  • author

Demo

Run the following set of commands:

$ cd <workspace>
$ virtualenv -p python2.4 --no-site-packages simpleusage
$ cd simpleusage
$ svn co https://svn.plone.org/svn/collective/niteoweb.transmogrifier.simpleusage/trunk ./
$ bin/python bootstrap.py
$ bin/buildout
$ bin/instance fg

Then start your favorite browser and point it to http://localhost:8080/manage to add a new Plone site. You can now use the following URL to start importing News Items: http://localhost:8080/<your_site_id>/@@import

Customizing

First, create a branch for you to work on:

$ cd <workspace>
$ virtualenv -p python2.4 --no-site-packages johns_migration
$ cd johns_migration
$ svn copy https://svn.plone.org/svn/collective/niteoweb.transmogrifier.simpleusage/trunk https://svn.plone.org/svn/collective/niteoweb.transmogrifier.simpleusage/branches/johns_migration

Then, checkout your branch and build a development environment:

$ svn co https://svn.plone.org/svn/collective/niteoweb.transmogrifier.simpleusage/branches/johns_migration ./
$ bin/python bootstrap.py
$ bin/buildout

Now you have everything you need to start your own migration. Open <workspace>/johns_migration/src/niteoweb.transmogrifier.simpleusage/transmogrifier.py in your favorite text editor. Scroll all the way to the bottom to find a method ‘source’ and modify it so that it parses data from your source and returns it as a list of dicts.

Once you’re done, start Zope and point your browser tohttp://localhost:8080/<your_site_id>/@@import to start importing! Changelog =========

1.0 (2010-07-26)

  • Initial release. [zupo]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

niteoweb.transmogrifier.simpleusage-1.0.tar.gz (14.1 kB view details)

Uploaded Source

File details

Details for the file niteoweb.transmogrifier.simpleusage-1.0.tar.gz.

File metadata

File hashes

Hashes for niteoweb.transmogrifier.simpleusage-1.0.tar.gz
Algorithm Hash digest
SHA256 1e72d7e57376e6a3009df0937e3edaf2419cbcf81bd75a505bdd3aef01e033a7
MD5 14ded91dbaf91a9a87ca00276838b566
BLAKE2b-256 fd7501d62a6b4aa6c207929ade1e8cdcf39404ba868e7083937311127c4380ce

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page