GAE org.restlet.parent (2.0-M4) does not specify lib-osgi-version property
Hi, The GAE version (2.0-M4) org.restlet.parent pom does not specify lib-osgi-version which causes maven build error. I think for GAE, osgi dependency is not necessary. Cheers, Keke - We paranoid love life Mike Ditka http://www.brainyquote.com/quotes/authors/m/mike_ditka.html - If God had wanted man to play soccer, he wouldn't have given us arms. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2386248
bug? - AccessControlException on Restlet GAE module
Hi, Does anybody else get AccessControlException when using restlet-gae? Everything goes well, unless I need to use GAE's authentication feature. After a successful login (on development env), I got following exception: java.security.AccessControlException: access denied (javax.security.auth.AuthPermission modifyPrincipals) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:76) at javax.security.auth.Subject$SecureSet.add(Unknown Source) at java.util.Collections$SynchronizedCollection.add(Unknown Source) at org.restlet.engine.servlet.ServletCall.getSubject(ServletCall.java:345) at org.restlet.engine.http.HttpRequest.getClientInfo(HttpRequest.java:231) Can I just use a mock Subject in gae env? Cheers, Keke - We paranoid love life -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1790594
Re: bug? - AccessControlException on Restlet GAE module
Can I simply return null in ServletCall.getSubject, because in GAE application usually relies on GAE's authentication. Cheers, Keke - We paranoid love life On Sat, Apr 18, 2009 at 10:25 PM, keke iamk...@gmail.com wrote: Hi, Does anybody else get AccessControlException when using restlet-gae? Everything goes well, unless I need to use GAE's authentication feature. After a successful login (on development env), I got following exception: java.security.AccessControlException: access denied (javax.security.auth.AuthPermission modifyPrincipals) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:76) at javax.security.auth.Subject$SecureSet.add(Unknown Source) at java.util.Collections$SynchronizedCollection.add(Unknown Source) at org.restlet.engine.servlet.ServletCall.getSubject(ServletCall.java:345) at org.restlet.engine.http.HttpRequest.getClientInfo(HttpRequest.java:231) Can I just use a mock Subject in gae env? Cheers, Keke - We paranoid love life -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1791082
MediaType: should application/xml be compatible with application/*+xml?
Hi, As title, should mediatype application/xml be compatible with application/*+xml? I thought it should be true, but In MediaType.includes method (1.2-M1), it says: } else if (getSubType().startsWith(*+) included.getSubType().endsWith( getSubType().substring(1))) { result = true; } Ans seems to me the answer is false. Which should be the correct answer? -- Cheers, Keke - We paranoid love life -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1163421
Re: calling PUT and DELETE
Or I think you can directly set your HTTP method to PUT or DELETE if you use XmlHttpRequest of Mozilla. On Mon, Nov 24, 2008 at 10:29 PM, Thierry Boileau [EMAIL PROTECTED] wrote: Hello, using the tunnelService (see http://www.restlet.org/documentation/1.1/api/org/restlet/service/TunnelService.html), you can invoke PUT and DELETE methods on a resource using a POST request and the method query parameter: For example, if your resource is http://example.com/my/resource, you can POST to http://example.com/my/resource?method=put. Best regards, Thierry Boileau -- Restlet ~ Core developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com Hi, i am working on a web application using RESTlet, wanted to invoke PUT and DELETE. some time back when i am searching for restlet resources i came across one page where author discussing about invoking PUT and DELETE using ajax, can any one tell me what URL that is available or tell me how it can be done? Thanks in advance -- Cheers, Keke - We paranoid love life
Re: Static files: no available connector for FILE
Have you add FILE protocol into your Component? Like component.getClients.add(Protocol.FILE) On Sun, Nov 16, 2008 at 12:54 PM, Matt [EMAIL PROTECTED] wrote: WARNING: No available server connector supports the required protocols: FILE . Please add the JAR of a matching connector to your classpath. Which jar file contains the connector implementation for the FILE protocol? Here is what I'm including: org.restlet.jar com.noelios.restlet.jar com.noelios.restlet.ext.simple_3.1.jar org.simpleframework_3.1/org.simpleframework.jar -- Cheers, Keke - We paranoid love life
Re: which is better way for web application using RESTlet?
I am also quite interested in the latter two options. Will Restlet team give out a standard(or recommended) approach about how to deploy a web application using for example option 2, for example a WebApplication which has lots of well-defined elements for serving static resources from a jar or some other locations? On Fri, Nov 14, 2008 at 10:10 PM, Rob Heittman [EMAIL PROTECTED]wrote: It depends on what you are trying to build with Restlet. If you need something that a JEE container provides (e.g. lifecycle services, deploy/undeploy applications, integration with existing Servlet code), or are required to run in an existing JEE container for business reasons, then you should use the ServerServlet approach. If you don't need any of the JEE container features and aren't using any Servlet API, it is good to have the ability to run Restlet in standalone mode (start Component from main) with your choice of connector. This is excellent for lightweight embedded systems, and also for any legacy-free new application which is designed totally around Restlet and doesn't need any JEE baggage. There is also at least one other really interesting option, which is to run Restlet as an OSGi service within an OSGi framework. This shares some properties/advantages of both the JEE and Standalone approach, and introduces other neat possibilities. Some of us (at least Hendy and I that I know of) have played with Restlet on OSGi a lot. - Rob On Fri, Nov 14, 2008 at 8:47 AM, Gan123 [EMAIL PROTECTED] wrote: Hi, i am new to restlet, started exploring. i found we can access an application mapped to ServerServlet in a web application, as well we can create a application where we use restlet client to create a client and use main to start application. in the first approach we are using the web server, where as the second approach we use restlet webcontainer for our application launch.. am i right? if not clarify me, as tell me which way is suggested and best Thanks in advance -- View this message in context: http://n2.nabble.com/which-is-better-way-for-web-application-using-RESTlet--tp1498498p1498498.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- Cheers, Keke - We paranoid love life
Re: which is better way for web application using RESTlet?
Yes. On Fri, Nov 14, 2008 at 10:59 PM, Thierry Boileau [EMAIL PROTECTED] wrote: Hello, by option 2, do you mean the standalone mode? best regards, Thierry Boileau I am also quite interested in the latter two options. Will Restlet team give out a standard(or recommended) approach about how to deploy a web application using for example option 2, for example a WebApplication which has lots of well-defined elements for serving static resources from a jar or some other locations? On Fri, Nov 14, 2008 at 10:10 PM, Rob Heittman [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: It depends on what you are trying to build with Restlet. If you need something that a JEE container provides (e.g. lifecycle services, deploy/undeploy applications, integration with existing Servlet code), or are required to run in an existing JEE container for business reasons, then you should use the ServerServlet approach. If you don't need any of the JEE container features and aren't using any Servlet API, it is good to have the ability to run Restlet in standalone mode (start Component from main) with your choice of connector. This is excellent for lightweight embedded systems, and also for any legacy-free new application which is designed totally around Restlet and doesn't need any JEE baggage. There is also at least one other really interesting option, which is to run Restlet as an OSGi service within an OSGi framework. This shares some properties/advantages of both the JEE and Standalone approach, and introduces other neat possibilities. Some of us (at least Hendy and I that I know of) have played with Restlet on OSGi a lot. - Rob On Fri, Nov 14, 2008 at 8:47 AM, Gan123 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, i am new to restlet, started exploring. i found we can access an application mapped to ServerServlet in a web application, as well we can create a application where we use restlet client to create a client and use main to start application. in the first approach we are using the web server, where as the second approach we use restlet webcontainer for our application launch.. am i right? if not clarify me, as tell me which way is suggested and best Thanks in advance -- View this message in context: http://n2.nabble.com/which-is-better-way-for-web-application-using-RESTlet--tp1498498p1498498.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- Cheers, Keke - We paranoid love life -- Cheers, Keke - We paranoid love life
Re: Attribute and URI patterns
Hi Have you tried to remove the last question mark in your DELETE router uri template? Actually, it is not necessary to declare the query part (anything after ?) in the uri template. If you do not do this, you can still get the query name and value from Resource of request.getResourceRef(). On Sat, Apr 12, 2008 at 3:54 AM, Bao,Sam [EMAIL PROTECTED] wrote: I'm trying to attach two different URI patterns to the same resource so that I can use different patterns for GET, POST, PUT, DELETE However, what I'm currently doing only GET works, and the attributes are null in DELETE. I'm using the representations in the POST and PUT, so that part seems fine to me right now. Any advice for GET and DELETE? This is what I'm doing right now Router resultRouter = new Router(getContext()); resultRouter.attach(/result, ResultResource.class); //initial route resultRouter.attach(/result/{getId}, ResultResource.class); //route for GET with a getId attribute resultRouter.attach(/result/{deleteId}/{deleteVersion}?, ResultResource.class); //route DELETE with a deleteId and a deleteVersion attribute resultRouter.attach(/result?{method}, ResultResource.class); //route for POST with a method attribute With the above code, in the GET, I'm able to use the getId attribute, but in the DELETE, the deleteId and deleteVersion attributes don't exist, and thus null. Any help or point me in the right direction, would be mucho appreciated. Thanks. -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. -- Cheers, Keke - We paranoid love life
Re: File extensions to select variants
Good for me :) On Thu, Mar 20, 2008 at 6:19 PM, Jerome Louvel [EMAIL PROTECTED] wrote: Hi all, I agree with Stephan that only recognized extensions in the last URI segment should be cut. The feature could be deactivated on a per-application basis. Also, the supporting filter in the NRE packages could always be used manually, but from an API user point of view, it is easier to expose it via the TunnelService class. Keke, would that be fine? Best regards, Jerome -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : jeudi 20 mars 2008 09:21 À : discuss@restlet.tigris.org Objet : Re: File extensions to select variants Hello keke, I am afraid that making this a default feature of application a bit dangerous. it will be possible, to disable this feature. I prefer, to disable it by default. Why not create a filter to do this? Users can then apply the filter if they want this feature. My first proposal was also to create a filter. But a lot of logic is already available in the TunnelFilter. I think the filter should only cut extension that are matched. best regards Stephan -- Cheers, Keke - We paranoid love life
Re: File extensions to select variants
I am afraid that making this a default feature of application a bit dangerous. Why not create a filter to do this? Users can then apply the filter if they want this feature. It might be possible the .xxx suffix is not served as a file extension rather than a special meaning for a service, If the URI reference is cut, this might be a problem. Sometimes the request URL On Tue, Mar 18, 2008 at 4:57 PM, Jerome Louvel [EMAIL PROTECTED] wrote: Hi all, We have started to discuss with Chuck Mortimer and Stephan Koops the support of file extensions to influence the content negotiation in Restlet. This is tracked in the following RFE: Support variant selection based on file extension http://restlet.tigris.org/issues/show_bug.cgi?id=463 The solution we are now considering is to enhance the TunnelService (one for each application) to support the automatic modification of the Accept, Accept-Language, Accept-Encoding, Accept-Charset headers (actually the Restlet equivalents in ClientInfo) based on the given file extensions and on the metadata associated (via the MetadataService). When processing a request with a resourceRef having file extensions, the idea is to update the client preferences and cut the URI reference to remove the extensions. With this, the application itself would not know or have to care about which way was used to select the variants (via Accept* headers, via tunnel query parameters or via tunnel file extensions). Also, we want to enable it by default and to refactor the Directory Restlet to take advantage of it instead of its internal mechanism. Any opinion on this new feature before we start coding it? Best regards, Jerome -- Cheers, Keke - We paranoid love life
ModificationDate of representation of static resource using CLAP protocol
Hi All, I tried to serve my static files using Restlet Directory component. I use CLAP as the scheme of root url of Directory. Everything works fine for me expect that modification date of representation was not set by ClapClientHelper. I am not sure whether this is the intentional design or not. Is it OK to add this feature in future release? -- Cheers, Keke - We paranoid love life
Re: ModificationDate of representation of static resource using CLAP protocol
Actually classLoader gets a URL of a resource. URL url = classLoader.getResource(Reference.decode(path)); We can either get the last modified date by calling URL.openConnection ().getLastModified() or create a File instance out of that URL. On Sat, Mar 8, 2008 at 3:16 PM, Rob Heittman [EMAIL PROTECTED] wrote: Does the classloader expose modification dates on classpath resources? On Sat, Mar 8, 2008 at 2:11 AM, keke [EMAIL PROTECTED] wrote: Everything works fine for me expect that modification date of representation was not set by ClapClientHelper. -- Cheers, Keke - We paranoid love life
Re: Problem with Override annotation in tutorial examples
Maybe you should try to use JDK 6 On Thu, Mar 6, 2008 at 11:35 AM, Marcus [EMAIL PROTECTED] wrote: I think/hope that this should be a fairly simple issue to resolve... :) I am trying to get into Restlet, and its slow work. I have been going through the tutorials and trying out the example code and I've hit a piece of code that I can't compile. It is in Section 3: // Creating a minimal Restlet returning Hello World Restlet restlet = new Restlet() { @Override public void handle(Request request, Response response) { response.setEntity(Hello World!, MediaType.TEXT_PLAIN); } }; I am new to Java and can only assume this 'new' instantiation syntax creates an inline subclass with the 'handle(..)' method overridden. I've have knocked up some simple test code and found that you cannot define new methods, but you can override existing ones in this manner. It also seems that the Override annotation is unnecessary, it simply generates a compiler error if the method doesn't infact override a method in the super class. THE PROBLEM: In the above example, I get the following error with the Override notation: com\firstStepsServlet\SimpleRestlet.java:22: method does not override or implement a method from a supertype @Override ^ The error message does not seem correct though, as I can create a new class that extends the Restlet class that overrides this method and uses the Override notation, and does not generate this error. It also executes correctly. Any help with this would be appreciated as it seems that the tutorials continue to use this form of syntax. Thanks in advance -- Cheers, Keke - We paranoid love life
Re: HTML with REST
Another workable solution I have found -- if you are using XML and will get criticized for making up MIME types -- is to expose the browser-friendly HTML variant by itself on a distinct URI (e.g. person.html). That's sloppy too, just in a different way. I think this might be a better and clear way than specifying content type in the HTTP header. The book Restful web service also recommends doing this. It is both friendly to browser client and programmatic client. On Tue, Feb 19, 2008 at 12:41 AM, Rob Heittman [EMAIL PROTECTED] wrote: This legacy browser behavior is frustrating in the extreme. Why in heaven's name would a tool meant primarily for viewing HTML, request XML as a higher quality representation? Just goes to show how uber-excited everybody was about XML once upon a time. You know, because in the future, all web pages will someday be XML with a reference to an XSL stylesheet, not HTML. Choosing a different MediaType for your XML, that the browser doesn't ask for, is the usual solution. Now, packaging your data with JSON instead of XML will avoid the issue altogether, without making up MIME types =) - R On 2/18/08, Stephan Koops [EMAIL PROTECTED] wrote: if a browser requests to a REST server, some browsers (Firefox and IE for example, Opera not) requests text/xml and application/xml with a higher quality than text/html. -- Cheers, Keke - We paranoid love life
[GroovyRestlet] GroovyRestlet is hosted as a Groovy Module
GroovyRestlet is a simple and ease of use Groovy DSL for constructing Restlet application. Main features of GroovyRestlet: * Simple Groovy DSL syntax and shortcuts for easily constructing Restlet application * Better integration with Spring framework A simple example of GroovyRestlet DSL: builder.component{ current.servers.add(protocol.HTTP, 8182) application(uri:){ router{ def guard = guard(uri:/docs, scheme:challengeScheme.HTTP_BASIC, realm:Restlet Tutorials) guard.secrets.put(scott, tiger.toCharArray()) guard.next = directory(root:, autoAttach:false) restlet(uri:/users/{user}, handle:{req,resp- resp.setEntity(Account of user \${req.attributes.get('user')}\, mediaType.TEXT_PLAIN) }) restlet(uri:/users/{user}/orders, handle:{req, resp- resp.setEntity(Orders or user \${req.attributes.get('user')}\, mediaType.TEXT_PLAIN) }) restlet(uri:/users/{user}/orders/{order}, handle:{req, resp- def attrs = req.attributes def message = Order \${attrs.get('order')}\ for User \${attrs.get('user')}\ resp.setEntity(message, mediaType.TEXT_PLAIN) }) } } }.start() The detail introduction and examples of GroovyRestlet can be found here: http://docs.codehaus.org/display/GROOVY/GroovyRestlet GroovyRestlet 0.1-SNAPSHOT can be downloaded here: http://svn.codehaus.org/groovy-contrib/groovyrestlet/download/groovy-restlet-0.1-SNAPSHOT.jar Thanks for Guillaume Laforge and Jerome Louvel's help and suggestion, GroovyRestlet is hosted by Groovy as a contribution. Cheers, Keke - We paranoid love life
Re: GroovyRestlet, a simple DSL for constructing Restlet application easily
Hi Jerome, It will be great for me if this project could be accepted and hosted as a Groovy Module. Cheers, Keke On Tue, Feb 26, 2008 at 5:55 PM, Jerome Louvel [EMAIL PROTECTED] wrote: Hi keke! This is excellent and will remind to some long Restlet users an experience that was made on fluent builders early in API design. Lars are you around? :) It seems to me that Groovy DSL are much more capable of supporting this style of programming (DSL) than what we initially achieved with a pure Java fluent API. I have added Guillaume Laforge (Groovy manager) in copy. I remember a presentation on DSL that he made recently to me and a group of open source fellows. He might be interested in hosting your project as a Groovy module... :-) I've had a look at your converted tutorial examples and they look pretty nice and compact: http://code.google.com/p/groovy-restlet/wiki/RestletTutorialExample Great work! Best regards, Jerome -Message d'origine- De : keke [mailto:[EMAIL PROTECTED] Envoyé : mardi 26 février 2008 09:56 À : discuss@restlet.tigris.org Objet : GroovyRestlet, a simple DSL for constructing Restlet application easily Hi All, I am working a simple Groovy Builder http://groovy.codehaus.org/GroovyMarkup for Restlet, which intends to create a complex Restlet application using a simple shortcutting syntax. Also this builder is trying to support smooth Spring integration. Here is a short example builder.component{ current.servers.add(protocol.HTTP, 8182) application(uri:){ router{ def guard = guard(uri:/docs, scheme:challengeScheme.HTTP_BASIC, realm:Restlet Tutorials) guard.secrets.put(scott, tiger.toCharArray()) guard.next = directory(root:, autoAttach:false) restlet(uri:/users/{user}, handle:{req,resp- resp.setEntity(Account of user \${req.attributes.get('user')}\, mediaType.TEXT_PLAIN) }) restlet(uri:/users/{user}/orders, handle:{req, resp- resp.setEntity(Orders or user \${req.attributes.get('user')}\, mediaType.TEXT_PLAIN) }) restlet(uri:/users/{user}/orders/{order}, handle:{req, resp- def attrs = req.attributes def message = Order \${attrs.get('order')}\ for User \${attrs.get('user')}\ resp.setEntity(message, mediaType.TEXT_PLAIN) }) } } }.start() For more detail, please visit project site http://code.google.com/p/groovy-restlet/. More examples are provided. I am not sure whether this would be a nice idea, any comments and suggestions are highly appreciated. -- We paranoid love life - We paranoid love life
GroovyRestlet, a simple DSL for constructing Restlet application easily
Hi All, I am working a simple Groovy Builderhttp://groovy.codehaus.org/GroovyMarkupfor Restlet, which intends to create a complex Restlet application using a simple shortcutting syntax. Also this builder is trying to support smooth Spring integration. Here is a short example builder.component{ current.servers.add(protocol.HTTP, 8182) application(uri:){ router{ def guard = guard(uri:/docs, scheme:challengeScheme.HTTP_BASIC, realm:Restlet Tutorials) guard.secrets.put(scott, tiger.toCharArray()) guard.next = directory(root:, autoAttach:false) restlet(uri:/users/{user}, handle:{req,resp- resp.setEntity(Account of user \${req.attributes.get('user')}\, mediaType.TEXT_PLAIN) }) restlet(uri:/users/{user}/orders, handle:{req, resp- resp.setEntity(Orders or user \${req.attributes.get('user')}\, mediaType.TEXT_PLAIN) }) restlet(uri:/users/{user}/orders/{order}, handle:{req, resp- def attrs = req.attributes def message = Order \${attrs.get('order')}\ for User \${attrs.get('user')}\ resp.setEntity(message, mediaType.TEXT_PLAIN) }) } } }.start() For more detail, please visit project site http://code.google.com/p/groovy-restlet/. More examples are provided. I am not sure whether this would be a nice idea, any comments and suggestions are highly appreciated. -- We paranoid love life