ISIS-497 ... contributed associations (properties and collections)

2013-08-16 Thread Dan Haywood
Folks,

just to publicise a significant new feature that I've implemented.

In Estatio [1], we've taken some care to layer our modules; for example the
finance package depends upon the parties package, but not vice versa.  Each
finance.BankAccount knows its owning party.Party,but the Party does not
know of its bank accounts.

While this provides a clean architecture, the downside of this is that it
is not possible to view the parties accounts as if they are a collection.
 The best that has been possible is to invoke a contributed action, eg on
the Party, contributed by the BankAccounts service.  However, this takes
the user to a different page (in the Wicket viewer), so they lose the
context of what they were looking at.

In ISIS-497, I've extended the concept of contributed actions so that any
service action that is a single-argument for is non-void will be displayed
as a contributed property or collection (dependent upon its return type).

The ToDoItem example demonstrates this:
- the ToDoItem#similarItems collection has now gone, but the
ToDoItems#similarTo(ToDoItem) action is rendered as a contributed
colleciton.
- a new ToDoItems#priority(ToDoItem) action is rendered as a contributed
property.

The @NotContributed annotation has also been enhanced:

@NotContributed  ... not contributed at all
@NotContributed(As.ACTION)    but is contributed as a
property/collection (dependent on return type)
@NoContributed(As.ASSOCIATION)  but is contributed as an action

Contributed collections are implicitly eagerly rendered.

Contributed properties can also be hidden from tables by annotating the
service action with @Hidden(where=ALL_TABLES), in the usual fashion.

~~~
I suspect that this new feature could make it much easier to keep designs
decoupled; these service actions are somewhat akin to traits/mixins of both
function and data.  (Indeed, Jeroen and I were talking a few days ago about
how Isis is as much an AOP framework as it is an OOP framework... these
contributed Xxx mixins are further evidence of that)

Note: there are still some issues with contributed actions; most notably
the supporting choices/default/ validate/disable aren't picked up.  I
intend to address that next.

As ever, feedback welcome

Thx
Dan







[1] https://github.com/estatio/estatio


[jira] [Commented] (ISIS-497) Allow service actions to be rendered as contributed collections or as contributed properties.

2013-08-16 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13742398#comment-13742398
 ] 

ASF subversion and git services commented on ISIS-497:
--

Commit 869668e2cb75447f4c1f783d0164f5a1797a5832 in branch refs/heads/master 
from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=869668e ]

ISIS-497: contributed associations.


> Allow service actions to be rendered as contributed collections or as 
> contributed properties.
> -
>
> Key: ISIS-497
> URL: https://issues.apache.org/jira/browse/ISIS-497
> Project: Isis
>  Issue Type: New Feature
>  Components: Core, Viewer: Wicket
>Affects Versions: viewer-wicket-1.2.0, core-1.2.0
>Reporter: Dan Haywood
>Assignee: Dan Haywood
> Fix For: viewer-wicket-1.3.0, core-1.3.0
>
>
> Thus:
> a non-void service action that accepts a single argument of the entity type 
> is rendered as a property if it returns a scalar, or a collection if it 
> returns a list.
> To prevent the service action from being contributed, use @NotContributed 
> annotation, which is extended to:
> @NotContributed  ... not contributed at all
> @NotContributed(As.ACTION)    but is contributed as a property/collection 
> (dependent on return type)
> @NoContributed(As.ASSOCIATION)  but is contributed as an action
> Contributed collections are implicitly eagerly rendered.
> Contributed properties can be hidden from tables by annotating the service 
> action with @Hidden(where=ALL_TABLES), in the usual fashion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (ISIS-497) Allow service actions to be rendered as contributed collections or as contributed properties.

2013-08-16 Thread Dan Haywood (JIRA)
Dan Haywood created ISIS-497:


 Summary: Allow service actions to be rendered as contributed 
collections or as contributed properties.
 Key: ISIS-497
 URL: https://issues.apache.org/jira/browse/ISIS-497
 Project: Isis
  Issue Type: New Feature
  Components: Core, Viewer: Wicket
Affects Versions: core-1.2.0, viewer-wicket-1.2.0
Reporter: Dan Haywood
Assignee: Dan Haywood
 Fix For: viewer-wicket-1.3.0, core-1.3.0


Thus:

a non-void service action that accepts a single argument of the entity type is 
rendered as a property if it returns a scalar, or a collection if it returns a 
list.

To prevent the service action from being contributed, use @NotContributed 
annotation, which is extended to:

@NotContributed  ... not contributed at all
@NotContributed(As.ACTION)    but is contributed as a property/collection 
(dependent on return type)
@NoContributed(As.ASSOCIATION)  but is contributed as an action

Contributed collections are implicitly eagerly rendered.
Contributed properties can be hidden from tables by annotating the service 
action with @Hidden(where=ALL_TABLES), in the usual fashion.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (ISIS-496) Quickstart RO viewer - a link is broken

2013-08-16 Thread Dimuthu Upeksha (JIRA)
Dimuthu Upeksha created ISIS-496:


 Summary: Quickstart RO viewer - a link is broken
 Key: ISIS-496
 URL: https://issues.apache.org/jira/browse/ISIS-496
 Project: Isis
  Issue Type: Bug
  Components: Viewer: RestfulObjects
Reporter: Dimuthu Upeksha
Assignee: Dan Haywood
Priority: Minor


A link is broken in quickstart RO viewer

http://localhost:8080/restful/domain-types/dom.todo.ToDoItem.Category/actions/id
 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (ISIS-495) Remove dependences to commons-lang and commons-collection

2013-08-16 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13742058#comment-13742058
 ] 

ASF subversion and git services commented on ISIS-495:
--

Commit 0eb6915ea019d13449463b0838a9d93fbc3e03f5 in branch refs/heads/master 
from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=0eb6915 ]

ISIS-495: further minor tidy up of dependencies

* removed unused org.codehaus.jettison
* removed crimson:crimson


> Remove dependences to commons-lang and commons-collection
> -
>
> Key: ISIS-495
> URL: https://issues.apache.org/jira/browse/ISIS-495
> Project: Isis
>  Issue Type: Improvement
>  Components: Core, Viewer: Scimpi
>Affects Versions: core-1.2.0
>Reporter: Dan Haywood
>Assignee: Dan Haywood
> Fix For: core-1.3.0
>
>
> Re: commons-lang:
> Analysis shows that only Scimpi module has a fairly deep dependency on 
> commons-lang (string escaping).  Otherwise there's very little usage, so 
> should be refactored to remove these dependencies in Isis as a whole.
> Re: commons-collection:
> Analysis shows can all be easily refactored to use guava.
> Re: commons-jxpath
> unused dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Resolved] (ISIS-51) Standardize on just one collections API (either google-collections/guava or Apache collections)

2013-08-16 Thread Dan Haywood (JIRA)

 [ 
https://issues.apache.org/jira/browse/ISIS-51?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood resolved ISIS-51.
-

Resolution: Fixed

> Standardize on just one collections API (either google-collections/guava or 
> Apache collections)
> ---
>
> Key: ISIS-51
> URL: https://issues.apache.org/jira/browse/ISIS-51
> Project: Isis
>  Issue Type: Improvement
>  Components: Core
>Affects Versions: core-1.0.0
>Reporter: Dan Haywood
>Priority: Minor
> Fix For: core-1.3.0
>
>
> Currently we use both.
> For what it's worth, my vote is for google-collections (which is now a subset 
> of guava) rather than the Apache commons collections.  Two reasons:
> 1. I think it's better quality
> 2. the guava library is likely to give us some further general language 
> utilities, meaning we can may be able to delete some stuff in 
> org.apache.isis.core.commons.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Resolved] (ISIS-495) Remove dependences to commons-lang and commons-collection

2013-08-16 Thread Dan Haywood (JIRA)

 [ 
https://issues.apache.org/jira/browse/ISIS-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood resolved ISIS-495.
--

Resolution: Fixed

> Remove dependences to commons-lang and commons-collection
> -
>
> Key: ISIS-495
> URL: https://issues.apache.org/jira/browse/ISIS-495
> Project: Isis
>  Issue Type: Improvement
>  Components: Core, Viewer: Scimpi
>Affects Versions: core-1.2.0
>Reporter: Dan Haywood
>Assignee: Dan Haywood
> Fix For: core-1.3.0
>
>
> Re: commons-lang:
> Analysis shows that only Scimpi module has a fairly deep dependency on 
> commons-lang (string escaping).  Otherwise there's very little usage, so 
> should be refactored to remove these dependencies in Isis as a whole.
> Re: commons-collection:
> Analysis shows can all be easily refactored to use guava.
> Re: commons-jxpath
> unused dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (ISIS-495) Remove dependences to commons-lang and commons-collection

2013-08-16 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13742046#comment-13742046
 ] 

ASF subversion and git services commented on ISIS-495:
--

Commit 28189e1f9a26d4774995b6f7594d6d84f2fdde88 in branch refs/heads/master 
from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=28189e1 ]

ISIS-51, ISIS-495: removing dependencies on Apache commons

- commons-lang (except in Scimpi)
- commons-collections


> Remove dependences to commons-lang and commons-collection
> -
>
> Key: ISIS-495
> URL: https://issues.apache.org/jira/browse/ISIS-495
> Project: Isis
>  Issue Type: Improvement
>  Components: Core, Viewer: Scimpi
>Affects Versions: core-1.2.0
>Reporter: Dan Haywood
>Assignee: Dan Haywood
> Fix For: core-1.3.0
>
>
> Re: commons-lang:
> Analysis shows that only Scimpi module has a fairly deep dependency on 
> commons-lang (string escaping).  Otherwise there's very little usage, so 
> should be refactored to remove these dependencies in Isis as a whole.
> Re: commons-collection:
> Analysis shows can all be easily refactored to use guava.
> Re: commons-jxpath
> unused dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (ISIS-51) Standardize on just one collections API (either google-collections/guava or Apache collections)

2013-08-16 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-51?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13742045#comment-13742045
 ] 

ASF subversion and git services commented on ISIS-51:
-

Commit 28189e1f9a26d4774995b6f7594d6d84f2fdde88 in branch refs/heads/master 
from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=28189e1 ]

ISIS-51, ISIS-495: removing dependencies on Apache commons

- commons-lang (except in Scimpi)
- commons-collections


> Standardize on just one collections API (either google-collections/guava or 
> Apache collections)
> ---
>
> Key: ISIS-51
> URL: https://issues.apache.org/jira/browse/ISIS-51
> Project: Isis
>  Issue Type: Improvement
>  Components: Core
>Affects Versions: core-1.0.0
>Reporter: Dan Haywood
>Priority: Minor
> Fix For: core-1.3.0
>
>
> Currently we use both.
> For what it's worth, my vote is for google-collections (which is now a subset 
> of guava) rather than the Apache commons collections.  Two reasons:
> 1. I think it's better quality
> 2. the guava library is likely to give us some further general language 
> utilities, meaning we can may be able to delete some stuff in 
> org.apache.isis.core.commons.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (ISIS-495) Remove dependences to commons-lang and commons-collection

2013-08-16 Thread Dan Haywood (JIRA)

 [ 
https://issues.apache.org/jira/browse/ISIS-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-495:
-

Description: 
Re: commons-lang:

Analysis shows that only Scimpi module has a fairly deep dependency on 
commons-lang (string escaping).  Otherwise there's very little usage, so should 
be refactored to remove these dependencies in Isis as a whole.



Re: commons-collection:

Analysis shows can all be easily refactored to use guava.



Re: commons-jxpath

unused dependency.

  was:
Re: commons-lang:

Analysis shows that only Scimpi module has a fairly deep dependency on 
commons-lang (string escaping).  Otherwise there's very little usage, so should 
be refactored to remove these dependencies in Isis as a whole.



Re: commons-collection:

Analysis shows can all be easily refactored to use guava.


> Remove dependences to commons-lang and commons-collection
> -
>
> Key: ISIS-495
> URL: https://issues.apache.org/jira/browse/ISIS-495
> Project: Isis
>  Issue Type: Improvement
>  Components: Core, Viewer: Scimpi
>Affects Versions: core-1.2.0
>Reporter: Dan Haywood
>Assignee: Dan Haywood
> Fix For: core-1.3.0
>
>
> Re: commons-lang:
> Analysis shows that only Scimpi module has a fairly deep dependency on 
> commons-lang (string escaping).  Otherwise there's very little usage, so 
> should be refactored to remove these dependencies in Isis as a whole.
> Re: commons-collection:
> Analysis shows can all be easily refactored to use guava.
> Re: commons-jxpath
> unused dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (ISIS-495) Remove dependences to commons-lang and commons-collection

2013-08-16 Thread Dan Haywood (JIRA)

 [ 
https://issues.apache.org/jira/browse/ISIS-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-495:
-

Description: 
Re: commons-lang:

Analysis shows that only Scimpi module has a fairly deep dependency on 
commons-lang (string escaping).  Otherwise there's very little usage, so should 
be refactored to remove these dependencies in Isis as a whole.



Re: commons-collection:

Analysis shows can all be easily refactored to use guava.

  was:Analysis shows that only Scimpi module has a fairly deep dependency on 
commons-lang (string escaping).  Otherwise there's very little usage, so should 
be refactored to remove these dependencies in Isis as a whole.


> Remove dependences to commons-lang and commons-collection
> -
>
> Key: ISIS-495
> URL: https://issues.apache.org/jira/browse/ISIS-495
> Project: Isis
>  Issue Type: Improvement
>  Components: Core, Viewer: Scimpi
>Affects Versions: core-1.2.0
>Reporter: Dan Haywood
>Assignee: Dan Haywood
> Fix For: core-1.3.0
>
>
> Re: commons-lang:
> Analysis shows that only Scimpi module has a fairly deep dependency on 
> commons-lang (string escaping).  Otherwise there's very little usage, so 
> should be refactored to remove these dependencies in Isis as a whole.
> Re: commons-collection:
> Analysis shows can all be easily refactored to use guava.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (ISIS-495) Remove dependences to commons-lang and commons-collection

2013-08-16 Thread Dan Haywood (JIRA)

 [ 
https://issues.apache.org/jira/browse/ISIS-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-495:
-

Summary: Remove dependences to commons-lang and commons-collection  (was: 
Remove dependences to commons-lang.)

> Remove dependences to commons-lang and commons-collection
> -
>
> Key: ISIS-495
> URL: https://issues.apache.org/jira/browse/ISIS-495
> Project: Isis
>  Issue Type: Improvement
>  Components: Core, Viewer: Scimpi
>Affects Versions: core-1.2.0
>Reporter: Dan Haywood
>Assignee: Dan Haywood
> Fix For: core-1.3.0
>
>
> Analysis shows that only Scimpi module has a fairly deep dependency on 
> commons-lang (string escaping).  Otherwise there's very little usage, so 
> should be refactored to remove these dependencies in Isis as a whole.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (ISIS-495) Remove dependences to commons-lang.

2013-08-16 Thread Dan Haywood (JIRA)
Dan Haywood created ISIS-495:


 Summary: Remove dependences to commons-lang.
 Key: ISIS-495
 URL: https://issues.apache.org/jira/browse/ISIS-495
 Project: Isis
  Issue Type: Improvement
  Components: Core, Viewer: Scimpi
Affects Versions: core-1.2.0
Reporter: Dan Haywood
Assignee: Dan Haywood
 Fix For: core-1.3.0


Analysis shows that only Scimpi module has a fairly deep dependency on 
commons-lang (string escaping).  Otherwise there's very little usage, so should 
be refactored to remove these dependencies in Isis as a whole.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira