<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>zope.app.publisher</name>
<shortdesc>Implementations and means for configuration of Zope 3-style views and resources.</shortdesc>
<description>========
Overview
========

*This package is at present not reusable without depending on a large
chunk of the Zope Toolkit and its assumptions. It is maintained by the*
`Zope Toolkit project &lt;http://docs.zope.org/zopetoolkit/&gt;`_.

``zope.publisher`` is a general purpose object publishing framework
which delegates to a publication object for determining the
to-be-published object.  With Zope 3's default publication from
``zope.app.publication``, this is usually a view or a resource.

This package, ``zope.app.publisher``, provides base implementations
for those.  It also provides ZCML directives for configuring views and
resources.  More specifically, ``zope.app.publisher`` defines the
following ZCML directives:

* browser:page

* browser:pages

* browser:view

* browser:menu

* browser:menuItem

* browser:menuItems

* browser:addMenuitem

* browser:resource

* browser:resourceDirectory

* browser:defaultSkin

* browser:icon

* xmlrpc:view


Views and Browser pages
=======================

XXX writeme


Resources
=========

Resources are static files and directories that are served to the browser
directly from the filesystem. The most common example are images, CSS style
sheets, or JavaScript files.

Resources are be registered under a symbolic name and can later be referred to
by that name, so their usage is independent from their physical location.

You can register a single file with the `&lt;browser:resource&gt;` directive, and a
whole directory with the `&lt;browser:resourceDirectory&gt;` directive, for example

  &lt;browser:resource
    directory="/path/to/static.file"
    name="myfile"
    /&gt;

  &lt;browser:resourceDirectory
    directory="/path/to/images"
    name="main-images"
    /&gt;

This causes a named adapter to be registered that adapts the request to
zope.interface.Interface (XXX why do we not use an explicit interface?),
so to later retrieve a resource, use
`zope.component.getAdapter(request, name='myfile')`.

There are two ways to traverse to a resource,

1. with the 'empty' view on a site, e. g. `http://localhost/@@/myfile`
   (This is declared by zope.app.publisher.browser)

2. with the `++resource++` namespace, e. g. `http://localhost/++resource++myfile`
   (This is declared by zope.traversing.namespace)

In case of resource-directories traversal simply continues through its contents,
e. g. `http://localhost/@@/main-images/subdir/sample.jpg`

Rather than putting together the URL to a resource manually, you should use
zope.traversing.browser.interfaces.IAbsoluteURL to get the URL, or for a
shorthand, call the resource object. This has an additional benefit:

If you want to serve resources from a different URL, for example
because you want to use a web server specialized in serving static files instead
of the appserver, you can register an IAbsoluteURL adapter for the site under
the name 'resource' that will be used to compute the base URLs for resources.

For example, if you register 'http://static.example.com/' as the base 'resource'
URL, the resources from the above example would yield the following absolute
URLs: http://static.example.com/myfile and
http://static.example.com/main-images
(XXX what about http://static.example.com/main-images/subdir/sample.jpg?)


=======
Changes
=======

3.8.2 (2009-06-16)
==================

- Remove test dependency on ``zope.app.pagetemplate``.
- Calling a resource to get its URL now uses IAbsoluteURL.

3.8.1 (2009-05-25)
==================

- Updated to use ``zope.pagetemplate.engine`` module (requires versino
  3.5.0 or later), instead of ``zope.app.pagetemplate`` precursor.

- Replaced zope.deprecation dependency with BBB imports

3.8.0 (2009-05-23)
==================

- There is no direct dependency on zope.app.component anymore (even in
  the tests).

- Moved the publicationtraverse module to zope.traversing, removing the
  zope.app.publisher -&gt; zope.app.publication dependency (which was a
  cycle).

- Moved the DefaultViewName API from zope.app.publisher.browser to
  zope.publisher.defaultview, making it accessible to other packages
  that need it.

3.7.0 (2009-05-22)
==================

- Use zope.componentvocabulary instead of zope.app.component
  (except for tests and IBasicViewInformation).

- Use zope.browser for IAdding interface (instead of zope.app.container)

- Update references to ``zope.app.component.tests.views`` to point to the new
  locations in ``zope.component.testfiles.views``.

3.6.2 (2009-03-18)
==================

- Register ``IModifiableUserPreferredLanguages`` adapter in the ZCML
  configuration of ``zope.app.publisher.browser`` package. This was previously
  done by ``zope.app.i18n``.

3.6.1 (2009-03-12)
==================

- Remove deprecated code.

- Adapt to removal of deprecated interfaces from zope.component.interfaces.
  The IResource is now moved to zope.app.publisher.interfaces. The IView
  and IDefaultViewName is now in zope.publisher.interfaces. The IPresentation
  interface was removed completely.

3.6.0 (2009-01-31)
==================

- Use zope.container instead of zope.app.container.

- Use zope.site.folder instead of zope.app.folder.

3.5.3 (2009-01-27)
==================

- Finally removed &lt;browser:skin&gt; and &lt;browser:layer&gt; that were marked as
  deprecated in 2006/02.

3.5.2 (2008-12-06)
==================

- Added possibility to specify custom item class in menuItem, subMenuItem
  and addMenuItem directives using the ``item_class`` argument (LP #291865).

- Menu items registered with &lt;browser:page/&gt; were not re-registered after the
  first functional test layer ran. In any subsequent functional test layer the
  items where not availabe (introduced in 3.5.0a3).

- Added a hook to specify a different BaseURL for resources. This makes sense
  if you want to put resources on a Content Delivery Network. All you need to
  do is to register an named Adapter 'resource' that implements IAbsoluteURL.

3.5.1 (2008-10-13)
==================

- Removed usage of deprecated LayerField from zope.app.component.back35.

3.5.0 (2008-08-05)
==================

- Refactored code to provide more hooks when deriving code from this pacakge.

  * A resource's URL creation is now in its own method.

  * The resource class of factories can be overwritten.

  * The cache timeout value can now be set as a class or instance attribute.

3.5.0a4 (2007-12-28)
====================

- Backed out the changes for the controversial XML-RPC skin support.

3.5.0a3 (2007-11-27)
====================

- make it possible to override menus: this was not possible because new
  interfaces where created any time a menu with the same name was created.

- Resolve ``ZopeSecurityPolicy`` deprecation warning.

3.5.0a2 (2007-08-23)
====================

- &lt;browser:defaultView&gt; now accepts classes as well as interfaces.

3.5.0a1 (2007-08-21)
====================

- Added a `layer` attribute to `xmlrpc:view`. This works just like layers for
  `browser:view` etc. but uses the `IXMLRPCSkinType`.</description>
<homepage rdf:resource="http://pypi.python.org/pypi/zope.app.publisher/" />
<maintainer><foaf:Person><foaf:name>Zope Corporation and Contributors</foaf:name>
<foaf:mbox_sha1sum>2a5d53de05a9e41953ed1826447b07e9a7fa1525</foaf:mbox_sha1sum></foaf:Person></maintainer>
<release><Version><revision>3.8.2</revision></Version></release>
</Project></rdf:RDF>