Author: reinhard Date: Sat Mar 26 01:20:51 2005 New Revision: 159099 URL: http://svn.apache.org/viewcvs?view=rev&rev=159099 Log: support that blocks can implement more than one interface; make it more explicit that a reference refers to an interface and not to an implementation
Modified: cocoon/trunk/src/schema/cob-schema-1.0.xsd cocoon/trunk/src/schema/test-block.xml Modified: cocoon/trunk/src/schema/cob-schema-1.0.xsd URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/schema/cob-schema-1.0.xsd?view=diff&r1=159098&r2=159099 ============================================================================== --- cocoon/trunk/src/schema/cob-schema-1.0.xsd (original) +++ cocoon/trunk/src/schema/cob-schema-1.0.xsd Sat Mar 26 01:20:51 2005 @@ -89,10 +89,10 @@ </xs:element> <xs:element name="property"> <xs:complexType> - <xs:sequence> + <xs:all> <xs:element name="default" minOccurs="0" maxOccurs="1" type="xs:string"/> - <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/> - </xs:sequence> + <xs:element name="description" minOccurs="1" maxOccurs="1" type="xs:string"/> + </xs:all> <xs:attribute name="name" use="required"/> </xs:complexType> </xs:element> @@ -107,7 +107,8 @@ </xs:element> <xs:element name="requires"> <xs:complexType> - <xs:attribute name="block" type="xs:anyURI" use="required"/> + <xs:attribute name="interface" type="xs:anyURI" use="required"/> + <xs:attribute name="default" type="xs:anyURI" use="optional"/> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> </xs:element> @@ -115,7 +116,14 @@ <!-- implements --> <xs:element name="implements"> <xs:complexType> - <xs:attribute name="block" type="xs:anyURI" use="required"/> + <xs:sequence> + <xs:element ref="interface" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="interface"> + <xs:complexType> + <xs:attribute name="id" type="xs:anyURI" use="required"/> </xs:complexType> </xs:element> Modified: cocoon/trunk/src/schema/test-block.xml URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/schema/test-block.xml?view=diff&r1=159098&r2=159099 ============================================================================== --- cocoon/trunk/src/schema/test-block.xml (original) +++ cocoon/trunk/src/schema/test-block.xml Sat Mar 26 01:20:51 2005 @@ -17,17 +17,36 @@ <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="someidhere"> - <name>irgendein block</name> - <description href="xxxx">yyyy</description> - <state href="" community="committed" interfaces="unstable" implementation="unstable"/> - <license href=""></license> - <author></author> - <sitemap href=""></sitemap> - <properties> - <property name=""> - <default></default> - <description></description> + 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 server that can send mails.</description> </property> + <property name="foo"> + <description>bar</description> + </property> </properties> + <requirements> + <requires + interface="http://cocoon.apache.org/interface/portal/1.0" + name="portal" + default="http://cocoon.apache.org/blocks/portal/1.0.2" + /> + </requirements> + <extends block="http://cocoon.apache.org/blocks/another-block/1.0"/> + <implements> + <interface id="http://cocoon.apache.org/interface/bla/1.0"/> + </implements> </block>