Joachim Schmitz wrote:
> Hi,
> 
> In our product we use CPSFlexible Types heavily. We also define a class
> for each Type to be able to programm specific behavior of that Type.
> 
> So we specify in our PortalTypes here is the xml-export:
> 
>  <property name="content_meta_type">StudentAdmission</property>
>  <property name="product">WAeUP_SRP</property>
>  <property name="factory">addStudentAdmission</property>
> 
> for that to work I have to specify in the products __init__.py
> 
> from Products.WAeUP_SRP.Students import StudentAdmission,
> addStudentAdmission
> 
> and later:
> contentClasses = (list-of-Contentclasses)
> extra_constructors = (list-of-add Functions in the same order as above
> list)
> fti = list of empty dictionarys for each ContentClass
> 
> 
> def initialize(registrar):
>     ContentInit('WAeUP Types',
>                 content_types = contentClasses,
>                 permission = AddPortalContent,
>                 extra_constructors = contentConstructors,
>                 fti = fti,
>                 ).initialize(registrar)
> 
>     # Extension profile registration
>     profile_registry.registerProfile(
>         'default',
>         'WAeUP_SRP',
>         "The WestAfrican e-University Project",
>         'profiles/default',
>         'WAeUP_SRP',
>         EXTENSION,
>         for_=ICPSSite)
> 
> Without the ContentInit I cannot access methods defined in the
> contentclass. Isn't there a better way to do this ?

nope. it's Zope2/CMF content class registration mecanism...

        J.

-- 
Julien Anguenot | Nuxeo R&D (Paris, France)
Open Source ECM - www.nuxeo.com
CPS Platform - http://www.cps-project.org
Mobile: +33 (0) 6 72 57 57 66

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel

Reply via email to