You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Kevin Meyer - KMZ <ke...@kmz.co.za> on 2013/03/02 21:31:51 UTC

Wicket Viewer: Picking up suggestions for actions?

Hi,

Am I going crazy or is the Wicket Viewer missing something...

I can't get the Wicket Viewer to pick up a previously-viewed object as 
a parameter to an action.

I thought that if you viewed an object it became available for use as 
an action parameter? Or is that only the HTML viewer?

I now have a situation where one of my domain objects has a method 
that I can't call:

public class Equipment {
	public boolean checkConnectedTo(Equipment equipment2) {
...
	}
}

I can not assign any value to the parameter... or choose any other 
existing Equipment.

Once I got the "Claims" application working with Wicket, I found that 
the same thing happened when I tried the "claimsFor" action from the 
Claims service...

Do I explicitly have to provide "choices" methods?



Re: Wicket Viewer: Picking up suggestions for actions?

Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
I understand where you're coming from.. implicitly add a specific 
"choices" facet to methods that don't already provide one. Have it 
contribute from the breadcrumb trail as appropriate.

I can't say I know the details of how to do this, but this description is a 
start.

I'm going to add it to my list of "TODOs".. and move this thread into 
dev@isis.


On 3 Mar 2013 at 18:39, Dan Haywood wrote:

> On 3 March 2013 16:36, Kevin Meyer - KMZ <ke...@kmz.co.za> wrote:
> 
> > > I suppose there's no reason that the Wicket viewer can't do something
> > > similar to the HTML viewer, which is to present a list of objects
> > recently
> > > encountered.
> >
> > I don't suppose it is straight forward extension that you can easily
> > describe?
> >
> >
> As a first cut, you could write a FacetFactory (register it explicitly
> using the technique documented in [1]), such that it would install a
> ChoicesFacet on any properties or parameters that don't already have a
> ChoicesFacet or AutoCompleteFacet.
> 
> You could either look inside the Breadcrumbs stuff to find a list of
> visited OIDs, or - perhaps even better - in the WebRequestCycleForIsis's
> onEndRequest() method you could reach into the objectstore (I'm not quite
> certain what API to use here) and get and cache the oid and title of all
> the objects that were brought into memory during the transaction.  You
> could probably just store this list in the Wicket Session object
> (Session.get()).
> 
> Let me know if that makes any sort of sense...


Re: Wicket Viewer: Picking up suggestions for actions?

Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
I understand where you're coming from.. implicitly add a specific 
"choices" facet to methods that don't already provide one. Have it 
contribute from the breadcrumb trail as appropriate.

I can't say I know the details of how to do this, but this description is a 
start.

I'm going to add it to my list of "TODOs".. and move this thread into 
dev@isis.


On 3 Mar 2013 at 18:39, Dan Haywood wrote:

> On 3 March 2013 16:36, Kevin Meyer - KMZ <ke...@kmz.co.za> wrote:
> 
> > > I suppose there's no reason that the Wicket viewer can't do something
> > > similar to the HTML viewer, which is to present a list of objects
> > recently
> > > encountered.
> >
> > I don't suppose it is straight forward extension that you can easily
> > describe?
> >
> >
> As a first cut, you could write a FacetFactory (register it explicitly
> using the technique documented in [1]), such that it would install a
> ChoicesFacet on any properties or parameters that don't already have a
> ChoicesFacet or AutoCompleteFacet.
> 
> You could either look inside the Breadcrumbs stuff to find a list of
> visited OIDs, or - perhaps even better - in the WebRequestCycleForIsis's
> onEndRequest() method you could reach into the objectstore (I'm not quite
> certain what API to use here) and get and cache the oid and title of all
> the objects that were brought into memory during the transaction.  You
> could probably just store this list in the Wicket Session object
> (Session.get()).
> 
> Let me know if that makes any sort of sense...


Re: Wicket Viewer: Picking up suggestions for actions?

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 3 March 2013 16:36, Kevin Meyer - KMZ <ke...@kmz.co.za> wrote:

> > I suppose there's no reason that the Wicket viewer can't do something
> > similar to the HTML viewer, which is to present a list of objects
> recently
> > encountered.
>
> I don't suppose it is straight forward extension that you can easily
> describe?
>
>
As a first cut, you could write a FacetFactory (register it explicitly
using the technique documented in [1]), such that it would install a
ChoicesFacet on any properties or parameters that don't already have a
ChoicesFacet or AutoCompleteFacet.

You could either look inside the Breadcrumbs stuff to find a list of
visited OIDs, or - perhaps even better - in the WebRequestCycleForIsis's
onEndRequest() method you could reach into the objectstore (I'm not quite
certain what API to use here) and get and cache the oid and title of all
the objects that were brought into memory during the transaction.  You
could probably just store this list in the Wicket Session object
(Session.get()).

Let me know if that makes any sort of sense...

Dan

[1]
http://isis.apache.org/core/metamodel-finetuning-the-programming-model.html

Re: Wicket Viewer: Picking up suggestions for actions?

Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
> I suppose there's no reason that the Wicket viewer can't do something
> similar to the HTML viewer, which is to present a list of objects recently
> encountered.

I was wondering about the implications for usage.. I can almost 
understand that there's an argument against it (non-linear / detached 
workflow), but it always seemed so useful in the HTML viewer! :)  

To put in explicit "choices" methods makes the available list 
programmatically known and predictable.
 
> I've made a note in my private todo list of items that I'm working on for
> the wicket viewer, but it's down at about num. 20, I'm afraid.

I don't suppose it is straight forward extension that you can easily 
describe?



Re: Wicket Viewer: Picking up suggestions for actions?

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 2 March 2013 22:27, Kevin Meyer <ke...@kmz.co.za> wrote:

> Thanks.. I set up a choices method, and have to admit I don't like that I
> have to type something before any choices actually appear.
>

I suppose there's no reason that the Wicket viewer can't do something
similar to the HTML viewer, which is to present a list of objects recently
encountered.

I've made a note in my private todo list of items that I'm working on for
the wicket viewer, but it's down at about num. 20, I'm afraid.

Cheers
Dan


> I can see the use for it later, but when the list is short, it forces an
> unneeded keypress.
>
> Is there any way a domain app service can access the bread crumb list?
>
> I saw the autocomplete annotation, thanks.
>
> Dan Haywood <da...@haywood-associates.co.uk> wrote:
>
> >On 2 Mar 2013 20:32, "Kevin Meyer - KMZ" <ke...@kmz.co.za> wrote:
> >>
> >> Hi,
> >>
> >> Am I going crazy or is the Wicket Viewer missing something...
> >>
> >> I can't get the Wicket Viewer to pick up a previously-viewed object
> >as
> >> a parameter to an action.
> >>
> >> I thought that if you viewed an object it became available for use as
> >> an action parameter? Or is that only the HTML viewer?
> >
> >That's the html viewer.
> >
> >With the wicket viewer, and you either use choices, and as you say, or
> >you
> >can use the @Autocomplete annotation.
> >
> >There's a example in the simple to do app that w use for the archetype.
> >
> >Cheers,
> >Dan
> >
> >> I now have a situation where one of my domain objects has a method
> >> that I can't call:
> >>
> >> public class Equipment {
> >>         public boolean checkConnectedTo(Equipment equipment2) {
> >> ...
> >>         }
> >> }
> >>
> >> I can not assign any value to the parameter... or choose any other
> >> existing Equipment.
> >>
> >> Once I got the "Claims" application working with Wicket, I found that
> >> the same thing happened when I tried the "claimsFor" action from the
> >> Claims service...
> >>
> >> Do I explicitly have to provide "choices" methods?
> >>
> >>
>
> --
> Sent from my phone with K-9 Mail.
> Please excuse my brevity.

Re: Wicket Viewer: Picking up suggestions for actions?

Posted by Kevin Meyer <ke...@kmz.co.za>.
Thanks.. I set up a choices method, and have to admit I don't like that I have to type something before any choices actually appear.

I can see the use for it later, but when the list is short, it forces an unneeded keypress.

Is there any way a domain app service can access the bread crumb list?

I saw the autocomplete annotation, thanks.

Dan Haywood <da...@haywood-associates.co.uk> wrote:

>On 2 Mar 2013 20:32, "Kevin Meyer - KMZ" <ke...@kmz.co.za> wrote:
>>
>> Hi,
>>
>> Am I going crazy or is the Wicket Viewer missing something...
>>
>> I can't get the Wicket Viewer to pick up a previously-viewed object
>as
>> a parameter to an action.
>>
>> I thought that if you viewed an object it became available for use as
>> an action parameter? Or is that only the HTML viewer?
>
>That's the html viewer.
>
>With the wicket viewer, and you either use choices, and as you say, or
>you
>can use the @Autocomplete annotation.
>
>There's a example in the simple to do app that w use for the archetype.
>
>Cheers,
>Dan
>
>> I now have a situation where one of my domain objects has a method
>> that I can't call:
>>
>> public class Equipment {
>>         public boolean checkConnectedTo(Equipment equipment2) {
>> ...
>>         }
>> }
>>
>> I can not assign any value to the parameter... or choose any other
>> existing Equipment.
>>
>> Once I got the "Claims" application working with Wicket, I found that
>> the same thing happened when I tried the "claimsFor" action from the
>> Claims service...
>>
>> Do I explicitly have to provide "choices" methods?
>>
>>

-- 
Sent from my phone with K-9 Mail.
Please excuse my brevity.

Re: Wicket Viewer: Picking up suggestions for actions?

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 2 Mar 2013 20:32, "Kevin Meyer - KMZ" <ke...@kmz.co.za> wrote:
>
> Hi,
>
> Am I going crazy or is the Wicket Viewer missing something...
>
> I can't get the Wicket Viewer to pick up a previously-viewed object as
> a parameter to an action.
>
> I thought that if you viewed an object it became available for use as
> an action parameter? Or is that only the HTML viewer?

That's the html viewer.

With the wicket viewer, and you either use choices, and as you say, or you
can use the @Autocomplete annotation.

There's a example in the simple to do app that w use for the archetype.

Cheers,
Dan

> I now have a situation where one of my domain objects has a method
> that I can't call:
>
> public class Equipment {
>         public boolean checkConnectedTo(Equipment equipment2) {
> ...
>         }
> }
>
> I can not assign any value to the parameter... or choose any other
> existing Equipment.
>
> Once I got the "Claims" application working with Wicket, I found that
> the same thing happened when I tried the "claimsFor" action from the
> Claims service...
>
> Do I explicitly have to provide "choices" methods?
>
>