- Plone 3 Products Development Cookbook
- Juan Pablo Gimenez Marcos F.Romero
- 431字
- 2021-08-06 17:06:01
Installing the product
Congratulations! You have created your first Archetypes-based content type.
Let's add it in our already configured Zope instance to see what it looks like.
Instead of using the ArchGenXML product as it is, we will wrap it in an egg structure and install it in the src
folder of our buildout.
How to do it…
First of all, we must create the egg structure that will hold the ArchGenXML generated code:
- Go to your
buildout
folder and create — if not created yet — asrc
folder.mkdir ./src
- Then call
paster
to create the egg folder structure:paster create -t plone
It will start a very short wizard to select some options for our product. Most important is the first one:

Add whatever you want to the remaining options or just hit Enter to each one.
Once finished, paster
should have created a folder structure like:
Products.poxContentTypes
+ docs
+ Products
+ poxContentTypes
...
- __init__.py
+ Products.poxContentTypes.egg-info
- dependency_links.txt
...
- README.txt
- setup.cfg
- setup.py
The new egg product is empty, but we already have some code that ArchGenXML has generated. So let's use it to make things work.
- Copy all the contents of
./models/poxContentTypes
inside your ArchGenXML folder, (not thepoxContentTypes
folder itself, but its contents) into thesrc/Products.poxContentTypes/Products/poxContentTypes
folder inside yourbuildout
folder. Some of the existing files will be overwritten, don't worry about them.We are done! We have a working content type. Now we should tell our Zope instance to be aware of it. To do that, modify the buildout and build the instance again.
- In the main
[buildout]
part, modify theeggs
parameter by adding a new line:[buildout] ... eggs = ... Products.poxContentTypes
- Given that our product is in development stage (that is, it's inside the
src
folder of our instance), we must also change thedevelop
parameter to tell our instance where to fetch its code from:[buildout] ... develop = src/Products.poxContentTypes
- Build your instance again and re-launch it:
./bin/buildout ./bin/instance fg
How it works…
Unfortunately, ArchGenXML doesn't create the egg structure together with the product. Neither does it allow us to use arbitrary namespaces. This is why we have chosen a simple word for the package name: poxContentTypes
that will be preceded by the Zope-ish Products
to create the final namespace: Products.poxContentTypes
.
Nevertheless we can still use ArchGenXML’s power to generate the necessary code and insert it into an egg structure we create ad-hoc with paster .
- 中文版AutoCAD 2016從入門到精通
- Photoshop CS6 互聯(lián)網(wǎng)應(yīng)用設(shè)計(jì)教程
- MLOps實(shí)戰(zhàn):機(jī)器學(xué)習(xí)模型的開(kāi)發(fā)、部署與應(yīng)用
- 中文版 Photoshop CC 從入門到精通
- Magento 1.4 Themes Design
- Photoshop圖形圖像處理實(shí)用教程
- Stable Diffusion圖像與視頻生成入門教程
- 中文版Dreamweaver基礎(chǔ)培訓(xùn)教程
- After Effects 2022從入門到精通
- Photoshop CC入門與提高
- 機(jī)械CAD軟件應(yīng)用入門指導(dǎo)書(shū)
- AutoCAD 2024室內(nèi)設(shè)計(jì)從入門到精通(升級(jí)版)
- Photoshop CS6圖像處理立體化教程
- Photoshop移動(dòng)UI設(shè)計(jì)
- SAI+Photoshop漫畫(huà)/插畫(huà)繪制技法全解析