Introduction

A resource type package is a publet which contains all components necessary to

  • create
  • present

resources (documents, assets, ...) of a certain type.

This requires a well-defined interface to access resource type. I could imagine a directory structure like

/lenya
    /publets

        /xhtml
            /config
                /publet.xconf                         Publet configuration
                /resourcetype.xconf                   General resource type configuration (samples etc.)
                /usecases.xconf                       Patch file for cocoon.xconf to insert usecase declarations

            /documentation                            Documentation (Forrest document, can be included in main documentation)
                /index.xml

            /resources
                /schema                               Schema (XSD, Relax NG)
                /samples                              Sample resources
                    /default.xml
                    /simple.xml
                    /detailed.xml

            /java                                     Usecase handlers etc.

            /lenya                                    Resources to use the fallback mechanism (e.g., usecases)
                /usecases

            /resourcetype.xmap                        Sitemap to render resources

        /docbook
        /bitmap-image
        /svg-image
                    

The Contents Of A Resource Type Package

resourcetype.xconf

This file describes the resource type.

<resource-type xmlns="...">

  <schema href="resources/schema/xhtml.rng"/>

  <samples>
    <sample href="resources/samples/default.xml">
      The default XHTML sample.
    </sample>
    <sample href="resources/samples/simple.xml">
      A minimal XHTML document.
    </sample>
    <sample href="resources/samples/detailed.xml">
      A document containing examples of the most XHTML structures.
    </sample>
  </samples>

</resource-type>

resourcetype.xmap

This sitemap handles the presentation of resources.

To provide a unified access point to resources, a common intermediate format has to be defined, for instance XHTML. This means that resourcetype.xmap
returns the result of the transformation of the resource into this intermediate format.

It should be possible to support custom views, which are requested using certain URI patterns, request parameters, etc.

Using Resource Types in Publications

The resource types used by a publication are declared in publication.xconf:

<publication>

   <publet id="xhtml"/>
   <publet id="bitmap-image"/>

   ...
</publication>

Options For Creating Resources

a) The site/create usecase provides the option to choose the to-be-created resource type and sample. The samples are listed in a combo box in the same order as they are declared in resourcetype.xconf.
a) A "create" submenu is generated dynamically according to the available resource types. This allows resource types to provide custom create screens and create usecase handlers.

Options For Managing Resources

a) All usecases provided by the resource type are available as menu items for the corresponding documents.

When a usecase is invoked on a resource, the resource type is determined and the usecase handler of this resource type is used. This means the usecase handler resolving strategy is

usecase -> publication -> (publication templates) -> core

Problems

  • How are shared schemas handled?
  • No labels