You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Reza Rasouli <ra...@gmail.com> on 2015/06/23 08:22:00 UTC

Providing Data From A Custom Backend Other Than Database

Hi,

Is it possible to provide data for apache isis from custom sources other
than Database?

for example a data provider class which calls various REST services in it's
implementation of CRUD functions, and make apache isis to use these CRUD
functions from this custom data provider class, so that the apache isis
only provides/generates the UIs and callbacks and the server side code
attaches hooks to these callbacks and uses that custom data provider for
CRUD.

Thanks.

Re: Providing Data From A Custom Backend Other Than Database

Posted by Reza Rasouli <ra...@gmail.com>.
This Was Really Helpul.
Many Thanks.

On Tue, Jun 23, 2015 at 12:05 PM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> On 23 June 2015 at 07:22, Reza Rasouli <ra...@gmail.com> wrote:
>
> > Hi,
> >
> > Is it possible to provide data for apache isis from custom sources other
> > than Database?
> >
> >
>
> > for example a data provider class which calls various REST services in
> it's
> > implementation of CRUD functions, and make apache isis to use these CRUD
> > functions from this custom data provider class, so that the apache isis
> > only provides/generates the UIs and callbacks and the server side code
> > attaches hooks to these callbacks and uses that custom data provider for
> > CRUD.
> >
> >
> There are a couple of approaches.
>
> The most straightforward is to simply use view models instead of persistent
> entities.  You could for example define a service that makes the REST calls
> and returns a view model to wrap the external entity.  This would normally
> be annotated with @DomainObject(nature=Nature.EXTERNAL_ENTITY) [1], though
> you could also use just @ViewModel  [2]  Note that view models are
> immutable and have no change tracking.  Also, while they can hold simple
> properties, Isis does not serialize the state of any collections.
>  (Contributed collections are supported though, so this may suffice).
>
>
> A much more advanced (but also flexible) approach is to define a custom
> DataNucleus StoreManager, as per [3] and [4].  Here the external objects
> would be mapped as DN @PersistenceCapable.  I've never done this, though.
>
> HTH
> Dan
>
>
>
>
>
> > Thanks.
> >
>
>
> [1]
>
> http://isis.apache.org/guides/rg.html#_rg_annotations_manpage-DomainObject_nature
> [2]
> http://isis.apache.org/guides/rg.html#_rg_annotations_manpage-ViewModel
> [3] http://www.datanucleus.org/extensions/store_manager.html
> [4]
>
> http://www.datanucleus.org/documentation/development/new_store_plugin_howto.html
>



-- 
*Warm Regards,*
*Reza Rasouli.*

Re: Providing Data From A Custom Backend Other Than Database

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 23 June 2015 at 07:22, Reza Rasouli <ra...@gmail.com> wrote:

> Hi,
>
> Is it possible to provide data for apache isis from custom sources other
> than Database?
>
>

> for example a data provider class which calls various REST services in it's
> implementation of CRUD functions, and make apache isis to use these CRUD
> functions from this custom data provider class, so that the apache isis
> only provides/generates the UIs and callbacks and the server side code
> attaches hooks to these callbacks and uses that custom data provider for
> CRUD.
>
>
There are a couple of approaches.

The most straightforward is to simply use view models instead of persistent
entities.  You could for example define a service that makes the REST calls
and returns a view model to wrap the external entity.  This would normally
be annotated with @DomainObject(nature=Nature.EXTERNAL_ENTITY) [1], though
you could also use just @ViewModel  [2]  Note that view models are
immutable and have no change tracking.  Also, while they can hold simple
properties, Isis does not serialize the state of any collections.
 (Contributed collections are supported though, so this may suffice).


A much more advanced (but also flexible) approach is to define a custom
DataNucleus StoreManager, as per [3] and [4].  Here the external objects
would be mapped as DN @PersistenceCapable.  I've never done this, though.

HTH
Dan





> Thanks.
>


[1]
http://isis.apache.org/guides/rg.html#_rg_annotations_manpage-DomainObject_nature
[2] http://isis.apache.org/guides/rg.html#_rg_annotations_manpage-ViewModel
[3] http://www.datanucleus.org/extensions/store_manager.html
[4]
http://www.datanucleus.org/documentation/development/new_store_plugin_howto.html