Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » API-only way to create dynamic web project using facets
API-only way to create dynamic web project using facets [message #186294] Tue, 16 January 2007 16:22 Go to next message
Raphael Mueller is currently offline Raphael MuellerFriend
Messages: 1
Registered: July 2009
Junior Member
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:can't access tomcat manager application when starting tomcat internally
Next Topic:show generated html of a jsp
Goto Forum:
  


Current Time: Fri Dec 19 13:08:27 GMT 2014

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

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