I think it's time to work on the contracts of blocks a bit more as I want to start to move the blocks into /cocoon/blocks/[name]/trunk. As we agreed that state information should be part of meta files, we also have to agree how this meta file should look like in detail.


For this purpose I started with a schema that desribes a block. You can find it at http://svn.apache.org/repos/asf/cocoon/trunk/src/schema/cob-schema-1.0.xsd.

Here an example of an XML file that validates against this schema:

<block xmlns="http://apache.org/cocoon/blocks/cob/1.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://apache.org/cocoon/blocks/cob/1.0
    cob-schema-1.0.xsd"
  id="http://cocoon.apache.org/blocks/anyblock/1.0";>
  <name>anyblock</name>
  <description href="http://cocoon.apache.org/blocks/anyblock/1.0";>
    A block based on the Apache Cocoon portal
  </description>
  <state
    href="http://cocoon.apache.org/blocks/anyblock/1.0/state.html";
    community="committed"
    interfaces="unstable"
    implementation="stable"/>
  <license href="http://www.apache.org/licenses/";>Apache License 2.0</license>
  <author href="http://cocoon.apache.org";>Apache Cocoon community</author>
  <properties>
   <property name="mailserver">
      <default>localhost</default>
      <description>The IP adress or the DNS name of a mail server</description>
    </property>
    <property name="foo">
      <description>bar</description>
    </property>
  </properties>
  <requirements>
   <requires block="http://cocoon.apache.org/blocks/portal/1.0"; name="portal"/>
 </requirements>
  <extends block="http://cocoon.apache.org/blocks/another-block/1.0"/>
  <implements block="http://cocoon.apache.org/blocks/bla/1.0"/>
</block>

It's widely the same as the XML Stefano proposed (long) time ago. I added a "state" element that desribes the community (committed, supported, deprecated), interfaces (stable, unstable) and implementation (stable, unstable) state and has a link to resource that desribes this in more detail.

Comments?


--
Reinhard P�tz Independent Consultant, Trainer & (IT)-Coach


{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                       web(log): http://www.poetz.cc
--------------------------------------------------------------------




Reply via email to