At this stage we have a complete package. However, other than in Zope 2, you have to register a new package explicitly. That means you have to hook up the components to Zope 3. This is done by creating a new file in ZOPE3/package-includes called messageboard-configure.zcml. The name of the file is not arbitrary and must be of the form *-configure.zcml. The file should just contain one directive:

我们现在已经有了一个完整的包,然而比起Zope2,你必须明确地注册一个新包,那意味着你必须集成组件到Zope3,接下来你需要在ZOPE3/package-includes中创建名为messageboard-configure.zcml的新文件。这个文件名称不是任意的,必须是形式为*-configure.zcml的文件,这个文件应该包含如下指令:

1 <include package="book.messageboard" />

When Zope 3 boots, it will walk through each file of this directory and execute the ZCML directives inside each file. Usually the files just point to the configuration of a package. 当Zope3 启动时,它将遍历在这个目录中的每个文件并且在每个文件中执行ZCML指令,通常这些文件就指向包的配置中。


CategoryCookbook