cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
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*
>>site_bugs
>>site_changes
>>site_contrib
>>site_document-v12
>>site_faq
>>...

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?

Yes.

>>Also, it doesn't like non-standard extensions for files:
> 
> 
>>[xml-forrest ~/build/site]$ ls -1 images/*.jpeg
>>images/add.jpg.jpeg
>>images/fix.jpg.jpeg
>>images/hack.jpg.jpeg
>>images/remove.jpg.jpeg
>>images/update.jpg.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"
>>./skin/breadcrumbs.jsnull
>>./favicon.iconull

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' 
suffix.

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 ;)

thanks,

--Jeff


> Regards, Upayavira
> 



Mime
View raw message