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 244640 - import options from zip has missing choices
Summary: import options from zip has missing choices
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Import Settings (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-22 01:47 UTC by err
Modified: 2014-06-06 13:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
pic of import from zip selections (37.49 KB, image/png)
2014-05-22 01:48 UTC, err
Details
pic of import from directory selections (34.36 KB, image/png)
2014-05-22 01:49 UTC, err
Details
zip file of options the shows the problem (276.66 KB, application/zip)
2014-05-22 01:51 UTC, err
Details

Note You need to log in before you can comment on or make changes to this bug.
Description err 2014-05-22 01:47:00 UTC
Look at the two png files, notice they have different "Import Source". The
directory input source is simply an expansion of the zip file
    jar -xf nbSeekerOptions.zip
Note that the "Available Options" from the zip does not have the nodes
    Projects
    Team

I did not try expanding nodes in the two trees to see if there are further
discrepancies.

Product Version: NetBeans IDE 8.0 (Build 201403101706)
Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 1.1
Java: 1.7.0_55; Java HotSpot(TM) 64-Bit Server VM 24.55-b03
Runtime: Java(TM) SE Runtime Environment 1.7.0_55-b13
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 err 2014-05-22 01:48:15 UTC
Created attachment 147373 [details]
pic of import from zip selections
Comment 2 err 2014-05-22 01:49:16 UTC
Created attachment 147374 [details]
pic of import from directory selections
Comment 3 err 2014-05-22 01:51:15 UTC
Created attachment 147375 [details]
zip file of options the shows the problem

The zip file was generated by NB-7.4
Comment 4 Theofanis Oikonomou 2014-05-23 11:16:24 UTC
Changeset: 1e72b702febe
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2014-05-23 13:15
Message:
Comment 5 Theofanis Oikonomou 2014-05-23 11:26:28 UTC
Changeset: 7f4dec273565
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2014-05-23 13:25
Message:   - minor additional fix
Comment 6 Theofanis Oikonomou 2014-05-23 11:29:08 UTC
The issue was surfaced when you tried to import from directory. This was not handled properly. It should be fixed now.
Comment 7 err 2014-05-23 15:38:37 UTC
(In reply to Theofanis Oikonomou from comment #6)
> The issue was surfaced when you tried to import from directory. This was not
> handled properly. It should be fixed now.

I'm confused. Are you saying that the directory import was in error and not the zip? In particular, the zip did not have "Projects" and it was present from the directory.
Comment 8 Theofanis Oikonomou 2014-05-23 15:59:14 UTC
(In reply to err from comment #7)
> (In reply to Theofanis Oikonomou from comment #6)
> > The issue was surfaced when you tried to import from directory. This was not
> > handled properly. It should be fixed now.
> 
> I'm confused. Are you saying that the directory import was in error and not
> the zip? In particular, the zip did not have "Projects" and it was present
> from the directory.

both imports are working correctly, meaning they import the correct options into the current userdir. The issue was only in UI. When you tried to import from the dir the contents of the enabledItems.info file were ignored thus resulting in showing Projects and Team categories in the UI.
Comment 9 err 2014-05-23 16:16:28 UTC
(In reply to Theofanis Oikonomou from comment #8)
> > 
> > I'm confused. Are you saying that the directory import was in error and not
> > the zip? In particular, the zip did not have "Projects" and it was present
> > from the directory.
> 
> both imports are working correctly, meaning they import the correct options
> into the current userdir. The issue was only in UI. When you tried to import
> from the dir the contents of the enabledItems.info file were ignored thus
> resulting in showing Projects and Team categories in the UI.

I'm talking about the Menu>Options>Import dialog, if that's not clear.
I have no idea what the enabledItems.info file is. Is that something
I need to be aware of?

My aim was to import the project groups I had setup on a different
machine. (The relavant directory structures were the same.) When I
opened the zip file, it did not show Projects/groups, so I could not
accomplish my task.

When I unziped the file into a directory, then the Projects/groups
settings showed up and I was able to import them.
Comment 10 Quality Engineering 2014-05-24 05:04:06 UTC
Integrated into 'main-silver', will be available in build *201405240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/1e72b702febe
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #244640 - import options from zip has missing choices
Comment 11 err 2014-05-25 15:31:36 UTC
With the change it is impossible to import projects/groups since now neither
the zip nor the directory structure displays it.

Looking into org-netbeans-modules-projectui.jar (got there from
thisLayerInContext/OptionsExport/Projects/Groups) there is


    <folder name="OptionsExport">
        <!-- category -->
        <folder name="Projects">
            ...
            <file name="Groups">
                <attr name="position" intvalue="200"/>
                <attr name="include"
                  stringvalue="config/Preferences/org/netbeans/modules/projectui/groups/.*|config/Preferences/org/netbeans/modules/projectui/groups.properties"/>
                <attr name="displayName"
                  bundlevalue="org.netbeans.modules.project.ui.Bundle#Export_Groups_Display_Name"/>
            </file>
        </folder>
    </folder>    

Expect these options to be available on import.

Product Version: NetBeans IDE Dev (Build 201405250001)
Java: 1.7.0_55; Java HotSpot(TM) 64-Bit Server VM 24.55-b03
Runtime: Java(TM) SE Runtime Environment 1.7.0_55-b13
Comment 12 Theofanis Oikonomou 2014-05-30 10:35:08 UTC
Well there is definitely something going on with what you are describing. I am basing that on the difference of what I see in the enabledItems.info file and the contents of the zip file you attached.

enabledItems.info shows what categories you had actually selected when you exported the options from 7.4 in the first place, see bug 227906 for more info on that. Since there is no "ProjectsProject Groups" entry there I must assume that you did not select the respective category while exporting the options.

On the other hand in the zip file the options regarding project groups are included. So I am not sure what or how this happened. 

Before the fix I was only examining enabledItems.info only when importing from zip file and not directories. This is why you were seeing different categories to import in those two cases.

Please reopen describing what exactly happened or steps to reproduce your scenario because it works for me. Thank you
Comment 13 err 2014-05-30 16:29:38 UTC
Did you try exporting Options from 7.4?

I just went back to the system with 7.4 installed. When I do
    Menu>Tools>Options>Export
the dialog does *NOT* have the projects subtree, so I guess it is not
a surprise that when I
    check the "All" (root of the tree)
    OK (save the file)
that there is not the two projectui categories in enabledItems.info.

So this may be a bug in 7.4 that produces a bad export zip file.

After the change you made, if I go into the unzipped directory and
delete the enabledItems.info file, then import from that directory,
then I see the projectui categories. So there is a still a workaround
to import the specific items that aren't mentioned in enabledItem.info.

I didn't read bug 227906 carefully enough to fully get what's going on.
But, since "General:All other unspecified" is in enabledItems.info
it could be argued that anything/everything under config/Preferences
should be included for consideration.

It's messy, maybe a WONTFIX.
Comment 14 Theofanis Oikonomou 2014-06-06 13:34:29 UTC
Changeset: 87ef84c8d82c
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2014-06-06 15:33
Message:
Comment 15 Theofanis Oikonomou 2014-06-06 13:38:36 UTC
(In reply to err from comment #13)
> Did you try exporting Options from 7.4?
> 
> I just went back to the system with 7.4 installed. When I do
>     Menu>Tools>Options>Export
> the dialog does *NOT* have the projects subtree, so I guess it is not
> a surprise that when I
>     check the "All" (root of the tree)
>     OK (save the file)
> that there is not the two projectui categories in enabledItems.info.

this is true. 

> 
> So this may be a bug in 7.4 that produces a bad export zip file.
> 
> After the change you made, if I go into the unzipped directory and
> delete the enabledItems.info file, then import from that directory,
> then I see the projectui categories. So there is a still a workaround
> to import the specific items that aren't mentioned in enabledItem.info.
> 
> I didn't read bug 227906 carefully enough to fully get what's going on.
> But, since "General:All other unspecified" is in enabledItems.info
> it could be argued that anything/everything under config/Preferences
> should be included for consideration.
> 
> It's messy, maybe a WONTFIX.

there would be the same issue with everyone trying to import into 8.0 or later options exported from 7.4 or some dev build before the "Projects" category was introduced. I think that now it is fixed. For me when I try to import from your zip or from the extracted contents of the zip file I get the same categories including Projects.