[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools] Re: new proj wizard

I am having trouble setting the install dir of my server runtime. I use setLocation() on the server runtime working copy but the result in the debugger shows this on the RuntimeWorkingCopy instance map member (which I can't access directly because it is discouraged):

{generic_server_instance_properties={serverRootDirectory=/your_server_root/appservers/jboss-4.0.3}, id-set=true, location=D:/PROGRA~1/NORTEL~1/SCE/Jboss/jboss-4.0.2, name=JBoss v4.0, id=org.eclipse.jst.server.generic.runtime.jboss4}

It is not obvious how I set the serverRootDirectory.  Any ideas?



jkenny wrote:

found this from Konstantin online (I'll try it out):

 The API that you need is in org.eclipse.wst.server.core. You first need
to retrieve the IRuntimeType object that corresponds to the tomcat
runtime of the appropriate version. You can do that using the ServerCore
class. Once you have the IRuntimeType object, it has a factory method
for creating an IRuntimeWorkingCopy. You create the working copy, fill
it out and use the save method to persist your changes. That adds the
runtime to the workspace. Also, make sure to call validate prior to
calling save to make sure that you are not saving a mis-configured runtime.