Re: How to let Amaya recognise new mime.types

At 09:37 18/08/00 +0200, Irene VATTON wrote:
>> Hi,
>> 
>> I configure an Apache server to send a special mime.types when serving
>> files with a special extension :
>> 	myfile.dchtml is served with "application/amaya" mime.type
>> 
>> myfile.dchtml are in fact generated html files.
>> 
>> The goal is to tell every client to launch Amaya when this type of document
>> is requested. It works. Because Amaya does not know this special mime.type,
>> the document is opened in text mode. Is there a way to let Amaya know that
>> these document are in fact HTML documents ? 
>
>Amaya detects that the document is written in html:
>1) when the mime-type is text/html
>2) when the suffix is (case insensitive) .html, .html.xx, .htm, .htm.xx, 
>shtml, jsp, xht, xhtml
>3) when the mime-type is text/xml and the document includes the tag <html>
>4) when the suffix is xml and the document includes the tag <html>
>
>You can play either on the mime-type or on the suffix.
>

Thanks Irčne. But all these extensions may already be defined and used by
other applications. That's why I was thinking of defining a specific
combination of mime type and extension. 

So I patch Amaya code to add a new extension and tell Amaya that files
having this extension have to be treated as HTML. To do that I :

	- open AHTURLTools.c
	- search for the IsHTMLName function 
	- add the new extension among 
         if (!ustrcmp (nsuffix, TEXT("html")) ||
             !ustrcmp (nsuffix, TEXT("htm")) ||
             !ustrcmp (nsuffix, TEXT("shtml")) ||
             !ustrcmp (nsuffix, TEXT("jsp")) ||
             !ustrcmp (nsuffix, TEXT("xht")) ||
             !ustrcmp (nsuffix, TEXT("xhtm")) ||
             !ustrcmp (nsuffix, TEXT("xhtml")))
            return (TRUE);
	- compile and build


There are more and more applications which are defining their own
extensions to treat special html files. I am thinking for example of .asp,
.php, .dwt (dreamweaver HTML templates files)... So having a ressource file
to define that in Amaya without recompiling would be useful.

Thanks to think about it.
Best regards,
Catherine.

>
>> Thanks.
>> 
>> Best regards,
>> Catherine.
>> --
>> Catherine CHAT  - Responsable Technique
>> Catherine.Chat@via-business.fr - Tel 01 3963 5737 - Fax 01 3963 5114
>> 
>> VIA BUSINESS S.A.
>> Domaine de Voluceau  - BP 105 - 78153 Le Chesnay cedex - FRANCE
>> http://www.via-business.fr
>> ---------------------------------------------------------------------
>> 
>
>-- 
>     Irene.
>
>
>
>

Received on Friday, 18 August 2000 10:57:03 UTC