Thanks Dan.

David.




On Monday, 18 November 2013 1:32 AM, Dan Haywood 
<[email protected]> wrote:
 
Yes, we can do this.

The easiest thing to do is to use the BookmarkService, eg as configured in
the quickstart example [1] or (even better) in a demo application "rrraddd"
that I put together for a conference recently [2] and now refererenced as a
tutorial from our website [3]

In [2], the SpeakerViewModel is a view model that is "backed" by an
individual Speaker entity (the domain is ConferenceSession, Speaker, Tag).
As [4] shows, you can use BookmarkService to bother convert the OID of a
Speaker into an opaque string, and convert it back again as shown in [5]

The base32() encoding is to avoid Isis getting confused between the OID of
the SpeakerViewModel and the OID of the Speaker itself that gets wrapped.

This approach should work for any entity at all; the string is basically a
URI to any object in the domain - a very powerful concept!

HTH
Dan


[1]
https://github.com/apache/isis/blob/5e9d586a3a1dcb9e4cf23470f6cb4ef43ebae06d/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties#L171
[2]
https://github.com/danhaywood/rrraddd-isis-131/blob/c3cdf918f7da0c83a1408c7e6712ab10b8798103/myapp/webapp/src/main/webapp/WEB-INF/isis.properties#L169
[3] http://isis.apache.org/documentation.html
[4]
https://github.com/danhaywood/rrraddd-isis-131/blob/c3cdf918f7da0c83a1408c7e6712ab10b8798103/myapp/dom/src/main/java/dom/simple/SpeakerViewModel.java#L29<https://github.com/danhaywood/rrraddd-isis-131/blob/c3cdf918f7da0c83a1408c7e6712ab10b8798103/myapp/dom/src/main/java/dom/simple/SpeakerViewModel.java#L28>
[5]
https://github.com/danhaywood/rrraddd-isis-131/blob/c3cdf918f7da0c83a1408c7e6712ab10b8798103/myapp/dom/src/main/java/dom/simple/SpeakerViewModel.java#L36




On 17 November 2013 08:36, David Tildesley <[email protected]> wrote:

> I'm interested in the answer to that also.
>
> David.
>
>
>
> On Sunday, 17 November 2013 8:50 AM, james agada <[email protected]>
> wrote:
>
> When creating a view model, I am retrieving the OID of a referenced entity.
> Is it possible to retrieve an entity with just the OID which is usually an
> integer
>

Reply via email to