API-only way to create dynamic web project using facets [message #186294] |
Tue, 16 January 2007 16:22  |
Eclipse User |
|
|
|
Hi there,
first of all: I found a nice tutorial at:
http://www.eclipse.org/articles/Article-BuildingProjectFacet s/tutorial.html
Now I know how to crate a dynamic web project by extending
org.eclipse.wst.common.project.facet.core.facets, contribute wizard pages to
it .... and so on.
BUT: Is there also an API-only way (I don't need a wizard) to create a
dynamic web project configured by facets (like "jst.java" , "jst.web" ....)?
So what I want to do per API is:
create dynamic webproject
set/enable facets on it (java, web, jsf)
create WAR file containing the dynamic webproject
create an EAR file and add WAR to it
Can anyone outline how to do this using WTP 1.5
Thanks in advance.
|
|
|
Re: API-only way to create dynamic web project using facets [message #186423 is a reply to message #186294] |
Wed, 17 January 2007 18:26  |
Eclipse User |
|
|
|
Originally posted by: kosta.bea.com
Raphael,
To create a blank faceted project, you can use one of the
ProjectFacetsManager.create() methods.
Once the project is created you will need to set fixed facets (those
facets that the user cannot deselect (WTP sets jst.java and jst.web for
the Dynamic Web Project as fixed) and set the runtime. You can do this
using setFixedProjectFacets() and addTargetedRuntime() methods of
IFacetedProject.
The next step is to install facets. You can do that using the modify
method of IFacetedProject or the convenience method installProjectFacet.
Now your project is created and configured.
To export ear archives, take a look at
org.eclipse.jst.j2ee.application.internal.operations.EARComp onentExportDataModelProvider
class. You can use it to create an IDataModel object that is used to
parameterize the export operation and then use getDefaultOperation()
method on IDataModel to get an executable operation that will create the
archive.
This should be enough to get you started.
- Konstantin
|
|
|
Powered by
FUDForum. Page generated in 0.03090 seconds