• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Writing New Content Objects > Step 7: Registering the Content Compo...

Step 7: Registering the Content Components

Now that you have developed your components, it is necessary to tell Zope 3 how to interact with them. This is commonly done using Zope's own configuration language, called ZCML. By convention, the configuration is stored in a file called configure.zcml. You should start to edit this file by adding the following ZCML code:

01 <configure
02     xmlns="http://namespaces.zope.org/zope">
03
04   <interface 
05       interface=".interfaces.IMessageBoard" 
06       type="zope.app.content.interfaces.IContentType"
07       /> 
08
09   <content class=".messageboard.MessageBoard">
10     <implements
11         interface="zope.app.annotation.interfaces.IAttributeAnnotatable"
12         />
13     <implements
14         interface="zope.app.container.interfaces.IContentContainer" 
15         />
16     <factory
17         id="book.messageboard.MessageBoard"
18         description="Message Board" 
19         />
20     <require
21         permission="zope.ManageContent"
22         interface=".interfaces.IMessageBoard"
23         />
24     <require
25         permission="zope.ManageContent"
26         set_schema=".interfaces.IMessageBoard"
27         />
28   </content>
29
30   <interface 
31       interface=".interfaces.IMessage" 
32       type="zope.app.content.interfaces.IContentType"
33       /> 
34
35   <content class=".message.Message">
36     <implements
37         interface="zope.app.annotation.interfaces.IAttributeAnnotatable"
38         />
39     <implements
40         interface="zope.app.container.interfaces.IContentContainer" 
41         />
42     <require
43         permission="zope.ManageContent"
44         interface=".interfaces.IMessage"
45         />
46     <require
47         permission="zope.ManageContent"
48         interface=".interfaces.IMessageContainer"
49         />
50     <require
51         permission="zope.ManageContent"
52         set_schema=".interfaces.IMessage"
53         />
54   </content>
55 
56 </configure>


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint