Subject: Non-cached view models


Hi,

I want to use view models as a wrapper around a persisted domain entity to
simply present an alternative view of that entity. The idea of caching such
a view model doesn't make sense to me, rather I want the persisted domain
entity to be cached and the view model (representation of it) to be
recreated each time that its needed, probably by having a constructor that
includes the domain entity as a parameter.

I can create a DomainObject with nature = Nature.INMEMORY_ENTITY, and make
it non bookmarkable, how the title is still a link to a now cached entity
that cannot be recreated.

Stack trace:

   - org.apache.wicket.WicketRuntimeException
   - Can't instantiate page using constructor 'public
   org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage(org.apache.wicket.request.mapper.parameter.PageParameters)'
   and argument
   'objectOid=[*one.projectviewmodel:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPG1lbWVudG8vPg==]'.
   An exception has been thrown during construction!
   - org.apache.wicket.session.DefaultPageFactory#newPage(DefaultPageFactory.java:194)
I can see a way to do what I want by creating a persistent domain entity
that references the persistent domain entity of interest, and then just has
getters that refer to the equivalent getter of the domain entity of
interest.

This need has been created my desire to have a very simple view of a domain
entity without using tabs in the layout.xml and the admin view that does
use layout.xml, but I suspect its a more general need.

Steve