[Checkins] SVN: bluebream/trunk/docs/source/gettingstarted.rst hello example

Baiju M baiju.m.mail at gmail.com
Sat Jan 9 07:23:39 EST 2010


Log message for revision 107917:
  hello example
  

Changed:
  U   bluebream/trunk/docs/source/gettingstarted.rst

-=-
Modified: bluebream/trunk/docs/source/gettingstarted.rst
===================================================================
--- bluebream/trunk/docs/source/gettingstarted.rst	2010-01-09 11:36:37 UTC (rev 107916)
+++ bluebream/trunk/docs/source/gettingstarted.rst	2010-01-09 12:23:39 UTC (rev 107917)
@@ -237,7 +237,10 @@
 
 You can define your browser view inside this module.  All browser
 views should implement
-``zope.publisher.interfaces.browser.IBrowserView`` interface.
+``zope.publisher.interfaces.browser.IBrowserView`` interface.  An
+easy way to do this would be to inherit from
+``zope.publisher.browser.BrowserView`` which is already implementing
+the ``IBrowserView`` interface.
 
 The content of this file could be like this::
 
@@ -248,6 +251,23 @@
       def __call__(self):
           return "Hello"
 
+Now you can register this view for a particular interface.  So that
+it will be available as a browser view for any object which implement
+this.  At this point you can register this for root folder which is
+implementing ``zope.site.interfaces.IRootFolder`` interface.
+
+So the registration could be like this::
+
+  <page
+     for="zope.site.interfaces.IRootFolder"
+     name="hello"
+     permission="zope.Public"
+     class=".myhello.HelloView"
+     />
+
+You can add this to: ``src/mynamespace/main/configure.zcml``.
+Run the application and visit: http://localhost:8080/@@hello
+
 Conclusion
 ----------
 



More information about the checkins mailing list