Re: Batch calls?

2013-07-29 Thread Paul Morris
I would tend to disagree. A bulkdeleter is a thing. It's a virtual thing but so are most other resources. And putting the links of the resources to be deleted in the body seems to me to follow the HATEOAS precepts of REST. Paul Morris On Jul 29, 2013, at 2:22 PM, Stephan Koops stephan.ko

ServerServlet load Application eagerly?

2013-07-28 Thread Paul Morris
I'm passing in an org.restlet.application param to the ServerServlet and the application doesn't load until the first request actually comes in. That is what I would expect of course and the source code shows that lazy initialization is what the authors were trying to achieve. But for my

Use of StatusService default behavior

2013-01-24 Thread Paul Morris
gets a 200 back with an empty application/pdf envelope } catch (IOException e) { setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage()); } } }; return representation; } Paul Morris, Software Developer Northwestern Memorial Physicians Grouphttp

Re: Serving up index file in Restlet Directory

2013-01-07 Thread Paul Morris
Sure. In the meantime is it possible to use the file protocol with a path relative to the context path or something along those lines? Paul Morris On Jan 7, 2013, at 2:54 PM, Jerome Louvel jlou...@restlet.commailto:jlou...@restlet.com wrote: FW: I'm resending this email from 01/04 due

Serving up index file in Restlet Directory

2013-01-03 Thread Paul Morris
Hi there- Here's what I'm trying to do: Redirect GET calls to root to a static directory with an index.html file in it. I thought I could redirect to the folder containing the index.html and then use the setIndexName of Directory to serve up the index.html file once the user gets redirected

Re: Get all ServerResource objects and their routes from Applicaiton

2012-12-16 Thread Paul Morris
Yes it looks like it does with getApplicationInfo(Request, Response).etc… Thanks Tim. Paul Morris, Software Developer Northwestern Memorial Physicians Grouphttp://www.nmpg.com 773.469.4330 | 312.926.6674 | pmor...@nmh.org [cid:9D02970D-9665-4E2E-8E2B-3D2F6275AFCF] From: Tim Peierls t

Get all ServerResource objects and their routes from Applicaiton

2012-12-11 Thread Paul Morris
I'm trying to figure out a way to at runtime get each ServerResource and its URI route from the org.restlet.Application API but can't seem to figure it out. Below is an example. So again I need the relative ref and the object (or even just its class). router.attach(/, tracer);

Re: error trapping with ServerResource

2012-09-02 Thread Paul Morris
Not exactly sure if this is what you're after but I would still set your message string in the setStatus method and and then use Status#getDescription in your catch block or wherever… -- Paul Morris, Software Developer Northwestern Memorial Physicians Group http://www.nmpg.com 773.469.4330

Re: error trapping with ServerResource

2012-09-02 Thread Paul Morris
Thanks Tim. Yes Stephen I missed that in your snippet... Use getResponse() Paul Morris On Sep 2, 2012, at 12:32 PM, Tim Peierls t...@peierls.netmailto:t...@peierls.net wrote: Why set the request entity rather than the response entity? On Sun, Sep 2, 2012 at 9:46 AM, Stephen More stephen.m

Re: error trapping with ServerResource

2012-09-01 Thread Paul Morris
/api/org/restlet/data/MediaType.html mediaType) Sets a textual entity. Paul Morris On Sep 1, 2012, at 6:35 PM, Stephen More stephen.m...@gmail.commailto:stephen.m...@gmail.com wrote: I have a ServerResource that has: throw new org.restlet.resource.ResourceException

Re: NPE when using WADL extension auto transform to HTML feature

2012-07-03 Thread Paul Morris
Also forgot to mention that I do have the XML extension on the classpath and debugging indicates that the Source object is the null object in the transform method (in case that wasn't obvious enough). I saw a related thread about OSGi bundles not being able to find the wadl2html.xslt file but I

Re: NPE when using WADL extension auto transform to HTML feature

2012-07-03 Thread Paul Morris
I just now saw a duplicate of this issue here: http://restlet-discuss.1400322.n2.nabble.com/NullPointerException-when-using-WADL-HTML-representation-td7526952.html I hadn't seen that earlier when I posted but it appears to be the same exact issue. In a similar vein, I saw a comment from some

Re: OPTIONS and TRACE not being caught by Restlet Server

2012-06-28 Thread Paul Morris
I did some more testing and it looks like the issue here is the Spring extension. I removed the dependency on Spring and just used the ServerServlet class in the servlet ext package and calling OPTIONS works. I found this discussion from a few years back

Re: OPTIONS and TRACE not being caught by Restlet Server

2012-06-28 Thread Paul Morris
=org.restlet.ext.spring.SpringComponent property name=name value=My Component / property name=author value=Paul Morris / property name=defaultTarget ref=myApplication / /bean bean id=resource class=com.quietbus.test.MyResource / bean id=router class

Re: Multiple versions of API in production

2011-12-09 Thread Paul Morris
Thanks for your comments Thierry. From: Thierry Boileau thierry.boil...@noelios.commailto:thierry.boil...@noelios.com Reply-To: discuss discuss@restlet.tigris.orgmailto:discuss@restlet.tigris.org Date: Wed, 7 Dec 2011 05:58:52 -0600 To:

Multiple versions of API in production

2011-12-04 Thread Paul Morris
Trying to implement some sort of versioning for an enterprise API. It could interface with external APIs eventually so I want to do it right. Resources will likely be grouped into war files (or maybe even JSE apps at some point who knows) that will be deployed on the server and the idea is to

Re: Sessions in web applications using RESTlet ?

2011-11-14 Thread Paul Morris
@restlet.tigris.org Cc: Paul Morris pmor...@nmh.orgmailto:pmor...@nmh.org Subject: Re: Sessions in web applications using RESTlet ? Does anyone have any experience with authenticating RESTlet against OpenAM? On Monday, October 10, 2011 09:50:58 Paul Morris wrote: OpenAM is one such session server

Re: Sessions in web applications using RESTlet ?

2011-10-10 Thread Paul Morris
Deep, I haven't tried building a RESTful e-commerce site and I'm not sure I would but... REST says state should be maintained on the client side so if you were going to build a RESTful e-commerce site you'd have to keep the cart on the client side. Storing it in a cookie would maintain state

Re: Log Question

2011-10-03 Thread Paul Morris
The entity size of the request is unknown (-1), thus the -. Not sure what's happening without seeing everything that you can see but maybe you could try manually setting the Content-Length header to zero before the redirect (request.getEntity.setSize(0);) and see what happens. I'm not saying this

Re: Log Question

2011-10-01 Thread Paul Morris
Here's the code that's logging the second value after the status code… // Append the received size sb.append('\t'); if (request.getEntity() == null) { sb.append('0'); } else { sb.append((request.getEntity().getSize() == -1) ? - : Long

JavaMail and GWT

2011-09-22 Thread Paul Morris
A high-level design question: I would like to send an email representation from Restlet-GWT to a Restlet Service on the back-end for processing (sending). I'm thinking of using the JavaMail extension on the server side. I'm also thinking of POSTing a MessageRepresentation from the client side

Re: Spring inject a Form constructed using the requestEntity

2011-08-11 Thread Paul Morris
Thanks Thierry. I have a handful of methods that depend on the raw value of a custom ChallengeScheme. It doesn't seem that Restlet will extract this value on the fly as in: @Get public Representation getAttributes(ChallengeResponse token) { // do stuff with token. } Right? If not, what

Re: Spring inject a Form constructed using the requestEntity

2011-08-08 Thread Paul Morris
, and you can verify that it works without any special configuration. --tim On Mon, Aug 8, 2011 at 10:18 AM, Paul Morris pmor...@nmh.orgmailto:pmor...@nmh.org wrote: It's a publicly exposed HTTP call so I won't be getting an org.restlet.data.Form passed in. I'll be getting an entity body with params

Re: Spring inject a Form constructed using the requestEntity

2011-08-08 Thread Paul Morris
Subject: Re: Spring inject a Form constructed using the requestEntity On Mon, Aug 8, 2011 at 2:38 PM, Paul Morris pmor...@nmh.orgmailto:pmor...@nmh.org wrote: Unfortunately, in the case I mentioned, I am implementing an abstract method that takes a Representation as the argument and since Form

Re: Spring inject a Form constructed using the requestEntity

2011-08-08 Thread Paul Morris
nice automatic conversion. --tim On Mon, Aug 8, 2011 at 7:06 PM, Paul Morris pmor...@nmh.orgmailto:pmor...@nmh.org wrote: The interface is part of a very generic API for managing sessions and it's meant to support a wide variety of implementations, different session provisioners, etc. public

Re: Calling Restful web service within a Restful Web Service

2011-07-31 Thread Paul Morris
Restlet keeps its interface uniform whether the Restlet is acting as a client or a server since servers often have to behave as clients when they have to call other servers. So yes your case is par for the course in the world of REST. ;-) Paul Morris On Jul 31, 2011, at 3:21 AM, Alex K

Re: Problem passing Context with Spring extension

2011-07-14 Thread Paul Morris
Have a look at how I create the child context here: https://github.com/apius/apius-core/blob/master/projects/identity/src/identity-context-common.xml Do this and you should be able to pass the child context into the Application constructor without an error. Paul Morris On Jul 14, 2011, at 4

Re: Access X-Forwarded-For in Tomcat embeded Restlet

2011-07-09 Thread Paul Morris
If you do getContext().getParameters().add(useForwardedForHeader, true); from within your class that extends org.restlet.Application does the address then show up in getRequest().getClientInfo().getAddresses() within the Resource class? Paul Morris On Jul 8, 2011, at 3:56 PM, Al Crowley

RE: Re: Problem with Spring Extension

2011-06-27 Thread Paul Morris
Thanks Rhett. That eliminated the error. On to the next error ;-) -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2778081

Problem passing Context with Spring extension

2011-06-27 Thread Paul Morris
=name value=APIUS Identity component / property name=description value=Authentication and authorization. Session management. / property name=owner value=apius.org / property name=author value=Paul Morris / property name=client value=http / property name=defaultHost ref=defaultHost / /bean

Setting outboundRoot Restlet with Spring

2011-06-27 Thread Paul Morris
and authorization. Session management. / property name=owner value=apius.org / property name=author value=Paul Morris / property name=clientsList list valuehttp/value /list /property property name=defaultHost ref=defaultHost / /bean bean id

RE: Re: Using Spring and Servlet extensions together

2011-06-27 Thread Paul Morris
Thanks Rhett. Was able to get over the initial hump. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2778198

RE: Problem passing Context with Spring extension

2011-06-27 Thread Paul Morris
I think I had some classpath problems or perhaps even a mixture of different release version jars. I deleted all jars from WEB-INF/lib and replaced the restlet and other dependent jars with those packaged in the 2.0.8 release and everything started behaving as expected. (Shaking my head).

RE: Setting outboundRoot Restlet with Spring

2011-06-27 Thread Paul Morris
I think I had some classpath problems or perhaps even a mixture of different release version jars. I deleted all jars from WEB-INF/lib and replaced the restlet and other dependent jars with those packaged in the 2.0.8 release and everything started behaving as expected. (Shaking my head). I'm

RE: Problem with Spring Extension

2011-06-26 Thread Paul Morris
I think the map values for attachments should be value-ref rather than just value because they refer to beans declared in the same file but in either case that doesn't eliminate my error. map entry key=/session value-ref=openAmSession / entry key=/session/attributes

RE: Problem with Spring Extension

2011-06-26 Thread Paul Morris
=author value=Paul Morris / property name=client value=http / property name=defaultHost ref=defaultHost / /bean bean id=defaultHost class=org.restlet.ext.spring.SpringHost constructor-arg ref=component / property name=defaultAttachment ref=openAmSessionApplication / /bean bean id

RE: Re: Restlet and Spring - Engine and Component

2011-06-22 Thread Paul Morris
Rhett, This is very helpful. Thanks. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2772273

Restlet and Spring - Engine and Component

2011-06-21 Thread Paul Morris
value=apius.org / property name=author value=Paul Morris / property name=client value=http / property name=defaultHost ref=defaultHost / /bean bean id=defaultHost class=org.restlet.ext.spring.SpringHost

RE: Re: Custom Challenge Scheme

2011-06-04 Thread Paul Morris
Thanks for the input. I was able to get Restlet to recognize my helper. Not sure I understand the implications of setting the clientSide boolean value to true but anyway what I'm fighting with now is the line in my overridden parseResponse method for setting the raw value. Unfortunately when

RE: Re: Custom Challenge Scheme

2011-06-04 Thread Paul Morris
I feel like an idiot (lol). I just needed to change my setRawValue method line so that it was using the ChallengeResponse argument in the method itself and not the HttpRequest adapter's getChallengeResponse(). It's understandable why that would have created an infinite loop. Anyway thanks again

Custom Challenge Scheme

2011-06-03 Thread Paul Morris
Having problems implementing a custom challenge scheme with an AuthenticatorHelper. I've read the documentation but I am still receiving this WARNING in the logs: WARNING: Couldn't find any helper support the HTTP_MYSCHEME challenge scheme. This is what I'm doing code-wise... public class

Eclipse Spring and Restlet with Restlet as the Main Container

2011-04-20 Thread Paul Morris
I'm just getting started with Spring and want to start putting together projects where Restlet is the main container and Spring wires everything together. Does anyone know of a tutorial or zipped Eclipse example project that shows how to set this up in Eclipse? There are plenty of pure Spring

RE: Re: Auditing function

2011-04-15 Thread Paul Morris
Ok. Thanks for the ideas. This is gradually taking shape in my head. I was thinking of extending the Restlet Service object and customizing as needed. I do like your idea of writing to a file in case of a failed connection. --

RE: Restlet integration with POJO for data persistence

2011-04-15 Thread Paul Morris
I've been researching the Spring framework and the Restlet Spring extension and I think this is indeed the best way to go. One more framework to learn but probably best in the long run. --

RE: Auditing function

2011-04-04 Thread Paul Morris
I've been looking into this since my initial post and want to add a couple of thoughts to clarify my intention here. I found the LogService Restlet class which looks very robust but I need to customize some of the logging here for auditing and compliance purposes (i.e. identify the user based

Auditing function

2011-04-03 Thread Paul Morris
I'm looking to catch all incoming requests and outgoing responses that pass through my Restlet API, break out the elements into fields and persist them in a relational database for later analysis. I thought of using service filters for this but have two concerns. One is latency since it seems

Restlet integration with POJO for data persistence

2011-04-03 Thread Paul Morris
I am building out a RESTful API based on Restlet in my organization. I have no dependencies on Spring or even the use of an EJB container. In fact I think I would prefer to just use POJOs in the web container for data persistence. Are there any resources or tutorials that someone could point me

Re: Set cookies

2011-01-17 Thread Paul Morris
Thierry, Your project was a good level-set. I took it and just started line by line closing the gap between your code and mine. As it turns out Safari wouldn't take my cookie since the version was 1 not 0. whereas Firefox accepted the version 1 cookie. Also, Firefox wouldn't accept the

RE: Set cookies

2011-01-12 Thread Paul Morris
I saw an entry similar to this elsewhere with an answer but unfortunately it doesn't work for me. I've tried the following: getResponse().getCookieSettings().add(myCookieSetting); and... SeriesCookieSetting cookies = getResponse().getCookieSettings(); cookies.add(myCookieSetting);

RE: Set cookies

2011-01-11 Thread Paul Morris
Any word on this? I'm struggling with the same issue. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2697375

Incorrect status returned from ClientResource

2011-01-10 Thread Paul Morris
I'm using ClientResource to call OpenAM's (http://www.forgerock.com/openam.html) authentication service as in: ClientResource resource = new ClientResource(http://glassfish.devbox.local:8080/openam_s951/identity/authenticate?username=pmorrispassword=secret); When I call resource.getStatus() no