Hi Paul,
On Wed, 2008-07-30 at 16:32 +0200, Paul Sandoz wrote:
> Hi Martin,
>
> Perhaps it would be easier to declare one Java class that has the
> configuration information declared in it, rather than a textual syntax.
>
> That way it should be easier to configure via programming and only a
> minimal amount of stuff needs to be declared somewhere else e.g. in the
> web.xml or in the ResourceConfig.
Thanx for you suggestion! I already have started implementing this and
just have to write tests. I can commit this in a branch, so that you can
have a look at it.
>
> One could use the builder pattern to make it easy to configure. For example:
>
> generator(<class>).prop(<name>, <value>).prop(<name>, <value>).add()
>
> in the constructor of the configuration class.
Great, I'll add a programmatic configuration.
Cheers,
Martin
>
> Paul.
>
> Martin Grotzke wrote:
> > On Mon, 2008-07-28 at 10:58 +0200, Paul Sandoz wrote:
> >> Hi Martin,
> >>
> >> Can this property be declared as property using ResourceConfig?
> >>
> >> The WADL code can get the ResourceConfig instance and get the
> >> "com.sun.jersey.config.property.wadlGeneratorConfigClass" from that.
> >>
> >> Such properties will also work when declared as Servlet init-params.
> > Ok.
> >
> > What is the best way if I want to provide a WadlGeneratorConfiguration
> > that can be configured via a special servlet init-param?
> >
> > My WadlGeneratorConfiguration primarily must return a list of
> > WadlGeneratorDescriptions. A WadlGeneratorDescription provides the
> > class(name) of an implementation of WadlGenerator plus a Properties
> > instance that is used to init the WadlGenerator.
> >
> > Therefore I thought about s.th. like a servlet init-param
> > "com.sun.jersey.config.property.wadlGeneratorDescriptions" with a
> > possible value like
> >
> > com.sun.jersey.impl.wadl.generators.WadlGeneratorApplicationDoc[applicationDocsFile=classpath:/src/main/api-doc/application-doc.xml];
> > com.sun.jersey.impl.wadl.generators.WadlGeneratorGrammarsSupport[grammarsFile=classpath:/src/main/api-doc/application-grammars.xml];
> > ...
> >
> > This would be interpreted by e.g. a
> > ConfigurableWadlGeneratorConfiguration.
> >
> > What do you think?
> >
> > Thanx && cheers,
> > Martin
> >
> >
> >> Paul.
> >>
> >> Martin Grotzke wrote:
> >>> Hi Paul,
> >>>
> >>> I want to add some WadlGenerationConfiguration to jersey, so that one
> >>> can configure the wadl-generation stuff like the maven-wadl-plugin.
> >>> There should be some property like
> >>>
> >>> com.sun.jersey.config.property.wadlGeneratorConfigClass
> >>>
> >>> that allows the user to specify some class, that provides the required
> >>> configuration properties.
> >>>
> >>> I would have a look at how PackagesResourceConfig is used. Do you have
> >>> another thing that provides a good start for this?
> >>>
> >>> Cheers,
> >>> Martin
> >>>
> >>>
> >