Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Creating a new Module Type
Creating a new Module Type [message #231917] Wed, 27 May 2009 11:44 Go to next message
Anders Olsson is currently offline Anders OlssonFriend
Messages: 21
Registered: July 2009
Junior Member
Hello,

I'm in the process of defining a new Module Type, that will be publishable
through my custom Server Adapter.

What I've done so far is to add the extensions:
<extension point="org.eclipse.wst.server.core.moduleTypes">
<moduleType id="my.type" name="MY TYPE">
</moduleType>
</extension>

<extension point="org.eclipse.wst.server.core.runtimeTypes">
<runtimeType...>
<moduleType types="jst.ear" versions="1.2,1.3,1.4,5.0"/>
<moduleType types="my.type" versions="1.0">
</moduleType>
</runtimeType>
</extension>

<extension point="org.eclipse.wst.common.project.facet.core.runtimes">
<runtime-component-type.../>
<runtime-component-version.../>
<adapter>
<runtime-component.../>
<factory.../>
<type.../>
</adapter>
<supported>
<runtime-component.../>
<facet
id="my.type"
version="1.0">
</facet>
</supported>
</extension>


Also, in my Serverdef I have:
<module>
<type>my.type</type>
<publishDir>${deploy.dir}</publishDir>
<publisherReference>org.eclipse.jst.server.generic.antpublisher </publisherReference>
</module>

I've added the natures:
"org.eclipse.wst.common.project.facet.core.nature" - For the ability to
use facet dependencies
and
"org.eclipse.wst.common.modulecore.ModuleCoreNature" - To be able to be
used as a module, to add to a Server Adapter.
to my project type.

My problem is that most of this is just figured out by taking from
different examples. But I've found no example as a whole, how to create a
new Module Type. I've tried reading the sources of WST/JST, but they're
not really written in a way that makes it easy to follow.

What more do I need to do in order to make this work? Are there any
examples of this? I have found no help in the book "Eclipse Web Tools
Platform".

Thanks in advance,

Anders Olsson
Re: Creating a new Module Type [message #231925 is a reply to message #231917] Fri, 29 May 2009 02:09 Go to previous message
Eclipse UserFriend
Originally posted by: rstryker.redhat.com

I assume you're making a project-type module, meaning where each project
is represented by one module. You could also theoretically turn anything
at all into a module via the module factory. You'll need to look into
the avialable extension points in the servertools server.core plugin.

Specifically, to actually turn your project (or any item) into a module,
you need have a module factory.

For example:
<extension
point="org.eclipse.wst.server.core.moduleFactories">
<moduleFactory
class="com.example.my.Modulefactory"
id="com.example.my.ModuleFactoryID"
projects="true">
<moduleType
types="my.module.type"
versions="1.0">
</moduleType>
</moduleFactory>
</extension>

It seems (because you're using a serverdef) that you're trying to use
the GenericServer Framework. If you wanted to have more control over the
publishing operation, you should also create a server type yourself
through the org.eclipse.wst.server.core.serverTypes extension point. In
this extension point you can also set a ServerBehaviourDelegate, which
can handle publishing of new or unusual modules.

But, of course, this added control with a lot more responsibility.
If you don't want that level of work, I believe the generic server
framework also includes a publisher's extension point, where you can
provide your own publisher for this new module type. I don't have the
extension point for that available off hand and I'm not familiar with
the process for this.

If, on the other hand, you really are trying to create a complete
module, very similar to WTP projects, with a content folder, the virtual
component framework in the project, a way to link projects together via
a page similar to the JEE Module dependency page, well, all I can say
is that you've got quite a task ahead of you, and good luck ;) That kind
of endeavor requires knowledge of the Component Core and Virtual
Component frameworks, how to add references, etc. There's currently no
generic module dependency page available. The current one is very
limited to JEE projects and has a lot of built in assumptions.

- Rob Stryker





Anders Olsson wrote:
> Hello,
>
> I'm in the process of defining a new Module Type, that will be
> publishable through my custom Server Adapter.
>
> What I've done so far is to add the extensions:
> <extension point="org.eclipse.wst.server.core.moduleTypes">
> <moduleType id="my.type" name="MY TYPE">
> </moduleType>
> </extension>
>
> <extension point="org.eclipse.wst.server.core.runtimeTypes">
> <runtimeType...>
> <moduleType types="jst.ear" versions="1.2,1.3,1.4,5.0"/>
> <moduleType types="my.type" versions="1.0">
> </moduleType>
> </runtimeType>
> </extension>
>
> <extension
> point="org.eclipse.wst.common.project.facet.core.runtimes">
> <runtime-component-type.../>
> <runtime-component-version.../>
> <adapter>
> <runtime-component.../>
> <factory.../>
> <type.../>
> </adapter>
> <supported>
> <runtime-component.../>
> <facet
> id="my.type"
> version="1.0">
> </facet>
> </supported>
> </extension>
>
>
> Also, in my Serverdef I have:
> <module>
> <type>my.type</type>
> <publishDir>${deploy.dir}</publishDir>
> <publisherReference>org.eclipse.jst.server.generic.antpublisher </publisherReference>
>
> </module>
>
> I've added the natures:
> "org.eclipse.wst.common.project.facet.core.nature" - For the ability to
> use facet dependencies
> and
> "org.eclipse.wst.common.modulecore.ModuleCoreNature" - To be able to be
> used as a module, to add to a Server Adapter.
> to my project type.
>
> My problem is that most of this is just figured out by taking from
> different examples. But I've found no example as a whole, how to create
> a new Module Type. I've tried reading the sources of WST/JST, but
> they're not really written in a way that makes it easy to follow.
>
> What more do I need to do in order to make this work? Are there any
> examples of this? I have found no help in the book "Eclipse Web Tools
> Platform".
>
> Thanks in advance,
>
> Anders Olsson
>
Previous Topic:Serializing namespaces on the xsd schema level
Next Topic:Tomcat start fails with syntax error
Goto Forum:
  


Current Time: Tue Mar 19 07:21:19 GMT 2024

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

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

Back to the top