Package: charm
ContentscharmIntroductionGetting startedInstallationExecutionExampleTroubleshootingContactCreditsContributorsHistorycharm(Formerly mr.importer, formerly parse2plone.)Import static websites on the file system into Plone via:$ bin/plone run bin/charm /path/to/filesWorks like a charm!WarningThis is more of a “toy” project than a “real” data migrator. For any
serious Plone migrations, you may want to consider acollective.transmogrifier-based tool e.g.mr.migrator. That is not
to say you will not findcharmuseful as a sample migration script,
just that you should not expect it to scale to meet any complex needs;
whereas that is exactly what transmogrifier-based tools are designed to do.Introductioncharmis a Buildout recipe that creates a script for you to
get content from static websites on the file system into Plone.NoteThis is aBuildoutrecipe for use withPlone; by itself it does nothing. If you
don’t know what Plone is, please see:http://plone.org. If you don’t know
what Buildout is, please see:http://www.buildout.org/.charmrelies on the “run” argument of scripts created byplone.recipe.zope2instanceto mount and modify the Plone database.Getting startedAPlonesite object must exist in theZope2instance database. By
default, charm assumes the site object is named “Plone”.A user must exist in theZope2instance database (or Plone site). By
default, charm assumes the user is named “admin”.NoteThis recipe creates a script that isnotintended to be run directly.
Due to technical limitations, the author was not able to implement a user
friendly error message. So if you runbin/charmdirectly you will see
this:$ bin/charm
Traceback (most recent call last):
  File "bin/charm", line 117, in <module>
    charm.main(app=app)
NameError: name 'app' is not definedTo avoid this, run the script as intended:$ bin/plone run bin/charm /path/to/filesSee theexecutionsection below for more information.InstallationYou can installcharmby editing yourbuildout.cfgfile like
so:[buildout]
...
parts =
    ...
    charm

[charm]
recipe = charmNow runbin/buildoutas usual.ExecutionNow you can runcharmlike this:$ bin/plone run bin/charm /path/to/filesNoteIn the example above and examples below,bin/plonerefers to aZope 2
instancescript created byplone.recipe.zope2instance.Yourbin/plonescript may be calledbin/instanceorbin/client, etc. instead.ExampleIf you have a site in /var/www/html that contains the following:/var/www/html/index.html
/var/www/html/about/index.htmlYou should run:$ bin/plone run bin/charm /var/www/htmlAnd the following will be created:http://localhost:8080/Plone/index.htmlhttp://localhost:8080/Plone/about/index.htmlTroubleshootingHere are some trouble-shooting comments/tips.Compiling lxmlcharmrequireslxmlwhich in turn requireslibxml2andlibxslt. If you do not havelxmlinstalled “globally” (i.e. in your
system Python’s site-packages directory) then Buildout will try to install it
for you. At this pointlxmlwill look for the libxml2/libxslt2 development
libraries to build against, and if you don’t have them installed on your system
alreadyyour mileage may vary(i.e. Buildout will fail).Database accessBefore runningcharm, you must either stop your Plone site or
use ZEO. Otherwisecharmwill not be able to access the
database.ContactQuestions/comments/concerns? Please e-mail:aclark@aclark.net.CreditsDevelopment sponsored by Radio Free AsiaContributorsAlex Clark [aclark4life]Derek Broughton [derek]History1.0b4 (03/23/2011)Bug fix for when not –match’ing.1.0b3 (03/22/2011)Include the damn data1.0b2 (03/22/2011)Fix package1.0b1 (03/22/2011)Renamemr.importertocharmmr.importerwas not that clever, and the author missed flat namespaceGet rid of all buildout options, support command line args onlyMake _setup_app optionally accept user, else use system userFix broken tests; remove unneccessary; now at 34% coverage619    34%   charm   (/Users/aclark/Developer/charm/charm.py)Doc fixes; clean up / scale downMany bug fixes1.0a5 (02/05/2011)Renameparse2plonetomr.importerRepackage as neededSwitch to kwargs in main()Better _SETTINGS handlingAdd support for illegal_expressions checkAdd “Keep going!” feature (to ignore errors)Add all HTML4 tags to target_tags1.0a4 (01/12/2011)Remove Plone dep1.0a3 (11/17/2010)Bug fix: TypeError: join() takes exactly one argument (2 given) related to
specifying import dir on on command line (as args[0]) fixedFix tests1.0a2 (11/17/2010)Add spreadsheet import featureFix docs1.0a1 (11/17/2010)Moved development to the (experimental) collective on Github0.9.9 (11/16/2010)Added a large number of tests; performed associated refactoring; 50% test coverage0.9.8 (11/12/2010)Add “paths” feature to allow multi-import dirs (on the
file system), and corresponding object paths (in Plone)
to be specified.0.9.7 (11/08/2010)Fix import errorAdd file handler to logger; saves output to a file called “parse2plone.log”0.9.6 (11/08/2010)Fixes to “match” featureCombine all modules into oneRemove a stray pdb (!)Add tests (we’re at 20% test coverage people!)Update docs0.9.5 (11/08/2010)Add match featureAdd more project justifications to the docs0.9.4 (11/06/2010)Removebin/importscript whenever recipe is uninstalled [aclark4life]Add support for XPath syntax in target_tags [derek]Add “typeswap” feature [aclark4life]Update docs [aclark4life]0.9.3 (11/04/2010)Add Plone 2.5 compatBug fixesBetter handling of file system path; better base dir calculation0.9.2 (11/03/2010)More doc fixes0.9.1 (11/03/2010)Doc fixes0.9.0 (11/03/2010)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” feature0.8.2 (11/02/2010)Add rename featureFix regressions introduced in 0.8.10.8.1 (10/29/2010)Refactor options/parameters functionality to universally support _SETTINGS dictAdd “slugify” featureDoc fixesAdd support to optionally publish content after creationAdd support for generic file import0.8 (10/27/2010)Support the importing of content to folders within the Plone site object0.7 (10/25/2010)Documentation fixes0.6 (10/25/2010)Support customization via recipe parameters and command line arguments0.5 (10/22/2010)Revert ‘Add Plone to install_requires’0.4 (10/22/2010)Add ‘Plone’ to install_requires0.3 (10/22/2010)Another setuptools fix0.2 (10/22/2010)Setuptools fix0.1 (10/21/2010)Initial release