Last-Modified Header

2009-06-10 Thread Sherif Ahmed
I've been trying to add Last-Modified Header via the following code in a Filter 
afterHandle method

Form responseHeaders = (Form) 
response.getAttributes().get(org.restlet.http.headers);   
  
if (responseHeaders == null)   
{   
responseHeaders = new Form();   
response.getAttributes().put(org.restlet.http.headers, 
responseHeaders);   
}   
responseHeaders.add(entity.modificationDate, Sun, 06 Nov 2005 14:59:42 
GMT);


However the header in the HTTP Response is not Last-Modified as I would have 
expected, rather a custom header

entity.modificationDate: Sun, 06 Nov 2005 14:59:42 GMT

Quick response would be much appreciated

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


Re: Last-Modified Header

2009-06-10 Thread Jonathan Hall
Hi Sherif,

For custom headers whatever name you give,  entity.modificationDate,  
will be used.

However, what you probably meant to do is use setModificationDate(new 
Date()) on the entity/response representation. ie. 
representation.setModificationDate(new Date());

Jon

Sherif Ahmed wrote:
 I've been trying to add Last-Modified Header via the following code in a 
 Filter afterHandle method

 Form responseHeaders = (Form) 
 response.getAttributes().get(org.restlet.http.headers);   
 
 if (responseHeaders == null)   
 {   
   responseHeaders = new Form();   
   response.getAttributes().put(org.restlet.http.headers, 
 responseHeaders);   
 }   
 responseHeaders.add(entity.modificationDate, Sun, 06 Nov 2005 14:59:42 
 GMT);  


 However the header in the HTTP Response is not Last-Modified as I would 
 have expected, rather a custom header

 entity.modificationDate: Sun, 06 Nov 2005 14:59:42 GMT

 Quick response would be much appreciated

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


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


RE: ERROR messages in log file

2009-06-10 Thread Jerome Louvel
Hi Denys,

This is produced by the LogService. It is similar to regular Web servers
logging except that it goes in the console by default. To customize logging
level and output formats, check:
http://wiki.restlet.org/docs_1.2/13-restlet/48-restlet/101-restlet.html

You can also turn it off altogether by calling
getLogService().setEnabled(false) on your Component instance.

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 : Denys Hryvastov [mailto:dhryvas...@serena.com] 
Envoyé : mardi 2 juin 2009 09:44
À : discuss@restlet.tigris.org
Objet : ERROR messages in log file

Hi All!
I am using restlet 1.2-M2 and I am faced with such problem:
I make calls to restlet services and get correct response, but after each
call I get such messages in log file:
ERROR 2009-06-02 10:33:57,654 STDERR -- 2/6/2009 10:33:57
org.restlet.engine.LogFilter afterHandle

Can somebody tell me what is the reason why this messages appear? 
-- 
View this message in context:
http://n2.nabble.com/ERROR-messages-in-log-file-tp3010777p3010777.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

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


Atom Pub Server / atomojo

2009-06-10 Thread webpost
Hello

I'm looking for a solution to run an Atom Pub Server preferably within Restlet, 
but it might also be standalone. Implementing all resources and handling seems 
to be overkill, isn't there something already available.

I tried atomojo but I simply can't get it running, or let's say I can't login 
with the provided admin/admin password. And their mailinglist/issuetracker 
doesn't seem to be read at all.

Thanks for your help.

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


PROBLEM WITH org.restlet.representation.InputRepresentation IN 1.2-M2

2009-06-10 Thread Denys Hryvastov
Hi all -

I am using Restlet 1.2-M2 and I have some troubles. Let me describe briefly:

The problem that happens with me occurs because the org.restlet.represen
tation.InputRepresen​tation class makes a reference to the
org.apache.catalina.​connector.CoyoteInpu​tStream, which Tomcat uses, and on
finalization it closes it.
CoyoteInputStream internally uses a recyclable
org.apache.catalina.​connector.InputBuffe​r which is marked as closed when
close is called on the CoyoteInpuStream.
So what happens is that the InputBuffer is recycled followed by a close from
the InputRepresentation finalizer. The next HttpRequest that comes along
will retrieve the now closed InputStream and will fail.

Any thoughts or ideas on any workarounds are greatly appreciated.
Thanks in advance. 
-- 
View this message in context: 
http://n2.nabble.com/PROBLEM-WITH-org.restlet.representation.InputRepresentation-IN-1.2-M2-tp3050953p3050953.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


PROBLEM WITH org.restlet.representation.InputRepresentation IN 1.2-M2

2009-06-10 Thread Denys Hryvastov
Hi all -

I am using Restlet 1.2-M2 and I have some troubles. Let me describe briefly:

The problem that happens with me occurs because the 
org.restlet.representation.InputRepresentation class makes a reference to the 
org.apache.catalina.connector.CoyoteInputStream, which Tomcat uses, and on 
finalization it closes it.
CoyoteInputStream internally uses a recyclable
org.apache.catalina.connector.InputBuffer which is marked as closed when close 
is called on the CoyoteInpuStream.
So what happens is that the InputBuffer is recycled followed by a close from 
the InputRepresentation finalizer. The next HttpRequest that comes along will 
retrieve the now closed InputStream and will fail.


Any thoughts or ideas on any workarounds are greatly appreciated.
Thanks in advance.

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


RE: GAE+oAuth

2009-06-10 Thread Jerome Louvel
Hi Ivan,

Our OAuth extension is currently lacking user documentation. We are looking
for help on this front (hint!):

OAuth extension
http://wiki.restlet.org/docs_1.2/13-restlet/28-restlet/80-restlet.html

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 : Ivan Vovnenko [mailto:ivovne...@gmail.com] 
Envoyé : mercredi 3 juin 2009 15:26
À : discuss@restlet.tigris.org
Objet : GAE+oAuth

Hi
is there any documentation and/or examples showing how to use Restlet+oAuth
deployed to Google App Engine? Thanks.

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

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


RE: JSON and File Representation

2009-06-10 Thread Jerome Louvel
Hi Thomas,

I would use another representation, or even another resource unless they do
represent the same state.

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 : Thomas Cozien [mailto:thomas.coz...@gmail.com] 
Envoyé : vendredi 5 juin 2009 12:33
À : discuss@restlet.tigris.org
Objet : JSON and File Representation

Hi,

I use RestLet server to send JSON Object with JsonRepresentation object.

I want to send picture (or image) with this Json representation. I know i
can send picture with FileRepresentation but I wonder if it possible to send
both picture and json?

Or may I use an other representation?

Best regards
Tom

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

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


RE: from the org.restlet.data.Request, get the HttpServletRequest

2009-06-10 Thread Jerome Louvel
Hi Marc,

Could you try the static ServletCall#getRequest(Request request):
HttpServletRequest?
If it doesn't work, then something change in the code during Restlet 2.0
refactoring. Which version are you using BTW?

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 : Marc Lerma [mailto:jxtam...@gmail.com] 
Envoyé : mardi 9 juin 2009 15:54
À : discuss@restlet.tigris.org
Objet : RE: from the org.restlet.data.Request, get the HttpServletRequest

Hi Jerome, 

I've just come across the same problem. I need to get the HttpServletRequest
from org.restlet.data.Request. I've been trying your code but it's not
working properly for me. 

It fails here in the following sentence: 

 if (httpCall instanceof ServletCall)  

It just won't enter the 'if' block as httpCall is not an instance of
ServletCall.


I need to get a HttpServletRequest because my app works with some services
already defined and developed which need this. I'm trying to integrate REST
with this so that I can consider every single service as a REST resource
with an URI associated to it. 

So, how could I get an HttpServletRequest from a org.restlet.data.Request ?

any ideas?

thank you!

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

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


RE: Restlet 2.0 M3 released

2009-06-10 Thread Jerome Louvel
Hi Tal,

This should now be fixed in SVN trunk. Could you confirm?

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 Liron [mailto:tal.li...@threecrickets.com] 
Envoyé : mercredi 3 juin 2009 08:54
À : discuss@restlet.tigris.org
Objet : Re: Restlet 2.0 M3 released

To add to this --

It seems that something changed with how negotiated mode is handled. 
It's breaking not just Directory, but also some of my other 
ServerResources. With my resources, I found that setNegotiated(false) 
fixed the problem, so I'm guessing that the bug introduced is 
somewhere there.

Should we open an issue for this in Tigris?

-Tal

Matt wrote:
 Hi Jerome,

 I'll put together some sample code highlighting this issue for you.

 Cheers,
 Matt


 jlouvel wrote:
   
 Matt,

 I've just done a simple test with Directory and SVN trunk and I'm able to
 serve static files fine. 

 I guess something else is causing an issue. We did migrate the Directory
 and
 its internal DirectoryResource to the new resource API recently. This
 might
 be the root cause.

 Could you send us reproducible sample code to debug this further?

 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 : Matt [mailto:mjwat...@gmail.com] 
 Envoyé : vendredi 29 mai 2009 00:43
 À : discuss@restlet.tigris.org
 Objet : Re: Restlet 2.0 M3 released

 Hi Jerome,

 I think I might have found a small issue effecting the Directory class
 since
 upgrading from M2 - M3.

 If I view my website in Safari and reload it the served statically files
 (css/js/images etc) by the directory class now seem to throw 405 errors.

 Even if type in the full URL to the file in safari I get a 405. 

 If I revert back to 1.2-M2 again these problems go away.

 Matt

 PS: Thanks for all your hard work. Great product.



 jlouvel wrote:
 
 Hi all,

  

 Restlet 2.0 M3 has just been kicked out:

 http://blog.noelios.com/2009/05/27/restlet-2-0-m3-released/

  

 We hope you will like it and strongly recommend upgrading from 1.2 M2 as
 it
 provides more stability, especially on the new APIs front (resource and
 security) and includes fresh JARs for all supported editions (GWT, GAE
 and
 Android).

  

 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

 --

   
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23557
 07
 
 -- 
 View this message in context:
 http://n2.nabble.com/Restlet-2.0-M3-released-tp2980083p2990789.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

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


 



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

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


RE: Relative URI in GWT Restlet

2009-06-10 Thread Jerome Louvel
Hi Wish,

What is your ServletContainer? There is a known bug with WebLogic regarding
port 80:

Locating REST resources on Port 80, Receive 404
http://restlet.tigris.org/issues/show_bug.cgi?id=710

We have very recently checked in a workaround in SVN trunk for this. Could
you try again with a recent Restlet 2.0 snapshot?

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 : wgandhi [mailto:wgan...@hotmail.com] 
Envoyé : samedi 6 juin 2009 08:31
À : discuss@restlet.tigris.org
Objet : Relative URI in GWT Restlet

Hi !
I have code that uses a GWT restlet class in the client. I generate the
request like this:
Request request = new
Request(Method.GET,http://localhost:8080/entApp-war/resources/Items/stock/;
+symbol+/);
An existing web service is running on the servlet container at :8080.

When I deploy the web application, I want to use apache to serve the static
content which will be on port :80. I have wired up my apache server to
forward to the servlet container when I access directory /entApp-war. On the
development platform, I use :8080 for everything and things work fine. When
I deploy, I dont want to change my code to include the address of the
correct server.
Everything would work for me, if I get to specify a relative URL. example:
Request request = new
Request(Method.GET,/entApp-war/resources/Items/stock/+symbol+/);

I tried that and it did not work. I get an Unable to create request-type
message from the Restlet class. Is there a workaround this issue?

-Wish

-- 
View this message in context:
http://n2.nabble.com/Relative-URI-in-GWT-Restlet-tp3034473p3034473.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

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


RE: Re: Last-Modified Header

2009-06-10 Thread Sherif Ahmed
Thanks Jon.

What I am trying to accomplish is implementing the Last-Modified / 
If-Modified-Since logic. Where I would tag responses with a uniform 
Last-Modified header for all resources/representations and when a request 
comes in with a If-Modified-Since header I'd send appropriate HTTP 304 
response or completely process the response.

Ideas/Best Practices to accomplish this without having to get the 
HttpServletRequest/Response objects to do this would be great

 Hi Sherif,
 
 For custom headers whatever name you give,  entity.modificationDate,  
 will be used.
 
 However, what you probably meant to do is use setModificationDate(new 
 Date()) on the entity/response representation. ie. 
 representation.setModificationDate(new Date());
 
 Jon
 
 Sherif Ahmed wrote:
  I've been trying to add Last-Modified Header via the following code in a 
  Filter afterHandle method
 
  Form responseHeaders = (Form) 
  response.getAttributes().get(org.restlet.http.headers);   

  if (responseHeaders == null)   
  {   
  responseHeaders = new Form();   
  response.getAttributes().put(org.restlet.http.headers, 
  responseHeaders);   
  }   
  responseHeaders.add(entity.modificationDate, Sun, 06 Nov 2005 14:59:42 
  GMT);
 
 
  However the header in the HTTP Response is not Last-Modified as I would 
  have expected, rather a custom header
 
  entity.modificationDate: Sun, 06 Nov 2005 14:59:42 GMT
 
  Quick response would be much appreciated
 
  --
  http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2360858
 

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


Re: Re: Last-Modified Header

2009-06-10 Thread Rob Heittman
Restlet provides the 304 plumbing for you.  Just setModificationDate() on
your Resource's returned Representation as Jon suggests.  The GET headers
returned from my Web site which calls this function are below.  If you hit
this resource with Firefox and watch it with Firebug as you refresh (which
does conditional GETs), you'll see 304s being returned instead.  This is all
done by Restlet internally -- my code doesn't know anything about
conditional processing.

curl -I http://solertium.com/index.html
HTTP/1.1 200 OK
Expires: Wed, 10 Jun 2009 15:55:42 GMT
Content-Type: text/html; charset=UTF-8
Last-Modified: Wed, 10 Jun 2009 15:40:42 GMT
Content-Length: 11302
Date: Wed, 10 Jun 2009 15:40:42 GMT
Set-Cookie: BROWSERID=cQv0DC1n-c0fgM3-Jl; Path=/; HttpOnly
Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
Server: Noelios-Restlet-Engine/1.2.m1

On Wed, Jun 10, 2009 at 11:36 AM, Sherif Ahmed sherifah...@hotmail.comwrote:

 Thanks Jon.

 What I am trying to accomplish is implementing the Last-Modified /
 If-Modified-Since logic. Where I would tag responses with a uniform
 Last-Modified header for all resources/representations and when a request
 comes in with a If-Modified-Since header I'd send appropriate HTTP 304
 response or completely process the response.

 Ideas/Best Practices to accomplish this without having to get the
 HttpServletRequest/Response objects to do this would be great

  Hi Sherif,
 
  For custom headers whatever name you give,  entity.modificationDate,
  will be used.
 
  However, what you probably meant to do is use setModificationDate(new
  Date()) on the entity/response representation. ie.
  representation.setModificationDate(new Date());
 
  Jon
 
  Sherif Ahmed wrote:
   I've been trying to add Last-Modified Header via the following code in
 a Filter afterHandle method
  
   Form responseHeaders = (Form)
 response.getAttributes().get(org.restlet.http.headers);
  
   if (responseHeaders == null)
   {
   responseHeaders = new Form();
   response.getAttributes().put(org.restlet.http.headers,
 responseHeaders);
   }
   responseHeaders.add(entity.modificationDate, Sun, 06 Nov 2005
 14:59:42 GMT);
  
  
   However the header in the HTTP Response is not Last-Modified as I
 would have expected, rather a custom header
  
   entity.modificationDate: Sun, 06 Nov 2005 14:59:42 GMT
  
   Quick response would be much appreciated
  
   --
  
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2360858
  

 --

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


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

Re: Pagination

2009-06-10 Thread Dustin N. Jenkins
I assume the POST/Redirect/GET pattern is the Client POSTing to the 
Resource, and instead of filling the Response's Entity with the 
Representation of the change, one simply redirects the Client to the GET 
representation.  Is this the desired behaviour?  I was under the 
impression that populating the Response's Entity in the POST was 
improper practice, but we often lazily do it.

One more thing I thought of that might be handy is the ability to go 
directly to the First or Last page.  Going to the First page would be 
easy, I think, as one would simply omit the AFTER clause, but going to 
the Last page seems like a different story.  The type of Pagination 
we've been talking about is simply a Go to Next Page and Go to 
Previous Page design, which should be sufficient I guess.  Although I 
think users typically would like to see how many pages there are in the 
result set.  Having said that, though, I suppose if the Searching 
service were asked to simply return everything, and only Resource 
consumes what it wants to based on, say, the User's preferred page size, 
then one could simply do the math on the Collection size.  Anyway, the 
scope of Pagination seems to be growing...

Thanks again for your help Rob.  I really like this approach to RESTful 
Pagination.

Dustin


Rob Heittman wrote:
 Yes, keeping the state bookmarkable for a complex search is also an 
 interesting challenge.  I know one web site (also a science app) that 
 has several hundred variables that can be incorporated in a query, 
 more than a bookmark would easily store.  They keep a permanent cache 
 of search queries in the database and return a minified URL, like 
 bit.ly 
 http://bit.ly, using the Post/Redirect/Get pattern.  They mark position in 
 pagination using query params:

 http://{science-app}/search/afq1z?start=1564extent=20

 but I also like the after approach better:

 http://{science-app}/search/afq1z?after=Sula+Nebouxi,Ecuadorextent=20

 There are also nice properties of the minified query identifier URL, 
 in that it lends itself to subsequent RESTful interrogation in other ways:

 http://{science-app}/search/afq1z/sql -- retrieve SQL query definition
 http://{science-app}/search/afq1z/export/csv -- dump entire data set 
 to CSV

 or fun using Variants ... etc ...

 On Tue, Jun 9, 2009 at 11:44 AM, Dustin N. Jenkins 
 dustin.jenk...@nrc-cnrc.gc.ca mailto:dustin.jenk...@nrc-cnrc.gc.ca 
 wrote:

 Hi Rob,

 Thank you very much for the detailed post.  It's very useful.

 My Persistence Layer uses Hibernate, which in turn uses ehcache as the
 Second Layer cache, but I've always had it turned off, so now
 would be a
 good time to experiment with it I suppose.

 A stable search result is not required in my case, and I would happily
 go back to the Persistence Layer each time as I deal with Scientific
 results that are updated all the time.  A user wouldn't
 necessarily get
 lost while moving from page to page.

 In reference to Josh's solution, I really like the idea of going
 by the
 sorted results and asking for the data after the last known item.  I
 deal with a multi-field form; upwards of a dozen fields to search
 on, so
 passing data back and forth may not be viable all the time, especially
 with a GET given the known character limitation.  However, do users
 commonly bookmark a search result with a page number?  I could
 definitely see it.  Perhaps the bookmark would encapsulate the AFTER
 clause in the URL.

 Thanks again, Rob.  It is an interesting problem.
 Dustin


 Rob Heittman wrote:
  Ah, pagination.  One of the great programming tradeoffs  :-)  Have a
  look at this comment thread from Ohloh a while back.
 
  http://www.ohloh.net/forums/3491/topics/1056
 
  Josh Triplett proposes a good solution that is lightweight for
 paging
  non-critical data without server state.
 
  You can guarantee a stable search result for the duration of the
  browse by caching the entire result set server side and providing a
  means of moving through it ... that might scale to hundreds of
  results, but not so much to millions.  Still, that's the usual
 Session
  idiom.
 
  Here's what I usually do ... send an HTML or XML representation with
  sufficient information about how to repeat the search and page thru
  it, but keep no server side state per se.  I just make sure the data
  layer is smart enough about caching result sets to avoid
 unnecessary work.
 
  Example: say I am exposing a fulltext search over a collection of
  10,000 documents and someone searches on the.
 
  Client hits Resource (stateless, short lived) by POST to /search
 with
  something like
 query
  termthe/term
 /query
  Resource submits the search to a query service.
  Query service hits fulltext index and gets 9,995 

RE: Last-Modified Header

2009-06-10 Thread Sherif Ahmed
Brilliant..
The more I use Restlet the more I am liking it indeed.

Now does Restlet has a framework to take care of Gzip encoding results when the 
Request headers indicate that the request is from a client that supports this 
encoding (all modern browsers do)

 I've been trying to add Last-Modified Header via the following code in a 
 Filter afterHandle method
 
 Form responseHeaders = (Form) 
 response.getAttributes().get(org.restlet.http.headers);   
 
 if (responseHeaders == null)   
 {   
   responseHeaders = new Form();   
   response.getAttributes().put(org.restlet.http.headers, 
 responseHeaders);   
 }   
 responseHeaders.add(entity.modificationDate, Sun, 06 Nov 2005 14:59:42 
 GMT);  
 
 
 However the header in the HTTP Response is not Last-Modified as I would 
 have expected, rather a custom header
 
 entity.modificationDate: Sun, 06 Nov 2005 14:59:42 GMT
 
 Quick response would be much appreciated

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


RE: Re: Re: Last-Modified Header

2009-06-10 Thread Sherif Ahmed
Cool,

This works as you indicate. However implementing this way has a downside. Would 
be nice that the framework could take care of sending a 304 even without having 
to get a concrete Representation which has a date set.

The idea is to avoid creating a Representation if the Resource has not changed 
and Restlet could send a 304 directly thus avoiding the cost that may be 
associated with building a Representation.

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


Re: Re: Re: Last-Modified Header

2009-06-10 Thread Rob Heittman
I can't imagine how the framework would be able to figure that out on its
own without being able to examine the Representation ... chicken, egg,
chicken, egg.
Still, I understand the concern if Representations are expensive to
generate.  I wonder if the conditional logic fetches the entity body if the
last modified date has not changed.  If it doesn't (and it probably
shouldn't) then you could just craft a Representation subclass in which the
expensive stuff only happens when the entity body is actually read -- the
headers should be enough to tell the engine how to handle the conditional
GET.

** disclaimer ** I really don't know if that approach works, but I think it
ought to.

- Rob

On Wed, Jun 10, 2009 at 1:11 PM, Sherif Ahmed sherifah...@hotmail.comwrote:

 Cool,

 This works as you indicate. However implementing this way has a downside.
 Would be nice that the framework could take care of sending a 304 even
 without having to get a concrete Representation which has a date set.

 The idea is to avoid creating a Representation if the Resource has not
 changed and Restlet could send a 304 directly thus avoiding the cost that
 may be associated with building a Representation.

 --

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


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

Re: Restlet 2.0 M3 released

2009-06-10 Thread Tal Liron
Hi Jerome,


The Directory class now seems fixed, and well in negotiated mode.


However... the SVN version breaks negotiated mode for all the rest of my 
ServerResources. Unless I explicitly setNegotiated(false) for them, they 
all return error 406 for every GET.


-Tal


Jerome Louvel wrote:

 Hi Tal,

 This should now be fixed in SVN trunk. Could you confirm?

 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 Liron [mailto:tal.li...@threecrickets.com] 
 Envoyé : mercredi 3 juin 2009 08:54
 À : discuss@restlet.tigris.org
 Objet : Re: Restlet 2.0 M3 released

 To add to this --

 It seems that something changed with how negotiated mode is handled. 
 It's breaking not just Directory, but also some of my other 
 ServerResources. With my resources, I found that setNegotiated(false) 
 fixed the problem, so I'm guessing that the bug introduced is 
 somewhere there.

 Should we open an issue for this in Tigris?

 -Tal

 Matt wrote:
   
 Hi Jerome,

 I'll put together some sample code highlighting this issue for you.

 Cheers,
 Matt


 jlouvel wrote:
   
 
 Matt,

 I've just done a simple test with Directory and SVN trunk and I'm able to
 serve static files fine. 

 I guess something else is causing an issue. We did migrate the Directory
 and
 its internal DirectoryResource to the new resource API recently. This
 might
 be the root cause.

 Could you send us reproducible sample code to debug this further?

 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 : Matt [mailto:mjwat...@gmail.com] 
 Envoyé : vendredi 29 mai 2009 00:43
 À : discuss@restlet.tigris.org
 Objet : Re: Restlet 2.0 M3 released

 Hi Jerome,

 I think I might have found a small issue effecting the Directory class
 since
 upgrading from M2 - M3.

 If I view my website in Safari and reload it the served statically files
 (css/js/images etc) by the directory class now seem to throw 405 errors.

 Even if type in the full URL to the file in safari I get a 405. 

 If I revert back to 1.2-M2 again these problems go away.

 Matt

 PS: Thanks for all your hard work. Great product.



 jlouvel wrote:
 
   
 Hi all,

  

 Restlet 2.0 M3 has just been kicked out:

 http://blog.noelios.com/2009/05/27/restlet-2-0-m3-released/

  

 We hope you will like it and strongly recommend upgrading from 1.2 M2 as
 it
 provides more stability, especially on the new APIs front (resource and
 security) and includes fresh JARs for all supported editions (GWT, GAE
 and
 Android).

  

 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

 --

   
 
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23557
 07
 
 -- 
 View this message in context:
 http://n2.nabble.com/Restlet-2.0-M3-released-tp2980083p2990789.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

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


 
   
 

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

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


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