RE: Re: Restlet and GWT 2.0

2010-02-17 Thread webpost
Hello Thierry,

Thank you for your help.
I split the test project into 2 projects, add required libraries and all is now 
working.

When you sent me the example, I though that all the code needed to be in a 
single project.

Best regards,
Christophe.

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


RE: Re: Restlet and GWT 2.0

2010-02-15 Thread webpost
Hello Thierry,

As said in my previous mail, I did not succeed to run the test example you 
sent. I got a class not found exception on 
org.restlet.ext.gwt.​GwtShellServletWrapp​er. It seems that this class is not 
compatible with GWT 2.0. Am I right or is it a classpath issue?
If so, what is the way to do?

I really need to get this working.

Thanks for your help,
Christophe. 

Ps: you will find my eclipse project in attachments.

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


RE: Re: Restlet and GWT 2.0

2010-02-10 Thread webpost
Hello Thierry,

I did not succeed to run the test example you sent. I got a class not found 
exception on org.restlet.ext.gwt.GwtShellServletWrapper. It seems that this 
class is not compatible with GWT 2.0. Am I right?
If so, what is the way to do?

Thanks,
Christophe.

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


RE: Re: Restlet and GWT 2.0

2010-02-09 Thread webpost
Hello again,

You can ignore my previous message. I just removed the import from the class 
and it's fine.

Thanks,
Christophe

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


RE: Re: Restlet and GWT 2.0

2010-02-09 Thread webpost
Hello Thierry,

I tried to run your example in Eclipse with GWT 2.0 and restlet 2.0M7 but I got 
an error at validation (just before running) by GWT:
 Errors in 
'jar:file:testChristophe/war/lib/org.restlet.jar!/org/restlet/client/resource/ClientResource.java'
 Line 33: The import java.lang.reflect cannot be resolved

This jar comes from GWT edition but it contains a reference to the package 
java.lang.reflect. It seems that GWT doesn't support reflection.

Is there an issue?

Thanks,
Christophe.

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


RE: Re: Restlet and GWT 2.0

2010-01-18 Thread webpost
Hello,

Has anyone an idea of what is going wrong?
I would like to use restlet as it seems to be a promising framework but I still 
cannot get it working.

Regards,
Christophe.

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


RE: Re: Restlet and GWT 2.0

2010-01-06 Thread webpost
Hi Thierry,

First, I'm new to GWT and Restlet, so apologies if my questions are not 
relevant.
I already read about the on-line documentation (especially pointers you gave 
me) but I still can't solve my issues.

I have an already running REST service at http://localhost:/components.
I want to access it with GWT2 with the help of restlet. So, I wrote a simple 
GWT app (MyApp, see below) to retrieve data from this service.
My GWT app is run with GAE at http://localhost:8890/.

I'm able to configure this GWT project by adding restlet jars in WEB-INF/lib 
but I still have some issues/questions.

1/ By using the Myapp class listed below, I cannot see any message on the web 
page. In another way, if the same code is launched by a clickHandler defined on 
a button, I can see the trace (text variable). So, can't we do calls to rest 
services at the application loading?
2/ By using the version with a button and aclick handler, JsonRepresentation is 
an empty array and JSONObject object is null. I got no error messages saying 
that the request cannot be proceed, so I don't understand what is happening.
3/ The redirector seems to work, if I visit http://localhost:8890/components I 
got the response formated in json.
If I use a router, it doesn't work. But perhaps I'm not using redirector in the 
right way.
By reading the documentation, I don't understand which Redirector mode to use? 
Do I need to use a router?
My first need is to redirect all calls to http://localhost:8890/components to 
http://localhost:/components. My future need will be to redirect 
http://localhost:8890/host/components to http://host:/components
4/ My last question is about resources. the Rest Service send me back resources 
marshalled in json. I would like to have my json automatically unmarshalled in 
a resource object. I saw 
http://www.restlet.org/documentation/2.0/tutorial#part12.
Is it the way to do that? It seems to be for the server part. What for the 
client part?

Thank you very much for your patience and your availability.
It's really handsome.

Regards,
Christophe.


-
public class Myapp implements EntryPoint {
public void onModuleLoad() {
ClientResource r = new 
ClientResource(http://localhost:8890/components;);

// Set the callback object invoked when the response is received.
r.setOnReceived(new Uniform() {
public void handle(Request request, Response response) {
String text;

// Get the representation as an JsonRepresentation
JsonRepresentation rep = new JsonRepresentation( 
response.getEntity() );
text += JsonRepresentation =  + rep.toString(); 
// Displays the properties and values.
try {
JSONObject object = rep.getValue().isObject();
text += JSONObject =  + object;
if (object != null) {
for (String key : object.keySet()) {
RootPanel.get(callButtonContainer).add( new 
HTML(key + : + object.get(key)) );
}
}
} catch (IOException e) {
e.printStackTrace();
}
RootPanel.get(defaultContainer).add( new HTML(text) );
}
});
}
}

public class MyRedirector extends Application {
  @Override  
  public synchronized Restlet createInboundRoot() {  
  // Create a root router  
  Router router = new Router(getContext());  

  // Create a Redirector to Google search service  
  String target = http://localhost:{rr};;  
  Redirector redirector = new Redirector(getContext(), target, 
Redirector.MODE_CLIENT_TEMPORARY);  
   
  // Attach the extractor to the router  
  // router.attach(/redirectme/, redirector);
  // return router;
  return redirector;
  }
}


web-app
  servlet
servlet-nameadapter/servlet-name
servlet-classorg.restlet.ext.gwt.GwtShellServletWrapper/servlet-class
init-param
  param-nameorg.restlet.application/param-name
  param-valueorg.myorg.server.MyRedirector/param-value
/init-param
  /servlet

  servlet-mapping
servlet-nameadapter/servlet-name
url-pattern/*/url-pattern
  /servlet-mapping
/web-app

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


RE: Re: Restlet and GWT 2.0

2010-01-06 Thread webpost
Hello again,

2/ As you can see, my sample code is almost the same as the code used in the 
example part dedicated to json. I just copy/paste this part.
That's why I don't understand why I got a null response. Is the request really 
performed? Could the target service be reached? Was there an exception?
I'm a bit disappointed because I'am able to get the result by browsing the 
ressource url in my browser. At this time, I have no clue to investigate any 
more.
Do you have any idea about this?

3/ Thanks a lot for the explanation. I now see the difference between 
client-side and server-side redirections. Unfortunately, the redirection 
doesn't work with MODE_CLIENT_DI​SPATCHER.
I got the following message when trying to browse directly (as it's not yet 
working inside my gwt app): org.restlet.engine.component.ClientRouter getNext 
WARNING: The protocol used by this request is not declared in the list of 
client connectors. (HTTP)
I tried to add this line 
(getConnectorService().getClientProtocols().add(Protocol.HTTP);) in 
myRedirector/createInboundRoot() but I still got the same warning.
Should I retrieve a reference to ClientRouter? How?

Thanks for your help.

Regards,
Christophe.

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