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 54042 - Need a way to turn on the mode of install the NBMs globally by default
Summary: Need a way to turn on the mode of install the NBMs globally by default
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Autoupdate (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
: 27913 (view as bug list)
Depends on: 57987
Blocks:
  Show dependency tree
 
Reported: 2005-01-26 21:28 UTC by Ch Nguyen
Modified: 2005-03-25 00:37 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
a possible patch (18.33 KB, patch)
2005-02-23 19:19 UTC, Jiri Rechtacek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ch Nguyen 2005-01-26 21:28:36 UTC
We need a way:
. to set the default is to install the modules
globally (or into the install directory)
automatically instead of the user directory
. to warn the user when the default selected mode
is changed from globally to user directory and
vice versa.
... without  modify the NB autoupdate module code.

Previously we directly modified the NB autoupdate
code (in particular SignVerifier.java &
ResultPanel.java) to provide this feature.  I will
attach a diff with NB 4.0.
Comment 1 Ch Nguyen 2005-01-26 21:39:08 UTC
Here is the diff of what was changed in NB autoupdate code to provide
the required behavior:
1. autoupdate/src/org/netbeans/modules/autoupdate/SignVerifier.java
@@ -144,6 +144,11 @@
                 return;
 
             ModuleUpdate mu = (ModuleUpdate)it.next();
+            
+//  comment="default to be in the installation dir"
+// This looks very suspicious!
+            mu.setToInstallDir( true ) ;
+// 
 
2. autoupdate/src/org/netbeans/modules/autoupdate/ResultsPanel.java	
-312,16 +312,37 @@
             return;
         }
         
-        if (Downloader.bannedWriteToInstall (mu)) {
-            NotifyDescriptor.Message nd = 
-                    new NotifyDescriptor.Message( getBundle(
"MSG_InstallNoWrite" ) );
-            DialogDisplayer.getDefault().notify( nd );
-            return;
-        }
+//       /* if (Downloader.bannedWriteToInstall (mu)) {
+//            NotifyDescriptor.Message nd = 
+//                    new NotifyDescriptor.Message( getBundle(
"MSG_InstallNoWrite" ) );
+//            DialogDisplayer.getDefault().notify( nd );
+//            return;
+//        } */
         if ( mu.isToInstallDir() )
-            mu.setToInstallDir( false );
+//  give warning on attempt to install to install dir.
+//            mu.setToInstallDir( false );
+// ====
+        {
+            NotifyDescriptor.Message nd =
+                    new NotifyDescriptor.Message( getBundle(
"MSG_InstallInUserdir" ) );
+            DialogDisplayer.getDefault().notify( nd );
+        }
+//
         else {
+// 
+//
+            if ( Downloader.bannedWriteToInstall(mu) ) {
+                NotifyDescriptor.Message nd =
+                        new NotifyDescriptor.Message( getBundle(
"MSG_InstallNoWrite" ) );
+                DialogDisplayer.getDefault().notify( nd );
+                return;
+            }
+//
Comment 2 Ch Nguyen 2005-01-26 22:41:59 UTC
Peter, why did you lower this to P3?  I think that this is a must-have
feature for us.
Comment 3 Jiri Rechtacek 2005-01-27 14:53:13 UTC
Doesn't help a new parameter in NBM/info.xml? E.g. boolean isGlobal,
false as default. If it's true then the global mode will check on on
this update.
Comment 4 Ch Nguyen 2005-01-27 19:56:20 UTC
I think it would work if we can specify "isGlobal" in the NBM's
info.xml.  Can you give us more details on how we can set this up in
the nbm build target?  Thanks.
Comment 5 Jiri Rechtacek 2005-02-08 09:27:59 UTC
Needs to new version the schema of NBM's info.xml
(i.e.autoupdate-catalog-2_2.dtd -> autoupdate-catalog-2_3), modify
antsrc/MakeNBM task and reflect this change in AutoUpdate module. The
attribute isGlobal will be not mandatory and false is default.
Comment 6 Jiri Rechtacek 2005-02-08 09:28:41 UTC
*** Issue 27913 has been marked as a duplicate of this issue. ***
Comment 7 Jiri Rechtacek 2005-02-08 09:29:21 UTC
Hint for me: issue 12705.
Comment 8 Jiri Rechtacek 2005-02-23 19:19:31 UTC
Created attachment 20488 [details]
a possible patch
Comment 9 Jiri Rechtacek 2005-02-23 19:31:37 UTC
The patch makes possible to mark a NBM as global, will be installed to
global install dir. This attribute is read from Info.xml from NBM
header. Property is not mandatory and the default value is false.
If the ant property "nbm.is.global" is set to true then the NBM will
generated with this attribute set to true.
Must be tested before integration.

The property "nbm.is.global" should be in
<module_dir>/nbproject/project.properties (for specific module) or in
<nb_all>/nbbuild/templates/projectized.xml (global for all NBMs).

Comment 10 Jiri Rechtacek 2005-03-15 14:03:51 UTC
Implemented.

RCS file: /cvs/www/www/dtds/autoupdate-catalog-2_3.dtd,v
done
Checking in www/www/dtds/autoupdate-catalog-2_3.dtd;
/cvs/www/www/dtds/autoupdate-catalog-2_3.dtd,v  <--  autoupdate-catalog-2_3.dtd
initial revision: 1.1
done
RCS file: /cvs/www/www/dtds/autoupdate-info-2_3.dtd,v
done
Checking in www/www/dtds/autoupdate-info-2_3.dtd;
/cvs/www/www/dtds/autoupdate-info-2_3.dtd,v  <--  autoupdate-info-2_3.dtd
initial revision: 1.1
done
Checking in www/www/dtds/catalog;
/cvs/www/www/dtds/catalog,v  <--  catalog
new revision: 1.37; previous revision: 1.36
done
Checking in nbbuild/antsrc/org/netbeans/nbbuild/MakeListOfNBM.java;
/cvs/nbbuild/antsrc/org/netbeans/nbbuild/MakeListOfNBM.java,v  <-- 
MakeListOfNBM.java
new revision: 1.31; previous revision: 1.30
done
Checking in nbbuild/antsrc/org/netbeans/nbbuild/MakeNBM.java;
/cvs/nbbuild/antsrc/org/netbeans/nbbuild/MakeNBM.java,v  <--  MakeNBM.java
new revision: 1.61; previous revision: 1.60
done
Checking in nbbuild/antsrc/org/netbeans/nbbuild/MakeUpdateDesc.java;
/cvs/nbbuild/antsrc/org/netbeans/nbbuild/MakeUpdateDesc.java,v  <-- 
MakeUpdateDesc.java
new revision: 1.24; previous revision: 1.23
done
Checking in nbbuild/antsrc/org/netbeans/nbbuild/ModuleTracking.java;
/cvs/nbbuild/antsrc/org/netbeans/nbbuild/ModuleTracking.java,v  <-- 
ModuleTracking.java
new revision: 1.5; previous revision: 1.4
done
Checking in
autoupdate/libsrc/org/netbeans/updater/resources/autoupdate-catalog-2_3.dtd;
/cvs/autoupdate/libsrc/org/netbeans/updater/resources/autoupdate-catalog-2_3.dtd,v
 <--  autoupdate-catalog-2_3.dtd
new revision: 1.2; previous revision: 1.1
done
Checking in
autoupdate/libsrc/org/netbeans/updater/resources/autoupdate-info-2_3.dtd;
/cvs/autoupdate/libsrc/org/netbeans/updater/resources/autoupdate-info-2_3.dtd,v
 <--  autoupdate-info-2_3.dtd
new revision: 1.2; previous revision: 1.1
done
Checking in autoupdate/src/org/netbeans/modules/autoupdate/Bundle.properties;
/cvs/autoupdate/src/org/netbeans/modules/autoupdate/Bundle.properties,v  <-- 
Bundle.properties
new revision: 1.150; previous revision: 1.149
done
Checking in autoupdate/src/org/netbeans/modules/autoupdate/Downloader.java;
/cvs/autoupdate/src/org/netbeans/modules/autoupdate/Downloader.java,v  <-- 
Downloader.java
new revision: 1.40; previous revision: 1.39
done
Checking in autoupdate/src/org/netbeans/modules/autoupdate/ModuleUpdate.java;
/cvs/autoupdate/src/org/netbeans/modules/autoupdate/ModuleUpdate.java,v  <-- 
ModuleUpdate.java
new revision: 1.58; previous revision: 1.57
done
Checking in autoupdate/src/org/netbeans/modules/autoupdate/ResultsPanel.java;
/cvs/autoupdate/src/org/netbeans/modules/autoupdate/ResultsPanel.java,v  <-- 
ResultsPanel.java
new revision: 1.56; previous revision: 1.55
done
Checking in autoupdate/src/org/netbeans/modules/autoupdate/Wizard.java;
/cvs/autoupdate/src/org/netbeans/modules/autoupdate/Wizard.java,v  <--  Wizard.java
new revision: 1.73; previous revision: 1.72
done
Checking in autoupdate/src/org/netbeans/modules/autoupdate/XMLAutoupdateType.java;
/cvs/autoupdate/src/org/netbeans/modules/autoupdate/XMLAutoupdateType.java,v 
<--  XMLAutoupdateType.java
new revision: 1.30; previous revision: 1.29
done
Comment 11 Jiri Rechtacek 2005-03-15 14:35:18 UTC
Functionally specification:
New 'global' attribute in Autoupdate Catalog/Info schema file, not mandatory and
won't be filled in in most cases.

How it works?
A. Attribute 'global' is no there.
     - everything works as before, no change
B. Attribute 'global' is true
     - the NBM, which has 'global' attr set 'true'  in own info.xml, is offered
as Global in Autoupdate wizard and there is no way to change it to local.
      - an user is notified by InfoMessage box that isn't allowed when s/he
trying it.

C. Attribute 'global' is false
     - it is paired with above
     - the NBM, which has 'global' set 'false', isn't offered as Global in
Autoupdate wizard (Global option is not checked) and there is no way to change
it to global.
      - an user is notified by InfoMessage box that isn't allowed when s/he
trying it.

How to fill up this attribute?
There are several options:
A. Invoke the ant's 'nbm' target with -Dnbm.is.global=true or false
      - it's effective for only once NBM generating
B. In netbeans project's you can declare the property 'nbm.is.global' in
<module_root>/nbproject/project.properties
      - it's effective for all generating NBM for this module
A. Declare 'nbm.is.global' in <nb_all>/nbbuild/templates/projectized.xml
      - it's effective for all NBMs generating for all module
      - Not recommended!
Comment 12 Ch Nguyen 2005-03-25 00:37:11 UTC
Can you send me the new autoupdate module .jar so that I can test this out?