Reinhard Poetz skrev:
Daniel Fagerstrom wrote:
Reinhard Poetz skrev:
Daniel Fagerstrom wrote:
...
But there are important use cases for run time discovery of servlet
services as well.
definitly. For the use cases that *I* have, a generator will be good
enough - I don't think that I need a source for them:
<map:generate type="servlets" src="data/myconfig.xml"/>
This could return something like this:
<servlets>
<service-A>
<config>...</config>
</service->
<service-B>
<config>...</config>
</service-B>
</servlets>
What are the usecases for implementing a servlets: protocol at all?
(Maybe I'm overlooking something important here ...)
In the above output from your generator, you need to reference the
actual resources of the listed servlet services. And to be able to do
that you need an URI.
The URI is data/myconfig.xml, resolved against all available servlet
services.
What I mean is that for the original use case where we needed a list of
links to block samples. What URIs are we going to list for the block
samples?
Being more concrete. With your servlets generator we would have
something like:
<map:generate type="servlets" src="xsample.xml"/>
in the cocoon-webapp sitemap. And it would return something like
<servlets>
<cocoon-ajax-sample-service>
<group name="Ajax">
<sample name="Ajax Block" href="ajax/">
Ajax block examples. This block is also used by <a
href="forms/">Cocoon Forms</a>.
</sample>
</group>
</cocoon-ajax-sample-service>
...
</servlets>
What about the /servlets/cocoon-ajax-sample-service/group/@href, what
protocol is that going to use?
And right now we have not any protocol that is suitable for that.
AFAIU we only have to create ServletConnection objects. Currently the
constructor expects the connection name as parameter but it shouldn't be
difficult to create those objects by implementing a second constructor
that uses the bean id or a bean reference.
That works for your use case, but not for the original one that creates
a page with links to all samples.
/Daniel