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 253044 - Please add mime type for nbm files
Summary: Please add mime type for nbm files
Status: CLOSED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: Plugin Manager (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-17 13:37 UTC by Christian Lenz
Modified: 2018-06-06 15:03 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lenz 2015-06-17 13:37:38 UTC
I checked the mime type of a nbm file and it is: application/octet-stream. It means that this filetype is unknown? So first why is a nbm file unknown for netbeans? And second I would like to create a plugin, where you can right click on a nbm file and choose install. So ou don't have to go to the plugin window -> download and choose this file via file chooser. Atm I only know, that I can add an action for a specific mime type and not for a concrete file type. So it would be nice, if any nbm file has a mime-type like application/x-nbm or so.


Regards

Chris
Comment 1 Christian Lenz 2015-06-24 06:58:19 UTC
Here is my example code to add a custom mime type to an extension, but it doesn't work correct. In my IDE, nbm files can be expanded like zip archives. After adding those code to a nbm file I can't expand the nbm file anymore. So smth worked, but there is no action. Here is my code example: http://pastebin.com/Jh3ssw3h
Comment 2 Christian Lenz 2015-06-29 14:01:18 UTC
I used now this tutorial: https://platform.netbeans.org/tutorials/nbm-filetype.html and removed all classes, which I not used. For example the template files to add a new file to the "New File" Wizard. Now it works. For me we can close the ticket maybe? I added a new mime type called application/nbm to nbm, NBM files. And I will add a action to it.
Comment 3 Christian Lenz 2016-01-08 08:17:58 UTC
Would be nice to have it, but I created a plugin with adding a mime type to a nbm file: https://github.com/Netbeans-Modules/NbInstallPlugin you can see it here, how I handled this: https://github.com/Netbeans-Modules/NbInstallPlugin/blob/develop/src/org/chrisle/netbeans/plugins/nbinstallplugin/actions/InstallPluginDataObject.java


Works like a charm and now I can add new stuff, like context menu entries to it.
Comment 4 Jaroslav Havlin 2016-01-08 09:07:17 UTC
Great job, thank you very much!

Can you please also publish your plugin at http://plugins.netbeans.org/ ?

Reassigning to platform/Plugin Manager. Should this feature be integrated into default NetBeans distribution? (I think that having it in optional plugin is quite OK.)
Comment 5 Geertjan Wielenga 2016-01-08 09:09:14 UTC
Would be great to have in default distribution.
Comment 6 Christian Lenz 2016-01-08 09:32:19 UTC
The plugin is still in development. It is not finished yet. My intention was to implement logic to install plugins (nbm files) right from the projects, files or favorites window. This logic is missing atm. Benno helped me to give me some hint for the API, but I have to dive into to finish it.
Comment 7 Christian Lenz 2016-01-08 09:33:39 UTC
And atm, there is a little new behavior. Usually you can exband/collapse nbm files like archive files, where you can see some stuff inside. This is not possible atm, because of the new mime-type that I created.
Comment 8 Christian Lenz 2018-06-06 15:03:12 UTC
I will close it, because it will handled now at the JIRA board: https://issues.apache.org/jira/browse/NETBEANS-929. Please discuss it there for further information.