Import static websites on the file system into Plone.
(Formerly mr.importer, formerly parse2plone.)
Import static websites on the file system into Plone via:
$ bin/plone run bin/charm /path/to/files
Works like a charm!
charm is a Buildout recipe that creates a script for you to get content from static websites on the file system into Plone.
charm relies on the “run” argument of scripts created by plone.recipe.zope2instance to mount and modify the Plone database.
A Plone site object must exist in the Zope2 instance database. By default, charm assumes the site object is named “Plone”.
A user must exist in the Zope2 instance database (or Plone site). By default, charm assumes the user is named “admin”.
You can install charm by editing your buildout.cfg file like so:
[buildout] ... parts = ... charm [charm] recipe = charm
Now run bin/buildout as usual.
Now you can run charm like this:
$ bin/plone run bin/charm /path/to/files
If you have a site in /var/www/html that contains the following:
You should run:
$ bin/plone run bin/charm /var/www/html
And the following will be created:
Here are some trouble-shooting comments/tips.
charm requires lxml which in turn requires libxml2 and libxslt. If you do not have lxml installed “globally” (i.e. in your system Python’s site-packages directory) then Buildout will try to install it for you. At this point lxml will look for the libxml2/libxslt2 development libraries to build against, and if you don’t have them installed on your system already your mileage may vary (i.e. Buildout will fail).
Before running charm, you must either stop your Plone site or use ZEO. Otherwise charm will not be able to access the database.
Questions/comments/concerns? Please e-mail: firstname.lastname@example.org.
Development sponsored by Radio Free Asia
Alex Clark [aclark4life]
Derek Broughton [derek]
Bug fix for when not –match’ing.
Include the damn data
Rename mr.importer to charm
mr.importer was not that clever, and the author missed flat namespace
Get rid of all buildout options, support command line args only
Make _setup_app optionally accept user, else use system user
Fix broken tests; remove unneccessary; now at 34% coverage
619 34% charm (/Users/aclark/Developer/charm/charm.py)
Doc fixes; clean up / scale down
Many bug fixes
Rename parse2plone to mr.importer
Repackage as needed
Switch to kwargs in main()
Better _SETTINGS handling
Add support for illegal_expressions check
Add “Keep going!” feature (to ignore errors)
Add all HTML4 tags to target_tags
Remove Plone dep
Bug fix: TypeError: join() takes exactly one argument (2 given) related to specifying import dir on on command line (as args) fixed
Add spreadsheet import feature
Moved development to the (experimental) collective on Github
Added a large number of tests; performed associated refactoring; 50% test coverage
Add “paths” feature to allow multi-import dirs (on the file system), and corresponding object paths (in Plone) to be specified.
Fix import error
Add file handler to logger; saves output to a file called “parse2plone.log”
Fixes to “match” feature
Combine all modules into one
Remove a stray pdb (!)
Add tests (we’re at 20% test coverage people!)
Add match feature
Add more project justifications to the docs
Remove bin/import script whenever recipe is uninstalled [aclark4life]
Add support for XPath syntax in target_tags [derek]
Add “typeswap” feature [aclark4life]
Update docs [aclark4life]
Add Plone 2.5 compat
Better handling of file system path; better base dir calculation
More doc fixes
Fix regressions introduced (or unresolved as of) 0.8.2. Thanks Derek Broughton for the bug report(s)
Many fixes to convert_parameter_values() method which converts recipe parameters to arguments passed to main()
Fix “slugify” feature
Add rename feature
Fix regressions introduced in 0.8.1
Refactor options/parameters functionality to universally support _SETTINGS dict
Add “slugify” feature
Add support to optionally publish content after creation
Add support for generic file import
Support the importing of content to folders within the Plone site object
Support customization via recipe parameters and command line arguments
Revert ‘Add Plone to install_requires’
Add ‘Plone’ to install_requires
Another setuptools fix
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.