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 124208 - Provide an API to make schema import for BPEL and WSDL
Summary: Provide an API to make schema import for BPEL and WSDL
Status: REOPENED
Alias: None
Product: xml
Classification: Unclassified
Component: Catalog (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@xml
URL:
Keywords:
: 124210 168581 168582 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-12-18 17:31 UTC by Sergey Lunegov
Modified: 2009-08-11 12:14 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Lunegov 2007-12-18 17:31:06 UTC
In WSDL and BPEL visual editors there is an option to import XML schema. Use can go to Navigator panel, make right click
on root element and choose "Add->Schema import...". In opened window there is no option to select schemas stored in NB
Global catalog. We need an API from XML to implement this option. Vitaly please provide the example of such API.
Comment 1 Samaresh Panda 2008-02-20 06:33:32 UTC
*** Issue 124210 has been marked as a duplicate of this issue. ***
Comment 2 Samaresh Panda 2008-05-21 17:31:17 UTC
You do not need a new API for this. You could query the UserCatalog and get all the schemas. Here is a code snippet to
do that:

        UserCatalog catalog = UserCatalog.getDefault();
        if (catalog == null) {
            return;
        Set idSet = new TreeSet();
        for (Iterator it = catalog.getPublicIDs(); it.hasNext(); ) {
             String next = (String) it.next();
             // get only schemas
             String nextLowerCase = next.toLowerCase();
             if (nextLowerCase.startsWith("schema:") || nextLowerCase.endsWith(".xsd")) { // NOI18N
                idSet.add(next);
             }
        }
        return (String[]) idSet.toArray(new String[idSet.size()]);

Let me know if this doesn't work.
Comment 3 Samaresh Panda 2008-05-28 16:45:25 UTC
Based on discussions with Vitaly, he wants to filter out schemas of a particular category. I'll try to find if there is
a way to filter them out.
Comment 4 Sergey Lunegov 2008-11-21 14:14:20 UTC
Sam, we'd like this one to be implemented in 7.0.
Comment 5 Nikita Krjukov 2009-03-26 18:54:17 UTC
The implementation of the issue will affect many different editors: Schema, WSDL, BPEL, XSLT, ... 
There is a reason for considering such enhancement dangerous for a while. The matter is it simplifies creation of new
imports and relaxes a user. But creation of a new import almost always implies that the imported resource will be a part
of the JAR, which will be deployed to a server. In case of resources from the Global Catalog, it isn't true. 
Current implementation doesn't guarantee that resources form Global Catalog will be added to JAR. 

So we decided to put off the feature while we don't have reliable way to prevent resources' losing. 
The user need add required imports and corresponding resources manually for a while. 
Comment 6 Vitaly Bychkov 2009-07-15 06:14:00 UTC
*** Issue 168582 has been marked as a duplicate of this issue. ***
Comment 7 Vitaly Bychkov 2009-07-15 06:14:15 UTC
*** Issue 168581 has been marked as a duplicate of this issue. ***
Comment 8 Sergey Lunegov 2009-07-30 13:21:09 UTC
Vladimir, I've reassigned it to you since this can be considered as part of catalog/ref resources  alignment.
Comment 9 Vladimir Yaroslavskiy 2009-08-11 11:53:04 UTC
I agree with Nikita that it is not guaranteed  that resources from the Global Catalog will be added to JAR while
deployment. From UI side, schemas (and types) are needed for variables and schemas from Global catalog are available in
the type chooser. From development side, see comment from samaresh Wed May 21 16:31:17 +0000 2008 where he suggested
program way to collect schemas from Global catalog.
Comment 10 Vladimir Yaroslavskiy 2009-08-11 11:53:45 UTC
Closing as won't fix.
Comment 11 Vitaly Bychkov 2009-08-11 12:14:01 UTC
From development side the suggested by Samaresh approach is not appropriate since there is no API way to get schemas
just from interested catalog e.g. from BPEL Global Catalog or Web Services global catalog.

By having a Global Catalog schemas in variable/type choosers we still have a problem whether the global catalog resource
should be included into jar? 
One of the possibilities to solve this problem is using metadatas associated with schemas and runtime.

To be in consistence variable/type choosers the import chooser should have as minimum the same set of resources to
import as variable/type choosers have.