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 128651 - Object types and file association problems
Summary: Object types and file association problems
Status: RESOLVED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-28 02:41 UTC by gt78
Modified: 2008-12-23 08:31 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Simple module to demonstrate the problem (1.21 MB, application/octet-stream)
2008-02-28 02:41 UTC, gt78
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gt78 2008-02-28 02:41:01 UTC
I've tried to install the ireport plugin on NetBeans 6.1 M1 (200801280931). The result is that jrxml file are no 
longer recognized as reports, but they are recognized as normal xml files. 
Playing a bit with NetBeans I discovered that in the advanced options the object type "XML Object" comes before "JRXML 
Files". Changing the order of the object types fixed the problem but there is something in NetBeans 6.1 M1 that is 
wrong since even after changing the order, when NetBeans starts again, it is not deterministic that the Jrxml will be 
recognized.
Please note that the module specifies the order requirements in the layer.xml in terms of mime resolver (and this is 
reflected in the options under the File Types branch) and in the module manifest: 

Name: com/jaspersoft/ireport/JrxmlDataLoader.class 
Install-Before: org.openide.loaders.XMLDataObject, org.netbeans.modules.xml.core.XMLDataObject 
OpenIDE-Module-Class: Loader 


As POC of this bug I created a simple module to support a new XML file extension called jrxml2. After installing the 
nbm, if you create in a project a file with extension .jrxml2 the IDE should show you this file with an icon similar 
to a rectangle. Depending on the order of the file types at startup you can randomly see the rectangle (plugin ok) or 
the XML file icon (meaning the correct mime resolver has been ignored in favor of the base xml resolver).
To see the bug you have to run the ide several times. Some times you'll see the rectangle icone, some others the xml 
file icon.

Giulio
Comment 1 gt78 2008-02-28 02:41:53 UTC
Created attachment 57405 [details]
Simple module to demonstrate the problem
Comment 2 Jesse Glick 2008-02-28 16:56:43 UTC
The XML modules were refactored a bit in 6.1. As you can see in the Representation Class property for XML Objects, the
class name changed. You can make your module work in either 6.0 or 6.1:

Install-Before: org.openide.loaders.XMLDataObject, org.netbeans.modules.xml.core.XMLDataObject,
org.netbeans.modules.xml.XMLDataObject

In fact I will do such an upgrade for netbeans.org modules.
Comment 3 Jesse Glick 2008-02-28 17:07:17 UTC
Fixing for nb.org modules in main #e64e822b2033, contrib #88ebb4d585c8. Looks like some fixes were made previously, e.g.
#e034d6777aea in main.
Comment 4 limo42 2008-03-27 17:30:35 UTC
BTW, the "New File Type" wizard needs to be fixed as well for NB 6.1, 
please refer to my comment to issue 131040.