You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by Dan Haywood <da...@haywood-associates.co.uk> on 2011/10/26 21:11:34 UTC

Isis/Joomla via REST [was: Re: Restful Objects spec (v0.41)]

> From: Kevin Meyer - KMZ<ke...@kmz.co.za>
> Date: Sun, Oct 23, 2011 at 8:16 PM
> Subject: Re: Restful Objects spec (v0.41)
> To: isis-dev@incubator.apache.org
>
>
> there is an external
> (Joomla) application that can expose objects (that would map onto Isis
> domain objects) via a REST interface[1] - represented as either JSON
> or XML.
>
> How can I use that REST interface to read (from) and update (to) the
> external app?

Hi Kevin,
Just piecing together this earlier mail with your request today for 
lightweight RESTful APIs...


>
> Basically, for certain domain objects (the "user" object), the "read" and
> "write" must be achieved via REST while for all other domain objects
> the default object store would be used, I guess.
...presumably this is the requirement you have?

> Does this make sense? Is this possible?
I can see three different places where you might integrate.

1. given that this is for users, you could write an implementation of 
the oai.core.runtime.authentication.standard.Authenticator interface?  
This would only allow the Joomla user Id to be exposed via UserMemento

2. or, you could write a domain service and inject it into your 
Isis-hosted domain objects.  The RestEasy client-side support would be 
useful here, I would think.

3. or, you could write an object store implementation (probably wrapping 
the primary objectstore) so that it would resolve certain objects via 
REST.  You could use a custom FacetFactory to provide a hint for this OS 
to know whether to make a REST call or just to delegate to the underlying.

eg:

public JoomlaObjectStore implements ObjectStore {

     public JoomlaObjectStore(ObjectStore underlying) { ... }

     public void resolveImmediately(ObjectAdapter adapter) {
         if(adapter.getSpecification().containsFacet(JoomlaFacet.class)) {
             ... make a REST call ...
         } else {
            underlying.resolveImmediately(adapter);
         }
     }

}

Hope that helps...

Dan





>
> It would even be acceptable if I could only access the external REST
> interface via an Isis service that internally calls the external
> application...
>
> Regards,
> Kevin
>
> [1] http://techjoomla.com/joomla-extension-news/joomla-rest-api.html