You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Dan Haywood <da...@haywood-associates.co.uk> on 2013/07/20 12:08:18 UTC

New features... dynamic layout of objects

Folks,

fyi, I've been implementing a new annotation @MemberGroupLayout that allows
up to three columns rather than two.

Generally the first two columns are for properties and the right-most
column is for collections.  However, if the entity has no collections at
all, then all three columns can be used for properties.

In addition, the columns can be specified as different widths.

Also, there's a degree of responsive design; if you shrink the page then
the elements reflow. A small amount of the bootstrap takes care of that.

~~~
In addition, both the @MemberGroupLayout and @MemberOrder annotations can
instead be specified using a new property file.  See the ToDoItem example
to see what I mean [1], specifically [2]

Why do it this way?  Well, because it can be updated dynamically.  If you
press the "refresh" contributed action from DeveloperUtilities service,
then Isis will recreate the metamodel for that domain object.  (Actually,
you need to press refresh twice.  Why? Don't ask...)

~~~
Next step is to find a less clunky way of specifying this information than
a properties file.  I am thinking that a bit of JSON might be a way to do
this... a poor man's DSL.

eg something like:

[
  {
    span: 3,
    memberGroups: {
      General: {
        description: {},
        category: {},
        complete: {
          completed(): {},
          notYetCompleted(): {}
      },
      Misc: {
        versionSequence: {}
      }
  },
  {
    span: 4,
    memberGroups: {
      Detail: {
        dueBy: {},
        cost: {
          updateCost():{}
        },
        notes: {},
        attachment: {}
      }
  },
  {
    span: 0
  },
  {
    span: 5,
    collections: {
      dependencies: {
        add():{},
        delete(): {}
      },
      similarItems: {}
  }
  actions: {
    delete(): {},
    duplicate(): {}
  }
}


Any thoughts on all of this welcome.

Cheers
Dan



[1]
https://github.com/apache/isis/tree/master/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo
[2]
https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.layout