[Zope-book] CVS: Docs/ZopeComponentArchitecture/PythonProgrammerTutorial/Chapter1/Step4 - products.zcml:1.1 Contact.zcml:1.3 ContactEditPresentation.py:1.4 ContactViewPresentation.py:1.2 IContact.py:1.2 README.txt:1.6
Chris McDonough
chrism at zope.com
Wed Feb 13 14:40:50 EST 2002
Update of /cvs-repository/Docs/ZopeComponentArchitecture/PythonProgrammerTutorial/Chapter1/Step4
In directory cvs.zope.org:/tmp/cvs-serv15582
Modified Files:
Contact.zcml ContactEditPresentation.py
ContactViewPresentation.py IContact.py README.txt
Added Files:
products.zcml
Log Message:
Turned lies into truth.
=== Added File Docs/ZopeComponentArchitecture/PythonProgrammerTutorial/Chapter1/Step4/products.zcml ===
<zopeConfigure
xmlns='http://namespaces.zope.org/zope'
xmlns:security='http://namespaces.zope.org/security'
xmlns:zmi='http://namespaces.zope.org/zmi'
xmlns:browser='http://namespaces.zope.org/browser'
>
<!-- add include directives for products here -->
<include package="Zope.Contact" file="Contact.zcml"/>
</zopeConfigure>
=== Docs/ZopeComponentArchitecture/PythonProgrammerTutorial/Chapter1/Step4/Contact.zcml 1.2 => 1.3 ===
-
-<security:permission name="Manage Contacts" />
-
-<security:protectClass name=".Contact">
- <security:protect interface=".Contact.IContactInfo"
- permission="AccessControl.Permissions.view"/>
- <security:instances permission="AccessControl.Permissions.view"/>
- <security:protect method="update" permission="Manage Contacts"/>
+<zopeConfigure
+ xmlns='http://namespaces.zope.org/zope'
+ xmlns:security='http://namespaces.zope.org/security'
+ xmlns:zmi='http://namespaces.zope.org/zmi'
+ xmlns:browser='http://namespaces.zope.org/browser'
+>
+
+<security:permission permission_id="Manage Contacts" title="Manage Contacts"/>
+
+<security:protectClass name="Zope.Contact.">
+ <security:protect interface="Zope.Contact.IContactInfo."
+ permission_id="Zope.View"/>
+ <security:instances permission_id="Zope.View"/>
+ <security:protect method="update" permission_id="Manage Contacts"/>
</security:protectClass>
-<security:protectClass name=".Contact.ViewPresentation"
- permission="AccessControl.Permissions.view"
+<security:protectClass name="Zope.Contact.ContactViewPresentation."
+ permission_id="Zope.View"
method="index" />
-<security:protectClass name=".Contact.ContactEditPresentation"
- permission="Manage Contacts"
+<security:protectClass name="Zope.Contact.ContactEditPresentation."
+ permission_id="Manage Contacts"
methods="index, action" />
-<zmi:provideClass name=".Contact" permission="Manage Contacts" />
+<zmi:provideClass name="Zope.Contact."
+ permission_id="Manage Contacts"
+ title="Contact"
+/>
-<browser:defaultPresentation for=".Contact.IContactInfo"
- name="view" component=".Contact.ViewPresentation" />
+<browser:defaultView for="Zope.Contact.IContactInfo."
+ name="view" factory="Zope.Contact.ContactViewPresentation." />
-<browser:presentation for=".Contact.IContactEdit"
- name="edit" component=".Contact.ContactEditPresentation" />
+<browser:view for="Zope.Contact.IContactEdit."
+ name="edit" factory="Zope.Contact.ContactEditPresentation." />
-<zmi:tabs for=".Contact.IContact">
+<zmi:tabs for="Zope.Contact.IContact.">
<zmi:tab label="Edit" action="edit"/>
<zmi:tab label="View" action="view"/>
<zmi:tab label="Security" action="security"/>
<zmi:tab label="Undo" action="undo"/>
</zmi:tabs>
-<zmi:icon for=".Contact.IContact" file="Contact/contact.gif" />
+<zmi:icon for="Zope.Contact.IContact." file="Contact/contact.gif" />
</zopeConfigure>
+
=== Docs/ZopeComponentArchitecture/PythonProgrammerTutorial/Chapter1/Step4/ContactEditPresentation.py 1.3 => 1.4 ===
-from Zope.Products.PageTemplate import PresentationPageTemplateFile
+from Zope.PageTemplate import PageTemplateFile
from IContactEdit import IContactEdit
-class ContactEditPresentationClass(AttributePublisher):
+class ContactEditPresentation(AttributePublisher.AttributePublisher):
"""Provide an interface for editing a contact
"""
@@ -17,7 +17,7 @@
__used_for__=IContactEdit
# Input form
- index = PresentationPageTemplateFile('edit.pt', globals())
+ index = PageTemplateFile('edit.pt', globals())
# action method
def action(self, first, last, email, address, pc):
=== Docs/ZopeComponentArchitecture/PythonProgrammerTutorial/Chapter1/Step4/ContactViewPresentation.py 1.1 => 1.2 ===
+from Zope.PageTemplate import SimpleViewClass
from IContactInfo import IContactInfo
# Create a simple view presentation
-ContactViewPresentation = SimplePresentationClass(
- 'view.pt', applicable_for=IContactInfo)
+ContactViewPresentation = SimpleViewClass(
+ 'view.pt', used_for=IContactInfo)
=== Docs/ZopeComponentArchitecture/PythonProgrammerTutorial/Chapter1/Step4/IContact.py 1.1 => 1.2 ===
from Contact import Contact
-class IContactInfo(Interface):
+class IContact(Interface):
"Marker for objects that provide specific behavior"
implements(Contact, IContact)
=== Docs/ZopeComponentArchitecture/PythonProgrammerTutorial/Chapter1/Step4/README.txt 1.5 => 1.6 ===
prevents someone from mistakedly configuring the component for use
with other (incompatable) interfaces. The '__used_for__'
- attribute is optional. Only one interfac can be specifeid. One
+ attribute is optional. Only one interface can be specified. One
could concievably create a component that is applicable to several
alternative interfaces, in which case, the '__applicable__'
attribute would not be set.
We modify the configuration file to add a security assertion for the
- new component and we add a 'browser::presentation' directive to
+ new component and we add a 'browser::view' directive to
register the component.
We also need to add a security assertion for the 'update' method of
More information about the Zope-book
mailing list