[Zope-CVS] CVS: Packages/JobBoardEx - Tutorial.html:1.11
Guido van Rossum
guido@python.org
Sat, 15 Jun 2002 11:12:51 -0400
Update of /cvs-repository/Packages/JobBoardEx
In directory cvs.zope.org:/tmp/cvs-serv7660
Modified Files:
Tutorial.html
Log Message:
Another checkpoint.
=== Packages/JobBoardEx/Tutorial.html 1.10 => 1.11 ===
-<h2>Building applications with Zope3</h2>
+<h2>Building Applications with Zope3</h2>
<p>One way to look at Zope in this case is as the controller of a
state machine. Your system will move through various states based on
@@ -118,7 +118,7 @@
<p>Note that there is no awareness of display in either the IJob
interface or the Job class.
-<h4>The Job class</h4>
+<h4>The Job Class</h4>
<p>Because we want it to be automatically stored in the Zope database,
the Job class is inherited from Persistent. In addition, it is marked
@@ -127,19 +127,39 @@
the arguments, and puts the object in the PendingApproval state. The
approve() method changes the state to Approved.
-<h4>The JobView class</h4>
+<h4>The JobView Page Template</h4>
-<p><b>XXX this class no longer exists! From here on the tutorial is
-fiction. I'm planning to fix it though, but I've got to go first.</b>
+<p>JobView tells Zope how to display a Job. Because this is a rather
+straightforward view, we don't have to write any Python code: instead,
+it is coded as a page template. This is an HTML-like file with
+embedded directives in the form of attributes that cause substitutions
+to happen. More about page templates later.
+
+<p>The view is attached to the Job class by means of a single
+statement in the configuration file:
+
+<pre>
+<browser:view name="index.html"
+ for=".IJob."
+ template="JobView.pt"
+ permission="Zope.Public"
+ />
+</pre>
+
+<p>This tells Zope that there is a view named index.html which applies
+to instances of the IJob interface, implemented by the page template
+JobView.pt, and requiring the permission Zope.Public (a fancy way to
+say that anyone can view the job; more about permissions later).
+
+<p>Another statement in the configuration file tells Zope that this is
+the default view:
+
+<pre>
+<browser:defaultView for=".IJob." name="index.html" />
+</pre>
-<p>JobView tells Zope how to display a Job. JobView inherits
-AttributePublisher, which is the big clue that this is a view class,
-since that base class is only associated with view classes. The
-AttributePublisher class includes an
-
-<pre> __implements__ = IBrowserPublisher </pre>
-
-Statement.
+<hr>
+<b>XXX The rest is not ready yet</b>
<p>The