incubator-isis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Haywood <dkhayw...@gmail.com>
Subject Re: a JSON-based RESTful protocol.
Date Sun, 26 Jun 2011 07:03:56 GMT
Hi Mark,
The viewer does use JAX-RS, so I think you slightly misunderstand... the 
discussion is about the format of one of the @PathParams ("oid") in the 
@Path [1]

@Path("/objects")
public class DomainObjectResourceImpl {
     ...
     @GET
     @Path("/{oid}")
     @Produces({ MediaType.APPLICATION_JSON })
     public String object(@PathParam("oid") final String oidStr) { ... }
     ...
}

So the question is, what is the format of the URL hits this resource...  
eg, any of:
* http://localhost:8080/objects/com.mycompany.myapp.Order|123
* http://localhost:8080/objects/ORD|123
* http://localhost:8080/objects/OID:123
* http://localhost:8080/objects/order:123

As I've said, the OID implementation is determined by the configured 
object store, specifically the OidGenerator.  In turn, this has an 
OidStringifier which converts to/from strings.  So, for those that 
really want to, this format can be customised if required.

Cheers
Dan

[1] 
https://svn.apache.org/repos/asf/incubator/isis/trunk/viewer/restful/viewer2/src/main/java/org/apache/isis/viewer/restful/viewer2/resources/objects/DomainObjectResourceImpl.java



On 25/06/2011 19:48, Mark Struberg wrote:
> Agreed. Why not just use JAX-RS (JSR-311). This provides a @Path annotation where you
can specify a different subdirectory in the URL.
>
> LieGrue,
> strub
>
> --- On Sat, 6/25/11, Alexander Krasnukhin<the.malkolm@gmail.com>  wrote:
>
>> From: Alexander Krasnukhin<the.malkolm@gmail.com>
>> Subject: Re: a JSON-based RESTful protocol.
>> To: isis-dev@incubator.apache.org
>> Date: Saturday, June 25, 2011, 1:49 PM
>> I have a very bad bad feeling about
>> assuming all the class names are unique.
>>
>> On Sat, Jun 25, 2011 at 11:58 AM, Robert Matthews<
>> rmatthews@nakedobjects.org>
>> wrote:
>>
>>> I've noticed a similar thing in a help index that I
>> have had to implement
>>> recently.  While starting off with a set of fully
>> qualified class names I
>>> noticed that for the domain classes (where the class
>> was ultimately accessed
>>> by the user) we never used the same name as this would
>> be confusing to the
>>> user. With that in mind we now assume that all the
>> class names are unique so
>>> can safely refer to them using their short names.
>>>
>>> Now as Dan said, these will depend on the OID in
>> question but we might want
>>> to adapt its interface so it can provide both the
>> original internal form and
>>> a suitable user identifiable form.  So in the
>> original example
>>> com.mycompany.Order|123 would be available as
>> Order|123 and Dan's JPA
>>> example, ORD|123 would also become Order|123.
>>>
>>> Regards
>>> Rob
>>>
>>>
>>> On 24/06/11 19:38, Henry Saputra wrote:
>>>
>>>> Hi Dan,
>>>>
>>>> Is there a way to map the actual Java class name
>> for the object such
>>>> as com.mycompany.Order|123 to short name? This
>> will help to make the
>>>> API URL simpler.
>>>>
>>>> I am new with Apache Isis and naked object design
>> but looking forward
>>>> to implement it as prototype for our
>> architecture.
>>>>
>>>> - Henry
>>>>
>>>> On Tue, Jun 14, 2011 at 2:39 PM, Dan Haywood<dkhaywood@gmail.com>
>> wrote:
>>>>> Alexander and I have (off-list) been throwing
>> an idea or two about
>>>>> developing a viewer-agnostic network
>> protocol.  Alexander put a page on
>>>>> the
>>>>> wiki about this a while back [1].
>>>>>
>>>>> My thought are that we could support this
>> using a JSON-based RESTful
>>>>> protocol, perhaps as an extension/evolution of
>> our current Restful viewer
>>>>> (which currently supports only XHTML).
>>>>>
>>>>> With that in mind, I've added a number of
>> pages to the wiki to document
>>>>> what
>>>>> this protocol might look like; [2] is the
>> jumping off point, but see also
>>>>> [3] for details on the typical representation
>> of a domain object.
>>>>> Comments/contributions welcome!
>>>>>
>>>>> Dan
>>>>>
>>>>> [1]
>>>>> https://cwiki.apache.org/**confluence/display/ISIS/**
>>>>> Viewer-agnostic+Network+**Protocol<https://cwiki.apache.org/confluence/display/ISIS/Viewer-agnostic+Network+Protocol>
>>>>> [2] https://cwiki.apache.org/**confluence/display/ISIS/**
>>>>> Restful+Json+Protocol<https://cwiki.apache.org/confluence/display/ISIS/Restful+Json+Protocol>
>>>>> [3] https://cwiki.apache.org/**confluence/display/ISIS/GET+**
>>>>> on+an+Object<https://cwiki.apache.org/confluence/display/ISIS/GET+on+an+Object>
>>>>>
>>>>>
>>>>>
>>>>>
>>
>> -- 
>> Regards,
>> Alexander
>>

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message