Archive for ‘Plone’

July 2, 2010

Integrating Plone and Dojo

Note: This makes sense only if you want to ship a custom dojo build with your Plone application or if you find it slow and annoying to go get dojo from one of the CDNs. If you don’t have a custom dojo build (if you don’t know what I am talking about, then you certainly don’t need one) just get dojo from the CDN – works beautifully with Plone.

We recently had to integrate the amazing  dojo toolkit with Plone. The problem we encountered was pretty simple – Plone does not serve any files/objects etc which have their names  starting with an underscore character ‘_’. Dojo has plenty of javascript modules beginning with ‘_’.

The existing solutions ranged from the brute force to the exotic and excessive.

The solution we settled down to (after a little bit of thinking) is to setup dojo behind apache and serve the files from there. Here’s how to do it.

  1. Get the dojo sdk
  2. extract it to a directory like /home/xxx/dojo and do a cross domain build (see dojo documentation on how to do this).
  3. Setup apache if you haven’t already done this. Don’t be scared – setting up apache these days just means installing the package from your favorite distribution.
  4. Open up /etc/apache2/apache2.conf (This is where it resides on my ubuntu server) and add the following at the end
Alias /dojo/ "/home/xxx/dojo/"
<Directory "/home/xxx/dojo">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

That will setup your dojo files to be served to the localhost – for development purposes it is ok. You can eventually change it to serve your intranet/internet users as well.

Advertisements
May 27, 2010

Plone Vs Drupal Vs *

Python is a religion at BYGSoft. We love everything about it -period. Given that, we naturally propose Plone to anyone who wants us to develop a CMS based App.

Normally our clients don’t challenge our technology proposals. This one case I had the client ask me, Plone? Python? isn’t that going to be expensive to maintain? Why not PHP? I knew exactly where he was coming from.

Naturally there is varied opinion – esp on the Internet almost like vi vs emacs – and no prizes for guessing what we like at BYGSoft.

I am not sure what convinced the clients, but we believe that the best answer out there and the one we concur with is

“irrespective of the language or the framework or any other tool – the solution is only going to be as good as the people mean it to be”.

If you have a talented bunch of programmers it does not matter – you will still get a good solution out.

Anyone who is familiar with Solaris or AIX internals will tell you that long long before C++ took center stage as an OOD platform, they had all the OOD covered in C – in the kernel.

February 1, 2010

What’s wrong with Plone (and Zope)

One word summarizes it all – ‘Legacy’.

Like many other softwares which have seen multiple releases – Plone/Zope suffers from its own past. Specifically I have developed an intense dislike for the lack of standardization in customizing Plone.  Note: Plone/Zope are standards compliant to the letter.

You disagree (I can hear you think)?

Just ask yourself  (or Google) how many ways can you override a view? Or how do you develop a product for Plone.

You just don’t get a straight answer. The answer depends on the “stack” (Plone/Zope) you are working on.

If the plone.org maintainers are reading this (I have a message) – Nuke all the articles (contributed by no doubt very smart plone developers) which are mostly useless and move towards a moderated wiki based documentation. For a content management system, Plone documentation is just awful and its organization even worse.

January 18, 2010

HOWTO: ArgoUML and archgenxml

ArgoUML and archgenxml are great utilities to have around while doing Plone development. However, if you go by the documentation (whatever little exists), be prepared for a long night and a pot of hot coffee handy. I hope to maintain this page with issues I encountered (and solutions wherever found).

Problem:

File “Plone/Python-2.4/lib/python2.4/site-packages/xmiparser-1.4-py2.4.egg/xmiparser/xmiparser.py”, line 697, in calcDatatype
raise ValueError, ‘datatype %s not defined’ % typeid
ValueError: datatype archgenxml_profile.xmi#16a8d020-4c0a-58ce-993f-e6306abf0bbf not defined

Solution:

Save your project as “.zargo” file format and pass that to archgenxml instead – like “archgenxml test.zargo”.

Comment: You’d have expected that whoever thought of something like archgenxml would have enough sense to print out a warning – seems like an obvious trap to fall into (going by the documentation).



Problem: You want to override the default view of a custom content type. That is “content_type/view” should resolve to your defined view.

Solution:

Setting up things in argouml to override the view is simple –

1. Select the class you want to set the default view. It is important that you click on the class name – selecting any other attribute or method will NOT work.

2. Click on the “Tagged Values” tab.

3. Select the default_view tag from the list of drop downs. Set the value of the tag to resolve to your defined view.

4. Save project and run archgenxml to setup the Plone product.

Comment: In case you cannot get this to work, just follow these simple steps to ensure that you haven’t been victimized by one of argouml’s quirks.

Step1. Open up the profiles/default/types/your_content_type.xml

Step2. Search for the line which contains the following declaration

<property name=”default_view”>your_default_view</property>

it should be set to your default view. If not, you need to go back to step 1 of the solution above and really ensure you click on the class name and start over again.

Next we will see how to actually provide the view.