You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Jörn Nettingsmeier <ne...@apache.org> on 2007/05/03 21:52:50 UTC

publication.rng question...

i'm thinking of committing the attached patch, which will make 
<resources/> and <modules/> optional, but forces them to have at least 
one resource or module element inside.

andreas, since you changed that code: is there a particular reason for 
the current behaviour, i.e. mandate the wrappers and make the content 
elements optional? i find it a little counter-intuitive...

regards,

jörn


-- 
Jörn Nettingsmeier

Kurt is up in heaven now.


Re: publication.rng question...

Posted by Joern Nettingsmeier <ne...@folkwang-hochschule.de>.
Andreas Hartmann wrote:
> Jörn Nettingsmeier schrieb:
>> i'm thinking of committing the attached patch, which will make
>> <resources/> and <modules/> optional, but forces them to have at least
>> one resource or module element inside.
>>
>> andreas, since you changed that code: is there a particular reason for
>> the current behaviour, i.e. mandate the wrappers and make the content
>> elements optional? i find it a little counter-intuitive...
> 
> The wrappers were already mandatory, I just had to make the content
> elements optional because child publications might have no modules
> or resource types. I considered to change this like you proposed above,
> but I think this would require to change the Instantiator. But when
> I gave it more thought, I came to the conclusion that mandatory
> wrappers aren't so bad because they serve as a scaffolding for the
> file structure, and thus the files are more similar to each other.

i see your point. but given that most other elements are optional (and 
thus do not provide much of a scaffold), i'd prefer these to be optional 
as well, for consistency. i'm not sure about the instantiator - iirc it 
should handle non-existing resource-types and modules elements just 
fine, but i'll need to look. will do tonight.

-- 
jörn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621

Kurt is up in Heaven now.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: publication.rng question...

Posted by Andreas Hartmann <an...@apache.org>.
Jörn Nettingsmeier schrieb:
> i'm thinking of committing the attached patch, which will make
> <resources/> and <modules/> optional, but forces them to have at least
> one resource or module element inside.
>
> andreas, since you changed that code: is there a particular reason for
> the current behaviour, i.e. mandate the wrappers and make the content
> elements optional? i find it a little counter-intuitive...

The wrappers were already mandatory, I just had to make the content
elements optional because child publications might have no modules
or resource types. I considered to change this like you proposed above,
but I think this would require to change the Instantiator. But when
I gave it more thought, I came to the conclusion that mandatory
wrappers aren't so bad because they serve as a scaffolding for the
file structure, and thus the files are more similar to each other.

-- Andreas



> 
> regards,
> 
> jörn
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Index: pubs/blog/config/publication.xml
> ===================================================================
> --- pubs/blog/config/publication.xml	(revision 534971)
> +++ pubs/blog/config/publication.xml	(working copy)
> @@ -37,6 +37,5 @@
>      <resource-type name="entry" workflow="workflow.xml"/>
>      <resource-type name="sidebar" workflow="workflow.xml"/>
>    </resource-types>
> -  <modules/>
>  </publication>
>  
> Index: resources/build/publication.rng
> ===================================================================
> --- resources/build/publication.rng	(revision 534971)
> +++ resources/build/publication.rng	(working copy)
> @@ -18,10 +18,10 @@
>  
>  <!-- 
>    This RELAX NG grammar defines the configuration file of a. Lenya publication.
> -  Configuration files must be located under "$YOURPUBROOT/$PUBNAME/config/publication.xml".
> +  Configuration files must be located under "$PUB_HOME/$PUBNAME/config/publication.xml".
>    
>    This schema is new as of 2007-02-23. It is NOT backwards-compatible. It combines the
> -  contents of $YOURPUBROOT/$PUBNAME/publication.xml and $YOURPUBROOT/$PUBNAME/config/publication.xml.
> +  contents of $PUB_HOME/$PUBNAME/publication.xml and $PUB_HOME/$PUBNAME/config/publication.xconf.
>    
>    The publication.xml file is parsed by:
>    
> @@ -162,22 +162,26 @@
>          </element>
>          <element name="document-builder"><attribute name="name"><data type="string"/></attribute></element>
>          <element name="site-manager"><attribute name="name"><data type="string"/></attribute></element>
> -        <element name="resource-types">
> -          <zeroOrMore>
> -            <element name="resource-type">
> -              <attribute name="name"><ref name="resourceTypeName"/></attribute>
> -              <attribute name="workflow"><ref name="workflowUri"/></attribute>
> -            </element>
> -          </zeroOrMore>
> -        </element>
> -        <element name="modules">
> -          <zeroOrMore>
> -            <element name="module">
> -              <attribute name="name"><ref name="moduleName"/></attribute>
> -            </element>
> -          </zeroOrMore>
> -        </element>
>          <optional>
> +          <element name="resource-types">
> +            <oneOrMore>
> +              <element name="resource-type">
> +                <attribute name="name"><ref name="resourceTypeName"/></attribute>
> +                <attribute name="workflow"><ref name="workflowUri"/></attribute>
> +              </element>
> +            </oneOrMore>
> +          </element>
> +        </optional>
> +        <optional>
> +          <element name="modules">
> +            <oneOrMore>
> +              <element name="module">
> +                <attribute name="name"><ref name="moduleName"/></attribute>
> +              </element>
> +            </oneOrMore>
> +          </element>
> +        </optional>
> +        <optional>
>            <element name="breadcrumb-prefix"><data type="string"/></element>
>          </optional>
>          <optional>
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org