- 1 Installation
Plone is easy to install but a pain to customize, the latest version we are working with is Plone 4.1.
This page is primarily being used by JFB for keeping notes on the migration task from Plone 2.5 to Plone 4.1.
Jfb 10:58, 29 September 2011 (CEST)
Working Through Aspeli Book
Followed the main recipes provided for the example 'Optilux' site. The key things done so far include:
- Creating a custom theme from an example
- Creating a custom BrowserView (or is it a product, I'm not sure)
Creating a custom theme
- copy over the example template them
- replace all instances of the previous them title or name
bin/zopeskel plone myproject.theme
Now, copy over all the components from the original theme into that directory:
-- configure.zcml --
Here's an approach that should work according to IRC folks: http://plone.org/documentation/kb/how-to-create-a-plone-3-theme-product-on-the-filesystem
Creating a BrowserView Product
Creating Custom Content
%bin/zopeskel plone optilux.cinemaconten
1) edit *generated* setup.py file:
install_requires=[ ... 'plone.app.dexterity [grok]', 'plone.app.referenceablebehavior', 'plone.app.relationfield', 'plone.namedfile [blobs]',
2) edit main packages.cfg add dexterity know good set:
http://good-py.appspot.com/release/dexterity/1.0.1?plone=4.1 ... [eggs] .... test= .... optilux.cinemacontent [test] ... [sources] ... optilux.cinemacontent = fs optilux.cinemacontent
3) edit buildout.cfg to assure optilux.cinemacontent is forced checked out (not in book)
4) edit optilux.policy and add optilux.cinemacontent as a dependency in setup.py
5) edit optilux.policy profiles/default/metadata.xml and set optilux.cinemacontent as a dependency
There are some key pieces of information for this here: | community-developer-documentation
Looking closely at:
However, there are some key pieces of information missing. Most notably, any scripts requiring an 'onload' command need to include this piece of information at the top of the template:
Just some personal notekeeping:
- installed Plone using the Aspeli guidelines and a simple buildout.
- I Created (or used the optilux example) policy package that actually requires Plone. This seems to simplify things, so that it is not actually 'Plone' that I will install to the server, but my own bin/buildout policy package.
- I created a new theme for the transport site using the optilux template as an example. I need to go back above and flush out how this is accomplished exactly, but it mostly was done by copying the optilux.theme and replacing any instance of optilux with 'transport'. However, I also had to make some configuration changes in the confifgure.zcml, instances.py module, and test.py module (maybe a few others too).
- created a new BrowserView product. This is going to replace the fpi cgi stuff I had before, or at least the front end. I imagine for now the CGI aspect may still be used, but we'll see. I guess the next step is figuring out how to render forms, etc. I will probably have to work with PloneFormGen.
Plotting Directly without Saving
Working out zope/plone and matplotlib
Working Case to return a image
In the view::
if self.request.get('REQUEST_METHOD', 'GET').upper() == 'POST': """ process """ from testmpl import make_fig im = make_fig() self.request.response.setHeader('Content-Type', 'image/png') return im.read()
In the make_fig() function:
imgdata = StringIO.StringIO() fig.savefig(imgdata, format='png') imgdata.seek(0) # rewind the data return imgdata
Following the overall scheme here: http://matplotlib.sourceforge.net/examples/pylab_examples/webapp_demo.html?highlight=webapp
With the exception that:
fig = matplotlib.pyplot.figure()
rather than this which did *not* work for me:
from matplotlib.figure import Figure fig = Figure()