cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <>
Subject Re: Cocoon CLI broken
Date Mon, 26 May 2003 23:04:29 GMT
Upayavira wrote:

> Jeff,
> I'll happily look into this.

Thanks! But see below -- problem is mostly user stupidity, and I think I 
can fix the remaining bug myself.  I'll ask if I get stuck.

> I presume I can download the site from the cocoon-site module?

It would involve:
  - Checking out xml-forrest
  - Running build.{sh,bat}
  - Running build/dist/shbat/bin/forrest
  - Checking for badly named files in build/site/

>>I've just noticed: the command-line rendering in Cocoon M2 leaves
>>build/site/ full of bogus files for site: and ext: links:
>>[xml-forrest ~/build/site]$ ls site*

I'm embarrassed but happy to say, I no longer see this behaviour. I'm 
not sure where it came from; perhaps an earlier experiment with the 
one-pass CLI.  Sorry for the noise ;)

> I presume you're using the multiple-generation/link-view/check-extensions version?


>>Also, it doesn't like non-standard extensions for files:
>>[xml-forrest ~/build/site]$ ls -1 images/*.jpeg

This we resolved simply by using the correct MIME type (image/jpeg, not 
image/jpg).  *.js was fixed in the same way (using 
application/x-javascript instead of text/javascript).

> That looks like the traditional 'check-extensions' behaviour. Given that it appends the

> default extension for the mime-type, in this case, image/jpeg, jpeg is appended to a

> jpg file. I haven't changed this code at all, so I can only imagine that this has always

> been its behaviour (or someone changed MimeUtils). Anyway, it doesn't look very 
> hard to fix with a couple of tweaks to MimeUtils (e.g adding a 
> confirmExtension(mimeType, extension) function.
>>And for unknown files, it appends 'null' to the filename:
>>[xml-forrest ~/build/site]$ find . -name "*null"

favicon.iconull is still a problem.  MIMEUtils doesn't contain an entry 
for 'image/x-icon'.

Also, any files copied with an unknown MIME type end up with a 'null' 

So the only change that's really needed is a null check on what 
MIMEUtils returns.  If no MIME type is found, the original filename 
should be used.  I'll try this tonight.

Secondarily, it would be nice for MIMEUtils to read the MIME type list 
from a .properties file.  Then users could edit the mapping themselves. 
  For instance, users might want to have text/html files saved with a 
.php extension.

>>Fortunately, for every wrong file, it also generated the correct file
>>alongside it, so this isn't a critical problem, just an annoyance.  
> Huh? Bizzarre. Again, I'll look into it.

I should have realized my mistake when writing that ;)



> Regards, Upayavira

View raw message