Thursday, February 26, 2015

Netbeans Update Center


1) Create a update.xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module_updates PUBLIC "-//NetBeans//DTD Autoupdate Catalog 2.6//EN" "http://plugins.netbeans.org/data/catalogue/autoupdate-catalog-2_6.dtd">
<module_updates timestamp="31/55/00/07/02/2015">

<module codenamebase="org.abc" distribution="http://abc.com/abcupdate/files/nbms/org-abc.nbm" downloadsize="21272" homepage="http://abc.com" license="8B813426" moduleauthor="Peter" needsrestart="true" releasedate="2015/02/24">
    <manifest AutoUpdate-Show-In-Client="true" OpenIDE-Module="org.abc" OpenIDE-Module-Display-Category="Editing" OpenIDE-Module-Implementation-Version="110324" OpenIDE-Module-Java-Dependencies="Java > 1.6" OpenIDE-Module-Long-Description="Shows the line endings of the currently edited file in the statuc bar, and allows to change them," OpenIDE-Module-Module-Dependencies="org.netbeans.modules.editor/3 > 1.50.1.3.10.2, org.netbeans.modules.editor.lib/2-3 > 2.10.1.10.2, org.netbeans.modules.editor.lib2/1 > 1.28.1.2, org.openide.awt > 7.23.1, org.openide.filesystems > 7.38.1, org.openide.loaders > 7.16.1, org.openide.nodes > 7.16.1, org.openide.text > 6.30.1, org.openide.util > 8.6.1, org.openide.util.lookup > 8.3.1" OpenIDE-Module-Name="Show and change line endings" OpenIDE-Module-Requires="org.openide.modules.ModuleFormat1" OpenIDE-Module-Short-Description="Shows the line endings of the currently edited file in the statuc bar, and allows to change them," OpenIDE-Module-Specification-Version="1.2"/>
 
</module>

<module codenamebase="org.abc.def.db" distribution="http://abc.com/abcupdate/files/nbms/org-abc-def-db.nbm" downloadsize="41272" homepage="http://abc.com" license="8B813424" moduleauthor="Peter" needsrestart="true" releasedate="2015/02/24">
    <manifest AutoUpdate-Show-In-Client="true" OpenIDE-Module="org.abc.def.db" OpenIDE-Module-Display-Category="Editing" OpenIDE-Module-Implementation-Version="110324" OpenIDE-Module-Java-Dependencies="Java > 1.3" OpenIDE-Module-Long-Description="Shows the line endings of the currently edited file in the statuc bar, and allows to change them," OpenIDE-Module-Module-Dependencies="org.netbeans.modules.editor/3 > 1.50.1.3.10.2, org.netbeans.modules.editor.lib/2-3 > 2.10.1.10.2, org.netbeans.modules.editor.lib2/1 > 1.28.1.2, org.openide.awt > 7.23.1, org.openide.filesystems > 7.38.1, org.openide.loaders > 7.16.1, org.openide.nodes > 7.16.1, org.openide.text > 6.30.1, org.openide.util > 8.6.1, org.openide.util.lookup > 8.3.1" OpenIDE-Module-Name="Show and change line endings" OpenIDE-Module-Requires="org.openide.modules.ModuleFormat1" OpenIDE-Module-Short-Description="Shows the line endings of the currently edited file in the statuc bar, and allows to change them," OpenIDE-Module-Specification-Version="1.2"/>
 
</module>

<license name="8B813426" url="http://abc.com/abcupdate/licenses/8B813426.license"/>
<license name="8B813424" url="http://abc.com/abcupdate/licenses/8B813424.license"/>
</module_updates>

Refer:
http://updates.netbeans.org/netbeans/updates/7.1.2/uc/final/distribution/catalog.xml.gz
(need to unzip file to get catalog.xml)

2) Create the nbm files for the respective modules
3) Place the nbm files in the respective folders specified above on the server
4) Define the Update Center in layer.xml and add code in Installer.java


layer.xml
...
        <folder name="AutoupdateType">
            <file name="org_doxa_update_center.instance">
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.doxa.Bundle"/>
                <attr name="enabled" boolvalue="true"/>
                <attr name="instanceCreate" methodvalue="org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogFactory.createUpdateProvider"/>
                <attr name="instanceOf" stringvalue="org.netbeans.spi.autoupdate.UpdateProvider"/>
                <attr name="url_key" stringvalue="org_doxa_update_center"/>
            </file>
        </folder>
</folder>

....



Set interval


-J-Dplugin.manager.check.interval=EVERY_STARTUP



http://wiki.netbeans.org/FaqPluginManagerCustomization#To_customize_Interval_of_Automatically_Check_for_Updates_.28since_NB6.1.29

Ref:
http://wiki.netbeans.org/FaqPluginManagerCustomization
https://blogs.oracle.com/rechtacek/entry/how_to_update_netbeans_platform


https://gist.github.com/alanhamlett/2a57ffb51f0850272d0d
http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-autoupdate-services/overview-summary.html


No comments:

Post a Comment