[Zope-CMF] Re: Problems installing type into portal

Raphael Ritz r.ritz at biologie.hu-berlin.de
Wed Mar 3 04:47:25 EST 2004



antonh at lawtec.net wrote:

> [...]
> It seems like the ConflictError I got on the first installation attempt
> has somehow fooled the installer into thinking that the type has been
> registered when it has not, so it is skipping this step on subsequent
> attempts. Is there a way that I can 'manually' force the registration of
> my new type with the portal again?
> 

You could do something like this (in your install or custom
external method):

def reinstallTypes(self, out):
     typesTool = getToolByName(self, 'portal_types')

     # Type deletion
     for f in fti_list:
         if f['id'] in typesTool.objectIds():
             out.write('*** Object "%s" already existed in the types tool \
             => deleting\n' % (f['id']))

             typesTool._delObject(f['id'])


     # Type re-creation
     for f in fti_list:
         cfm = apply(ContentFactoryMetadata, (), f)
         typesTool._setObject(f['id'], cfm)
         out.write('Type "%s" registered with the types tool\n' % (f['id']))


where fti_list is a list of factory type informations

Raphael


> Thanks,
> 
> Anton
> 
> 
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF at zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
> 
> See http://collector.zope.org/CMF for bug reports and feature requests
> 





More information about the Zope-CMF mailing list