[Checkins] SVN: bluebream/trunk/docs/source/howto/defaultview.rst expand and use better words
Baiju M
baiju.m.mail at gmail.com
Thu Jan 14 07:12:45 EST 2010
Log message for revision 108118:
expand and use better words
Changed:
U bluebream/trunk/docs/source/howto/defaultview.rst
-=-
Modified: bluebream/trunk/docs/source/howto/defaultview.rst
===================================================================
--- bluebream/trunk/docs/source/howto/defaultview.rst 2010-01-14 11:48:58 UTC (rev 108117)
+++ bluebream/trunk/docs/source/howto/defaultview.rst 2010-01-14 12:12:44 UTC (rev 108118)
@@ -3,24 +3,29 @@
Default view for objects
========================
-Normally in BlueBream, a browser view can be accessed using ``@@``
-symbols before the view name. For example, if you have registered a
-view named ``testview`` for an object, that view can be accessed like
-this: ``myobject/@@testview``.
+In BlueBream, a browser view can be accessed using ``@@`` symbols
+before the view name. For example, if you have registered a view
+named ``testview`` for a container object [#container_object]_ named
+``myobject``, that view can be accessed like this:
+``myobject/@@testview``.
The view could be accessed without using the ``@@`` symbols also,
-provided there is no object with same same exist inside the
-container. In the above example, If there is no object named
-``testview`` inside ``myobject`` container, then, the view can be
-accessed like ``myobject/testview``. However, BlueBream recommend to
-use ``@@`` symbols always to access view to avoid ambiguity.
+provided there is no content object [#content_object]_ with the same
+same exist inside the container. In the above example, If there is
+no content object named ``testview`` inside ``myobject`` container,
+then, the view can be accessed like ``myobject/testview``. However,
+BlueBream recommend, always to use ``@@`` symbols to access view to
+avoid ambiguity.
-If you try to access an object without specifying any view name,
+In BlueBream, a default view name will be defined for
+``zope.container.interfaces.IContainer`` interface. So, if you try
+to access any container object without specifying any view name,
BlueBream will try to display the default view registered. You can
-configure the name os default view for a particular type object using
-``browser:defaultView`` directive available in ``zope.publisher``
-package. If the name of default view is not configured, and you try
-to access an object without specifying the view name, you will get a
+configure the name of default view for a particular type of object
+[#type_of_object]_ with ``browser:defaultView`` directive available
+in ``zope.publisher`` package [#access_directive]_. If the name of
+default view is not configured, and when you try to access an object
+without specifying the view name, you will get a
``ComponentLookupError`` with a message like this: ``Couldn't find
default view name``. For example, if you try to access the root
folder like: htt://localhost:8080/ and name of default view is not
@@ -31,12 +36,12 @@
<zope.publisher.browser.BrowserRequest instance
URL=http://localhost:8080>)
-If you have created the application using ``bluebream`` project
+If you have created the application using the ``bluebream`` project
template, you won't get this error. Because there is already a a
default view name (``index``) is configured in ``application.zcml``
configuration file inside the main package.
-If there is a default view name configured, but that there is no view
+If there is a default view name configured, but there is no view
registered with that name, you will get ``NotFound`` error when you
try to access object directly without specifying the name of view.
For example, if the default view name is ``index`` and there is no
@@ -60,15 +65,37 @@
for="zope.container.interfaces.IContainer"
/>
-If ``index`` is registered as the name for default view, BlueBream
-will try to get ``@@index`` view for any containers, if the view is
-not explicitly mentioned in the URL. However, you need to have a
-browser view registered to access the view, otherwise a ``NotFound``
-error will be raised as mentioned above.
+If ``index`` is registered as the name for default view and the view
+is not explicitly mentioned in the URL, BlueBream will try to get
+``@@index`` view for containers. However, you need to have a browser
+view registered to access the view, otherwise a ``NotFound`` error
+will be raised as mentioned above.
More details about registering a browser view using ``browser:page``
directive is explained in `browser page HOWTO <browserpage.html>`_.
+.. rubric:: Footnotes
+
+.. [#container_object] Container object -- Any object implementing
+ ``zope.content.interfaces.IContainer`` interface is called a
+ content object.
+
+.. [#content_object] Content Object -- If an **interface** provides
+ ``zope.app.content.interfaces.IContentType`` interface type, then
+ all objects providing the **interface** are considered content
+ objects.
+
+.. [#type_of_object] To specify a particular type of object, BlueBream use interface.
+
+.. [#access_directive] In order to use any ZCML excepte few built-ins
+ like ``configure`` and ``include``, you include the ZCML where it
+ is defined the directive, conventionally in BlueBream it will be
+ inside ``meta.zcml`` for any package. For example, to use
+ ``defaultView`` directive, you need to include ``mata.zcml`` file
+ inside ``zope.publisher``::
+
+ <include package="zope.publisher" file="meta.zcml" />
+
.. raw:: html
<div id="disqus_thread"></div><script type="text/javascript"
More information about the checkins
mailing list