JAX-RS and unbound url path

2009-01-26 Thread xasima
I want to write the Resource that will handle the following URL pattern:
openstorage/{version}/{prefix}/{user}/{collection}/{resource}

I wish to use the same Resource even if {resource} is complex. For example to 
server  both 
openstorage/0.1/test/john/bookmarks/cars  (resource=cars, collection=bookmarks)
and 
openstorage/0.1/test/john/bookmarks/cars/lexus (resource=cars/lexus, 
collection=bookmarks)



I'll try to implement this using 
@RestResource
@Path(value=openstorage/{version}/{prefix}/{user}/{collection}/{resource}, 
limited=false)
public class WeaveBasicObjectResource {
 
public WeaveBasicObjectResource(
@PathParam(resource) String resource, 
@PathParam(collection) String collection, 
@PathParam(user) String user, @PathParam(prefix) String prefix, 
@PathParam(version) String version
) {
System.err.println(WBO for resource  + resource + , 
collection  + collection + , user  + user +
, prefix  + prefix + , version  + version); 

}   

.


but it constantly add / symbol to anything except resourc, means it reports 
version=0.1/test and so on (collection=bookmarks/cars). 

I wish to get in resource the cars/lexus only. 

Am i right with uses of limited=false? or how to process this with JAX-RX 
support.

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1055349


Re: Router.attach Patterns

2007-11-08 Thread xasima
Hi, Jerome and Alex. 

What do you think on the implementation:

1) Coocoon map concept
(http://cocoon.apache.org/2.2/core-modules/core/2.2/1376_1_1.html), just to
provide more declarative way to configure URI - Restlets mapping?

2) Internal Restful design of web-application? means to get name for each of the
individual classes/resources/restlet with the help of java5 annotation 
@uri(schema://internal/weatherwidgetresource) 
and use them as individual pipes (POST data to proccess and getTheRepresentation
of the result)

We can use http://smallx.dev.java.net or cocoon maps notation
(http://cocoon.apache.org/2.2/core-modules/core/2.2/853_1_1.html) to provide
info for the coordination of such a pipes / URI. I think that  reasons to do
this are
a) to get all advantages that cocoon offers by providing declarative URI model
and pipeline support
b) do the mentioned actions in distibuted manner, since each pipe can be
deployed in any place of the web (or in scope of your cluster), due to REST
notion of the pipe (GET, POST) and ability to negotiate on the representation
(JAVA_IN_PROCESS, SAX, DOM, or custom one). 


I 'd be pleased to work on such an feature.



 


Re: Newbie question: How to stream data between RESTlets

2007-10-16 Thread xasima
Why no one goes further and proposes the  concrete schema and classes for doing
this?

I really have no great knowledge in the area, so the following is just a some
kind of expectation what we really need to do while elaborating such a system. 

Let we play with HTTP protocol and we have just the only EVENT server that
exposes the following REST interfaces:

1) http://newbie.com/feeds lists the HTML docs with the following information 
div class=feeds
 ul
  li class=feed
   a href=http://newbie.com/feed/msf-17;Medical Sensor Feed # 17/a
  /li
  li class=feed
 a href=http://newbie.com/feed/msf-27;Radio Sensor Feed # 27/a
  /li
   !-- etc --
 /ul
   /div

2)  http://newbie.com/feed/msf-11 lists the stream 
 div class=feed
   This is a feed from span class=sourcea
href=http://newbie.com/feeds;source feed list/a /span   with the name
span class=namehttp://newbie.com/feed/msf-11/span   
  ul
   !-- data in the same manner --
!-- never stop --

When each GET to the service its start propagation of the current EVENT window
to the client. And never stop 

the request GET http://newbie.com/feed/msf-11?n=1500 means 
GET 1500 data items from the feed and refuse connection

GET http://newbie.com/feed/msf-11?t=2007-10-17T21:00Z
Refuse connection near the specified time

GET http://newbie.com/feed/msf-11?e=fastinfoset produce the same content using
some kind of binary encoding to compress 

GET http://newbie.com/feed/msf-11?e=plain
NEED to populate the propose schema data per row / number. So this protocol
would be used only by closed, yours proprietary system that feel ok to do this
in such a manner. No interoperability here. 




3)  I don't know what to set up in Content-length, may be we need to work in the
schema PARTIAL GET (that is uses for download manager). 

4) We need to work with KEEP-ALIVE  HTTP 1/1 switch on and use the  Continuation
feature (Grizzly / AcyncWeb / Jetty) 

5) We need to create an StreamRepresenation class, it's simple, and probably use
the write(WritableChannel) methods to produce content

6) We MAY use the direct NIO transfer of repeatable chunks like
 /a
  /li
  li class=feed
 a href=http://newbie.com/feed/msf-27;  

7) AND at the last we may look through the ability to use the restlet with the
specific protocol for this purpose. I suspect that MINA is the  good way to
connect restlet with to do this easyly.

mmm, do anyone try to use 4th item (Continuation) with restlet?