Geertjan's Blog

  • February 7, 2006

Simplified Handling of NetBeans Update Centers

Geertjan Wielenga
Product Manager
There are update centers all over the world—I know of at least the following (off the top of my head): Masoud's (Gmail Checker), Sandip's (variety of cool editor tools, such as 'Copy Up'), my own (various API samples as well as Iván's class-based argument module), Nicolas (JavaScript Editor), and there's also someone (in Austria, I think) with a work-in-progress JNLP MultiView Editor in their update center.

However, it's a little bit of a painful process to register those update centers. You have to go deep into the murky part of the Options window and fiddle around a bit (for each update center). That's a bit of a tiresome process. Wouldn't it be much easier if you had a plug-in module that would register the update center for you? Well... check this out, it's a really cool 'Update Center wizard' and available in post 5.0 dev builds:

The Update Center wizard lets you specify the URL to your update center, together with the display name:

Then you click Finish. Now, what do you have? Let's take a little look:

  • Firstly, you have a new XML file (called xxxSettings.xml) with this content:

    <?xml version="1.0"?>
    <!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN"
    <settings version="1.0">
    <module name="org.netbeans.modules.autoupdate/1"/>
    <instanceof class="org.openide.ServiceType"/>
    <instanceof class="org.netbeans.modules.autoupdate.AutoupdateType"/>
    <instanceof class="org.netbeans.modules.autoupdate.XMLAutoupdateType"/>
    <instance class="org.netbeans.modules.autoupdate.XMLAutoupdateType" method="createXMLAutoupdateType"/>

  • Secondly, when you look in the module project's Project Properties dialog box, in the Libraries panel, you will see a module dependency on Auto Update. Then, look in project.xml and you will see a declarative module dependency (the 'Module Dependencies' list in the Libraries panel in the Project Properties dialog box is the GUI for the project.xml file).

  • Thirdly, you also have this new entry in your layer.xml file:

    <folder name="Services">
    <folder name="AutoupdateType">
    <file name="update_center.settings" url="update_centerSettings.xml">
    <attr name="SystemFileSystem.localizingBundle"
    <attr name="enabled" boolvalue="true"/>
    <attr name="url_key" stringvalue="org_yourorghere_updatecenterinstaller_update_center"/>

  • Finally, you have two new entries in Bundle.properties:

    Services/AutoupdateType/update_center.settings=Geertjan's Update Center

As a result, when the user installs this plug-in module, they will automatically (i.e., without even knowing about the Options window and how murky it is down there), have registered your update center. When they open the Update Center Wizard, they will see the display name right away and be able to access your update center just like any of the default NetBeans update centers.

Now, the only question is: How will you distribute this plug-in module? Hmmm... if you put it in your update center, you're still going to have to tell your users to fiddle around in the Options window. Haha. So, maybe the better solution is to just send the URL to the NBM directly to the user (or make it available as a downloadable link on-line somewhere or just send the NBM as a file to the user).

This Update Center wizard is really useful, and, of all all the wizards that the module development team could have created at this stage, I'm really impressed that usability (more than anything else) is being focused on right now. Other new wizards are the JavaHelp Help Set wizard (mentioned recently in this blog), the Options Panel wizard (say goodbye to the NetBeans Options Window Extension Module Tutorial), and the Module Installer wizard (which could be useful in the NetBeans Manifest File Syntax Highlighting Module Tutorial).

Join the discussion

Comments ( 4 )
  • Sebastian Kalita Tuesday, February 7, 2006
    That is really good news !!!! Previously I had to create this module manually when I wanted to have update center in my application built on top of NetBeans platform. I am very glad :)
  • Geertjan Sunday, February 12, 2006
    Good to hear, Sebastian! Stay tuned for an announcement about when an update to module development support in 5.0 will be made available (hint: a few weeks from now).
  • roxie Tuesday, August 8, 2006
    I got "Unable to Parse the content of update center server" when I tried to connect to Geertjan's update center using the url in the 2nd screenshot above. His quick response to my question was that the update center's url has changed to: http://blogs.sun.com/roller/resources/geertjan/updates_geertjan.xml
    You can also get this by copying the "link location" from the link in the left sidebar of the blog and paste it in the "Url to Update Descriptor" (2nd screenshot from the top)
  • guest Monday, December 23, 2013

    Thanks for all the great info you share on this blog!! I'm currently working on a corporate application for a client and would like to password protect the menu option for the "Tools/Plugins" menu option in the app in order to control access to different update centers on a per user basis. Any ideas on how I could do that? Any help would be greatly appreciated.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.