CMFPublicator Special Uses

Multi nodes control features

CMFPublicator tool can be used to another purposes. The default is a unique portal_publicator object in the root site, that control and manage all boxes.

The feature that doesn't allow you create another portal_publicator object in other site nodes, or another object type with this object ID, is the inherited class UniqueObject, defined in the PublicatorTool.py module. It is used by default for security prevention.

But, in some cases the portal needs manage boxes in other site nodes, given different content control in diferent site levels.

CMFPublicator can be used in this case too. To do this, just edit the PublicatorTool.py module and change the constant ROOT_SITE_ONLY value to 0 (now it's default value). Save and refresh the CMFPublicator product or restart Zope.

Now you can create more than one portal_publicator object, in other site nodes by selecting the default dropdown box, from ZMI, and choosing CMF Publicator Tools. Or simply copying the portal_publicator from the root site, and paste in other folder.

One last thing. Go to portal_publicator, in root site and click the Actions tab. Here we have two actions pre-programated, but only the first has the check box Visible? checked. Unckeck it, check the last checkbox action Visible? and save.

This is because the first action provide a publications link in user actions bar, to control the root portal_publicator, and now we need control the portal_publicator present in each site node. Then this last action appears in folder tabs, if it has a portal_publicator object.

Plone 2 doesn't use the default user actions bar to control add-ons. If you want, uncheck all CMFPublicator actions and create one action in the portal_controlpanel object, but only in default uses, because this special case need control per node.

Be careful when using this feature. If you have a foo box on the portal_publicator root site and you create a new portal_publicator in the bar node and your portlet invokes here/portal_publicator then an exception will be raised when request this node because this new portal_publicator don't have the foo box. To prevent this fail use portal/portal_publicator getting the portal_publicator root site.

Getting more metadata content

In some cases, you need get other specific metadata to manipulate in a box template. The default CMFPublicator stored metadata is showed in Stored items help page.

CMFPublicator has a Script Python called getItemInfo.py that get customized metadatas. This script can be customized in the portal_skins/publicator and must return a dictionary with the metadatas.

The getItemInfo default script, return the folder Title where the object is contained, naming it Group(it's just an example). But the Group metadata is refered in an example portlet, see Example help page. Delete this if you think you'll not use it, but you can leave it returning Group as one more key of dictionary.

--eof