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 89573 - Share catalog utility by both UI and ant task.
Summary: Share catalog utility by both UI and ant task.
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Girish Balachandran
URL:
Keywords:
Depends on: 89572
Blocks: 89562 89565 89568 89570
  Show dependency tree
 
Reported: 2006-11-18 02:16 UTC by Nam Nguyen
Modified: 2007-02-06 18:59 UTC (History)
0 users

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 Nam Nguyen 2006-11-18 02:16:48 UTC
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
Comment 1 Nam Nguyen 2006-11-20 23:58:47 UTC
Implementation depends on capabilities and design from sub-feature 89572.
Comment 2 Nam Nguyen 2006-12-15 20:29:46 UTC
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.
Comment 3 Girish Balachandran 2006-12-16 00:22:38 UTC
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);

}
Comment 4 Nam Nguyen 2007-01-09 01:41:58 UTC
Implemented by Ajit and Girish in xml/retriever and xml/catalogsupport in
release551.
Code changes in xml/retriever has been merged to trunk.
Comment 5 Nam Nguyen 2007-02-06 18:59:48 UTC
v