Re: Reference with baseref and absolute path
Jerome, So this leaves me wondering: Should getTargetRef() clear the baseref or do we have to rely on the verbose new Reference(getTargetRef().toString()) to do this ourselves ? It think we should fix the code as suggested by the Javadocs, unless I'm missing some other aspect. If all the unit tests pass after the change, then we should be pretty safe. Let's only change this in 1.1 branch only for now. = issue 473 : I generated the diff against the trunk - which is the 1.1 branch I assume And considering the request.getProtocol(): doesn't it make more sense to use the protocol of the targetref instead of the baseref when the targetref itself is absolute ? Yes, I think so. = issue 474 : same remark as above Kind regards, Jeroen DISCLAIMER http://www.schaubroeck.be/maildisclaimer.htm
RE: Series.getValues()
Hi Paul, You can to this with: subList(name).toArray(). Is that sufficient? Maybe we could also add a toArray(String name) or subArray(String name) shortcut method? Best regards, Jerome -Message d'origine- De : Paul J. Lucas [mailto:[EMAIL PROTECTED] Envoyé : jeudi 20 mars 2008 16:27 À : discuss@restlet.tigris.org Objet : Series.getValues() Sorry if this is a duplicate, but I never say my original message echo to the list. Begin forwarded message: Date: March 19, 2008 4:19:32 PM PDT To: discuss@restlet.tigris.org Subject: Series.getValues() This method, as written in Restlet 1.0.8, specifically this variant: getValues(String name, String separator, boolean ignoreCase) has room for improvement. Aside from the fact that the ignoreCase parameter is not used, globbing the values together with a separator is not that useful. I really want: String[] getValues(String name) with an implementation like: public String[] getFormValues( String paramName ) { final ListString temp = new LinkedListString(); for ( Parameter param : this ) if ( param.getName().equalsIgnoreCase( paramName ) ) temp.add( param.getValue() ); return temp.toArray( new String[ temp.size() ] ); } - Paul
Re: Spring + Restlet + Tomcat
Hi Rhett thanks for replying. I'll take a look at the links you sent later today. In the meantime I've switched back to using the NRE ServerServlet with a custom Application that wires in a manager obj to create a Router whose config is fed from the applicationContext.xml. The spring config uses the SpringFinfer to overload createResource. It all works but I'd still like to understand what was wrong with my first approach. If anyone has any insights please send them along. cheers, -s Hi Stephen, On Mar 20, 2008, at 10:27 AM, Stephen Mc Namara wrote: I'm trying without much success to bootstrap a new project using both Spring (2.5) and restlet(1.1-M2). The plan goes something like this; * Restlet resources on the front end which interact with a service layer. The service layer contains some business logic but mostly passes off calls to a bunch of back end legacy systems. The goal is to expose those back end systems as a uniform set of RESTful web services. * I want to use Spring primarily for IoC, Aspects and JMX ease of use. Plus being able to fairly easily add thread pools to my back end adapters is appealing; all the usual Spring container arguments. * I can't use the Restlet HTTP server and in all likelihood the corporate powers will make us deploy on WebSphere for production but for now I'm trying to deploy Spting+Restlet as a WAR inside Tomcat. I've read all I can find on the restlet site, the faq, the wiki and this list about the various integration options but none are working. It seems there were some previous integration strategies and some newer options. Various googling has produced a confusing list of alternate approaches and I have to say the restlet docs need a major boost. This is at least partially my fault. I promised documentation for how to use RestletFrameworkServlet and SpringBeanRouter/Finder, but have not delivered them yet. I'd like to use Spring to inject the service layer into my Resources; and in general to use its IoC injection across all the beans. Having restlet config (router config, URL mapping etc) exposed (and manageable) by Spring is nice. This is how I use it today. I'd really appreciate if anyone has a complete end-to-end working example of spring+restlet in tomcat with either approach, or if you can spot a problem with the config shown above. If you'd like an end-to-end working application of moderate complexity, you can look at Patient Study Calendar (PSC): https://svn.bioinformatics.northwestern.edu/studycalendar/trunk/ It is the open source clinical research app I developed the aforementioned adapter classes for. It is primarily a Spring-MVC webapp, with Spring IoC connecting all the layers. The RESTful API was added after most of the application functionality was in place, so it is somewhat similar to your situation. In particular, I think you'll want to look at https://svn.bioinformatics.northwestern.edu/studycalendar/trunk/src/ma in/webapp/WEB-INF/restful-api-servlet.xml which is the spring configuration file for the RestletFrameworkServlet (using SpringBeanRouter) and https://svn.bioinformatics.northwestern.edu/studycalendar/trunk/src/ma in/java/edu/northwestern/bioinformatics/studycalendar/restlets/ which contains all the Resource implementations. PSC's not as clean as an example written specifically for demonstration, but hopefully it can get the point across for now. Rhett -- I'm trying a new usenet client for Mac, Nemo OS X. You can download it at http://www.malcom-mac.com/nemo
Re: Specifying a specific client connector
Thanks Jerome. If I can twist the scenario slightly now... :-) Lets imagine that I want my HttpclientHelper to be injected with a parameter. Let me explain my case, I've been working on integration for Restlet and Mule (http://svn.restlet.muleforge.org/, http://mule.codehaus.org). I want to use the Restlet client overtop of Mule. Sometimes I want to pass in an existing mule instance though so my client knows which mule instance to use. What do you think about creating a property on Context which stores the Engine instead? Than I could extend Engine and create a MuleEngine class which wraps a Mule instance. If we replaced all the calls to Engine.getInstance() with Context.getEngine() this would magically solve my issues :-). Luckily there aren't that many places where Engine.getInstance() is called and I think a Context is always available. This would allow people to have multiple Restlet instances configured differently in their application and also get rid of evil static calls throughout the codebase :-) Thoughts? Dan Jerome Louvel wrote: Hi Dan, This is an advanced need but I can see how useful it can be. I've added an extra constructor to Client and Server that takes the qualified class name of the connector helper to use (such as com.noelios.restlet.ext.grizzly.HttpServerHelper). I didn't want to add it to other shortcut constructors to not overload the API and to highlight the fact that this is an advanced/special feature. Let me know if it helps. Code in SVN trunk. Best regards, Jerome -Message d'origine- De : Dan Diephouse [mailto:[EMAIL PROTECTED] Envoyé : mercredi 19 mars 2008 20:26 À : discuss@restlet.tigris.org Objet : Re: Specifying a specific client connector Imagine this scenario though - you have two threads creating clients with different implementations. If I have to explicitly set up engine properties then I have to make sure the threads execute sequentially. Am I missing something? It'd great if in the future there was a way to specify this information at a per-client or per-server level instead of via the global Engine. Dan Thierry Boileau wrote: Hello Dan, I think you can have a look at the following classe: com.noelios.restlet.test.BaseConnectorsTestCase. It is a base class that allows to cross server/client connectors and test each combination (see also GetTestcase in the same package). best regards, Thierry Boileau On Wed, Mar 19, 2008 at 7:28 PM, Dan Diephouse [EMAIL PROTECTED] wrote: I'm doing some experimentations with Restlet and have come up with a case were I wish to have multiple client connector implementations on the classpath. When I create the Client object I'd like to specify which implementation Restlet should use. Is there any way to do this? AFAICT from looking at the source code, Restlet just loops through the available ConnectorHelpers. Cheers, Dan -- Dan Diephouse MuleSource http://mulesource.com | http://netzooid.com -- Dan Diephouse MuleSource http://mulesource.com | http://netzooid.com -- Dan Diephouse MuleSource http://mulesource.com | http://netzooid.com