[Yanel-dev] Contract of BasicXMLResource subclasses, when using controller-adapter

Cedric Staub cedric.staub at wyona.com
Wed Oct 20 13:32:53 CEST 2010


Hello Rob

On Wed, Oct 20, 2010 at 10:29:56AM +0100, Rob Adamson wrote:
> I have a resource type that's a subclass of
> org.wyona.yanel.impl.resources.BasicXMLResource, and I want to know
> what the contract is. In particular, what should getContentXML return
> for different values of its parameter (String viewId)?

As far as I know the only thing getContentXML(...) has to do is to
return well-formed XML in the output stream. You're free to ignore the
viewId if you want to, tough it usually doesn't make sense to do that
unless your resource has only a single available view.

> The specific problem I'm trying to solve is controlling the output to
> the user after creating or modifying a resource, via
> controller-adapter.
> 
> I can see that getContentXML gets called with the parameter value
> "done", but cannot see how the result relates to the 'done' template
> configured in the controller-adapter resource configuration.
>
> How can I bind values to attributes accessible from the 'done'
> template? (a Jelly template.)

I'm not sure I fully understand what you're saying here. Yanel should
pass the requested viewId to the resource. A resource can tell Yanel
which viewIds exist by implementing getViewDescriptors, and some
resources allow you to specify views in their resource config. 

If that's what controller-adapter is doing (reading the views from the
resource configuration) and 'done' is the requested viewId, then this
corresponds to the viewId passed to getContentXML. 

Is that what you meant? 

Greetings
Cedric


More information about the Yanel-development mailing list