Re: Jetty integration

2009-07-21 Thread Tony Bigbee
Thanks, Jerome.  After my first posting, I was able to experiment and
resolve this (using 2.0m3).  One thing that slowed me down is that my
IDE automatically created a couple of imports for Server and another
class I no longer remember that were not Restlet classes.  I also
didn't understand that having Jetty in the classpath would mean it was
automatically used as the http server, but discovered that as well.
The XML config file constructor for Component is very handy and I'm
using that right now.


On Mon, Jul 20, 2009 at 12:30 PM, Jerome
Louveljerome.lou...@noelios.com wrote:
 Hi Tony,

 Do you have the org.restlet.ext.jetty.jar and all its dependencies (see
 the lib/readme.txt file) in your classpath? If so, it should be detected
 by the engine and used instead of the internal HTTP server. There is really
 nothing much to do... Which version of Restlet are you using?

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


Re: Guidance on Atom/APP in Restlet

2009-07-21 Thread Hendy Irawan
Hi Tim,

The biggest APP user I know is Google, with practically all of its API
using the Google Data (GData) protocol. It's basically a extended
version of APP, most due to practicality reasons prevailing over
idealistic (i.e. pure APP).

GData puts some extensive stress testing on APP, i.e. Using advanced
features such as querying and returning different serialization
formats not just Atom+XML, but manages to adhere to fundamental
principles of APP.

Aside from Google's own proprietary auth mechanism (which I think
can be replaced with Oauth for general masses), I think Google's use
of GData/APP is a good example of APP in the real world.

On 7/18/09, Tim Peierls t...@peierls.net wrote:
 Some rambling newbie Restlet design questions:

 Background: I'm in the preliminary stages of a ground-up redesign of an
 existing non-Restlet application. I'm (naturally) convinced that Restlet is
 the way to go for this redesign, and I'm pretty sure I want the UI to be
 GWT-based. So far so good ... GWT-Restlet is alive and well. (And I'll get
 cracking on a Restlet-Guice extension before too long, or not, depending on
 how you define too.)

 My analysis of the existing application keeps leading me to the Atom
 Publishing Protocol, because the key elements of that application feel
 like collections of publishable/updatable resources (and collections of such
 collections). It doesn't fit the canonical examples of APP, however, which
 leads to my first questions: Does anyone know of APP being used successfully
 outside of the usual document/news item examples that everyone uses to
 explain it? If so, what criteria would you use to determine whether APP is
 really appropriate to my resource design?

 I'm sort of hoping the answer is a resounding yes to this, in which case my
 second question is: If I want to design my application around APP but I
 don't intend to use a file-based storage system like eXist, what does
 Atomojo have for me that the Restlet Atom extension doesn't? Is there
 something else that I should know about?

 --tim

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

-- 
Sent from my mobile device

Best regards,
Hendy Irawan
http://www.hendyirawan.com/ :: he...@soluvas.com

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


RE: Help!

2009-07-21 Thread Jerome Louvel
Hi Schley,

Could you send us your project (or a snippet reproducing the issue) and
Restlet environment details (version, OS, etc.)? It should definitely work.

BTW, I suggest that you use more meaningful email title when you post,
easier for tracking and searching in the archives.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com



-Message d'origine-
De : Schley Andrew Kutz [mailto:sak...@gmail.com] 
Envoyé : mardi 14 juillet 2009 21:52
À : discuss@restlet.tigris.org
Objet : Help!

The StringRepresentation returned by 'public Representation handle()'  
is no longer appearing in the browser when I access my server.

Here is an example:

@Override
 public Representation handle()
 {
 if (true) return new StringRepresentation(Hello, world.);
 ...

That should ALWAYS trump any other logic and show Hell, world. in the  
browser. Was a bug introduced to the Maven snapshot? Or do you think I  
could have farked myself somehow.

-- 
-a

Ideally, a code library must be immediately usable by naive  
developers, easily customized by more sophisticated developers, and  
readily extensible by experts. -- L. Stein

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

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


RE: Question about 'org.restlet.engine.Engine.registerHelper(ClassLoader, URL, List, Class)'

2009-07-21 Thread Jerome Louvel
Hi Marcelo,

Looking at the code in Engine#registerHelper, it appears that the class
instantiation is protected by a try/catch block for Exception. It should
catch the classnotfound exception, log it and continue with the next helper
declared in the 'META-INF/services/org.restlet.engine.ServerHelper' file.

Maybe you were worried by the log messages (SEVERE level)? I just refactored
this logic in SVN trunk to log such errors at the INFO level instead and
split the registerHelper method in two for easier maintenance. 

Let me know if I missed something.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Marcelo Paternostro [mailto:marce...@ca.ibm.com] 
Envoyé : vendredi 17 juillet 2009 01:55
À : discuss@restlet.tigris.org
Objet : Question about
'org.restlet.engine.Engine.registerHelper(ClassLoader, URL, List, Class)'

Hi, 

I am starting to use restlet. The framework seems impressive but
unfortunately I have just spent +5hrs trying to get it to run on my
environment. Hopefully this is just my personal christening and everything
will go smooth from now on ;-)

My environment is:

- Eclipse 3.5
- The Jetty support offered by Eclipse

So I've added all 'org.mortbay.jetty.*' bundles that come with Eclipse plus
'org.restlet.ext.jetty' to the class path and run the basic restlet example
just to see it dying in a NoClassDefFoundError agony.

After a lot of digging, I understood the problem:
'org.restlet.ext.jetty.jar!/META-INF/services/org.restlet.engine.ServerHelpe
r' declares 3 helpers (AJP, HTTP, HTTPS) and Eclipse has support for only
one of them (HTTP). So when the method in the subject tries to load the
other helper classes (for AJP and HTTPS), everything breaks down due to the
fact that their dependencies are not in the class path.

I manage to hack a workaround by overriding the referred method to ensure
that only the HTTP helper is registered. Everything seems to be working fine
now. I have 2 question though:

1.
Can anyone foresee a problem on my approach (other than not having AJP and
HTTPS)?

2.
On my code I am requesting a HTTP server via
'component.getServers().add(Protocol.HTTP, 80)'. Since I am only interested
on this protocol, does it make sense for the registerHelper method to fail
because of things that I am not using? Would it make sense to make it a bit
more resilient and let the problem surface when the client code asks for a
protocol that was not registered?

Thanks in advance. I hope I will soon be able to help others.

Cheers,
Marcelo Paternostro

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

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


RE: Re: REST in mobiles

2009-07-21 Thread Jerome Louvel
Hi Abdul,

Restlet only works with Android on mobile phones, not J2ME.

One way to make a phone acts as a Web server is to send request as special
SMS messages. See related RFE:

Add SMS server for Android
http://restlet.tigris.org/issues/show_bug.cgi?id=828

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : feda abdul [mailto:o...@hotmail.com] 
Envoyé : vendredi 17 juillet 2009 20:03
À : discuss@restlet.tigris.org
Objet : RE: Re: REST in mobiles

But I tried to run the simple hello World on mobile but I got problem that
is getrVariants.add(new Variant MediaType.TEXT_PLAIN)) is not supported by
J2me! How can I solve this problem

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

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


RE: Addition Function

2009-07-21 Thread Jerome Louvel
Hi Abdul,

I suggest that you start with the first steps tutorial:
http://www.restlet.org/documentation/2.0/firstSteps

Adjusting it to do some computation should be trivial.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com




-Message d'origine-
De : feda abdul [mailto:o...@hotmail.com] 
Envoyé : dimanche 19 juillet 2009 09:25
À : discuss@restlet.tigris.org
Objet : Addition Function

How to implement a simple web service that performs simple calculation such
as taking two integers from the client, sum them and sending back the
result.Thanks in advance.

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

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


RE: Receive a multipart HTTP response

2009-07-21 Thread Jerome Louvel
Hi Evgeny,

 

Restlet doesn’t have built-in support for multipart representation yet. This
is planned however:

 

“Support composite representations”

http://restlet.tigris.org/issues/show_bug.cgi?id=71

 

However, it is possible to parse progressively with the Restlet FileUpload
extension. See the related doc:

http://commons.apache.org/fileupload/streaming.html

 

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~  http://www.restlet.org/
http://www.restlet.org
Noelios Technologies ~ Co-founder ~  http://www.noelios.com/
http://www.noelios.com

 

 

 

De : Evgeny Shepelyuk [mailto:eshepel...@gmail.com] 
Envoyé : lundi 20 juillet 2009 23:12
À : discuss@restlet.tigris.org
Objet : Re: Receive a multipart HTTP response

 

1. FileUpload doesn't support multipart/mixed 
2. I need HTTP not XMPP 
3. Seems restlet don't have any support for parsing  multipart/mixed
response 
4. The problem can be solved with MimePull from Glasshfish or any 
similar library. Probably mime4j from James project.

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

RE: Guidance on Atom/APP in Restlet

2009-07-21 Thread Jerome Louvel
Hi Henry,

I was about to answer the same thing. In addition to Google, Microsoft is
making a heavy use of Atom as well in its ADO.NET Data Services (ex-Astoria)
technology:

Overview: ADO.NET Data Services
http://msdn.microsoft.com/en-us/data/bb931106.aspx?ppud=4

However, for communication with GWT, it is indeed a better idea to rely on
JSON. I have also been working on reusing the 'transparent' serialization of
beans between Restlet/Server and Restlet/GWT. This serialization is used in
GWT-RPC but can be reused in a RESTful way. This isn't quite ready yet, but
hopefully for Restlet 2.0 M4, I'll have something more stable.

As David mentioned, this could be complementary to exposing Atom
representations of your resources. Finally, I'm not sure if you need to
support the full AtomPub standard or just the Atom XML one. 

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Hendy Irawan [mailto:he...@soluvas.com] 
Envoyé : lundi 20 juillet 2009 17:54
À : discuss@restlet.tigris.org
Objet : Re: Guidance on Atom/APP in Restlet

Hi Tim,

The biggest APP user I know is Google, with practically all of its API
using the Google Data (GData) protocol. It's basically a extended
version of APP, most due to practicality reasons prevailing over
idealistic (i.e. pure APP).

GData puts some extensive stress testing on APP, i.e. Using advanced
features such as querying and returning different serialization
formats not just Atom+XML, but manages to adhere to fundamental
principles of APP.

Aside from Google's own proprietary auth mechanism (which I think
can be replaced with Oauth for general masses), I think Google's use
of GData/APP is a good example of APP in the real world.

On 7/18/09, Tim Peierls t...@peierls.net wrote:
 Some rambling newbie Restlet design questions:

 Background: I'm in the preliminary stages of a ground-up redesign of an
 existing non-Restlet application. I'm (naturally) convinced that Restlet
is
 the way to go for this redesign, and I'm pretty sure I want the UI to be
 GWT-based. So far so good ... GWT-Restlet is alive and well. (And I'll get
 cracking on a Restlet-Guice extension before too long, or not, depending
on
 how you define too.)

 My analysis of the existing application keeps leading me to the Atom
 Publishing Protocol, because the key elements of that application feel
 like collections of publishable/updatable resources (and collections of
such
 collections). It doesn't fit the canonical examples of APP, however, which
 leads to my first questions: Does anyone know of APP being used
successfully
 outside of the usual document/news item examples that everyone uses to
 explain it? If so, what criteria would you use to determine whether APP is
 really appropriate to my resource design?

 I'm sort of hoping the answer is a resounding yes to this, in which case
my
 second question is: If I want to design my application around APP but I
 don't intend to use a file-based storage system like eXist, what does
 Atomojo have for me that the Restlet Atom extension doesn't? Is there
 something else that I should know about?

 --tim

 --

http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23721
42

-- 
Sent from my mobile device

Best regards,
Hendy Irawan
http://www.hendyirawan.com/ :: he...@soluvas.com

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

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


Re: Receive a multipart HTTP response

2009-07-21 Thread Evgeny Shepelyuk
Hello !

I've tried to use commons-fileupload and it's not parsing  
multipart/x-mixed-replace content type.
I tried both directly with commons-fileupload and with restlet extension.

Commons-fileupload supports only multipart/form-data and correponding RFC  
1867.
All others ain't supported  according to users' reviews
and actually other RFCs ain't declared as suppored by commons-fileupload  
team.

Please note again. In my case i don't upload files, i have server-side  
HTTP push from digital camera stream.

However i was able to easily solve my problem using mimepull library from  
Glasshfish project.


 Hi Evgeny,


 Restlet doesn’t have built-in support for multipart representation yet.  
 This
 is planned however:


 “Support composite representations”

 http://restlet.tigris.org/issues/show_bug.cgi?id=71


 However, it is possible to parse progressively with the Restlet  
 FileUpload
 extension. See the related doc:

 http://commons.apache.org/fileupload/streaming.html


 Best regards,
 Jerome Louvel
 --
 Restlet ~ Founder and Lead developer ~  http://www.restlet.org/
 http://www.restlet.org
 Noelios Technologies ~ Co-founder ~  http://www.noelios.com/
 http://www.noelios.com




 De : Evgeny Shepelyuk [mailto:eshepel...@gmail.com]
 Envoyé : lundi 20 juillet 2009 23:12
 À : discuss@restlet.tigris.org
 Objet : Re: Receive a multipart HTTP response


 1. FileUpload doesn't support multipart/mixed
 2. I need HTTP not XMPP
 3. Seems restlet don't have any support for parsing  multipart/mixed
 response
 4. The problem can be solved with MimePull from Glasshfish or any
 similar library. Probably mime4j from James project.

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



-- 
Regards,
Evgeny Shepelyuk

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


RE: Wikipedia Restlet entry

2009-07-21 Thread Jerome Louvel
Hi guys,

 

Thanks for updating this entry. I’ve been reluctant to touch it so far, as I
think it should provide a neutral presentation of Restlet. So, it would be
better if the Restlet users could maintain it.

 

However, I’ll be happy to read and comment. For example, I noticed that the
new EPL 1.0 licensing option isn’t mentioned. Regarding the history, the
development started in 2005 with a first public release in December 2005
(instead of 2006). I have a couple more article pointers to add if
necessary.

 

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~  http://www.restlet.org/
http://www.restlet.org
Noelios Technologies ~ Co-founder ~  http://www.noelios.com/
http://www.noelios.com

 

 

 

 

De : Aron Roberts [mailto:a...@socrates.berkeley.edu] 
Envoyé : lundi 20 juillet 2009 21:04
À : discuss@restlet.tigris.org
Objet : Re: Wikipedia Restlet entry

 

In the message Wikipedia Restlet entry, dated 2009-07-20, Rob Heittman
wrote:

 

Stumbled across this: http://en.wikipedia.org/wiki/Restlet

Currently on probation for not meeting notability standards.  Anybody else
(Jerome, Thierry) want to volunteer with me to help doctor up the entry and
provide relevant citations?  Any Restleters with good Wikipedia karma would
be welcome too.

 

  Many thanks for pointing this out, Rob.

 

  I've made a few, very minor updates to that Wikipedia page today as a
starting point, and to encourage others to jump in. :-)

 

Aron Roberts  Information Services and Technology . Warren Hall, 2195 Hearst
  University of California, Berkeley, CA 94720-4876 USA
  a...@socrates.berkeley.edu . +1 510-642-5974 . fax
510-643-5385
  http://purl.org/net/aron

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

RE: Credentials

2009-07-21 Thread Jerome Louvel
Hi there,

Have a look at org.restlet.data.Request#getChallengeResponse() or
ServerResource#getChallengeResponse().

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : restletuser [mailto:jeanjov...@yahoo.com] 
Envoyé : mercredi 15 juillet 2009 17:41
À : discuss@restlet.tigris.org
Objet : Credentials

I am a newbie using restlet framework. I would like to know how the user
credentials can be passed to the resource for GET, POST, PUT operations. Can
someone give insight on to this.
-- 
View this message in context:
http://n2.nabble.com/Credentials-tp3263991p3263991.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

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


RE: Setting custom HTTP headers and ATOM feeds

2009-07-21 Thread Jerome Louvel
Hi Dyaa,

Regarding the Atom issue, we have recently fixed them. I suggest trying
again with a Restlet 2.0 snapshot (unstable) until we release 2.0 M4.

Regarding the additional HTTP headers, it is possible to define them. See
this method on Request/Response:
http://www.restlet.org/documentation/2.0/api/org/restlet/data/Message.html#g
etAttributes%28%29

You just need to use the org.restlet.http.headers key like this:

Form extraHeaders = new Form();
extraHeaders.add(myHeaderName, myHeaderValue);
request.getAttributes().put(org.restlet.http.headers,
extraHeaders);

Let us know if anything is missing.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Dyaa Albakour [mailto:dyaa.albak...@aws.net] 
Envoyé : vendredi 17 juillet 2009 17:24
À : discuss@restlet.tigris.org
Objet : Setting custom HTTP headers and ATOM feeds

Dear all,

I am trying to use a Restlet HTTP client to connect to the Azure Storage
service. Restlet seems to be the best options as it implements the Micosoft
shared key authentication scheme.

However I got stuck for two reasons. Restlet doesn't allow you to add custom
HTTP request headers which is necessary for some of the Azure services. Also
the ATOM feed extension doesn't support XML content. It will always treat
the content as text(that's what I found when I looked into the source code,
please see org.restlet.ext.atom.Content.java#writeElement)

Is that 100% correct? Any ideas/thoughts?

Many Thanks

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

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


RE: Re: Accept header sent by the client not being taken into account (2.0 snapshot from July 9th, 2009)

2009-07-21 Thread Jerome Louvel
Hi Tal,

Could you send us a Zip of your test project so we can debug?

Of the three option, only @Get(xml) is valid. It should expose both
text/xml and application/xml variants automatically. The logic you added
in doInit() shouldn't be necessary. 

See the attached sample code which works for me.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Tal Friedman [mailto:tfried...@gmail.com] 
Envoyé : samedi 18 juillet 2009 02:22
À : discuss@restlet.tigris.org
Objet : RE: Re: Accept header sent by the client not being taken into
account (2.0 snapshot from July 9th, 2009)

I've been having the same problem as Fabian.  The annotation way of doing
things is still not working for me, and I'm getting strange results with
manually specifying the variants.

I'm running the snapshot I downloaded yesterday
(Engine.VERSION_HEADER=Noelios-Restlet-Engine/2.0snapshot)

I get a 406 error when I try the annotation approach.

Specifically the url:

http://localhost:8080/world.xml does NOT work
http://localhost:8080/world.json  WORKS!

I've tried @Get(xml)  @Get(application/xml) and @Get(text/xml) and
none of them work.

Meanwhile Get(json) is working.


If I try overriding doInit like this:

ListVariant variants = new ArrayListVariant();
variants.add(new Variant(MediaType.APPLICATION_JSON));
variants.add(new Variant(MediaType.APPLICATION_XML));
/*variants.add(new Variant(MediaType.TEXT_XML));
*/  getVariants().put(Method.GET, variants);

I also get a 406 Error for the URL ending in .xml (again, json works).

Finally, if I uncomment out the line that adds text/xml as a variant, it
works.

Here is the header firefox is sending:

Hostlocalhost:8080
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11)
Gecko/2009060215 Firefox/3.0.11
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-gb,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive  300
Connection  keep-alive


So:

1) Any ideas why the annotations are not working for the xml extension?
2) Why does the code only work for text/xml and not application/xml
(especially since the browser specifies in it's accept header that it
accepts application/xml but NOT text/xml) if I manually specify media
types for GET?


Thanks,
T

 Hello Fabian,
 
 Actually your resource does not declare the kind of variants it is able 
 to generate.
 
 So I indicate two ways to achieve what need according to the current 
 state of the code.
 
 Either, you create one annotated method per each supported variant:
 @Get(html)
 public Representation toHtml(){
 }
 
 where the parameter is the extension declared for the corresponding 
 media type (see the MetadataService class).
 
 Or you declare them manually in the doInit method :
 ListVariant variants = new ArrayListVariant();
 variants.add(new Variant(MediaType.TEXT_HTML));
 variants.add(other variant);
 getVariants().put(Method.GET, variants);
 In addition, remove the @Get annotation and rename the represent 
 method to get (the represent method has been removed)
 
 I hotpe this will help you.
 
 Best regards,
 Thierry Boileau
 
  Hello there,
 
  still with my content negotiation issues (which worked great and
  simple in restlet 1.1.x series, I've just checked the Variant's media
  type and acted according to its value, which just matched the client's
  expectations...)
 
  I've downloaded 2.0 snapshot from yesterday (July 9th, 2009) and
  changed jars in my project (currently,
  org.apache.commons.fileupload.jar,
  org.restlet.ext.fileupload.jar, org.restlet.ext.xml.jar and
  org.restlet.jar), recompiled and rerun the jar (I was using 2.0M3)
 
  Now, when I connect with my browser (Firefox 3.0) it sends the
  following Accept header:
  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 
  The method accepting that request starts like this:
 
  @Get
  public Representation represent(Variant variant) throws
ResourceException {
  long lstart = System.currentTimeMillis();
  MediaType mt = variant.getMediaType();
  getLogger().info( MediaType =  + mt);
 
  The idea is to have the method return the corresponding representation
  according to the media type specified in the Variant, which I
  understand comes from the request and the Accept header. However, even
  with the above Accept header, I get the following output:
 
  Jul 10, 2009 10:20:49 AM com.calenco.resource.WorkspacesResource
represent
  INFO:  MediaType = */*
  Jul 10, 2009 10:20:49 AM com.calenco.resource.WorkspacesResource
represent
  INFO: Request processed in 0.045 sec.
  Jul 10, 2009 10:20:49 AM org.restlet.engine.log.LogFilter afterHandle
  INFO: 2009-07-1010:20:490:0:0:0:0:0:0:1 -   -   8182
GET 

Re: Wikipedia Restlet entry

2009-07-21 Thread Rob Heittman
I agree you should avoid it, they get grumpy about that.  Anyone know of any
Restlet coverage in main stream media or other citable support for
notability?

On Tue, Jul 21, 2009 at 4:47 AM, Jerome Louvel jerome.lou...@noelios.comwrote:

  Hi guys,



 Thanks for updating this entry. I’ve been reluctant to touch it so far, as
 I think it should provide a neutral presentation of Restlet. So, it would be
 better if the Restlet users could maintain it.



 However, I’ll be happy to read and comment. For example, I noticed that the
 new EPL 1.0 licensing option isn’t mentioned. Regarding the history, the
 development started in 2005 with a first public release in December 2005
 (instead of 2006). I have a couple more article pointers to add if
 necessary.



 Best regards,
 Jerome Louvel
 --
 Restlet ~ Founder and Lead developer ~ http://www.restlet.org
 Noelios Technologies ~ Co-founder ~ http://www.noelios.com









 *De :* Aron Roberts [mailto:a...@socrates.berkeley.edu]
 *Envoyé :* lundi 20 juillet 2009 21:04
 *À :* discuss@restlet.tigris.org
 *Objet :* Re: Wikipedia Restlet entry



 In the message Wikipedia Restlet entry, dated 2009-07-20, Rob Heittman
 wrote:



 Stumbled across this: http://en.wikipedia.org/wiki/Restlet

  Currently on probation for not meeting notability standards.  Anybody
 else (Jerome, Thierry) want to volunteer with me to help doctor up the entry
 and provide relevant citations?  Any Restleters with good Wikipedia karma
 would be welcome too.



   Many thanks for pointing this out, Rob.



   I've made a few, very minor updates to that Wikipedia page today as a
 starting point, and to encourage others to jump in. :-)



 Aron Roberts  Information Services and Technology . Warren Hall, 2195
 Hearst
   University of California, Berkeley, CA 94720-4876 USA
   a...@socrates.berkeley.edu . +1 510-642-5974 . fax
 510-643-5385
   http://purl.org/net/aron


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

Re: Guidance on Atom/APP in Restlet

2009-07-21 Thread Tim Peierls
Thanks -- I was particularly interested in the Google Calendar Data API, but
I'd be rolling my own implementation, right?
--tim

On Mon, Jul 20, 2009 at 11:53 AM, Hendy Irawan he...@soluvas.com wrote:

 Hi Tim,

 The biggest APP user I know is Google, with practically all of its API
 using the Google Data (GData) protocol. It's basically a extended
 version of APP, most due to practicality reasons prevailing over
 idealistic (i.e. pure APP).

 GData puts some extensive stress testing on APP, i.e. Using advanced
 features such as querying and returning different serialization
 formats not just Atom+XML, but manages to adhere to fundamental
 principles of APP.

 Aside from Google's own proprietary auth mechanism (which I think
 can be replaced with Oauth for general masses), I think Google's use
 of GData/APP is a good example of APP in the real world.

 On 7/18/09, Tim Peierls t...@peierls.net wrote:
  Some rambling newbie Restlet design questions:
 
  Background: I'm in the preliminary stages of a ground-up redesign of an
  existing non-Restlet application. I'm (naturally) convinced that Restlet
 is
  the way to go for this redesign, and I'm pretty sure I want the UI to be
  GWT-based. So far so good ... GWT-Restlet is alive and well. (And I'll
 get
  cracking on a Restlet-Guice extension before too long, or not, depending
 on
  how you define too.)
 
  My analysis of the existing application keeps leading me to the Atom
  Publishing Protocol, because the key elements of that application feel
  like collections of publishable/updatable resources (and collections of
 such
  collections). It doesn't fit the canonical examples of APP, however,
 which
  leads to my first questions: Does anyone know of APP being used
 successfully
  outside of the usual document/news item examples that everyone uses to
  explain it? If so, what criteria would you use to determine whether APP
 is
  really appropriate to my resource design?
 
  I'm sort of hoping the answer is a resounding yes to this, in which case
 my
  second question is: If I want to design my application around APP but I
  don't intend to use a file-based storage system like eXist, what does
  Atomojo have for me that the Restlet Atom extension doesn't? Is there
  something else that I should know about?
 
  --tim
 
  --
 
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2372142

 --
 Sent from my mobile device

 Best regards,
 Hendy Irawan
 http://www.hendyirawan.com/ :: he...@soluvas.com

 --

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


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

RE: Wikipedia Restlet entry

2009-07-21 Thread Jerome Louvel
Rob,

 

Sounds like a good approach indeed. 

 

To answer your question about press coverage, here are two pointers from InfoQ:

http://www.infoq.com/restlet

 

Two from eWeek:

http://www.eweek.com/c/a/Application-Development/Restlet-Engine-Reaches-10/

http://www.eweek.com/c/a/Application-Development/Java-Project-Founder-Outlines-Benefits-of-Restlet/

 

One from ComputerWeekly:

http://www.computerweekly.com/Articles/2006/09/12/218314/open-tool-makes-it-easier-to-develop-web-services.htm

 

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~  http://www.restlet.org/ 
http://www.restlet.org
Noelios Technologies ~ Co-founder ~  http://www.noelios.com/ 
http://www.noelios.com

 

 

 

De : Rob Heittman [mailto:rob.heitt...@solertium.com] 
Envoyé : mardi 21 juillet 2009 14:15
À : discuss@restlet.tigris.org
Objet : Re: Wikipedia Restlet entry

 

I agree you should avoid it, they get grumpy about that. Anyone know of any 
Restlet coverage in main stream media or other citable support for notability?

On Tue, Jul 21, 2009 at 4:47 AM, Jerome Louvel jerome.lou...@noelios.com 
wrote:

Hi guys,

Thanks for updating this entry. Ive been reluctant to touch it so far, as I 
think it should provide a neutral presentation of Restlet. So, it would be 
better if the Restlet users could maintain it.

However, Ill be happy to read and comment. For example, I noticed that the new 
EPL 1.0 licensing option isnt mentioned. Regarding the history, the development 
started in 2005 with a first public release in December 2005 (instead of 2006). 
I have a couple more article pointers to add if necessary.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~  http://www.restlet.org/ 
http://www.restlet.org
Noelios Technologies ~ Co-founder~  http://www.noelios.com/ 
http://www.noelios.com

De: Aron Roberts [mailto:a...@socrates.berkeley.edu] 
Envoy頺 lundi 20 juillet 2009 21:04
: discuss@restlet.tigris.org
Objet: Re: Wikipedia Restlet entry

In the message Wikipedia Restlet entry, dated 2009-07-20, Rob Heittman wrote:

Stumbled across this: http://en.wikipedia.org/wiki/Restlet

Currently on probation for not meeting notability standards. Anybody else 
(Jerome, Thierry) want to volunteer with me to help doctor up the entry and 
provide relevant citations? Any Restleters with good Wikipedia karma would be 
welcome too.

Many thanks for pointing this out, Rob.

I've made a few, very minor updates to that Wikipedia page today as a starting 
point, and to encourage others to jump in. :-)

Aron Roberts Information Services and Technology . Warren Hall, 2195 Hearst
University of California, Berkeley, CA 94720-4876 USA
a...@socrates.berkeley.edu . +1 510-642-5974 . fax 510-643-5385
http://purl.org/net/aron

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

Re: Guidance on Atom/APP in Restlet

2009-07-21 Thread Tim Peierls
On Tue, Jul 21, 2009 at 4:39 AM, Jerome Louvel jerome.lou...@noelios.comwrote:

 However, for communication with GWT, it is indeed a better idea to rely on
 JSON. I have also been working on reusing the 'transparent' serialization
 of
 beans between Restlet/Server and Restlet/GWT. This serialization is used in
 GWT-RPC but can be reused in a RESTful way. This isn't quite ready yet, but
 hopefully for Restlet 2.0 M4, I'll have something more stable.


I've already said that this is very cool, but it does make we wonder ...
Isn't this sort of, um, cheating? A representation that is coupled to a
particular client/service pair? Another few steps over the edge and we're
back to RPC-style services.

I guess the saving grace is that Restlet makes it easy, or even trivial, to
provide other representations in addition to the one that's optimized for
common use, and RPC-style frameworks can't offer that at all.




 As David mentioned, this could be complementary to exposing Atom
 representations of your resources. Finally, I'm not sure if you need to
 support the full AtomPub standard or just the Atom XML one.


Hmm, the wind is going out of my sails. I started by recognizing that
AtomPub seemed to be a natural fit for my domain, and now I'm looking at
JSON/serialized beans and optional plain Atom feeds. (Optional in the
sense that my main applications wouldn't need them,  because they'd be
happily talking JSON.)

Anybody have anything encouraging to say about why I shouldn't just stick
with my existing DWR application? (www.directwebremoting.org)

--tim

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

Re: Guidance on Atom/APP in Restlet

2009-07-21 Thread Tim Peierls
Do the Java Client libraries for the Google Data APIs run under GWT? I can't
find any indication one way or the other.
It'd be cool if they did, though.

--tim

On Tue, Jul 21, 2009 at 8:29 AM, Tim Peierls t...@peierls.net wrote:

 Thanks -- I was particularly interested in the Google Calendar Data API,
 but I'd be rolling my own implementation, right?
 --tim


 On Mon, Jul 20, 2009 at 11:53 AM, Hendy Irawan he...@soluvas.com wrote:

 Hi Tim,

 The biggest APP user I know is Google, with practically all of its API
 using the Google Data (GData) protocol. It's basically a extended
 version of APP, most due to practicality reasons prevailing over
 idealistic (i.e. pure APP).

 GData puts some extensive stress testing on APP, i.e. Using advanced
 features such as querying and returning different serialization
 formats not just Atom+XML, but manages to adhere to fundamental
 principles of APP.

 Aside from Google's own proprietary auth mechanism (which I think
 can be replaced with Oauth for general masses), I think Google's use
 of GData/APP is a good example of APP in the real world.

 On 7/18/09, Tim Peierls t...@peierls.net wrote:
  Some rambling newbie Restlet design questions:
 
  Background: I'm in the preliminary stages of a ground-up redesign of an
  existing non-Restlet application. I'm (naturally) convinced that Restlet
 is
  the way to go for this redesign, and I'm pretty sure I want the UI to be
  GWT-based. So far so good ... GWT-Restlet is alive and well. (And I'll
 get
  cracking on a Restlet-Guice extension before too long, or not, depending
 on
  how you define too.)
 
  My analysis of the existing application keeps leading me to the Atom
  Publishing Protocol, because the key elements of that application feel
  like collections of publishable/updatable resources (and collections of
 such
  collections). It doesn't fit the canonical examples of APP, however,
 which
  leads to my first questions: Does anyone know of APP being used
 successfully
  outside of the usual document/news item examples that everyone uses to
  explain it? If so, what criteria would you use to determine whether APP
 is
  really appropriate to my resource design?
 
  I'm sort of hoping the answer is a resounding yes to this, in which case
 my
  second question is: If I want to design my application around APP but I
  don't intend to use a file-based storage system like eXist, what does
  Atomojo have for me that the Restlet Atom extension doesn't? Is there
  something else that I should know about?
 
  --tim
 
  --
 
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2372142

 --
 Sent from my mobile device

 Best regards,
 Hendy Irawan
 http://www.hendyirawan.com/ :: he...@soluvas.com

 --

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




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

Re: Wikipedia Restlet entry

2009-07-21 Thread Rob Heittman
Thanks, that was helpful to make a start.

On Tue, Jul 21, 2009 at 8:41 AM, Jerome Louvel jerome.lou...@noelios.comwrote:

  Rob,



 Sounds like a good approach indeed.



 To answer your question about press coverage, here are two pointers from
 InfoQ:

 http://www.infoq.com/restlet



 Two from eWeek:

 http://www.eweek.com/c/a/Application-Development/Restlet-Engine-Reaches-10/


 http://www.eweek.com/c/a/Application-Development/Java-Project-Founder-Outlines-Benefits-of-Restlet/



 One from ComputerWeekly:


 http://www.computerweekly.com/Articles/2006/09/12/218314/open-tool-makes-it-easier-to-develop-web-services.htm



 Best regards,
 Jerome Louvel
 --
 Restlet ~ Founder and Lead developer ~ http://www.restlet.org
 Noelios Technologies ~ Co-founder ~ http://www.noelios.com







 *De :* Rob Heittman [mailto:rob.heitt...@solertium.com]
 *Envoyé :* mardi 21 juillet 2009 14:15
 *À :* discuss@restlet.tigris.org
 *Objet :* Re: Wikipedia Restlet entry



 I agree you should avoid it, they get grumpy about that. Anyone know of any
 Restlet coverage in main stream media or other citable support for
 notability?

 On Tue, Jul 21, 2009 at 4:47 AM, Jerome Louvel jerome.lou...@noelios.com
 wrote:

 Hi guys,

 Thanks for updating this entry. Ive been reluctant to touch it so far, as I
 think it should provide a neutral presentation of Restlet. So, it would be
 better if the Restlet users could maintain it.

 However, Ill be happy to read and comment. For example, I noticed that the
 new EPL 1.0 licensing option isnt mentioned. Regarding the history, the
 development started in 2005 with a first public release in December 2005
 (instead of 2006). I have a couple more article pointers to add if
 necessary.

 Best regards,
 Jerome Louvel
 --
 Restlet ~ Founder and Lead developer ~ http://www.restlet.org
 Noelios Technologies ~ Co-founder~ http://www.noelios.com

 *De:* Aron Roberts [mailto:a...@socrates.berkeley.edu]
 *Envoy**頺* lundi 20 juillet 2009 21:04
 *:* discuss@restlet.tigris.org
 *Objet:* Re: Wikipedia Restlet entry

 In the message Wikipedia Restlet entry, dated 2009-07-20, Rob Heittman
 wrote:

 Stumbled across this: http://en.wikipedia.org/wiki/Restlet

  Currently on probation for not meeting notability standards. Anybody else
 (Jerome, Thierry) want to volunteer with me to help doctor up the entry and
 provide relevant citations? Any Restleters with good Wikipedia karma would
 be welcome too.

  Many thanks for pointing this out, Rob.

 I've made a few, very minor updates to that Wikipedia page today as a
 starting point, and to encourage others to jump in. :-)

 Aron Roberts Information Services and Technology . Warren Hall, 2195 Hearst
 University of California, Berkeley, CA 94720-4876 USA
 a...@socrates.berkeley.edu . +1 510-642-5974 . fax 510-643-5385
 http://purl.org/net/aron




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

Getting POST parameters out of request

2009-07-21 Thread webpost
How is this possible?

I'm using Apache HTTPClient to make a POST request, but at my resource are no 
parameters set (else the one parsed into the url).
Isn't it possible to make a POST request without using Restlet and putting the 
post object into a Representation object?

I'm using 2.0-M3.

Thanks,

Adrian

Sorry for posting twice, as I didn't noticed if the message was send or not.

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


Getting POST parameters out of request

2009-07-21 Thread webpost
How is this possible?

I'm using Apache HTTPClient to make a POST request, but at my resource are no 
parameters set (else the one parsed into the url).
Isn't it possible to make a POST request without using Restlet and putting the 
post object into a Representation object?

I'm using 2.0-M3.

Thanks,

Adrian

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


RE: Problem configuring spring ext in 2.0M3

2009-07-21 Thread webpost
If anyone else has this problem, I got SpringBeanRouter working by making my 
own subclass, like so: http://pastie.org/553359

I guess this should really go into SpringBeanRouter and SpringBeanFinder, so if 
the maintainers of the spring extension would like I can post a patch with some 
unit tests.

Hope this helps someone,
Ryan Hoegg

 Hello, I am trying to use RestletFrameworkServlet with 2.0M3 and have not 
 been able to get anything other than 404.  The servlet mapping works fine, 
 but neither SpringRouter nor SpringBeanRouter has worked for me.
 
 My latest spring config is here: http://pastie.org/550641
 
 I was debugging using SpringFinder and SpringBeanFinder, and kept ending up 
 in Finder.handle with a null getTargetClass(), which prevented me from 
 getting any further.  I think.
 
 Any pointers?
 
 Thanks,
 Ryan Hoegg

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


RE: Re: REST in mobiles

2009-07-21 Thread webpost
Hi, Thank you for your response How about JSR300 and jersey does it work with 
mobiles?

 Hi Abdul,
 
 Restlet only works with Android on mobile phones, not J2ME.
 
 One way to make a phone acts as a Web server is to send request as special
 SMS messages. See related RFE:
 
 Add SMS server for Android
 http://restlet.tigris.org/issues/show_bug.cgi?id=828
 
 Best regards,
 Jerome Louvel
 --
 Restlet ~ Founder and Lead developer ~ http://www.restlet.org
 Noelios Technologies ~ Co-founder ~ http://www.noelios.com
 
 
 -Message d'origine-
 De : feda abdul [mailto:o...@hotmail.com] 
 Envoyé : vendredi 17 juillet 2009 20:03
 À : discuss@restlet.tigris.org
 Objet : RE: Re: REST in mobiles
 
 But I tried to run the simple hello World on mobile but I got problem that
 is getrVariants.add(new Variant MediaType.TEXT_PLAIN)) is not supported by
 J2me! How can I solve this problem
 
 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23721
 36

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


Re: Getting POST parameters out of request

2009-07-21 Thread Fabian Mandelbaum
Parameters as in URL?param1=value1param2=value2... ?

If so, you need to do something like this on your resource's doInit() method:

Form query = getRequest().getResourceRef().getQueryAsForm();
String value1 = query.getFirstValue(param1);
String value2 = query.getFirstValue(param2);

I hope to have understood your question correctly, and to have
provided you the answer you were looking for.

Best wishes.

On Tue, Jul 21, 2009 at 11:18 AM, webp...@tigris.org wrote:
 How is this possible?

 I'm using Apache HTTPClient to make a POST request, but at my resource are no 
 parameters set (else the one parsed into the url).
 Isn't it possible to make a POST request without using Restlet and putting 
 the post object into a Representation object?

 I'm using 2.0-M3.

 Thanks,

 Adrian

 Sorry for posting twice, as I didn't noticed if the message was send or not.

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




-- 
Fabián Mandelbaum
IS Engineer

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


Re: Guidance on Atom/APP in Restlet

2009-07-21 Thread David Bordoley
On Tue, Jul 21, 2009 at 6:08 AM, Tim Peierlst...@peierls.net wrote:
 Hmm, the wind is going out of my sails. I started by recognizing that
 AtomPub seemed to be a natural fit for my domain, and now I'm looking at
 JSON/serialized beans and optional plain Atom feeds. (Optional in the
 sense that my main applications wouldn't need them,  because they'd be
 happily talking JSON.)

Interestingly enough, when work first began on the AtomPub spec, there
were some in the working group who were in favor of making the spec
representation agnostic [*]. Even with its concentration on Atom as
its representational format, the App spec for managing collections
provides a pretty clear outline of how to use HTTP effectively for
managing datasets.

[*] One of the AtomPub spec authors clued me in to this a few months ago.

 Anybody have anything encouraging to say about why I shouldn't just stick
 with my existing DWR application? (www.directwebremoting.org)
 --tim

I haven't used DWR in probably 3 years so I'm sure some stuff has
changed but let me enumerate my reasons for preferring a REST
approach:

1) REST approach works with the web, RPC works against it. When you
design your service API Restfully you get all the built in benefits of
HTTP such as: cache support, security, scalability, wide client
support, etc. This approach is proven. When using DWR you get none of
these. DWR must push all requests over POST to ensure that no cache
server accidentally caches a result thus breaking your app. Conversely
when using DWR you can't leverage internet caching architecture that
can help offload your servers. Furthermore, a restfully linked set of
resources that support con-neg can support multiple representational
types (such as HTML), thus your API is not just an API but also a
static HTML website that can be indexed by search engines, and allows
for a nice debugging interface in a browser.

2) Strongly defined server interface that is implementation agnostic.
When using DWR, you essentially are exposing your server's Java
methods and tying your client to that implementation. You can't
replace your Java implementation with one in Ruby/C#/fill in the blank
language, later. With the REST approach you are essentially defining
an implementation neutral wire protocol.

3) Strong client/server separation. When using HTTP as your protocol,
you're forced to acknowledge in your client code that you are
accessing a remote resource and take this into account. One of the
major flaws with RPC systems has been the attempt to give remote
resources the appearance of being local, which just doesn't work well
in practice.

4) Multiple client support. DWR only allows you to build your client
in JavaScript (well at least in a well defined way). However, what
happens when your service takes off and you want to support an iPhone
Apps, Android Apps, Desktop widgets, etc. A well defined REST service
may be reused across devices, because it defines a data model with
well understood semantics.

That said, from a software engineering perspective you need to look at
your intended goals for your application and make a sane cost/benefit
analysis.

Dave

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