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.
Implement "NonIDECatalogUtil" to be shared by UI and ant task. The best location is /xml/serviceapi/src/org/netbeans/xml/serviceapi/spi. The util is used for referential closure, calculate relative URI value, detect conflict in reference in a reference request (same file already get mapped to from a diffrent uri key),... ------------- References: ------------- http://xdesign-tools.czech.sun.com:8080/JSPWiki/Wiki.jsp?page=XProject_XMLRef_Func_Spec http://xdesign-tools.czech.sun.com:8080/JSPWiki/Wiki.jsp?page=XmlFileRefsOnepager
Implementation depends on capabilities and design from sub-feature 89572.
I think to support UI with writing and model to resolve catalog references, we need to define an SPI in resolver like XMLCatalogSupport { // add entry in the catalog for the reference and return the reference value URI setReference(FileObject referencing, FileObject referenced); // return the referenced file FileObject getReference(URI reference); } There would be an implementation in xml/catalogsupport. The implementation will be assured to have AntProjectHelper to access the project properties. Supported project type (BPEL, XSLT...) needs to have an instance of the implemenation in its lookup.
After having discussion with Chris, we decided for the following API: Add a new abstract public abstract class org.netbeans.modules.xml.retriever.catalog.ProjectCatalogSupport { /*this method will be called by the CatalogWriteModel if the FileObject passed in the addURI(URI LEFT, FileObject rightFO); does not belong to same project as of the catalog. The impl of this class must return a URI similar to the following: sample URI = nb-uri:project.<project_identifier_name>/src/a/b/c/xyz.xsd */ public abstract URI constructProjectProtocol(FileObject fo2beAddedInCat); /*This method called when the CatalogModel looks in to the catalog and gets back a URI that is not a standard URI. If the parameter URI is understood by the impl of this class, return true, else false. This method is for extension purpose of any kind of URI a project wants to add to the catalog file in the future.*/ public abstract boolean isProjectProtocol(URI); /* This method will be called after isProjectProtocol(URI) returns true. The impl has to interpret the URI parameter (that slooks similar to sample URI mentioned above) and get the equivalent FO associated with that URI. A null should be returned in case if the file is not found on disk (and hence can not create corresponding file object */ public abstract FileObject resolveProjectProtocol(URI uriToBeResolved); }
Implemented by Ajit and Girish in xml/retriever and xml/catalogsupport in release551. Code changes in xml/retriever has been merged to trunk.
v