[CPS-devel] how to "bind" product classes to flexible types ?

Joachim Schmitz js at aixtraware.de
Mon Aug 28 19:24:26 CEST 2006


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 ?



-- 
Mit freundlichen Grüßen                                Joachim Schmitz
......................................................................
AixtraWare eK ..Joachim Schmitz ..www.aixtraware.de ..t: +49-2464-8851
Hüsgenstr. 33a .....d-52457 Aldenhoven .............f: +49-2464-905163




More information about the cps-devel mailing list

This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.