Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Is there an unrestricted API similar to IModelManager.getModelForRead(IFile)?
Is there an unrestricted API similar to IModelManager.getModelForRead(IFile)? [message #203480] Fri, 02 November 2007 07:02 Go to next message
Carlin Rogers is currently offline Carlin RogersFriend
Messages: 11
Registered: July 2009
Junior Member
Given an IFile for a JSP file, I'd like to know the best way to get an org.w3c.dom.Document.

I want the Document object so I can determine if a given taglib is present and then get the taglib namespace prefix and see if the Document contains certain tag.

Here are some more details...
I'm using the org.eclipse.wst.server.ui.moduleArtifactAdapters extension point to integrate with the "Run on Server" menu option. In my scenario, the object passed in to my ModuleArtifactAdapterDelegate implementation's getModuleArtifact() method will be a resource IFile.

I've saw some code in the newsgroup that uses the org.eclipse.wst.sse.core.internal.provisional.StructuredMode lManager to get the DOM model and then the get the DOM document. Something like this...

IStructuredModel model = StructuredModelManager.getModelManager().getModelForRead(fil e);
IDOMModel domModel = (IDOMModel)model;
Document doc = domModel.getDocument();

....but I noticed the following warning in my dev env:

"Discouraged access: The method getModelForRead(IFile) from the type IModelManager is not accessible due to restriction on required library ...org.eclipse.wst.sse.core_1.1.101.v200611210021.jar"

Should I go ahead and use this or is there a public API I can use for reading in the IFile to get the DOM document and check for certain JSP tags?

Thanks,
Carlin
Re: Is there an unrestricted API similar to IModelManager.getModelForRead(IFile)? [message #203534 is a reply to message #203480] Fri, 02 November 2007 18:58 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2872
Registered: July 2009
Senior Member

At the moment we don't have a public API for anyone to call that
does the same thing. You're not alone in having to endure those
warnings. We haven't had the time to design a good, clean,
replacement for any of that. That's the recommended mechanism for
now (as long as you're releasing the model!).

--
Nitin Dahyabhai
Structured Source Editing


Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Is there an unrestricted API similar to IModelManager.getModelForRead(IFile)? [message #203578 is a reply to message #203534] Fri, 02 November 2007 23:13 Go to previous messageGo to next message
Carlin Rogers is currently offline Carlin RogersFriend
Messages: 11
Registered: July 2009
Junior Member
OK, thanks for the help Nitin. Looking at some of the other posts I figured that might be the case. I appreciate the help.
Re: Is there an unrestricted API similar to IModelManager.getModelForRead(IFile)? [message #203586 is a reply to message #203534] Fri, 02 November 2007 23:22 Go to previous message
Carlin Rogers is currently offline Carlin RogersFriend
Messages: 11
Registered: July 2009
Junior Member
OK, thanks Nitin. Looking at some of the other posts to
this newsgroup I figured that might be the case. I appreciate
your help.

Kind regards,
Carlin
Previous Topic:Deploy WAR with WTP
Next Topic:new proj wizard
Goto Forum:
  


Current Time: Sun Jun 25 14:06:24 GMT 2017

Powered by FUDForum. Page generated in 0.03059 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software