[Zope3-dev] Job Board Example

Steve Alexander steve@cat-box.net
Tue, 18 Jun 2002 08:57:03 +0100


Guido van Rossum wrote:
>
> It seems that JobBoardEx and JobBoardI18n define some conflicting
> resources that make it impossible to have both configured.  I would
> like to see that fixed.  I currently get this error when I enable both
> in products.zcml:
> 
> Zope.Configuration.xmlconfig.ZopeConfigurationConflictError: Conflicting configuration actions
> for: ('AddableFactory', u'.JobList.')
>   at line 11 column 18 of /home/guido/projects/zzz/lib/python/ZopeProducts/JobBoardEx/configure.zcml
>   at line 12 column 18 of /home/guido/projects/zzz/lib/python/ZopeProducts/JobBoardI18n/configure.zcml
> 
> This seems strange since the full package names are different.  Could
> this be a Zope3 bug?  The only conflict seems to be the zmi:factory
> directive; once I have created an i18n job board, I can have both
> existing in parallel.


<content class=".JobList.">
   <zmi:factory
       title="Job List"
       permission="Zope.ManageContent" />
   <security:allow interface=".IJobList." />
   <implements
       interface="Zope.App.OFS.Container.IContainer.IItemContainer" />
</content>


The literal string given as the "class" attribute in the content 
directive is used as the "id" attribute of the zmi:factory subdirective, 
unless you give the zmi:factory subdirective an explicit id.

Use something like the following in your internationalized version.

<content class=".JobList.">
   <zmi:factory
       id="i18nJobList"
       title="Job List"
       permission="Zope.ManageContent" />
   <security:allow interface=".IJobList." />
   <implements
       interface="Zope.App.OFS.Container.IContainer.IItemContainer" />
</content>



I'll add a note about this to the documentation:

   doc/zcml/namespaces.zope.org/zope/content.stx

--
Steve Alexander