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 26243 - Read mounted catalogs from layers
Summary: Read mounted catalogs from layers
Status: CLOSED DUPLICATE of bug 22848
Alias: None
Product: xml
Classification: Unclassified
Component: Catalog (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: _ pkuzel
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2002-08-02 21:10 UTC by Jesse Glick
Modified: 2007-09-25 01:30 UTC (History)
3 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 Jesse Glick 2002-08-02 21:10:40 UTC
Using Lookup, for example

Lookup.getDefault().lookup(new
L.T(CatalogReader.class))

where catalogs are conventionally placed in a
designated folder

Services/XMLCatalogs/

or similar, where each file there is an instance
of CatalogReader. CatalogProvider could be
deleted, as new kinds of catalogs could simply be
placed in

Templates/Services/XMLCatalogs/

CatalogRootNode would become a
DataFolder.FolderNode with a different icon etc.
(see various such folder nodes in core for code
examples). Its new type could be replaced with a
TemplateWizard.Cookie pointing to the catalog
template area, and CatalogMounterModel etc. etc.
could be replaced with standard
TemplateWizard.Iterator implementations.
CatalogSettings could be deleted, as the folder
would handle its own storage using .settings files
etc. Listening for changes in catalogs etc. would
be replaced with a standard LookupListener idiom.

Besides possibly simplifying the xml/catalog
module and making its structure more standard, it
would improve the ability of other modules to add
catalogs; for example API Support would probably
add an instance of the NetBeans Catalog by
default, since NB developers would normally want
it mounted. This would be trivial to implement:

<folder name="Services">
    <folder name="XMLCatalogs">
        <file
name="org-netbeans-modules-apisupport-nbcat.instance">
            <attr name="instanceOf"
stringvalue="org.netbeans.modules.xml.catalog.spi.CatalogReader"/>
            <attr name="instanceClass"
stringvalue="org.netbeans.modules.xml.catalog.impl.SystemCatalogReader"/>
            <!-- also localized name & icon for
display -->
        </file>
    </folder>
</folder>

Similarly, the web/advanced module would no longer
need this ugly trick in its ModuleInstall:

public void restored() {
    // ...
   
CatalogSettings.getDefault().addCatalog(getDDCatalog());
}

which is contrary to the spirit of layers, for
example because it will cause a change to
CatalogSettings in every project without the
possibility of override.

If CatalogReader is ever added to the official
xml/api API set, it would be much less
controversial if it were kept small (just one
interface) and did not have the extra API/SPI
weight of CatalogProvider, CatalogSettings, etc.
Comment 1 _ rkubacki 2002-08-05 09:45:53 UTC
seems to be dup of 22848
Comment 2 Jesse Glick 2002-08-12 16:12:02 UTC

*** This issue has been marked as a duplicate of 22848 ***
Comment 3 dmladek 2004-08-19 09:58:20 UTC
probably dup