Hi Dan, Thank you for the information. I started developing actual application instead that dummy one I created. Before that I needed a plan to figure out correct paths to develop this. So I created a document mentioning abstract overview of the app [1] I'm going to develop, Please refer to that document and give some comments, so I can figure out whether I'm on the right track.
Thank you Dimuthu [1] https://github.com/DImuthuUpe/IsisAndroid/tree/master/IsisAndroid/support On Thu, Apr 18, 2013 at 10:55 PM, Dan Haywood <[email protected]> wrote: > > > > On 19 April 2013 05:10, DImuthu Upeksha <[email protected]> wrote: >> >> Hi Dan, >> When creating fields to input data or view data of domain objects we >> need to know the exact data type of the properties of the domain >> object (Srting, Date, Bolb). So I went through the application and >> finally ended up with the attributes like "canonicalName: >> "org.joda.time.LocalDate",". or "java.lang.String" like that. > > > That sounds correct. You'll have seen that there are "describedBy" links > that reference the domainTypes resources. This is where you get this > metadata from. > > >> >> But I >> don't know how to figure out the data type from this. One thing I can >> do is one to one mapping all the data types to the data types in >> android manually. > > > Yup, you'll need to do this, I think. The viewer needs to have built-in > knowledge about the standard primitives, plus one or two additional common > types - String, BigDecimal, BigInteger, the joda date classes. There are > also some Isis-specific value classes in the applib. > > If you look at the Wicket viewer (or any of the viewers) then you'll see > that they all do something similar. In the case of the Wicket viewer, it > has a component for each of the types [1]. > > That viewer also uses the chain of responsibility pattern. There is a > registry of ComponentFactory's [2] and each is asked in turn as to whether > it can render the value (or indeed the collection, or action, or entity, or > standalone collection of entities). > > It's this design that lets the viewer support extensions such as the > googlemaps or wickedcharts or excel extensions [3,4,5] > >> >> Then I need to know the all the possible data types >> provided by the server so that I can create a pre-defined entry to map >> those datatypes to android data types. Or is there any convenient way >> to fix this? > > > Focus on the ones listed above. Anything that isn't a "built-in" should > then be treated as an entity. Typically this is rendered as a link to the > associated object. For example, an Order entity has a reference to a > Customer entity. > > (Strictly speaking, the above is a simplification: Isis also supports types > annotated with @Value, which are types that can be rendered converted to and > from strings. The google-map extension for wicket [3] defines the Location > class, which is an example. So a further refinement would be to support > these types, too). > > HTH > Dan > > >> >> Department of Computer Science And Engineering >> >> University of Moratuwa, Sri Lanka > > > [1] > https://github.com/apache/isis/tree/master/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars > [2] > https://github.com/apache/isis/blob/master/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java > [3] https://github.com/danhaywood/isis-wicket-gmap3 > [4] https://github.com/danhaywood/isis-wicket-wickedcharts > [5] https://github.com/danhaywood/isis-wicket-excel -- Regards W.Dimuthu Upeksha Undergraduate Department of Computer Science And Engineering University of Moratuwa, Sri Lanka
