Hi Adam, Rob would be the man to answer this, but he's being a bit elusive. I'm trying to track him down to see if he can enlighten us.
That said, here's some thoughts on how to enhance the Wicket viewer. First thing is that I noticed Alain Zhang has raised a ticket [1] that the Wicket viewer is broken anyway with aggregated entities (irrespective of providing special rendering support for that annotation). So that would need looking into first. Assuming that that works, what I think would need to be provided is a variant on the ReferencePanelFactory and ReferencePanel: let's call them AggregatedReferencePanelFactory and AggregatedReferencePanel. >From the aggregate root entities perspective, it will have a reference to the aggregated entity, and so it will have a ScalarModel representing the value of the OneToOneAssociation (entity property) where the ObjectSpecification (class) of that OTOA property will have the AggregatedFacet. Thus, the "appliesTo" method in the AggregatedReferencePanelFactory will need to do this check on the ObjectSpec for the AggregatedFacet. In the AggregatedReferencePanel, its responsibility would be to recursively show the properties of the aggregated entity. You could probably borrow some of the code in EntitiesPropertiesPanel. However, I think there must still only be one outer HTML FORM to submit. One thing that'll need to be worked through is the unpicking of the updated values when that FORM is submitted. Since the UI has the aggregated entity's properties "flattened" into the aggregate root's, something somewhere will need to distinguish between the properties of the aggregate and those of the aggregated. I'm not sure how this will pan out, exactly. Something similar needs to be done for the action parameters form also, though in this case I think that the Wicket viewer will need to instantiate the aggregated entity on-the-fly in order to call the action with an argument of the right type. Hope that helps, if only a little... Dan [1] https://issues.apache.org/jira/browse/ISIS-295 On 17 February 2013 08:50, Adam Howard <[email protected]> wrote: > I want to start getting the @Aggregated annotation working in the Wicket > viewer. I synced my isis clone and started looking at the source and saw > that the only viewer that uses it now is Scimpi. So I wanted to fire up the > Scimpi viewer to see what's done there but I had problems adding it to my > project[1]. When running mvn jetty:run I get the following exception: > > 2013-02-17 02:27:40.971:WARN:/onaboat-viewer-scimpi:unavailable > org.apache.isis.core.commons.config.IsisConfigurationException: No > configuration available > at > > org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext.getConfiguration(IsisContext.java:320) > at > > org.apache.isis.viewer.scimpi.dispatcher.debug.DebugUsers.initialize(DebugUsers.java:49) > at > > org.apache.isis.viewer.scimpi.servlet.DispatcherServlet.init(DispatcherServlet.java:85) > at javax.servlet.GenericServlet.init(GenericServlet.java:241) > ... > > I thought maybe Scimpi (at 0.2.0-incubating) was incompatible with the > 1.1.0 release of Isis so I went back to Dan's revenue.ie demo[2] and after > turning off the json viewer I was able to start up using the jetty-console > war. But, when I go to localhost:8080/index.shtml I get the following > exception: > > Error while processing swf:services element at > /scimpi/style/template.shtml:25 - null > ... > Caused by: java.lang.NullPointerException > at > > org.apache.isis.viewer.scimpi.dispatcher.context.RequestContext.mappedObject(RequestContext.java:194) > at > > org.apache.isis.viewer.scimpi.dispatcher.context.RequestContext.getMappedObject(RequestContext.java:151) > at > > org.apache.isis.viewer.scimpi.dispatcher.view.action.Methods.writeMethods(Methods.java:97) > at > > org.apache.isis.viewer.scimpi.dispatcher.view.action.Methods.writeMethods(Methods.java:73) > at > > org.apache.isis.viewer.scimpi.dispatcher.view.action.Services.process(Services.java:50) > at > > org.apache.isis.viewer.scimpi.dispatcher.processor.Request.process(Request.java:149) > ... > > So I don't know if anyone is running the Scimpi viewer with a current Isis > release or if anyone happens to know how Scimpi handles @Aggregated objects > (Rob?) but I'd like to make Wicket handle them similarly (fully embedded > fields?, fieldset to distinguish grouping?, etc.) > > Thanks. > -- > Adam > > [1] https://github.com/adamhoward/onaboat/tree/master/viewer-scimpi > [2] https://github.com/danhaywood/apacheisis-demo >
