You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Giacomo Pati <pa...@yahoo.com> on 2000/07/12 15:57:40 UTC

Sitemap configuration issues

Hi all

For the Sitemap we need to come to a consensus what the most complex and still legal configuration
is for components in the <map:components> section. These configurations are passed as a tree of
org.apache.avalon.Configuration objects to the components immediately after instantiation with a
call to their setConfiguration method if they implement the org.apache.avalon.Configurable
interface. And also we need to know what is not allowed or doesn't make sense as for a
configuration syntax. To begin the dicussion I put the following snipped into it. Please make your
additions, suggestions and comments based on this:

  <map:serializer name="html" 
      src="class:///org.apache.cocoon.serializer.HTMLSerializer">
    <mime-type>text/html</mime-type>
    <doctype-public map:value="-//W3C//DTD HTML 4.0 Transitional//EN"/>
    <doctype-system map:value="http://www.w3.org/TR/REC-html40/loose.dtd"/>
    <preserve-space map:value="true"/>
    <encoding map:value="UTF-8"/>
    <indent>1</indent>
    <colors>
      <foreground map:value="white"/>
      <borders>
        <left map:value="blue"/>
        <right>red</right>
      </borders>
      <text>black</text>
      <lines>
        <left map:value="cyan"/>
        <right>orange</right>
      </lines>
      <background>green</background>
    </colors>
    <map:param name="foo" value="bar"/>
    <map:param name="baz">foobar</map:param>
    <line-width map:value="120"/>
  </map:serializer>

Stefano also stated in the sitemap-working-draft.xmap that:

  The syntax
    
    <xxx map:value="yyy">
      
  is completely equivalent to
    
    <xxx>yyy</xxx>
      
  throughout the entire sitemap.

And I will state the following for discussion:

Attributes at the component element are reserved for exclusive use by the Sitemap engine and are
not passed to the component as configuration attributes.

This is correct:
  <map:serializer type="html" 
      src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>

because type= and src= are attribute recognized by the Sitemap engine.

This doesn't make sence because the component will not get the mime-type attribute:
  <map:serializer type="html" mime-type="text/html"
      src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>

instead it has to be written as:
  <map:serializer type="html" 
      src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>
    <mime-type map:value="text/html"/>
  </map:serializer>

or
  <map:serializer type="html" mime-type="text/html"
      src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>
    <mime-type>text/html</mime-type>
  </map:serializer>

I will also state that the following as illegal:
  <map:serializer type="html" 
      src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>
    <mime-type>text/html</mime-type>
    <map:param name="foo" value="bar"/>
    <map:param name="baz">foobar</map:param>
  </map:serializer>

simply because we don't need a construct like <map:param .../>

Please, all, help to reach a common sense concerning component configuration at init time.

I will soon start another thread which enters the configuration of component at run time (that is
during request processing).

Giacomo

=====
--
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail � Free email you can access from anywhere!
http://mail.yahoo.com/

Re: Sitemap configuration issues

Posted by Stefano Mazzocchi <st...@apache.org>.
Giacomo Pati wrote:
> 
> Hi all
> 
> For the Sitemap we need to come to a consensus what the most complex and still legal configuration
> is for components in the <map:components> section. These configurations are passed as a tree of
> org.apache.avalon.Configuration objects to the components immediately after instantiation with a
> call to their setConfiguration method if they implement the org.apache.avalon.Configurable
> interface. And also we need to know what is not allowed or doesn't make sense as for a
> configuration syntax. To begin the dicussion I put the following snipped into it. Please make your
> additions, suggestions and comments based on this:
> 
>   <map:serializer name="html"
>       src="class:///org.apache.cocoon.serializer.HTMLSerializer">
>     <mime-type>text/html</mime-type>
>     <doctype-public map:value="-//W3C//DTD HTML 4.0 Transitional//EN"/>
>     <doctype-system map:value="http://www.w3.org/TR/REC-html40/loose.dtd"/>
>     <preserve-space map:value="true"/>
>     <encoding map:value="UTF-8"/>
>     <indent>1</indent>
>     <colors>
>       <foreground map:value="white"/>
>       <borders>
>         <left map:value="blue"/>
>         <right>red</right>
>       </borders>
>       <text>black</text>
>       <lines>
>         <left map:value="cyan"/>
>         <right>orange</right>
>       </lines>
>       <background>green</background>
>     </colors>
>     <map:param name="foo" value="bar"/>
>     <map:param name="baz">foobar</map:param>

We don't need this, do we?

>     <line-width map:value="120"/>
>   </map:serializer>
> 
> Stefano also stated in the sitemap-working-draft.xmap that:
> 
>   The syntax
> 
>     <xxx map:value="yyy">
> 
>   is completely equivalent to
> 
>     <xxx>yyy</xxx>
> 
>   throughout the entire sitemap.
> 
> And I will state the following for discussion:
> 
> Attributes at the component element are reserved for exclusive use by the Sitemap engine and are
> not passed to the component as configuration attributes.

I would restate as:

everything placed in the sitemap namespace will be removed and not
available to the components. Behavior when multiple namespaces are used
is not defined at this time, so we suggest to use the default namespace
for component configurations.

> This is correct:
>   <map:serializer type="html"
>       src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>
> 
> because type= and src= are attribute recognized by the Sitemap engine.
> 
> This doesn't make sence because the component will not get the mime-type attribute:
>   <map:serializer type="html" mime-type="text/html"
>       src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>
> 
> instead it has to be written as:
>   <map:serializer type="html"
>       src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>
>     <mime-type map:value="text/html"/>
>   </map:serializer>
> 
> or
>   <map:serializer type="html" mime-type="text/html"
>       src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>
>     <mime-type>text/html</mime-type>
>   </map:serializer>
> 
> I will also state that the following as illegal:
>   <map:serializer type="html"
>       src="class:///org.apache.cocoon.serializer.HTMLSerializer"/>
>     <mime-type>text/html</mime-type>
>     <map:param name="foo" value="bar"/>
>     <map:param name="baz">foobar</map:param>
>   </map:serializer>
> 
> simply because we don't need a construct like <map:param .../>

While I agree on <map:param> I totally disagree on mime-type.

"mime-type" is an attribute of the map:serializer element, not a
component configuration.
 
> Please, all, help to reach a common sense concerning component configuration at init time.
> 
> I will soon start another thread which enters the configuration of component at run time (that is
> during request processing).

??? there is no such thing as "runtime configuration". Configurations
are, by definition, available at init time and restart time.

At run-time, variables are called "parameters", not "configurations".

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------