You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rodent of Unusual Size <Ke...@Golux.Com> on 1998/11/22 16:14:33 UTC

Re: mod_negotiation/3430: Enhancement: MultiViews, Multi-Language Documents

pcs@apache.org wrote:
> 
> Thanks for the comments. Your main point is that you
> would like a request for (say) doc.htm to negotiate
> amongst files called doc.en.htm and doc.fr.htm. That
> would involve a significant change from the current
> behaviour, which will only negotiate amongst
> documents matching doc.htm.*. Your suggestion does make
> sense, and would remove the artificial requirement that
> extensions appear in a particular order (which is
> not a requirement anywhere else in Apache).

I'm not sure we can legally do what's requested in any event,
since it means having detailed understanding of the submitted
URI rather than treating it as an opaque quantity.  It seems to
me that if we're going to break "doc.htm" down into tokens,
we'd need to return a 300 code for user selection even if
the only file matching was 'doc.en.htm'.

It's been my understanding that the URI should only be
used as a basename, not as a tokenisable quantity.  I'd
like a reading from the protocol cop.. Roy?
-- 
#ken	P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Group member         <http://www.apache.org/>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>

Re: mod_negotiation/3430: Enhancement: MultiViews, Multi-Language Documents

Posted by Dirk-Willem van Gulik <di...@jrc.it>.
On Mon, 23 Nov 1998, Martin Kraemer wrote:

> On Mon, Nov 23, 1998 at 11:50:24AM +0100, Dirk-Willem van Gulik wrote:
> > That is actually a bit of an issue; and I was forced to build this into
> > mod_i18n.c 
 
> I assume this module is the one which picks up the charset from:
> > 	index.en.latin1.html 
> right? Is that module publicly available?

Well it is mainly mod_mime and mod_negotiation working in combo. I18n does
the on the fly conversion. Let me check if the latest version is
modules.apache.org. (Documentation suchs :-)



Re: mod_negotiation/3430: Enhancement: MultiViews, Multi-Language Documents

Posted by Martin Kraemer <ma...@mch.sni.de>.
On Mon, Nov 23, 1998 at 11:50:24AM +0100, Dirk-Willem van Gulik wrote:
> That is actually a bit of an issue; and I was forced to build this into
> mod_i18n.c 

I assume this module is the one which picks up the charset from:
> 	index.en.latin1.html 
right? Is that module publicly available?

    Martin
-- 
<Ma...@Mch.SNI.De>      |        Siemens Information and
Phone: +49-89-636-46021          |        Communication  Products
FAX:   +49-89-636-47816          |        81730  Munich,  Germany

Re: mod_negotiation/3430: Enhancement: MultiViews, Multi-Language Documents

Posted by Dirk-Willem van Gulik <di...@jrc.it>.

On Mon, 23 Nov 1998, Paul Sutton wrote:

> On Mon, 23 Nov 1998, Martin Kraemer wrote:
> > On Sun, Nov 22, 1998 at 10:14:33AM -0500, Rodent of Unusual Size wrote:
> > > pcs@apache.org wrote:
> > > > Thanks for the comments. Your main point is that you
> > > > would like a request for (say) doc.htm to negotiate
> > > > amongst files called doc.en.htm and doc.fr.htm.
> > > 
> > > It's been my understanding that the URI should only be
> > > used as a basename, not as a tokenisable quantity.  I'd
> > > like a reading from the protocol cop.. Roy?
> > 
> > How about (another new directive?)
> > 
> >    <Directory somewhere>
> >      NegotiationFormat   "%n.%L.%T.%E"
> >    </Directory>
> > 
> > to denote that document names for basename %n are constructed in a
> > format which has first the language %L (en/fr/de), then the type %T
> > (txt/html/gif) and finally the Encoding %E (gz/bz2/Z) ?
> > 
> > It would even allow people to put their language versions into
> > different subdirectories ("%L/$n.%T" -> en/index.html) -- as seen in
> > many servers (where you have to click on a flag to get your locale's
> > version - urgh!)
> 
> You could pretty much emulate that now with:
> 
> <Directory ~ /en/>
> DefaultLanguage en
> </Directory>
> 
> (except in this case you have to do the above for every language you store
> in separate sub-directories). This would allow you to replicate the whole
> directory tree until a top-level "en" directory, for example.

Which is what you have when you inherit an NT Netscape or IIS site which
you have to redo (cause it became too expensive to buy new hardware, and
you could do it on BSD with a fraction of that). As this is the suggested
approach in the SuiteSpot documentation.

But with the RewriteRules you can actually map quite easiy

	http://foo.bar/some/where/(??)/xyz.html
and
	http://foo.bar/en/some/where/xyz.html

To something more sensible. (Unless they have _also_ translated the URLs.
:-().

Dw.



Re: mod_negotiation/3430: Enhancement: MultiViews, Multi-Language Documents

Posted by Paul Sutton <pa...@c2.net>.
On Mon, 23 Nov 1998, Martin Kraemer wrote:
> On Sun, Nov 22, 1998 at 10:14:33AM -0500, Rodent of Unusual Size wrote:
> > pcs@apache.org wrote:
> > > Thanks for the comments. Your main point is that you
> > > would like a request for (say) doc.htm to negotiate
> > > amongst files called doc.en.htm and doc.fr.htm.
> > 
> > It's been my understanding that the URI should only be
> > used as a basename, not as a tokenisable quantity.  I'd
> > like a reading from the protocol cop.. Roy?
> 
> How about (another new directive?)
> 
>    <Directory somewhere>
>      NegotiationFormat   "%n.%L.%T.%E"
>    </Directory>
> 
> to denote that document names for basename %n are constructed in a
> format which has first the language %L (en/fr/de), then the type %T
> (txt/html/gif) and finally the Encoding %E (gz/bz2/Z) ?
> 
> It would even allow people to put their language versions into
> different subdirectories ("%L/$n.%T" -> en/index.html) -- as seen in
> many servers (where you have to click on a flag to get your locale's
> version - urgh!)

You could pretty much emulate that now with:

<Directory ~ /en/>
DefaultLanguage en
</Directory>

(except in this case you have to do the above for every language you store
in separate sub-directories). This would allow you to replicate the whole
directory tree until a top-level "en" directory, for example.

Paul


Re: mod_negotiation/3430: Enhancement: MultiViews, Multi-Language Documents

Posted by Dirk-Willem van Gulik <di...@jrc.it>.
On Mon, 23 Nov 1998, Paul Sutton wrote:

> On Mon, 23 Nov 1998, Martin Kraemer wrote:
> > On Sun, Nov 22, 1998 at 10:14:33AM -0500, Rodent of Unusual Size wrote:
> > > pcs@apache.org wrote:
> > > > 
> > > > Thanks for the comments. Your main point is that you
> > > > would like a request for (say) doc.htm to negotiate
> > > > amongst files called doc.en.htm and doc.fr.htm.
> > > 
> > > It's been my understanding that the URI should only be
> > > used as a basename, not as a tokenisable quantity.  I'd
> > > like a reading from the protocol cop.. Roy?
> >
> > How about (another new directive?)
> > 
> >    <Directory somewhere>
> >      NegotiationFormat   "%n.%L.%T.%E"
> >    </Directory>
> 
> I've actually been thinking about this in generic terms. The fundamental
> problem to solve is how to obtain meta-information about a resource
> (meta-information being the content-type, languages, charset, etc). At the
> moment this comes from mod_mime when it looks at the extensions of the
> file, in any order (apart from if an "unknown" extension appears, of
> course).
> 
> mod_negotiation has its own way of specifying meta-data, in a type-map
> files. This is bad because you can easily get different meta-data from the

Or it picks it up from what has already been inferred from the file
extensions I believe.

> type-map as you do from the file extensions. E.g. if the type map
> correctly maps doc.html onto type text/html, charset iso-8859-1, language
> en, encoding none, that is fine. But the a request for plain "doc.html"
> (which doesn't go via mod_negotiation) does not get any of the meta-data
> returned in the response apart from content-type. I think that this is a
> major problem with type-map files (and the reason why I use multiviews
> instead, even though it is slower). Mod_negotiation should be concerned
> about negotiation _only_, and should not ever set its own meta-data. 
 
Yes I completely agree... and

> So generic meta-data would mean we should take the current type-map
> parsing out of mod_negotiation and put it into mod_mime. Then we could
> provide a directive to say whether mod_mime to obtain meta-data from
> unstructured extensions (as now), from a structured filename (as above),
> or from a meta-data source file.

This makes sense.
 
> Mod_negotiation's type-map file would then just become a list of variants
> for a particular resource (thus making it easy to create and maintain).

This makes a lot of sense; but as soon as you start having variants, in
particular when the variants are for and charset, language I am lost on
how to proceed. 

Because the browser/OS comes in here; ideally charset and language are
coupled (latin2+croatian, latin1+dutch, sJ+japanese, ..)  but one often
wants to send a latin1+croatian to a poor windows user on IE3 who is in
the UK; so that he has a fair change to read it. 

So perhaps you need to add another step; or mergine this into
mod-negotiation after the type setting has been moved to mod_mime, which
is this sort of coupling of the variants.

Dw.


Re: mod_negotiation/3430: Enhancement: MultiViews, Multi-Language Documents

Posted by Paul Sutton <pa...@c2.net>.
On Mon, 23 Nov 1998, Martin Kraemer wrote:
> On Sun, Nov 22, 1998 at 10:14:33AM -0500, Rodent of Unusual Size wrote:
> > pcs@apache.org wrote:
> > > 
> > > Thanks for the comments. Your main point is that you
> > > would like a request for (say) doc.htm to negotiate
> > > amongst files called doc.en.htm and doc.fr.htm.
> > 
> > It's been my understanding that the URI should only be
> > used as a basename, not as a tokenisable quantity.  I'd
> > like a reading from the protocol cop.. Roy?
>
> How about (another new directive?)
> 
>    <Directory somewhere>
>      NegotiationFormat   "%n.%L.%T.%E"
>    </Directory>

I've actually been thinking about this in generic terms. The fundamental
problem to solve is how to obtain meta-information about a resource
(meta-information being the content-type, languages, charset, etc). At the
moment this comes from mod_mime when it looks at the extensions of the
file, in any order (apart from if an "unknown" extension appears, of
course).

mod_negotiation has its own way of specifying meta-data, in a type-map
files. This is bad because you can easily get different meta-data from the
type-map as you do from the file extensions. E.g. if the type map
correctly maps doc.html onto type text/html, charset iso-8859-1, language
en, encoding none, that is fine. But the a request for plain "doc.html"
(which doesn't go via mod_negotiation) does not get any of the meta-data
returned in the response apart from content-type. I think that this is a
major problem with type-map files (and the reason why I use multiviews
instead, even though it is slower). Mod_negotiation should be concerned
about negotiation _only_, and should not ever set its own meta-data. 

So generic meta-data would mean we should take the current type-map
parsing out of mod_negotiation and put it into mod_mime. Then we could
provide a directive to say whether mod_mime to obtain meta-data from
unstructured extensions (as now), from a structured filename (as above),
or from a meta-data source file.

Mod_negotiation's type-map file would then just become a list of variants
for a particular resource (thus making it easy to create and maintain).

Paul



Re: mod_negotiation/3430: Enhancement: MultiViews, Multi-Language Documents

Posted by Dirk-Willem van Gulik <di...@jrc.it>.

On Mon, 23 Nov 1998, Martin Kraemer wrote:

> On Sun, Nov 22, 1998 at 10:14:33AM -0500, Rodent of Unusual Size wrote:
> > pcs@apache.org wrote:
> > > 
> > > Thanks for the comments. Your main point is that you
> > > would like a request for (say) doc.htm to negotiate
> > > amongst files called doc.en.htm and doc.fr.htm.
> > 
> > It's been my understanding that the URI should only be
> > used as a basename, not as a tokenisable quantity.  I'd
> > like a reading from the protocol cop.. Roy?
> 
> How about (another new directive?)
> 
>    <Directory somewhere>
>      NegotiationFormat   "%n.%L.%T.%E"
>    </Directory>
> 
> to denote that document names for basename %n are constructed in a
> format which has first the language %L (en/fr/de), then the type %T
> (txt/html/gif) and finally the Encoding %E (gz/bz2/Z) ?

Apart from the dreaded .pl = perl versus polish mix; my personal feel
is that the various extensions are picked up OK, i.e. at the moment on
our site

	index.en.latin1.html 

works quite ok, regardless of the order; and also responds sensibly if you
fetch index.html or even plain 'index'.
 
> It would even allow people to put their language versions into
> different subdirectories ("%L/$n.%T" -> en/index.html) -- as seen in
> many servers (where you have to click on a flag to get your locale's
> version - urgh!)

That is actually a bit of an issue; and I was forced to build this into
mod_i18n.c 

> And it would solve the ambiguity between .pl (Perl) and .pl (Poland)
> by configuration and convention.

Which I see as a feature rahter than an issue.

But you are right; for the next major release it would make sense to
really make all MIME dimensions fully independend and well defined;
implied from location, extension, directiory etc ,etc.

Dw.


Re: mod_negotiation/3430: Enhancement: MultiViews, Multi-Language Documents

Posted by Martin Kraemer <ma...@mch.sni.de>.
On Sun, Nov 22, 1998 at 10:14:33AM -0500, Rodent of Unusual Size wrote:
> pcs@apache.org wrote:
> > 
> > Thanks for the comments. Your main point is that you
> > would like a request for (say) doc.htm to negotiate
> > amongst files called doc.en.htm and doc.fr.htm.
> 
> It's been my understanding that the URI should only be
> used as a basename, not as a tokenisable quantity.  I'd
> like a reading from the protocol cop.. Roy?

How about (another new directive?)

   <Directory somewhere>
     NegotiationFormat   "%n.%L.%T.%E"
   </Directory>

to denote that document names for basename %n are constructed in a
format which has first the language %L (en/fr/de), then the type %T
(txt/html/gif) and finally the Encoding %E (gz/bz2/Z) ?

It would even allow people to put their language versions into
different subdirectories ("%L/$n.%T" -> en/index.html) -- as seen in
many servers (where you have to click on a flag to get your locale's
version - urgh!)

And it would solve the ambiguity between .pl (Perl) and .pl (Poland)
by configuration and convention.

    Martin
-- 
<Ma...@Mch.SNI.De>      |        Siemens Information and
Phone: +49-89-636-46021          |        Communication  Products
FAX:   +49-89-636-47816          |        81730  Munich,  Germany