How to create a new MIME type for a Sugar activity?

Tomeu Vizoso tomeu at tomeuvizoso.net
Wed Feb 6 06:56:20 EST 2008


On Mon, 2008-02-04 at 11:21 -0600, James Simmons wrote:
> I am writing a Sugar activity in Python.  This activity will enable the 
> user to navigate through a list of image files stored in a Zip file by 
> using the arrow keys, and might support a slideshow feature too.  There 
> might be a hundred image files stored in the Zip file.  Grouping the 
> images in one file makes it much easier to deal with them in the Journal.
> 
> The thing is, I want this Zip file to have its own MIME type, so that:
> 
> 1).  The Etoys activity does not try to open the file, at all, ever.  
> EToys takes a long time to start up and shut down and it is really 
> annoying when I open the file with EToys instead of my own activity.
> 2).  My Activity *does* open the file.
> 3).  The Zip files containing images show up in the Journal with my own 
> Activity's icon, which looks like a slide projector.
> 
> To accomplish this I have created my Zip files with the extension 
> ".slides" and I'd like to be able to use the MIME type 
> "application/slides" for such files.
> 
> I'm also interested in creating a reader program for Gutenberg etexts.  
> I'd like these files to have their own MIME type too so they don't get 
> opened by the Write activity by mistake.  I was thinking of using a file 
> suffix of ".book" and a MIME type of "text/book" for these.
> 
> I tried using a mimetypes.xml file in the bundle but that didn't work.  
> I couldn't find an example of an Activity that used such a file so I'm 
> not certain I'm doing it correctly.
> 
> I'd appreciate any information on MIME types or on alternative 
> approaches that would solve problems 1-3.  Thanks much,

I'm not sure what's exactly your problem. In principle, if the data from
your activity can be reused in other activities, I would call that a
good thing.

If things work as they are supposed to, without doing anything about
mime types your journal entries should be resumed by default in your
activity and would use your activity's icon. This is not working?

Can you provide a link to you activity source code?

Regards,

Tomeu




More information about the Devel mailing list