On May 10, 2012, at 3:37 PM, Randolph M. Fritz wrote: >> The easiest way to get what you want would be to use the script to write the >> output to a file on the filesystem somewhere, then open and read that file >> using plone. > > That sounds good. Perhaps we could run the script every hour or so. > > Where would you suggest that "somewhere" be?
It doesn't really matter, so long as you know where it is, the location doesn't change, and the system user account under which Zope/Plone is running has read access to the file > >> Depending on how pretty you want the output (and on how 'right' you want to >> be about your approach), the two possible ways to go here are a >> 'BrowserView', and an 'External Method'. > > I think I understand what an external method is; so far I cannot decipher the > explanation of views in the Plone site. Can you point me to some examples? > Or at least a concise glossary? An external method will require the least initial work, but is the least flexible and does not really allow easy access to the full site template and theme. If you are comfortable setting one up, you can certainly start there. It is also easy enough to create a basic template in your custom folder which calls the external method and presents the results, but this is not particularly repeatable, and leaves you with all your code in the ZODB, which means you can't easily move it to a different site if you need to. A browser view is a bit more complex because it requires a bit of installable machinery to set up. Basically, you need to write a python package with some boilerplate code in it in order to make your browser view available. After you get past that hump, though, browser views are very powerful and allow you to do many things. They also simplify the act of integrating the output of your script with the Plone template and theme, so you can get output that looks like its a 'page' in the site, and not just some random text. I would suggest if you are interested in a browser view based solution that you read these sources: 1. http://blog.aclark.net/2011/08/20/hello-plone/ 2. http://collective-docs.readthedocs.org/en/latest/views/browserviews.html In both cases there are some caveats. In the first document, since you already have a Plone instance, you do not need to do the first few steps. You can begin at the part where you install zopeskel to generate the boilerplate package. Alex's suggestion regarding using the plone_basic template from zopeskel is exactly right. That will give you an installable python package into which you can put your view. In the second case, the community developer's manual is a great resource for finding out everything, but it isn't particularly well organized. I would not follow any instructions from that page, but use it as a resource to start to understand how things work. > >> You cannot use a Python Script created through the web, because Plone/Zope's >> underlying security will not allow TTW creation of a script that directly >> accesses the server filesystem (this is a good thing). > > That makes all kinds of sense. > >> What version of Plone are you using, and how pretty do you want it to be? > > No idea how pretty, yet, or even what that would work out to in practice. > > Version Overview > • Plone 4.1.2 (4111) > • CMF 2.2.4 > • Zope 2.13.10 > • Python 2.6.7 (r267:88850, Dec 6 2011, 10:20:02) [GCC 4.2.1 20070719 > [FreeBSD]] > • PIL 1.1.7 > > Randolph Great to see that you're using a nice, recent version of Plone. I will be happy to answer any questions you have as you move forward. You can also get a ton of help in the #plone channel on IRC on freenode.net if you are comfortable going to IRC for help. One last suggestion, before doing any of this, I would highly recommend developing your solution on a local machine before you try to deploy it to your server. It's pretty easy with the Plone unified installer to get a nice, usable buildout of plone on your desktop, and the whole installation of zopeskel in order to get package skeletons quickly can easily be taken care of with that setup. If you do that, then you do not need to install zopeskel on your server, which is a good thing. Let me know how else I can help, Cris Ewing -------------------------------------------------- Principal, Cris Ewing, Developer LLC http://www.crisewing.com [email protected] 1.206.724.2112
