Hiding your dependencies

A few days ago Wichert showed me something interesting. You can hide profiles / products from both the quickinstaller and the Plone site creation screen. This came in handy for a project we were working on.

The project is for a client that delivers a customized version of a product we developed for them. So each of their clients receives a tailored version (think branding, default settings etc.).

Code wise this means we have a base package for all installaties. On top of this we built the branded versions. To minimize installation problems the possibility to hide dependent products came in really handy.

Hiding products can be done by registering two utilities. One for disabling products in the quickinstaller. The other for disabling extension profiles from the Plone site creation.

To register these utilities add something like this your configure.zcml:

<utility factory=".profile.HiddenProducts" name="my.special.project" />
<utility factory=".profile.HiddenProfiles" name="my.special.project" />

Now create a profile.py file in your project and add the following lines:

from zope.interface import implements
from Products.CMFQuickInstallerTool.interfaces import INonInstallable as INonInstallableProducts
from Products.CMFPlone.interfaces import INonInstallable as INonInstallableProfiles

class HiddenProducts(object):
implements(INonInstallableProducts)

def getNonInstallableProducts(self):
return [
u'some.package',
u'another.product',
]

class HiddenProfiles(object):
implements(INonInstallableProfiles)

def getNonInstallableProfiles(self):
return [
u'some.package:default',
u'another.product:default',
]
Advertisements

No comments yet

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: