Re: how to "bind" product classes to flexible types ?

Julien Anguenot <[email protected]>
Newsgroups gmane.comp.web.zope.cps.devel
Organization NUXEO
Message-ID <[email protected]>
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

_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
signature.asc (application/pgp-signature, 252 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/iMUGhoG8MxZ/pIRAr46AJ9Goy37FTyQPCOaGN1bMCQgcFvzYwCeOY5U
NhamHS5jTckcv/n+OKuMpf4=
=atse
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.