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 to http://localhost:8080/<your_site_id>/@@import to start importing!

Changelog

1.0.1 (2010-07-26)

  • Added newlines to long description.

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

File details

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

File metadata

File hashes

Hashes for niteoweb.transmogrifier.simpleusage-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d0868d67bac44f6d5482078ec093b13c41f7c539489b7fe5233bad4d5e71990a
MD5 9f5a76548bc1befbbdb5f2165a8206e6
BLAKE2b-256 cf41aabb6005c407f818387a874c2487a00aacba40e812da3d6316dfd6ab6686

See more details on using hashes here.

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