This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 60274 - [devrev][mime-lookup]Support "compound" mime-types
Summary: [devrev][mime-lookup]Support "compound" mime-types
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Martin Roskanin
URL:
Keywords:
Depends on:
Blocks: 20203
  Show dependency tree
 
Reported: 2005-06-20 13:25 UTC by Jan Lahoda
Modified: 2007-11-05 13:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2005-06-20 13:25:44 UTC
In the IDE "compound" mime-types, like text/xml+ant, are used. The MIME lookup
should support such mime-types as merge of text/xml and text/xml+ant.
Comment 1 Martin Roskanin 2005-06-21 08:37:24 UTC
I am not able to find sufficient info about "compound" mime-types on Inet. I
have found RFC 3023:
http://www.rfc-editor.org/rfc/rfc3023.txt
that covers XML Media Types and these +xml types are specified there. Anyway, I
haven't found a document that would standardize the global use of "+" in other
mime types also. Thus I have following questions, maybe someone of you will know
the answers:

1. In RFC 3023 document the "+xml" suffix convention is always in the way
<something>+xml and not xml+<something>. However, I have noticed, that the mime
type text/xml+ant is widely used in mailing lists, or e.g. in this issue instead
of text/ant+xml. I would say, to ensure correct merging (inheritance of mime
types), this needs to be unified. 

2. Can such "compound" mime-type contain embeded mime types, e.g.
Editors/text/ant+xml/text/dtd? (Similar as scriplet in JSP -
Editors/text/jsp/text/x-java)

3. Is it possible to declare more suffixes like: text/ant+dtd+xml?


Comment 2 Jesse Glick 2005-06-21 16:31:46 UTC
Re. #1 - follow the RFC; other styles are presumably mistakes. The Ant module
uses text/x-ant+xml which seems to comply with the RFC.

Re. #2 - how would that work in practice?

Re. #3 - I don't think so.
Comment 3 Martin Roskanin 2005-06-21 16:52:06 UTC
>Re. #2 - how would that work in practice?
I am not aware of some use case. It would work similar like in JSP scriplet,
where java language can be embeded into jsp document - in this case for example
invoking context menu over scriplet will use the actions from jsp and some
(suitable in the scriplet context) actions from java. I just thought, that maybe
there can be some use case where "compound" mime-type can have embeded languages
as well.
Comment 4 Martin Roskanin 2005-06-22 16:51:24 UTC
fixed in [editor_api]

/cvs/editor/mimelookup/src/org/netbeans/modules/editor/mimelookup/Attic/LayerFolderObjectsProvider.java,v
 <--  LayerFolderObjectsProvider.java
new revision: 1.1.2.11; previous revision: 1.1.2.10

/cvs/editor/mimelookup/test/unit/src/org/netbeans/modules/editor/mimelookup/Attic/MimeLookupTest.java,v
 <--  MimeLookupTest.java
new revision: 1.1.2.16; previous revision: 1.1.2.15
Comment 5 Jesse Glick 2005-06-22 19:57:41 UTC
So... when this impl is merged, what will I be able to do that I cannot now?
Specifically, can I now remove the line

  setMIMEType("text/xml");

from AntProjectDataEditor, and still have XML syntax coloring in the Ant editor,
but also use Editors/text/x-ant+xml/Popup/*.instance to adjust the context menu?
Comment 6 Martin Roskanin 2005-06-23 08:13:18 UTC
Yes. Objects in "text/xml" will be inherited, it means that for mime type
"text/x-ant+xml" a Popup menu items will be represented as a compound of
Editors/text/xml/Popup and Editors/text/x-ant+xml/Popup folder objects plus
objects found in default Editors/Popup folder (there are actions like Cut, Copy,
Paste...general for all editors)

And as for #2: I implemented a generic mechanism for sub mime-types of
"compound" mime-types so now it is possible to use even such nightmare as e.g.:
Editors/text/ant+xml/text/dtd/text/dtd+xml/application/x-word...
Comment 7 Jesse Glick 2005-06-23 16:43:38 UTC
Great - let me know when it is in trunk.