Skip to main content

Posts

Showing posts from November, 2009

Generating Excel Sheets in Plone

Sometimes we have to generate excel sheets or csv files or doc files which contain data of our content types. Generating Excel Sheets in Plone Let us see, how we can generate an excel sheet which contains names of Documents and their description. Add a script in Custom Folder with the sample code, shown below. Sample code to generate an excel sheet: # Example code: # Import a standard function, and get the HTML request and response objects. from Products.PythonScripts.standard import html_quote request = container.REQUEST RESPONSE = request.RESPONSE counter = 0 print "Number|Name" documents = context.portal_catalog(portal_type='Document') for document in documents: counter += 1 doc = document.getObject() desc = doc.description dtit = doc.pretty_title_or_id() print "%d|%s|%s" % (counter,dtit,desc) RESPONSE.setHeader("Content-type","application/vnd.ms-excel") RESPONSE.setHeader("Content-disposition","attachment;filename= Doc...

Replicating Sharing Feature of Plone

Today, for my project I had to replicate Sharing Feature for my Project Management Product. My Client liked the UI of the Plone sharing very much. This is one of the features of Plone 3 that I liked. So I started to write this feature for my product. I wanted to show only three roles and members having any of these 3 roles only. I was not interested in remaining roles the user had as those roles won't affect my workflow. I copied sharing.py sharing.pt macro_renderer.pt, kss_sharing.py files from plone.app.workflow's browser folder. Then I copied the configurartion of sharing and kss view from configuration.zcml. I readjusted the names for browser page to suit my needs. I restarted zope and voila! my custom sharing page was ready. To show only required 3 roles, I went and edited def roles(self) to show only required 3 roles def roles(self): """Get a list of roles that can be managed. Returns a list of dicts with keys: ...

Mail Host for KARL

There no clear documentation on how to set the mail host for KARL. I asked the same in #karl in IRC. chrisrossi was very kind to answer it. sowmya : Hi, I just installed KARL [ 1:20pm ] sowmya : Now I want to know where do I setup the smtp for the project? [ 2:10pm ] [ [ 4:38pm ] mahiti : hi [ 4:41pm ] mahiti : how do we configure the smtp settings of a new karl instance [ [ 6:56pm ] chrisrossi : sowmya : mahiti : Karl delivers mail to a queue that is a folder in Maildir format on your local filesystem. [ 6:57pm ] chrisrossi : so Karl, the webapp, doesn't interact directly with an smtp server. [ 6:57pm ] chrisrossi : In order to send the mail out you need to invoke the bin/qp script [ 6:57pm ] chrisrossi : bin/qp --help will print the arguments you can provide, including smtp host information. [ 6:57pm ] chrisrossi : we invoke this once a minute or so via cron. [ 6:58pm ] chrisrossi : There is also a daemon mode that we're not currently using that you could experiment with [ 6:...

KARL Project

This week I tried KARLProject . It is a open source web system for collaboration, organizational intranets, and knowledge management. It uses repoze.bfg. It is very simple to use. Advanatages are it uses zope 3 libraries and putting it together is very easy. What I liked about KARL is how easy it was to install and how fast the server can be run. it hardly takes few seconds. Additionally it uses blob to store files which makes the Data.fs lighter. It indexes these files so easy to search. For mailing, it has a separate library and thus leaves us on how to send mails or how frequently ( I have set up a cron job to sending emails every 10 minutes :)). On a whole it is a very nice system. But (Yes, there is a but ;)) can it replace Plone which still uses older zope? No, I don't think so. What I miss in repoze is ZMI. Plone offers me a quick way to fix things and move it to file system.