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 98643 - Created schema is unavailable from the project tree
Summary: Created schema is unavailable from the project tree
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
: 107168 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-22 13:58 UTC by Mikhail Matveev
Modified: 2007-09-25 01:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Matveev 2007-03-22 13:58:29 UTC
1. Create new application.
2. Right-click application name in Project Window, New File/Folder->XML->Sample
Schemas->Loan Application->Next->Finish.
Result: schema editor opens for the schema, but that schema isn't presented in
project tree. After closing schema editor window, I see no way to access it.
Comment 1 Samaresh Panda 2007-03-28 00:47:09 UTC
This is because you did not specify the target folder and hence the file got
created under the project root. By default, for a Java App, the target folder is
src, but for samples, for some reason, the target folder is empty by default and
you have to pick a target folder.

Assigning to editor. Pre-populate the target folder for samples to src.

We're allowing creation of samples thru layer.xml and we have some templates. Is
there a way to specify target folder in layer file. If not, please pre-populate
target folder to src.
Comment 2 Marian Mirilovic 2007-03-28 11:08:54 UTC
Don't know why was this issue moved to core ...

Jirka, New From Template panels are under responsibilities of module owners -
those provide them, aren't they ?
Comment 3 Jiri Rechtacek 2007-03-29 17:10:10 UTC
Marian, I'm sorry but I don't see a reason why it should be on openide/wizards.
Reassigned back to xml/schema tools for justification why it's Wizard API
problem, maybe try consider projects/ui or editor. Thanks
Comment 4 Vitezslav Stejskal 2007-03-30 02:42:15 UTC
Hi, reporter, I am sorry for a stupid question, but did you install any
additional modules to your 6.0 build? If so, which ones? I can't see XML ->
Sample Schemas in my wizard (using an ordinary 6.0 daily build). Do I need to
install something from an autoupdate center? Once we find the module that
installs this template we will be able to assign the issue to the right people.
Thank you.

Also, downgrading to P3, it's not a crash and there is a simple workaround, just
select a target folder. Plus I'm sure that you will find the file under the
project's folder in the 'Files' view. If you accidentally create new files in
places that are not visible in 'Projects' view you can always use 'Files' view
to find the file and move it to an appropriate place.
Comment 5 Mikhail Matveev 2007-03-30 14:28:53 UTC
I have Enterprise Pack (Hula) installed. It contains few XML sample schemas. The
issue was filed against XML/schema tools first.

You're right that the file can be found in the 'Files' view. OK, let it be P3.
But note that new XML schema (New File/Folder->XML->XML Schema->Next->Finish) is
placed correctly, but XML sample schema is placed another way. In my opinion,
it's very confusing.
Comment 6 Vitezslav Stejskal 2007-04-02 01:19:41 UTC
The 'Loan Application' example is added by xml/schema/schemaui module from
xml/schema/schemaui/src/org/netbeans/modules/xml/schema/ui/basic/layer.xml and I
guess its wizard will need to be fixed. IMO the issue was initially assigned to
the correct module, which makes this whole discussion look a bit silly. Anyway,
xml folks please fix your wizard.
Comment 7 Mikhail Matveev 2007-06-19 18:51:26 UTC
*** Issue 107168 has been marked as a duplicate of this issue. ***
Comment 8 Michael Nazarov 2007-06-20 12:04:44 UTC
I raised priority due to reasons noted in later filed duplicate issue. Repeat here because this is useful I hope:
if XML schema is not visible in projects tree then it's impossible to add reference to this schema file from referenced
project. This looks like stopper for some our tests but I have kind of workaround so P2.

BTW this is bit specific for WebApplication and few other projects while some projects doesn't affected. For, say, BPEL
module I don't need to point to "Process files" node exactly, adding file using Root node works fine and file goes to
"Process files" automatically.
Comment 9 tonybeckham 2007-06-26 17:45:08 UTC
These steps create a new file of whatever type at the top level of the project, unless you specify a target folder. 
This is the case for all new file creation.  I don't think this is a defect but more of an enhancement and definitely
not a P2.  I'm going to change the priority to P3 for now and also change the issue type to enhancement.   
Comment 10 Michael Nazarov 2007-06-27 10:35:57 UTC
I can't agree.
Again - not all project types affected and this is NOT "the case for all new file creation". BPEL module doesn't
affected and file goes to special folder automatically.
And one more "again" - it's impossible to reference files created at root from other projects. So it should be P2 and
DEFECT.
Comment 11 Samaresh Panda 2007-07-17 20:45:08 UTC
IMO the base panel that allows creation of new files should have a validation check (similar to the one "the file ...
already exists") in the case when the target folder is empty. For such a small thing now I'll have to write my own iterator.
Comment 12 Samaresh Panda 2007-07-17 20:54:36 UTC
Fix integrated. The default folder will be src in most of the cases.
/cvs/xml/schema/src/org/netbeans/modules/xml/schema/wizard/SampleSchemaIterator.java,v  <--  SampleSchemaIterator.java
initial revision: 1.1
/cvs/xml/schema/src/org/netbeans/modules/xml/schema/resources/mf-layer.xml,v  <--  mf-layer.xml
new revision: 1.16; previous revision: 1.15

Perhaps you should file a bug on standard "New File Wizard" where it allows to create documents on empty target folder.
Atleast there could be a warning.
Comment 13 Michael Nazarov 2007-07-25 15:10:40 UTC
Product Version: NetBeans IDE Dev (Build 200707250000)

This issue became really SHOWSTOPPER for our tests!
Due to some code changes (or regardless of them) newly created schemes are unavailable in project tree even correct node
(such as Process Files node) selected as target. So it's completely impossible to add xml to project and import from
other project.

I'm not sure this is same issue and can file new one if you think it's better.
Comment 14 Samaresh Panda 2007-07-25 17:34:28 UTC
I do see that no matter what, the target folder is 'src' even if you want to create the schemas in a specific folder,
and that is a bug. If this is what you're talking about, I'm going to integrate the fix for that. If not, we're working
on a stupid problem in the first place.

Fix:
/cvs/xml/schema/src/org/netbeans/modules/xml/schema/wizard/SampleSchemaIterator.java
new revision: 1.2; previous revision: 1.1
Comment 15 Michael Nazarov 2007-07-25 17:47:48 UTC
I don't care about "src"... Let me describe my actions and results.

In previous releases I was able to create BPEL module, then right-click on project node or "Process Files" node and add
new sample XML schema. This schema appears under "Process Files" node and was accessible for referencing.

In last releases if I try to right-click (on any node) and add new Sample schema this schema doesn't appear in project
view and unavailable for referencing.

I don't know is it result of fixing or result of some other changes but again:

this is newly founded showstopper for our testing.

If you think this is other issue just say so and I'll file new one. But currently I can't see any fixes I just see more
buggy behavior then earlier.
Comment 16 Samaresh Panda 2007-07-25 18:06:09 UTC
Ok, I do not see that problem. If I create a BPEL project, right click on the project and create sample schema, it gets
created in "Process Files" node. This is even without today's fix.

Mikhail, Tony, can you guys verify the behavior?
Comment 17 tonybeckham 2007-07-25 18:20:38 UTC
The fix Sam had said in a Jul 17 posting I can confirm.  It seams with later comments that this is specific to BPEL
projects, so I will now take a look at that specific case.  Michael Nazarov, If you can provide specific steps about
what type of project etc. we can nail this problem down.
Comment 18 tonybeckham 2007-07-25 19:28:39 UTC
What I find is that with a BPEL module, the behavior of adding schema is not the same as adding to another type of
project like a web or java project.  For BPEL projects, all files for the process should be created under process files,
whereas for Java or web projects the schemas are now (correctly and conveniently and what I think this bag was
originally about) are created in a source package. 

As of now (NetBeans IDE Dev (Build 200707250000)) Adding either of the sample loan schemas does not add them to the BPEL
process files folder but to the top level of the BPEL process.  For any other type of file, the new file gets added to
the BPEL process folder level.

As mentioned by michaelnazarov I think this is a separate issue that should be created.  I advise to close this bug and
open a new one, detailing steps to reproduce and the exact issue (sample schemas are not created in the correct project
location in a BPEL module)
Comment 19 Michael Nazarov 2007-07-26 12:40:43 UTC
I'll file additional issue as soon as I'll be able to check with latest build. Currently this functionality completely
brocken, it's impossible to even add reference to other project, see 111095.
Comment 20 Mikhail Matveev 2007-09-03 15:04:59 UTC
Verified. 
Michael, if you filed another issue as you were going to do, please leave its number here.
Comment 21 Michael Nazarov 2007-09-03 15:16:02 UTC
I checked with latest available instrumented build.
Works fine -- I was able to add XML into WebApplication and import reference to schema from other project.

One note: XML with reference in source code view highligted not as XML but something else. I'll file issue.
Comment 22 Michael Nazarov 2007-09-03 15:16:21 UTC
I checked with latest available instrumented build.
Works fine -- I was able to add XML into WebApplication and import reference to schema from other project.

One note: XML with reference in source code view highligted not as XML but something else. I'll file issue.