ResourceFilePublisher

Christian Egli <[email protected]> 19 Mar 2003 16:13:06 +0100
Newsgroups gmane.comp.cms.wyona.devel
Message-ID <[email protected]>
Hi all

I've been working on adding resource publishing to publisher
classes. I checked in the folloing changes:

* The publishing process now optionally also publishes resources
  (e.g. images).

* To this effect there are two new classes ResourceFilePublisher and
  ResourcePublishingEnvironment which can be used in the tasks.xconf
  as a publisher.

* ResourceFilePublisher is a sublclass of DefaultFilePublisher which
  also publishes resources

* ResourcePublishingEnvironment is a subclass of PublishingEnvironment
  which reads additional parameters (<resource href=""/>) from
  publication.xconf.

* The publisher interface has been extended to allow for passing of
  parameters related to resource publishing.

If you want to publish your resources together with your documents and
your tree you'll have to apply the following vhanges to your
publication:

1. Add  <resource href=""/> to your publication.xconf, e.g. as follows:

  <authoring>
    <documents href="content/authoring"/>
    <tree href="content/authoring/tree.xml"/>
    <resource href="resources/images/authoring"/>
  </authoring>


2. Specify the ResourceFilePublisher as the publisher class in
   tasks.xconf

  <task id="publish">
    <label>Publish</label>
    <task id="publish" class="org.lenya.cms.publishing.ResourceFilePublisher"/>
    <task id="export" class="org.lenya.cms.publishing.StaticHTMLExporter"/>
  </task>

I tested it and checked it in for unipublic, so see the unipublic
publication in CVS for details.

TODO
----

The image upload should probably be changed to reflect this, i.e. it
should upload the images to resources/imgages/authoring instead of
resources/imgages/live directly.


-- 
Christian Egli       [email protected]   +41 1 272 9161
                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS      http://www.wyona.org http://www.wyona.com