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 126424 - regenerate on dependend schema changes and flexible schema location in project
Summary: regenerate on dependend schema changes and flexible schema location in project
Status: NEW
Alias: None
Product: webservices
Classification: Unclassified
Component: JAXB (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ gmpatil
URL: http://www.rekk.de/bloggy/?p=44
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-31 17:49 UTC by restjavator
Modified: 2008-04-14 17:10 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Sample web app with Schema including Schema (17.51 KB, application/x-compressed)
2008-01-31 20:29 UTC, _ gmpatil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description restjavator 2008-01-31 17:49:06 UTC
(See also the URL http://www.rekk.de/bloggy/?p=44 where it is described in detail)

Problem:Create an XML Schema which will be binded by JAXB to a class structure following certain constrains. You have 
certain degrees of freedom for your schema design and later you might also use schema annotations provided by JAXB. 
Modularize your XML schemas, simplest example is: A.xsd uses <include> to include declarations from schema B.xsd.

I want to try Netbeans’ excellent schema design features. Eventually I want to publish the schemas in a WAR deployed in a 
web container. That’s why I decided to put the files directly into the /web directory of the web-project.

Trying to use Netbeans’ JAXB Wizard  to create a JAXB Binding for A.xsd you will meet certain limitations: schema file 
changes won’t be visible to the “Regenerate” operation. You could edit the copy of A.xsd created by the JAXB Wizard in src/
conf/xml-resources/jaxb/name_of_the_binding to make changes visible to the task but that will not see changes in B.xsd. The 
reason is that the ant tasks created by the JAXB Wizard do not provide this kind of granularity.
Comment 1 _ gmpatil 2008-01-31 20:27:54 UTC
When "clean and build" target is used, one does not have to modify the 'xml_binding_build' to add additional "depends"
to make included Schema changes to be picked up by XJC. 

To illustrate this I have attached simple Web app which has a.xsd and b.xsd in 'web' folder. 
a.xsd includes b.xsd.
Note class UsePerson uses elements from both a.xsd and b.xsd.

Now modify original b.xsd using "Web pages/b.xsd", say Address1 to AddressOne.
Click on a.xsd under JAXB bindings, select "refresh" action.
Now do clean and build, you will compilation error for UsePerson at using Address1 "String ad1 = a.getAddress1();"


Comment 2 _ gmpatil 2008-01-31 20:29:27 UTC
Created attachment 55871 [details]
Sample web app with Schema including Schema
Comment 3 restjavator 2008-01-31 21:23:13 UTC
@gmpatil, thanks, I see , can confirm what you say.  Ok, that is acceptable. But I would want to have in one click or
action. It works know by just Clicking "Regenerate". Other propostions to make this work simpler in one click are welcome.
Comment 4 _ gmpatil 2008-02-04 20:21:53 UTC
I think JAXB Wiz recognizing binding for internal schema file and using it always instead of local copy will remove
unnecessary step of "refresh". 


Comment 5 Lukas Jungmann 2008-04-14 17:10:56 UTC
moving opened issues where TM != dev to TM=TBD