Florent Guillaume a écrit :
Soon (but the code is not finished) you'll be able to work with XML
files instead of various python scripts. But you'll still have to
change something like:
Products/MyProduct/profiles/default/types/mytype.xml
Products/MyProduct/profiles/default/schemas/myschema.xml
Products/MyProduct/profiles/default/layouts/mylayout.xml
There will be no need for specialized install scripts anymore though.
We're still not there, in a few weeks...
Until CPS 3.4.0 is released an example of a clean way to define custom
definitions (types, schemas, layouts, etc.) can be found in
https://svn.nuxeo.org/trac/pub/file/CPSDefault/trunk/Extensions/cpsinstall.py
def setupCustomDocuments(self):
"""Setup custom widgets/schemas/layouts/vocabularies.
Setup the needed components for the advanced search form.
"""
# Reloading the modules to have the latest definitions present
# on the file system without having to restart Zope.
reload(schemas)
reload(widgets)
reload(layouts)
reload(vocabularies)
self.log("Installing custom schemas")
custom_schemas = schemas.getSchemas()
self.verifySchemas(custom_schemas)
self.log("Installing custom widgets")
custom_widgets = widgets.getWidgets()
self.verifyWidgets(custom_widgets)
self.log("Installing custom layouts")
custom_layouts = layouts.getLayouts()
self.verifyLayouts(custom_layouts)
self.log("Installing custom vocabularies")
custom_vocabularies = vocabularies.getVocabularies()
self.verifyVocabularies(custom_vocabularies)
This is the same example that Bruno has posted, but I had started
my message before his post arrived. Please note the reload statement
which makes life easier :-)
Cheers,
--
Marc-Aurèle DARCHE
NUXEO (Paris, France) http://nuxeo.com/
Nuxeo Collaborative Portal Server (CPS) http://www.cps-project.org/
Gestion de contenu web / portail collaboratif / logiciel libre
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel