Jonas wrote:

> Ok I wrote a very simple model class which only has one method return a 
> constant string.
> I set the "modelClass" attribute in the page defintition to the appropriate 
> value.
> When I now load a page with this template a ClassCastException telling me 
> that my model class cannot be casted to 
> [url]http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/ref/4.5.3/apidocs/info/magnolia/rendering/model/RenderingModel.html[/url].
>  So obviusly I need to Implement that specific interface. My problem now is: 
> how do I implement all the required methods of the interface properly, for 
> instance what value do I have to provide for the getContentMap() method?
> Am I even close to what I am supposed to do for implementing tghe model 
> class? Or am I on a completely wrong path?

I recommend extending RenderingModelImpl for this very basic use case. But I 
also recommend taking a look at all other Magnolia classes that implement the 
RenderingModel interface if you have more advanced use cases, because for a lot 
of use cases there is probably already ready-to-go functionality implemented.

Nils.

----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to