Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I update a plone page via a script?

Tags:

python

plone

I have a large amount of automatically generated html files that I would like to push to my Plone website with a script. I currently generate the files, log into Plone, click edit on each individual page and copy and paste the html into the editor. I'd like to automate this. It would be nice to retain the plone versioning, have a auto generated comment for the edit, and come from a specific user.

I've read and tried Webdav with little luck at getting it working consistently and know that there is a way to connect to plone via ftp, but haven't tried it. I'm not sure if these are the methods that I need.

My google searches aren't leading me to anything useful. Any ideas on where to start looking for a solution to this? Or any tips on implementing it?

like image 558
moorepants Avatar asked Sep 01 '11 18:09

moorepants


1 Answers

You can script anything in Plone via the following methods:

  • Through-the-web via API calls (e.g. XML-RPC, wsapi, etc.)
  • The bin/instance run script provided by plone.recipe.zope2instance (See charm for an example of this).

You can also use a migration framework like:

  • collective.transmogrifier

which allows you to write migration code, and trigger it via GenericSetup or Browser view. Additionally, there are applications written on top of Transmogrifier aimed roughly at what you are describing, the most popular of which is:

  • funnelweb

I would recommend that you consider using or writing a Transmogrifier "blueprint(s)" to do your import, and execute the pipeline with a tool that makes that easy:

  • mr.migrator

You can find blueprints by searching PyPI for "transmogrify". One popular set of blueprints is:

  • quintagroup.transmogrifier

One of the main attractions to the Transmogrifier approach, aside from getting the job done, is the ability to share useful blueprints with others.

like image 172
aclark Avatar answered Oct 27 '22 05:10

aclark