Re: accessing restlet web (deployed on tomcat for instance) resources from a not java client, is it possible?

2008-12-18 Thread antoniojg
Ok thanks very much.


Stephen Groucutt wrote:
> 
> Hi Antonio,
> 
> You really can use anything that can do an HTTP request - you could use
> cURL, you could write something in C++ using boost asio, perl/python have
> standard HTTP libraries, and there are many more.  I think the only reason
> you would need to worry about the Representation classes themselves is if
> you used the Restlet Client.  Should you use a different client tool,
> you'll
> just get back output, of the type that your client requests.  Interpreting
> it is pretty much dependent on the client API.
> 
> I don't know specifically about .net or C#, but a quick search shows a lot
> of matches for "C# HTTP" that could help you with that specifically.  One
> page that looks pretty helpful is
> http://developer.yahoo.com/dotnet/howto-rest_cs.html .  In general, just
> make an HTTP request to a REST resource, and interpret your results in
> accordance with the Accept type you are requesting.
> 
> Steve
> 
> On Tue, Dec 16, 2008 at 10:33 AM, antoniojg  wrote:
> 
>> Hello I would like to know  if it's possible to connect to a Restlet web
>> resource 8deployed on Tomcat or an other web server) through a client
>> that
>> is written in an other language.
>> To better explain, let's suppose that we have defined some restlet
>> resources
>> which return some type of representation, let's say DomRepresentattion or
>> ObjectRepresentation.
>> Is it possible to write a .net or C# client that connects to the restlet
>> web
>> server and can understand the result returned from the server?
>> Since they connect through http and speak html, it should be feasible
>> even
>> if the client can not understand reslet based output representations like
>> DOMRepresentation or what ever else.
>> Am I wrong?
>> Is there any example that may let me better understand this kind of
>> integration?
>> Thanks in advance.
>> Antonio.
>> --
>> View this message in context:
>> http://n2.nabble.com/accessing-restlet-web-%28deployed-on-tomcat-for-instance%29-resources-from-a-not-java-client%2C-is-it-possible--tp1663393p1663393.html
>> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>>
>> --
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=985042
>>
> 
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=985107
> 

-- 
View this message in context: 
http://n2.nabble.com/accessing-restlet-web-%28deployed-on-tomcat-for-instance%29-resources-from-a-not-java-client%2C-is-it-possible--tp1663393p1668438.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


a question about resolving urls for resources.

2008-12-18 Thread antoniojg
Hello, I'm designing an application that retrieves some email messages from a
DB back end.
I'd like to use Rest to put and get messages on the db. A component is later
responsible of retrieving them from the DB and storing them on a PEC  inboox
and for getting mails from the inboox and storing them on the DB. The DB
layer is essential for data maintenance since the inboox is constantly
cleared.
In my application each mail is identified by a msg_id and each mail can have
several attachments 

So I have the following urls :

mail_list  : get all the application related emails and post a new message

mail_list/{msg_ID} in order to get, update and delete a specific message

mail_list/{msg_ID}/attachment to get all the attachments and post a new one

mail_list/{msg_ID}/attachment/{att_id}  to get, put and delete a specific
attachment

and so on.

My doubt is related to how to configure the urls in order to manage requests
for email specific attachments : mail_list/{msg_ID}/attachment/{att_id}

There are two parameters here {msg_ID} and {att_id} . I can attach the
resource mail list to the url /mail_list and the engine will be able to
manage the parameter msg_ID through the API.

However, how can I configure the mappings in order to reach the attachment
resource if the url always starts with mail_list/{msg_ID}/attachment..?

I' d be greatful isf someone may help me resolving this doubt.
Thanks.
Antonio.

 



-- 
View this message in context: 
http://n2.nabble.com/a-question-about-resolving-urls-for-resources.-tp1668521p1668521.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


I can't figure out how to map urls in this case, please help me

2008-12-18 Thread antoniojg
Hello, I'm designing an application that retrieves some email messages from
a DB back end.
I'd like to use Rest to put and get messages on the db. A component is later
responsible of retrieving them from the DB and storing them on a PEC  inboox
and for getting mails from the inboox and storing them on the DB. The DB
layer is essential for data maintenance since the inboox is constantly
cleared.
In my application each mail is identified by a msg_id and each mail can have
several attachments

So I have the following urls :

mail_list  : get all the application related emails and post a new message

mail_list/{msg_ID} in order to get, update and delete a specific message

mail_list/{msg_ID}/attachment to get all the attachments and post a new one

mail_list/{msg_ID}/attachment/{att_id}  to get, put and delete a specific
attachment

and so on.

My doubt is related to how to configure the urls in order to manage requests
for email specific attachments : mail_list/{msg_ID}/attachment/{att_id}

There are two parameters here {msg_ID} and {att_id} . I can attach the
resource mail list to the url /mail_list and the engine will be able to
manage the parameter msg_ID through the API.

However, how can I configure the mappings in order to reach the attachment
resource if the url always starts with mail_list/{msg_ID}/attachment..?

I' d be greatful isf someone may help me resolving this doubt.
Thanks.
Antonio.

-- 
View this message in context: 
http://n2.nabble.com/I-can%27t-figure-out-how-to-map-urls-in-this-case%2C-please-help-me-tp1669818p1669818.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


accessing restlet web (deployed on tomcat for instance) resources from a not java client, is it possible?

2008-12-16 Thread antoniojg
Hello I would like to know  if it's possible to connect to a Restlet web
resource 8deployed on Tomcat or an other web server) through a client that
is written in an other language.
To better explain, let's suppose that we have defined some restlet resources
which return some type of representation, let's say DomRepresentattion or
ObjectRepresentation.
Is it possible to write a .net or C# client that connects to the restlet web
server and can understand the result returned from the server?
Since they connect through http and speak html, it should be feasible even
if the client can not understand reslet based output representations like
DOMRepresentation or what ever else.
Am I wrong?
Is there any example that may let me better understand this kind of
integration?
Thanks in advance.
Antonio.
-- 
View this message in context: 
http://n2.nabble.com/accessing-restlet-web-%28deployed-on-tomcat-for-instance%29-resources-from-a-not-java-client%2C-is-it-possible--tp1663393p1663393.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


Re: restlet can work together with servlets?

2008-12-05 Thread antoniojg
Ok Thanks. I'll make some attempt and let you know some possible scenario
when my ideas will be clearer :-)

Rob Heittman wrote:
> 
> Hi Antonio,
> 
> Yes, they can work together very well.  You needn't mount Restlet's
> ServerServlet at /*.  In fact, you can mount your Restlet-powered REST URI
> space anywhere you like.  You can use Servlet filters etc. in front of the
> Restlet space.  Generally, you can interoperate with the entire Restlet
> powered space as if it is a single Servlet.
> 
> On Fri, Dec 5, 2008 at 10:02 AM, antoniojg <[EMAIL PROTECTED]> wrote:
> 
>> a request http://somehost:8080/web_root/ping should be served by a
>> TestServlet instance and so the restlet engine should not be invoked.
>>
>> Am I wrong?
> 
> 
> You're right.  Sometimes it is a little difficult to bridge the two ideas
> conceptually -- e.g. a Servlet that stows information in the Session, and
> then expects a Restlet resource to access it (but REST is stateless, so
> the
> session concept is not native).
> 
> I think most of the list participants would find it easiest to advise on a
> concrete example of what you want to do.  Rather than making incremental
> suggestions about the architecture, people can recommend from scratch
> successful solutions to similar needs.
> 
> - R
> 
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=980142
> 

-- 
View this message in context: 
http://n2.nabble.com/restlet-can-work-together-with-servlets--tp1618705p1619110.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


how to provide several guards for a resource when using jax-rs extensions

2008-12-05 Thread antoniojg
Hi all, I'm trying to port the restlet-gwt sample to a jax-rs style using the
appropriate classes and annotations.
However, I do not know how to set  two guards on a same resource.

In the original sample, two guards performing basic and digest
authentication were added on two different urls /guarded and guarded_digest.
This was possible since the router.attach method was being invoked.

Now I'm wondering whether the same thing is possible to achieve using a
JsrApplication instance.
If I use the setGuard method I'm unable to distinguish which Guard should be
invoked depending on a particular url. So how can I do?
May someone help me?

The documentation at the link:
http://wiki.restlet.org/docs_1.1/13-restlet/28-restlet/57-restlet.html 
is a little vague and according to previous posts, it also seems to be
partially wrong since the createRoot method is being missed and all the
activity has been moved to the construcor.
Moreover, the  ExampleApplication should extend ApplicationConfig and not
Application, if I do not get wrong.
Thanks to alla for your support. It's a really great project and I'd like to
contribute for it.
 
-- 
View this message in context: 
http://n2.nabble.com/how-to-provide-several-guards-for-a-resource-when-using-jax-rs-extensions-tp1619094p1619094.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


restlet can work together with servlets?

2008-12-05 Thread antoniojg
Hello, I'd like to know if restlets and servlets may work together.
I saw that there's a servlet adapter for using restlets in a tomcat
environment and that the servlet mapping must match /*.
>From shat I remember about servlets mapping, this should not prevent other
servlets from working in the container.
To better explain, if I introduce an other servlet, let's say TestServlet 
in the deployment descriptor and map it to the following url,
/ping/*

a request http://somehost:8080/web_root/ping should be served by a 
TestServlet instance and so the restlet engine should not be invoked.

Am I wrong?

If this is true, which restlet-servlet integration scenario might be
feasible?

May a sevlet perform some controller logic and then delegate to the restlet
engine or may they work together in order to serve different requests and
logic?

The restlet engine could provide resource's representations and the servlet
might provide some other logic that does not fit well with the restlet
implementation.

I don't know if I'm saying strange things and would like to have a piece of
advice from someone expert in the matter.
Thanks in advance.
Bye.
Antonio   
-- 
View this message in context: 
http://n2.nabble.com/restlet-can-work-together-with-servlets--tp1618705p1618705.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


Re: problem with restlet-gwt

2008-12-04 Thread antoniojg
Hi Rob, thanks for your support.
Unfortunatelly the web.xml has not been overwritten.
I controlled it more times and it's ok.
What can be wrong?
Did you try the sample on windows?
It seems like the gwt engine is finding something in the module.
When we perform a gwt-rpc call, we have to add a servlet entry in the module
and the gwt module in this way knows how to route the request.
When we run the gwtshell under eclipse, I saw that it starts a tomcat
instance.
It also deploys the restlet resources there in order they to be found by the
gwt engine?
My question is does the gwt shell behave as a web container and deploy the
resources (in the server folder) within it as we had created a web project
and put the restlet based application 
classes within it?
If I start the restlet TestServer component as a standaolne application and
then run the shell again it complains of an already used address and so the
server side should work well even if I can not see the TestServer's 
sytem.out statements in the console.
I read several books on gwt (gwt in practice and Pro web 2.0  with gwt
... and so on) and I have seen different solutions but noone clearly refers
to this particular integration with rest.
Can You please help me?




Rob Heittman wrote:
> 
> On Thu, Dec 4, 2008 at 10:31 AM, antoniojg <[EMAIL PROTECTED]> wrote:
> 
>> Hello, I imported the sample restlet-gwt project within eclipse 3.4 but
>> I'm
>> unable to connect to the restlet resource. When I click on the close
>> button
>> It complains of the following  error
>>
>> "unable to find 'ping.gwt.xml' on your classpath; could be a typo, or
>> maybe
>> you forgot to include a classpath entry for source?"
> 
> 
> The web.xml inside your project root /tomcat/webapps/ROOT/WEB-INF/web.xml
> has probably been overwritten (or never configured).  GWT sometimes will
> overwrite this due to some combination of timestamps I've never been able
> to
> figure out.  (If someone knows, and can propose a workaround, I'd love to
> hear it).  This needs to have the declaration of the
> GwtShellServletWrapper
> in it (see the one in the example zip).
> 
> Moreover has someone succeded in configuring the module to run on a real
>> tomcat instance?
> 
> Which kind of servlet is it necessary to configure in the deoployment
>> descriptor? GwtServletWrapper should not work in web mode so
>> ServerServlet
>> should be enough? And how to pass the module information?
> 
> 
> Yes, just use ServerServlet to power your Restlet server side.  You need
> not
> pass the module information any more, as you'd now be running a JavaScript
> compiled version of the client side.  You cannot, to my knowledge, use a
> real Tomcat in GWT hosted mode -- I believe there are Google specific
> changes in the hosted mode Tomcat bundled with GWT.
> 
> We'll add it to the "to do" list to add a walk thru of compilation and
> deployment options in some various production environments.
> 
> - Rob
> 
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=979683
> 

-- 
View this message in context: 
http://n2.nabble.com/problem-with-restlet-gwt-tp1613932p1614203.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


problem with restlet-gwt

2008-12-04 Thread antoniojg
Hello, I imported the sample restlet-gwt project within eclipse 3.4 but I'm
unable to connect to the restlet resource. When I click on the close button
It complains of the following  error

"unable to find 'ping.gwt.xml' on your classpath; could be a typo, or maybe
you forgot to include a classpath entry for source?"

I get this error both creating a new project with all the dependencies and
importing the already configured one and running the .launch file.
I am using eclipse in windows and I changed the gwt_home setting and the
gwt.linux settings to point to the right files and path.
I don't understand why it's looking within the module to find the resocuces.
It should use the restlet-gwt jar file and open a http connection.
Can you please suggest me a solution? 
Moreover has someone succeded in configuring the module to run on a real
tomcat instance?
Which kind of servlet is it necessary to configure in the deoployment
descriptor? GwtServletWrapper should not work in web mode so ServerServlet
should be enough? And how to pass the module information?
The documentation is not very detailed as far as these concerns and a
complete example should help very much.
Thanks.
Antonio
-- 
View this message in context: 
http://n2.nabble.com/problem-with-restlet-gwt-tp1613932p1613932.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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