Serialize a ressource in XML format

2008-04-10 Thread Ludovic chaplin
Hi,
I'd like to know if there a tool in Restlet (or else) to easily serialize 
ressources in XML.
Something like XStream but that is using template URIs for linked ressources 
instead of the full objects.

XStream give me that :
city
nameParis/name
code75056/code
department
nameParis/name
code75/code
/department
/city

but I want this :
city
nameParis/name
code75056/code
department xlink:href=http://MyServeur/department/75/
/city

Thanx,
Ludovic 





RE: How do I switch off log output?

2008-04-10 Thread Jerome Louvel

Hi Steve,

Thanks, I've updated the wiki:
http://wiki.restlet.org/docs_1.1/g1/13-restlet/29-restlet/98-restlet/101-res
tlet.html

Rhett has also added details for the Spring framework.

Best regards,
Jerome  

 -Message d'origine-
 De : Steve Loughran [mailto:[EMAIL PROTECTED] 
 Envoyé : mercredi 9 avril 2008 21:35
 À : discuss@restlet.tigris.org
 Objet : Re: How do I switch off log output?
 
 On Wed, Apr 9, 2008 at 5:02 PM, Jerome Louvel 
 [EMAIL PROTECTED] wrote:
 
   Hi all,
 
   In order to clarify the usage logging with Restlet, I've 
 started a dedicated
   page of the wiki (future user guide):
   
 http://wiki.restlet.org/docs_1.1/g1/13-restlet/29-restlet/98-r
estlet/101-res
   tlet.html
 
   We need to collect the logger names of all the 
 dependencies and add them to
   the proper column in the related table. Contributions welcome.
 
   Best regards,
   Jerome
 
 OK. My contribution. Jetty chooses its logger from the property
 org.mortbay.log.class, biased towards slf4j but overrideable.
 
 http://www.mortbay.org/apidocs/org/mortbay/log/package-tree.html
 http://wiki.smartfrog.org/wiki/display/sf/Integrating+Jetty+Lo
 gging+with+SmartFrog



Re: Can Rest handles complex posts?

2008-04-10 Thread Stephan Koops

Hi Surjendu,

If you mean a html form ... , you can use

form ... method=POST
  input name=user1.firstName /
  input name=user1.lastName /
  input name=user1.email /
  input name=user1.birthDate /
  input name=user2.firstName /
  input name=user2.lastName /
  input name=user2.email /
  input name=user2.birthDate /
  input name=user3.firstName /
  input name=user3.lastName /
  input name=user3.email /
  input name=user4.birthDate /
  input type=submit /
/form

best regards
  Stephan

Surjendu schrieb:

Say I want to create 3 users. A user is designated by an User object. The User
object has 4 attributes( FirstName,LastName,Email,BirthDate).

How do i send this as part of WebForm?
  


Re: First resource page

2008-04-10 Thread Thierry Boileau

Hello Tim,

thanks a lot for your feed-back. We fully agree with you and have 
updated the page and source code.


best regards,
Thierry Boileau


This is a nice bit of documentation by example -- I'm glad you added it.

FirstResourceApplication is not thread-safe, however. I know you want 
the example to be simple, but it's important to give readers code that 
exemplifies good practice. This is different from using an in-memory 
Map instead of a real database; even a toy application should not be 
broken.


Simplest fix is to use ConcurrentHashMap instead of HashMap for the 
items field. (And make that field final.)


The Resource implementation does *not* need to be thread-safe.

A minor point: How about factoring the calls to
((FirstResourceApplication) getApplication()).getItems()
  
into a common method of an abstract class extending Resource that both 
ItemsResource and ItemResource could extend? Then the toy-ness of 
the persistence layer wouldn't be so apparent, and dependency on 
FirstResourceApplicaiton would be confiined to one method.


--tim

On Tue, Apr 8, 2008 at 9:00 AM, Thierry Boileau [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Hello all,

We've added a new First resource document in the Restlet web site.
You can get it at the following URL:
http://www.restlet.org/documentation/1.1/firstResource (or
http://www.restlet.org/documentation/1.0/firstResource, for
Restlet 1.0).

It simply describes how to create 2 basic resources illustrating how
to handle GET, POST, PUT, DELETE methods.
Your comments and questions are of course welcomed.

best regards,
Thierry Boileau






Unit testing code coverage

2008-04-10 Thread Bao,Sam
I was wondering how are you guys unit testing for code coverage with restlet 
applications and resources?  I ask this because, I've tried using a couple of 
different code coverage eclipse plugins, and using restlet Client over Http, I 
can unit test my application, but I can not achieve any kind of code coverage.  
I've googled around on this topic and did not see anything helpful.  So, what 
are you guys doing?

--
CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.


Re: Unit testing code coverage

2008-04-10 Thread Stephan Koops

Hi Sam,

as you perhaps know, I'm implementing the JAX-RS extension and wrote a 
lot of unit tests. But I do not check, if all code is covered.


BTW: It's not required that you use a real TCP client for testing: You 
can give the application directly your requests. So you save a LOT of 
time, because you save the time to start the TCP-ServerSocket, 
serializing requests and so on.
I should refactor that out of my JAX-RS test case class, because it is 
combined with services for JAX-RS testing.


best regards
  Stephan

Bao,Sam schrieb:

I was wondering how are you guys unit testing for code coverage with restlet 
applications and resources?  I ask this because, I've tried using a couple of 
different code coverage eclipse plugins, and using restlet Client over Http, I 
can unit test my application, but I can not achieve any kind of code coverage.  
I've googled around on this topic and did not see anything helpful.  So, what 
are you guys doing?
  


Re: Help! Weird timeout on GET to Restlet API

2008-04-10 Thread Ian Clarke
On Tue, Apr 8, 2008 at 8:38 AM, Rob Heittman [EMAIL PROTECTED] wrote:
 Since one of the main objectives of 1.1 has been to respond to issues that
 confuse or frustrate people coming to the platform, the changes in 1.1 are
 extremely on point for the needs of a new Restlet user.

Ok, I'll take your advice and switch to 1.1 as soon as I get a chance.
 Can you point me to a convenient upgrade guide?

Kind regards,

Ian.

-- 
Email: [EMAIL PROTECTED]
Cell: +1 512 422 3588
Skype: sanity