Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 374991 - Consider use MIME format IDs for content types
Summary: Consider use MIME format IDs for content types
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.5 M1   Edit
Assignee: Mark Macdonald CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 375008 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-21 17:02 EDT by John Arthorne CLA
Modified: 2012-04-11 14:38 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2012-03-21 17:02:14 EDT
While writing the Orion tutorial it struck me as strange that we invent our own syntax for content type ids: "text.plain", "image.png", etc. It seems to me we should just use the established MIME ids here ("text/plain", "image/png", etc).

http://en.wikipedia.org/wiki/Internet_media_type

Note I don't think there is anywhere we are enforcing any format here or interpreting these hierarchically, so I suspect this is just a matter of changing our own Orion and example plugins and be consistent.

Mark any thoughts?
Comment 1 Susan McCourt CLA 2012-03-21 17:08:08 EDT
I was just thinking the same thing.  I have (barely) started on a web intents plugin that will "open with" to a web intents editor.  I realized that I'd have to write some code that maps Orion content types to MIME types, and meant to open a bug on this same topic.
Comment 2 Susan McCourt CLA 2012-03-21 23:21:39 EDT
*** Bug 375008 has been marked as a duplicate of this bug. ***
Comment 3 Mark Macdonald CLA 2012-03-22 10:03:21 EDT
I think this will be OK as long as we continue to treat the IDs as opaque identifiers. By convention, they will match the common MIME type (when one exists) for a format.

We may run into trouble if we start treating MIMEs and content type IDs as identical. For example, the Orion "HTML" content type could plausibly cover 2 MIMEs: "text/html" and "application/xhtml+xml". This is mostly a concern for plugins and future development, since we don't do any MIME mapping in Orion right now.
Comment 4 Mark Macdonald CLA 2012-03-26 10:44:43 EDT
I've got a change [1] that makes our IDs (defined in webEditingPlugin.html) match the internet MIME type.

Note: the correct MIME for JavaScript is not text/javascript (deprecated) but rather application/javascript. Also, Java source files are unexpectedly text/x-java-source [2].

Any comments? This is a breaking change for a lot of plugins. I am OK with this if it makes plugin authoring easier, I'm just wary about misleading authors into thinking any MIME type will work. For example, Susan's use case from Comment 1 might still require extra mapping to handle a web intent that targets a deprecated or non-standard MIME.

[1] http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?h=bug374991_mime
[2] http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/conf/mime.types?view=annotate
Comment 5 John Arthorne CLA 2012-03-28 12:00:22 EDT
(In reply to comment #4)
> I've got a change [1] that makes our IDs (defined in webEditingPlugin.html)
> match the internet MIME type.

+1 from me.
Comment 6 Susan McCourt CLA 2012-04-03 11:53:47 EDT
+1.
Mark, we should try to time it so that we release this bug and bug 370903 all in one swoop.  That way, we won't break plugins twice.  Maybe this week?
Comment 7 Mark Macdonald CLA 2012-04-03 12:25:33 EDT
(In reply to comment #6)
> +1.
> Mark, we should try to time it so that we release this bug and bug 370903 all
> in one swoop.  That way, we won't break plugins twice.  Maybe this week?

Sure: the patch for this bug can be pushed whenever bug 370903 is ready.
Comment 8 Susan McCourt CLA 2012-04-11 14:38:25 EDT
I pushed this fix when I released bug 370903.