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.
We need the TagLibSupport as an API. It would be much easier to reuse the web/core syntax impl that way. We would only attach that cookie to our kind of data object (representing jsp). Then to reimplement entire JspContextInfo, and replacing the oringal functionality when reusing the NB project.
Please, respond to this, and in case it is late for 5.0, please provide a way, how it is possible to use via friend API, the reusability of TagLibParseSupport is very important for us.
This is a minimalistic suggestion of the API we need: It consist from interface which defines the cookie, and factory which returns the instance of that cookie. It could be in e.g. org.netbeans.modules.api.web.core package. Please consider it, and feel free to adjust it (change the names, etc. just to keept the availability of the method and definition of the cookie class). /** * Defines cookie which supports parsing of jsp file. * Note: Do not implement this cookie, use the factory only. * (The same contract like for window system API interfaces, you as * provider can later add methods to it, the client is not implementor). */ public interface TagLibParseCookie extends org.openide.nodes.Node.Cookie { public JspParserAPI.JspOpenInfo getCachedOpenInfo(boolean preferCurrent, boolean useEditor); } /** * Factory which creates instances of TagLibParseCookie's. */ public class TagLibParseFactory { /** Creates tag lib parse cookie, (may throw an exception or return null if the file is not jsp?). */ public static TagLibParseCookie createTagLibParseCookie(FileObject fObj) { return new TagLibParseSupport(fObj); } } Then the current TagLibParseSupport would just implement the TagLibParseCookie (instead of just Node.Cookie).
Petre, what do you think?
The suggested changes looks very simple and reasonably. You wrote that you use your own data object for the jsp files. How do you recognize these files? My question is related to the Creator pack for NetBeans. I'm asking because our data object and yours can be in clash.
There is no clash. Our data objects are recognized for jsp+java pair if they are in our project type only. (For those we provide the designer+jsp+java multiview). All other fall back to the default NB dataobjects. I.e. if you have NB project type you get only NB data objects.
If this will be solved as the friend API, I'd like to ask for adding this friend module: com.sun.rave.project.jsfloader
I committed the new API. It's almost as Peter suggested I only changed the implementation, where the TagLibParseSupport is not created against but already existing instance for the file object is used. I cannot put the module com.sun.rave.project.jsfloader as friend, because I need to go through the fast track review (due to the cross cluster dependency) and it's takes at least 8 days.
I would like to go with this through the fast track review, because we need to add as friend module com.sun.rave.project.jsfloader and this will cross-cluster dependency. The main reason of this api, is that the encoding of the jsp file can be defined outside the file in the deployment descriptor (web.xml) file. So an editor opens a jsp file it needs to know the encoding. In NetBeans we have small parser, which solve this issue. Accessing information from this parser is this API. There is known only one client of this friend api and it is com.sun.rave.project.jsfloader.
I'm going to commit tomorrow the friend modules.
The appropriate changes are committed in the cvs.