- Plone 3 Products Development Cookbook
- Juan Pablo Gimenez Marcos F.Romero
- 288字
- 2021-08-06 17:06:00
Generating code
At this stage, we have drawn the definitions for a new content type based on Plone's default News Item
but with some differences: there's a lead
field, a country
field, and a modified relatedItems
field. There's also a new countryVocabulary
method that will provide the country options list for that field.

To turn all these drawings into a Plone usable content type, we must finally use ArchGenXML.
How to do it…
- Save the model as
poxContentTypes.zargo
inside themodels
folder we created before. - Go to your ArchGenXML
models
folder and run:cd ~/libexec/archgenxml/models ../bin/archgenxml ./poxContentTypes.zargo
- If everything is okay, you'll get an output similar to this:
INFO ArchGenXML Version 2.4.1
(c) 2003-2009 BlueDynamics Alliance, Austria, GPL 2.0 or later
INFO Directories to search for profiles: ['~/archgenxml/profiles']
INFO Parsing...
INFO Profile files: '{u'archgenxml_profile.xmi': u'~/archgenxml/profiles/archgenxml_profile.xmi'}'
INFO Directory in which we're generating the files: ''.
INFO Generating...
INFO Starting new Product: 'poxContentTypes'.
INFO Generating package 'content'.
INFO Generating class 'XNewsItem'.
INFO generator run took 1.00 sec.
- After this, you'll see a new
poxContentTypes
folder insidemodels
with a main structure like:poxContentTypes
+ content
+ locales
+ profiles
+ skins
- __init__.py
- config.py
- configure.zcml
- profiles.zcml
- refresh.txt
- setuphandlers.py
There's more…
We suggest you to:
- Browse and see the generated code to start getting used to it, especially
XNewsItem.py
file. - Continue with the great ArchGenXML documentation to explore even more of its features:
See also
- Adding i18ndude support to ArchGenXML
- Adobe 創(chuàng)意大學動漫設(shè)計師Flash CS5 + Photoshop CS5 標準實訓教材
- Plone 3 Multimedia
- RESTful PHP Web Services
- 3ds Max/MaxScript印象 腳本動畫制作基礎(chǔ)與應(yīng)用
- Google App Engine Java and GWT Application Development
- NHibernate 3.0 Cookbook
- SOLIDWORKS 2020產(chǎn)品設(shè)計基本功特訓(第3版)
- Stable Diffusion圖像與視頻生成入門教程
- Small Business Server 2008 – Installation, Migration, and Configuration
- Elgg Social Networking
- VR策劃與編導(dǎo)
- Cinema 4D基礎(chǔ)與實戰(zhàn)教程
- 機械CAD軟件應(yīng)用入門指導(dǎo)書
- iOS智能手機APP界面設(shè)計實戰(zhàn)教程
- Photoshop CS6淘寶美工完全實例教程(培訓教材版)