RE: Acegi support [was: AuthenticatedUser [was: Request in checkSecret()]]

2008-02-06 Thread Jerome Louvel

Hi Rhett,

Great feed-back, I've added your comment to the RFE and replied directly
there.
http://restlet.tigris.org/issues/show_bug.cgi?id=264

Unless others want to jump in an have a broader discussion via the list, I
suggest to continue discussing specifics via the issue comment system.

Best regards,
Jerome  

> -Message d'origine-
> De : Rhett Sutphin [mailto:[EMAIL PROTECTED] 
> Envoyé : mercredi 6 février 2008 19:42
> À : discuss@restlet.tigris.org
> Objet : Acegi support [was: AuthenticatedUser [was: Request 
> in checkSecret()]]
> 
> Hi,
> 
> > Now all the logic specific to authentication schemes is delegated to
> > the Engine. It will now be easy to add pluggable authentication  
> > modules.
> 
> That's great to hear.
> 
> > "Support Acegi"
> > http://restlet.tigris.org/issues/show_bug.cgi?id=264
> 
> The project for which I'm using Restlet uses Acegi for 
> security, so I  
> may be able to provide some input and/or code for this support.  One  
> thing I would note at the outset is that Acegi is a large library,  
> with support for many kinds of authentication/authorization and many  
> protocols, so it's probably worthwhile to examine what scope of  
> support would be useful.
> 
> For example, the application I'm working on supports either 
> username &  
> password authentication against the application database or 
> CAS-based  
> single sign on (the authentication mechanism is a deploy-time  
> option).  Both of these can be handled by Acegi using the same  
> interfaces, but at the HTTP level (i.e., for Restlet integration)  
> they'd be different, since they'd need different challenge schemes.   
> (In fact, I haven't found a defined challenge scheme that would work  
> for CAS, so it might have to be custom).
> 
> That's all to point out that "Acegi support" could be very simple  
> (provide a Guard which uses HTTP Basic or HTTP Digest and then  
> delegates the credential verification to an Acegi  
> AuthenticationProvider or AuthenticationManager) or much more 
> complex  
> (supporting all the authentication mechanisms Acegi supports; using  
> Acegi decision mechanisms for authorization).  I, for one, am 
> not sure  
> what amount would be generally useful.  Did the original feature  
> requester have any more detailed suggestions about what would be  
> useful for him?
> 
> Rhett
> 
> On Feb 6, 2008, at 8:11 AM, Jerome Louvel wrote:
> 
> >
> > Hi Stephan,
> >
> > Somehow, I didn't get this email before. It doesn't appear in the  
> > archives
> > either, so it was probably lost on the way. Anyway, thanks for  
> > forwarding it
> > again :)
> >
> >>> Yes, I think attributes are the perfect place to put such
> >>> information, you can add a user "role" or any other application
> >>> specific info about your authenticated user.
> >>
> >> I've implemented this feature for the JAX-RS implementation
> >> by putting an java.security.Principal into the request attribute
> >> map. Should I made this available for the Restlet API?
> >> I would change the Guard, that it set the Principal into the
> >> attribute map for key "java.security.Principal" (in the accept()
> >> method, if it is ok) and add a method Util.getPrincipal()
> >> ( or Guard.getPrincipal()? ) that returns the Principal, or
> >> null, if it is not set.
> >
> > I know that Principal is widely used in Java security APIs, 
> but I'm  
> > not
> > convinced yet that we should explicitly support it in the 
> Guard class.
> >
> > Personally, I need more feed-back to move further in this area. We  
> > have just
> > landed a patch to add support for HTTP DIGEST, it required a few  
> > changes to
> > Guard. Now all the logic specific to authentication schemes is  
> > delegated to
> > the Engine. It will now be easy to add pluggable authentication  
> > modules.
> > When we add this feature in 1.2, we should definitely consider the  
> > support
> > for JAAS (JDK's authentication APIs).
> >
> > I've added two related comments:
> > http://restlet.tigris.org/issues/show_bug.cgi?id=229
> >
> > We also have two RFE for integration with third-party solutions:
> >
> > "Support Acegi"
> > http://restlet.tigris.org/issues/show_bug.cgi?id=264
> >
> > "Support jGuard"
> > http://restlet.tigris.org/issues/show_bug.cgi?id=265
> >
> > Best regards,
> > Jerome
> >
> 



Re: Jaxb representation (HELP!)

2008-02-06 Thread dev dev
Thanks Florian. It works after i change it to test_binding. Now i got this
exception right after the following statement got executed but it seems to
go through fine.

Customer customer = new Customer("foo", "bar");
return new JibxRepresentation(MediaType.APPLICATION_XML, customer,
"test_binding");

=
Here is the exception
INFO: Exception intercepted
java.io.IOException: Stream closed
at simple.http.ResponseStream.ensureOpen(ResponseStream.java:286)
at simple.http.ResponseStream.flushBuffer(ResponseStream.java:204)
at simple.http.ResponseStream.flush(ResponseStream.java:190)
at com.noelios.restlet.http.HttpServerCall.sendResponse(
HttpServerCall.java:368)
at com.noelios.restlet.http.HttpServerConverter.commit(
HttpServerConverter.java:152)
at com.noelios.restlet.http.HttpServerHelper.handle(
HttpServerHelper.java:95)
at com.noelios.restlet.ext.simple.SimpleProtocolHandler.handle(
SimpleProtocolHandler.java:67)
at simple.http.Dispatcher.run(Dispatcher.java:83)
at simple.util.process.Daemon.execute(Daemon.java:121)
at simple.util.process.Daemon.run(Daemon.java:106)



On Feb 6, 2008 10:51 AM, dev dev <[EMAIL PROTECTED]> wrote:

> Error in the code. It should be as follows. I will try with you recommend
> and let you know. So you don't need the full path to the binding filename (
> e.g.
> src/main/java/com/mycompany/test/test_binding), how does jibx know where
> to find that file without a full path?
>
> Also, in your code, you use a combination of bindingName +
> bindingclass.tostring() as the key. It's bad IMO if you're toString() is
> long. It should be just bindingName + bindingClass.getName().
>
> IBindingFactory jibxBFact = bindingFactories.get(bindingName
> + bindingClass.toString());
>
> 
>
> Customer customer = new Customer("foo", "bar");
> return new JibxRepresentation(MediaType.APPLICATION_XML, customer,
> "test_binding");
>
>
> On Feb 6, 2008 10:31 AM, Florian Schwarz <[EMAIL PROTECTED]>
> wrote:
>
> >  could you try to replace "test-binding.xml" with "test_binding" (and
> > "test-binding"):
> >
> > return new JibxRepresentation(MediaType.APPLICATION_XML, Customer.class,
> > "test_binding");
> >
> > (I think either the plugin or JiBX self has proplems with the '-' and I
> > think the '.xml' should be removed)
> >
> >
> > If that does not work I recommend to check wheter the bytecode of the
> > Customer class has been enhanced. For this purpose you could try to
> > marshal/unmarhal it with JiBX by hand or use Reflection to see whether JiBX
> > has added some methods.
> >
> > dev dev schrieb:
> >
> > what is the definition of binding name or bindingClass? We have the
> > binding file test-binding.xml under /src/main/java/com/mycompany/test
> > and our Customer class i under src/main/java/com/mycompany/test/data/.
> >
> > In the Representation represent(Variant variant) method {
> >  etc...
> >
> > return new JibxRepresentation(MediaType.APPLICATION_XML, Customer.class,
> > "test-binding.xml");
> > }
> >
> > Thanks
> > dev
> >
> >
> > On Feb 6, 2008 12:41 AM, Florian Schwarz <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Hi dev,
> > >
> > > your integration of the JiBX-Maven2-Plugin looks good so far. Please
> > > send the code of the test case and the JJiBX-Binding that uses the
> > > JibxRepresentation.
> > >
> > > I think, that you have not specified the bindingClass, that should bes
> > > used.
> > >
> > > Cheers
> > > Flo.
> > >
> > >
> > > dev dev schrieb:
> > >  > Finally got every integrated to our maven 2 build. However, we got
> > > > this exception when running  one of our test cases (mvn test
> > > > -Dtest=testjibx). We define the jiBX binding in our pom.xml. What
> > > did
> > > > we do wrong?
> > > >
> > > >  
> > > >org.jibx
> > > >maven-jibx-plugin
> > > >1.1.5
> > > >
> > > >   src/main/java
> > > >   
> > > >   *-binding.xml
> > > >   
> > > >   
> > > >  template-binding.xml
> > > >   
> > > >   true
> > > >   
> > > >
> > > >
> > > >  compile
> > > >  
> > > >  bind
> > > > 
> > > >
> > > >
> > > > 
> > > >
> > > > Output
> > > >
> > > -
> > > > INFO: Exception intercepted
> > > > java.io.IOException: Unable to access binding information for class
> > > > java.lang.Class
> > > > Make sure the binding has been compiled
> > > > at
> > > > org.restlet.ext.jibx.JibxRepresentation.write(
> > > JibxRepresentation.java:219)
>

RE: Evaluating Restlet

2008-02-06 Thread Jerome Louvel

Hi Jaime,

Thanks, I've added the link as a new comment. Feel free to comment
issues/RFEs directly if you want to.

Best regards,
Jerome  

> -Message d'origine-
> De : jbarciela jbarciela [mailto:[EMAIL PROTECTED] 
> Envoyé : mercredi 6 février 2008 21:34
> À : discuss@restlet.tigris.org
> Objet : Re: Evaluating Restlet
> 
> a possible addition to that list (probably you know the link but I
> didn't see it in the list), is Tomcat 6's approach, they named the
> interface "CometProcessor"
> 
> http://tomcat.apache.org/tomcat-6.0-doc/aio.html
> 
> hope it helps
> Jaime
> 
> 
> On Feb 5, 2008 6:01 PM, Rob Heittman 
> <[EMAIL PROTECTED]> wrote:
> >
> > Exactly ...
> >
> > In my case, I'm working on Restlet API support in Google 
> Web Toolkit using
> > XmlHttpRequest as the "Client".  As this is idiomatically 
> an asynchronous
> > facility -- regardless of whether your response is short 
> lived (AJAX style)
> > or long lived (Comet style), the API needs ways of handling 
> clients that
> > behave asynchronously, which it presently lacks.  Several 
> interesting
> > connectors like Jetty have also introduced neat new 
> facilities driven by the
> > desire to make the Comet style more manageable on the 
> server side, so it's
> > not just about the client side.
> >
> > Have a look at this RFE and its references:
> > http://restlet.tigris.org/issues/show_bug.cgi?id=143   ...  
>  you guessed
> > right, it started with an observation about the Comet style.
> >
> > - Rob
> >
> >
> >
> > On 2/5/08, jbarciela jbarciela <[EMAIL PROTECTED]> wrote:
> > > When you say "callbacks", what do you have in mind? 
> Something like Comet?
> > >
> > > Cheers
> > > Jaime
> > >
> >
> >



Re: ServerServlet: [Noelios Restlet Engine] - classpath - resin 3.1.x - linux

2008-02-06 Thread Lawrence Kalinowski
hi Joe - 

Just saw your q's.

Are you restarting the resin server or the jvm at all when trying to 
redeploy/undeploy? Yep. I was restarting each time.

Do you have other apps running in the resin server that are using different 
versions of the restlet api jars? No. It was a fresh install.

I think I just found a new way to foobar the 3.1.x install - can't point the
finger anywhere else.

cheers.



Re: ServerServlet: [Noelios Restlet Engine] - classpath - resin 3.1.x - linux

2008-02-06 Thread Lawrence Kalinowski
Lawrence Kalinowski  gmail.com> writes:

3.0.25 works fine. Likely just a case of me not setting something up (ie. the
cp) right on the 3.1.3 build; then doing it right the second time.






Re: ServerServlet: [Noelios Restlet Engine] - classpath - resin 3.1.x - linux

2008-02-06 Thread Joe Nellis

Lawernce,

Maybe you can add to this then:
http://restlet.tigris.org/issues/show_bug.cgi?id=379

Are you restarting the resin server or the jvm at all when trying to 
redeploy/undeploy?
Do you have other apps running in the resin server that are using different 
versions of the restlet api jars?


Joe.



- Original Message - 
From: "Lawrence Kalinowski" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, February 06, 2008 5:16 PM
Subject: ServerServlet: [Noelios Restlet Engine] - classpath - resin 3.1.x - 
linux




Hi -

Have been butting my head against what seems a simple problem.

On my development system (Windows XP - resin 3.0.19 - SUN JDK 1.5) I am 
using
restlet within a resin 3.0.19 servlet container using the ServerServlet as 
an

adapter. Everything works fine in development - no worries.

But when I move the webapp to Linux - resin 3.1.3 environment the adapter 
fails
due to a noclassdef found exception (the application class as indicated in 
the

context-param element for the key "org.restlet.application").

Exact same config between the two ServletContainers but the noelios class 
loader

is bombing out b/c it can't find the Application in the classpath.

I'll probably drop the resin down  to 3.0.19 and rebuild ... see if it is 
the

same issue then. If it goes away I'll update this thread.

But in the meantime, I've verified the classpath is fine - any ideas why 
the

classloader for ServerServlet is unable to find the class?

thnx much - lwk







ServerServlet: [Noelios Restlet Engine] - classpath - resin 3.1.x - linux

2008-02-06 Thread Lawrence Kalinowski
Hi -

Have been butting my head against what seems a simple problem. 

On my development system (Windows XP - resin 3.0.19 - SUN JDK 1.5) I am using
restlet within a resin 3.0.19 servlet container using the ServerServlet as an
adapter. Everything works fine in development - no worries. 

But when I move the webapp to Linux - resin 3.1.3 environment the adapter fails
due to a noclassdef found exception (the application class as indicated in the
context-param element for the key "org.restlet.application"). 

Exact same config between the two ServletContainers but the noelios class loader
is bombing out b/c it can't find the Application in the classpath.

I'll probably drop the resin down  to 3.0.19 and rebuild ... see if it is the
same issue then. If it goes away I'll update this thread.

But in the meantime, I've verified the classpath is fine - any ideas why the
classloader for ServerServlet is unable to find the class? 

thnx much - lwk





Re: Set Content-Type response header within resource

2008-02-06 Thread Stephan Koops

I don't know, but I think so.
Because I'm developing an extension, so I working on the trunk.

Otherwise you can set the header directly.

Stephan

Bob Harrod schrieb:

Unfortunately, I'm using 1.0.7, and I don't see this method.
I did locate it in the 1.1 API.  I thought 1.1 was in beta, so I
avoided this version - is 1.1 stable?

Is there an equivalent in 1.0.7, or will I have to upgrade?
  


Re: Set Content-Type response header within resource

2008-02-06 Thread Bob Harrod
Unfortunately, I'm using 1.0.7, and I don't see this method.
I did locate it in the 1.1 API.  I thought 1.1 was in beta, so I
avoided this version - is 1.1 stable?

Is there an equivalent in 1.0.7, or will I have to upgrade?






Re: Set Content-Type response header within resource

2008-02-06 Thread Stephan Koops

Hello Bob,

Try  result.setDownloadName(..)

Stephan

Bob Harrod schrieb:

That worked well, thank you - could you tell me how to set the file name of the
response?  I tried setIdentifier(), but it does not seem to work:

result = new StringRepresentation( "...", MediaType.valueOf( "..." ) );
result.setIdentifier( "facility.kml" );
  


Re: Set Content-Type response header within resource

2008-02-06 Thread Bob Harrod
That worked well, thank you - could you tell me how to set the file name of the
response?  I tried setIdentifier(), but it does not seem to work:

result = new StringRepresentation( "...", MediaType.valueOf( "..." ) );
result.setIdentifier( "facility.kml" );





Re: Evaluating Restlet

2008-02-06 Thread jbarciela jbarciela
a possible addition to that list (probably you know the link but I
didn't see it in the list), is Tomcat 6's approach, they named the
interface "CometProcessor"

http://tomcat.apache.org/tomcat-6.0-doc/aio.html

hope it helps
Jaime


On Feb 5, 2008 6:01 PM, Rob Heittman <[EMAIL PROTECTED]> wrote:
>
> Exactly ...
>
> In my case, I'm working on Restlet API support in Google Web Toolkit using
> XmlHttpRequest as the "Client".  As this is idiomatically an asynchronous
> facility -- regardless of whether your response is short lived (AJAX style)
> or long lived (Comet style), the API needs ways of handling clients that
> behave asynchronously, which it presently lacks.  Several interesting
> connectors like Jetty have also introduced neat new facilities driven by the
> desire to make the Comet style more manageable on the server side, so it's
> not just about the client side.
>
> Have a look at this RFE and its references:
> http://restlet.tigris.org/issues/show_bug.cgi?id=143   ...   you guessed
> right, it started with an observation about the Comet style.
>
> - Rob
>
>
>
> On 2/5/08, jbarciela jbarciela <[EMAIL PROTECTED]> wrote:
> > When you say "callbacks", what do you have in mind? Something like Comet?
> >
> > Cheers
> > Jaime
> >
>
>


Re: Set Content-Type response header within resource

2008-02-06 Thread Bob Harrod
Stephan,

I think that's it - thank you.

- Bob



Re: Set Content-Type response header within resource

2008-02-06 Thread Stephan Koops

Hello Bob,

you should give the StringRepresentation the right MediaType:

@Override
   public Representation getRepresentation( Variant variant ){
Representation result = null;
   if( variant.getMediaType().equals(MediaType.APPLICATION_XML ) ) {
  result = new StringRepresentation( ".", 
MediaType.valueOf("application/vnd.google-earth.kml+xml"));
   return result;
   }
   }


best regards
  Stephan

Bob Harrod schrieb:

I'm trying to do something that seems very easy, but I cannot find any
documentation on how to do this with Restlet.  I've created a few resources and
I want to change the content-type header to KML...  I'm not sure why this is so
difficult.  Any help would be greatly appreciated!

Essentially:


public KMLResource( Context context, Request request, Response response ){
super( context, request, response );
response.setHeader( "Content-Type",
"application/vnd.google-earth.kml+xml" );

}

@Override
public Representation getRepresentation( Variant variant ){

Representation result = null;

if( variant.getMediaType().equals(MediaType.APPLICATION_XML ) ) {

   result = new StringRepresentation( "." );
   return result;
}
}

  


Re: Set Content-Type response header within resource

2008-02-06 Thread Bob Harrod
Bob Harrod  hotmail.com> writes:

> 
> I'm trying to do something that seems very easy, but I cannot find any
> documentation on how to do this with Restlet.  I've created a few resources 
> and
> I want to change the content-type header to KML...  I'm not sure why this is 
> so
> difficult.  Any help would be greatly appreciated!
> 
> Essentially:
> 
> public KMLResource( Context context, Request request, Response response ){
>   super( context, request, response );
> response.setHeader( "Content-Type",
> "application/vnd.google-earth.kml+xml" );
> 
> }
> 
> @Override
> public Representation getRepresentation( Variant variant ){
> 
>   Representation result = null;
> 
> if( variant.getMediaType().equals(MediaType.APPLICATION_XML ) ) {
> 
>result = new StringRepresentation( "." );
>  return result;
> }
> }
> 
> 


I also tried the following, but received a WARNING: "Addition of the standard
header 'Content-Type' is not allowed.  Please us the Restlet API instead.".  The
result did not contain the correct header.

Map attributes = response.getAttributes();
Form headerForm = (Form)attributes.get( "org.restlet.http.headers" );

if( headerForm == null ){
headerForm = new Form();
}

headerForm.add( "Content-Type", "application/vnd.google-earth.kml+xml" );

attributes.put( "org.restlet.http.headers", headerForm );



Set Content-Type response header within resource

2008-02-06 Thread Bob Harrod
I'm trying to do something that seems very easy, but I cannot find any
documentation on how to do this with Restlet.  I've created a few resources and
I want to change the content-type header to KML...  I'm not sure why this is so
difficult.  Any help would be greatly appreciated!

Essentially:


public KMLResource( Context context, Request request, Response response ){
super( context, request, response );
response.setHeader( "Content-Type",
"application/vnd.google-earth.kml+xml" );

}

@Override
public Representation getRepresentation( Variant variant ){

Representation result = null;

if( variant.getMediaType().equals(MediaType.APPLICATION_XML ) ) {

   result = new StringRepresentation( "." );
   return result;
}
}



Re: Jaxb representation (HELP!)

2008-02-06 Thread dev dev
Error in the code. It should be as follows. I will try with you recommend
and let you know. So you don't need the full path to the binding filename (
e.g.
src/main/java/com/mycompany/test/test_binding), how does jibx know where to
find that file without a full path?

Also, in your code, you use a combination of bindingName +
bindingclass.tostring() as the key. It's bad IMO if you're toString() is
long. It should be just bindingName + bindingClass.getName().

IBindingFactory jibxBFact = bindingFactories.get(bindingName
+ bindingClass.toString());



Customer customer = new Customer("foo", "bar");
return new JibxRepresentation(MediaType.APPLICATION_XML, customer,
"test_binding");

On Feb 6, 2008 10:31 AM, Florian Schwarz <[EMAIL PROTECTED]>
wrote:

>  could you try to replace "test-binding.xml" with "test_binding" (and
> "test-binding"):
>
> return new JibxRepresentation(MediaType.APPLICATION_XML, Customer.class,
> "test_binding");
>
> (I think either the plugin or JiBX self has proplems with the '-' and I
> think the '.xml' should be removed)
>
>
> If that does not work I recommend to check wheter the bytecode of the
> Customer class has been enhanced. For this purpose you could try to
> marshal/unmarhal it with JiBX by hand or use Reflection to see whether JiBX
> has added some methods.
>
> dev dev schrieb:
>
> what is the definition of binding name or bindingClass? We have the
> binding file test-binding.xml under /src/main/java/com/mycompany/test and
> our Customer class i under src/main/java/com/mycompany/test/data/.
>
> In the Representation represent(Variant variant) method {
>  etc...
>
> return new JibxRepresentation(MediaType.APPLICATION_XML, Customer.class, "
> test-binding.xml");
> }
>
> Thanks
> dev
>
>
> On Feb 6, 2008 12:41 AM, Florian Schwarz <[EMAIL PROTECTED]>
> wrote:
>
> > Hi dev,
> >
> > your integration of the JiBX-Maven2-Plugin looks good so far. Please
> > send the code of the test case and the JJiBX-Binding that uses the
> > JibxRepresentation.
> >
> > I think, that you have not specified the bindingClass, that should bes
> > used.
> >
> > Cheers
> > Flo.
> >
> >
> > dev dev schrieb:
> >  > Finally got every integrated to our maven 2 build. However, we got
> > > this exception when running  one of our test cases (mvn test
> > > -Dtest=testjibx). We define the jiBX binding in our pom.xml. What did
> > > we do wrong?
> > >
> > >  
> > >org.jibx
> > >maven-jibx-plugin
> > >1.1.5
> > >
> > >   src/main/java
> > >   
> > >   *-binding.xml
> > >   
> > >   
> > >  template-binding.xml
> > >   
> > >   true
> > >   
> > >
> > >
> > >  compile
> > >  
> > >  bind
> > > 
> > >
> > >
> > > 
> > >
> > > Output
> > >
> > -
> > > INFO: Exception intercepted
> > > java.io.IOException: Unable to access binding information for class
> > > java.lang.Class
> > > Make sure the binding has been compiled
> > > at
> > > org.restlet.ext.jibx.JibxRepresentation.write(JibxRepresentation.java
> > :219)
> > > at
> > > com.noelios.restlet.http.HttpServerCall.writeResponseBody(
> > HttpServerCall.java:407)
> > > at
> > > com.noelios.restlet.http.HttpServerCall.sendResponse(
> > HttpServerCall.java:361)
> > > at
> > > com.noelios.restlet.http.HttpServerConverter.commit(
> > HttpServerConverter.java:152)
> > > at
> > > com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java
> > :95)
> > > at
> > > com.noelios.restlet.ext.simple.SimpleProtocolHandler.handle(
> > SimpleProtocolHandler.java:67)
> > > at simple.http.Dispatcher.run(Dispatcher.java:83)
> > > at simple.util.process.Daemon.execute(Daemon.java:121)
> > > at simple.util.process.Daemon.run(Daemon.java:106)
> > >
> > >
> > > On Feb 4, 2008 1:56 PM, dev dev <[EMAIL PROTECTED]
> >  > > wrote:
> > >
> > > Thanks much Jerome.
> > >
> > >
> > > On Feb 2, 2008 9:57 AM, Jerome Louvel <[EMAIL PROTECTED]
> >  > > wrote:
> > >
> > >
> > > Hi dev,
> > >
> > > I've just updated the build script to include JiBX and
> > > generate its Maven
> > > artifacts. It will be distributed with 1.1 M2, hopefully next
> > > week.
> > >
> > > Best regards,
> > > Jerome
> > >
> > > > -Message d'origine-
> >  > > De : dev dev [mailto:[EMAIL PROTECTED]  > [EMAIL PROTECTED]>]
> > > > Envoyé : samedi 2 février 2008 03

Acegi support [was: AuthenticatedUser [was: Request in checkSecret()]]

2008-02-06 Thread Rhett Sutphin

Hi,


Now all the logic specific to authentication schemes is delegated to
the Engine. It will now be easy to add pluggable authentication  
modules.


That's great to hear.


"Support Acegi"
http://restlet.tigris.org/issues/show_bug.cgi?id=264


The project for which I'm using Restlet uses Acegi for security, so I  
may be able to provide some input and/or code for this support.  One  
thing I would note at the outset is that Acegi is a large library,  
with support for many kinds of authentication/authorization and many  
protocols, so it's probably worthwhile to examine what scope of  
support would be useful.


For example, the application I'm working on supports either username &  
password authentication against the application database or CAS-based  
single sign on (the authentication mechanism is a deploy-time  
option).  Both of these can be handled by Acegi using the same  
interfaces, but at the HTTP level (i.e., for Restlet integration)  
they'd be different, since they'd need different challenge schemes.   
(In fact, I haven't found a defined challenge scheme that would work  
for CAS, so it might have to be custom).


That's all to point out that "Acegi support" could be very simple  
(provide a Guard which uses HTTP Basic or HTTP Digest and then  
delegates the credential verification to an Acegi  
AuthenticationProvider or AuthenticationManager) or much more complex  
(supporting all the authentication mechanisms Acegi supports; using  
Acegi decision mechanisms for authorization).  I, for one, am not sure  
what amount would be generally useful.  Did the original feature  
requester have any more detailed suggestions about what would be  
useful for him?


Rhett

On Feb 6, 2008, at 8:11 AM, Jerome Louvel wrote:



Hi Stephan,

Somehow, I didn't get this email before. It doesn't appear in the  
archives
either, so it was probably lost on the way. Anyway, thanks for  
forwarding it

again :)


Yes, I think attributes are the perfect place to put such
information, you can add a user "role" or any other application
specific info about your authenticated user.


I've implemented this feature for the JAX-RS implementation
by putting an java.security.Principal into the request attribute
map. Should I made this available for the Restlet API?
I would change the Guard, that it set the Principal into the
attribute map for key "java.security.Principal" (in the accept()
method, if it is ok) and add a method Util.getPrincipal()
( or Guard.getPrincipal()? ) that returns the Principal, or
null, if it is not set.


I know that Principal is widely used in Java security APIs, but I'm  
not

convinced yet that we should explicitly support it in the Guard class.

Personally, I need more feed-back to move further in this area. We  
have just
landed a patch to add support for HTTP DIGEST, it required a few  
changes to
Guard. Now all the logic specific to authentication schemes is  
delegated to
the Engine. It will now be easy to add pluggable authentication  
modules.
When we add this feature in 1.2, we should definitely consider the  
support

for JAAS (JDK's authentication APIs).

I've added two related comments:
http://restlet.tigris.org/issues/show_bug.cgi?id=229

We also have two RFE for integration with third-party solutions:

"Support Acegi"
http://restlet.tigris.org/issues/show_bug.cgi?id=264

"Support jGuard"
http://restlet.tigris.org/issues/show_bug.cgi?id=265

Best regards,
Jerome





Re: Jaxb representation (HELP!)

2008-02-06 Thread Florian Schwarz
could you try to replace "test-binding.xml" with "test_binding" (and 
"test-binding"):


return new JibxRepresentation(MediaType.APPLICATION_XML, Customer.class, 
"test_binding");


(I think either the plugin or JiBX self has proplems with the '-' and I 
think the '.xml' should be removed)



If that does not work I recommend to check wheter the bytecode of the 
Customer class has been enhanced. For this purpose you could try to 
marshal/unmarhal it with JiBX by hand or use Reflection to see whether 
JiBX has added some methods.


dev dev schrieb:
what is the definition of binding name or bindingClass? We have the 
binding file test-binding.xml under /src/main/java/com/mycompany/test 
and our Customer class i under src/main/java/com/mycompany/test/data/.


In the Representation represent(Variant variant) method {
 etc...

return new JibxRepresentation(MediaType.APPLICATION_XML, 
Customer.class, "test-binding.xml");

}

Thanks
dev


On Feb 6, 2008 12:41 AM, Florian Schwarz <[EMAIL PROTECTED] 
> wrote:


Hi dev,

your integration of the JiBX-Maven2-Plugin looks good so far. Please
send the code of the test case and the JJiBX-Binding that uses the
JibxRepresentation.

I think, that you have not specified the bindingClass, that should
bes used.

Cheers
Flo.


dev dev schrieb:
> Finally got every integrated to our maven 2 build. However, we got
> this exception when running  one of our test cases (mvn test
> -Dtest=testjibx). We define the jiBX binding in our pom.xml.
What did
> we do wrong?
>
>  
>org.jibx
>maven-jibx-plugin
>1.1.5
>
>   src/main/java
>   
>   *-binding.xml
>   
>   
>  template-binding.xml
>   
>   true
>   
>
>
>  compile
>  
>  bind
> 
>
>
> 
>
> Output
>

-
> INFO: Exception intercepted
> java.io.IOException: Unable to access binding information for class
> java.lang.Class
> Make sure the binding has been compiled
> at
>
org.restlet.ext.jibx.JibxRepresentation.write(JibxRepresentation.java:219)
> at
>

com.noelios.restlet.http.HttpServerCall.writeResponseBody(HttpServerCall.java:407)
> at
>

com.noelios.restlet.http.HttpServerCall.sendResponse(HttpServerCall.java:361)
> at
>

com.noelios.restlet.http.HttpServerConverter.commit(HttpServerConverter.java:152)
> at
>
com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:95)
> at
>

com.noelios.restlet.ext.simple.SimpleProtocolHandler.handle(SimpleProtocolHandler.java:67)
> at simple.http.Dispatcher.run(Dispatcher.java:83)
> at simple.util.process.Daemon.execute(Daemon.java:121)
> at simple.util.process.Daemon.run(Daemon.java:106)
>
>
> On Feb 4, 2008 1:56 PM, dev dev <[EMAIL PROTECTED]

> >> wrote:
>
> Thanks much Jerome.
>
>
> On Feb 2, 2008 9:57 AM, Jerome Louvel <[EMAIL PROTECTED]

> >>
wrote:
>
>
> Hi dev,
>
> I've just updated the build script to include JiBX and
> generate its Maven
> artifacts. It will be distributed with 1.1 M2, hopefully
next
> week.
>
> Best regards,
> Jerome
>
> > -Message d'origine-
> > De : dev dev [mailto:[EMAIL PROTECTED]
 >]
> > Envoyé : samedi 2 février 2008 03:10
> > À : discuss@restlet.tigris.org

> >
> > Objet : Re: Jaxb representation (HELP!)
> >
> > After playing with it a bit, we will go with jibx instead
> > (Thanks Florian) mainly  because of  performance and  its
> > java-centric XML mapping approach. That said, how come we
> > don't see jibx on
http://maven.restlet.org/org/restlet/. I do
> > see jaxb there.
> >
> > Thanks
> > dev
>  

Re: Jaxb representation (HELP!)

2008-02-06 Thread dev dev
what is the definition of binding name or bindingClass? We have the binding
file test-binding.xml under /src/main/java/com/mycompany/test and our
Customer class i under src/main/java/com/mycompany/test/data/.

In the Representation represent(Variant variant) method {
 etc...

return new JibxRepresentation(MediaType.APPLICATION_XML, Customer.class, "
test-binding.xml");
}

Thanks
dev


On Feb 6, 2008 12:41 AM, Florian Schwarz <[EMAIL PROTECTED]>
wrote:

> Hi dev,
>
> your integration of the JiBX-Maven2-Plugin looks good so far. Please
> send the code of the test case and the JJiBX-Binding that uses the
> JibxRepresentation.
>
> I think, that you have not specified the bindingClass, that should bes
> used.
>
> Cheers
> Flo.
>
>
> dev dev schrieb:
> > Finally got every integrated to our maven 2 build. However, we got
> > this exception when running  one of our test cases (mvn test
> > -Dtest=testjibx). We define the jiBX binding in our pom.xml. What did
> > we do wrong?
> >
> >  
> >org.jibx
> >maven-jibx-plugin
> >1.1.5
> >
> >   src/main/java
> >   
> >   *-binding.xml
> >   
> >   
> >  template-binding.xml
> >   
> >   true
> >   
> >
> >
> >  compile
> >  
> >  bind
> > 
> >
> >
> > 
> >
> > Output
> >
> -
> > INFO: Exception intercepted
> > java.io.IOException: Unable to access binding information for class
> > java.lang.Class
> > Make sure the binding has been compiled
> > at
> > org.restlet.ext.jibx.JibxRepresentation.write(JibxRepresentation.java
> :219)
> > at
> > com.noelios.restlet.http.HttpServerCall.writeResponseBody(
> HttpServerCall.java:407)
> > at
> > com.noelios.restlet.http.HttpServerCall.sendResponse(HttpServerCall.java
> :361)
> > at
> > com.noelios.restlet.http.HttpServerConverter.commit(
> HttpServerConverter.java:152)
> > at
> > com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java
> :95)
> > at
> > com.noelios.restlet.ext.simple.SimpleProtocolHandler.handle(
> SimpleProtocolHandler.java:67)
> > at simple.http.Dispatcher.run(Dispatcher.java:83)
> > at simple.util.process.Daemon.execute(Daemon.java:121)
> > at simple.util.process.Daemon.run(Daemon.java:106)
> >
> >
> > On Feb 4, 2008 1:56 PM, dev dev <[EMAIL PROTECTED]
> > > wrote:
> >
> > Thanks much Jerome.
> >
> >
> > On Feb 2, 2008 9:57 AM, Jerome Louvel <[EMAIL PROTECTED]
> > > wrote:
> >
> >
> > Hi dev,
> >
> > I've just updated the build script to include JiBX and
> > generate its Maven
> > artifacts. It will be distributed with 1.1 M2, hopefully next
> > week.
> >
> > Best regards,
> > Jerome
> >
> > > -Message d'origine-
> > > De : dev dev [mailto:[EMAIL PROTECTED]  >]
> > > Envoyé : samedi 2 février 2008 03:10
> > > À : discuss@restlet.tigris.org
> > 
> > > Objet : Re: Jaxb representation (HELP!)
> > >
> > > After playing with it a bit, we will go with jibx instead
> > > (Thanks Florian) mainly  because of  performance and  its
> > > java-centric XML mapping approach. That said, how come we
> > > don't see jibx on http://maven.restlet.org/org/restlet/. I do
> > > see jaxb there.
> > >
> > > Thanks
> > > dev
> > >
> > >
> > > On Jan 27, 2008 10:22 AM, dev dev <[EMAIL PROTECTED]
> > > wrote:
> > >
> > >
> > >   Great help Florian. We will definitely take a look at
> > > Jibx representation before considering JAXB.
> > >
> > >   Thank you.
> > >   dev
> > >
> > >
> > >   On Jan 27, 2008 1:17 AM, Florian Schwarz
> > > <[EMAIL PROTECTED]
> > > wrote:
> > >
> > >
> > >   Hi dev,
> > >
> > >   the usage of JaxbRepresentation is quite simple:
> > >
> > >   Java -> XML
> > >
> > >   public Representation represent(Variant variant)
> {
> > >
> > >  ...
> > >  Flight flight = ...
> > >  JaxbRepresentation jaxbRepOfMyFlight = new
> > >   JaxbRepresentation

RE: RE: RE: template question

2008-02-06 Thread Makunas, Michael
Great! Thanks! 

-Original Message-
From: Jerome Louvel [mailto:[EMAIL PROTECTED] 
Sent: 06 February 2008 12:09
To: discuss@restlet.tigris.org
Subject: RE: RE: template question


Hi Michael,

Good idea, Stephan Koops also pushed in this direction. 

So, there is now a Variable.TYPE_URI_PATH constant supported in SVN trunk.
It will be part of 1.1 M2!

Best regards,
Jerome  

> -Message d'origine-
> De : Makunas, Michael [mailto:[EMAIL PROTECTED]
> Envoyé : mardi 5 février 2008 19:10
> À : discuss@restlet.tigris.org
> Objet : RE: RE: template question
> 
> 
> Thanks.  Using Variable.TYPE_URI_ALL works. Though it would be nice to 
> have something like Variable.TYPE_URI_ALL_WITHOUT_QUERY or something 
> like that since {id} now includes the query string. That's not an 
> issue in my case, though, so it works well enough.
> 
> Cheers,
> Michael
> 
> -Original Message-
> From: Jerome Louvel [mailto:[EMAIL PROTECTED]
> Sent: 05 February 2008 08:25
> To: discuss@restlet.tigris.org
> Subject: RE: template question
> 
> 
> Hi all,
> 
> Michael, if you don't want to introduce redundancy in your URI 
> templates, you can also use a hierarchy of routers, or maybe use 
> String constants to compose the URI templates.
> 
> Concerning your {id} variable, it is possible to make it match any URI 
> character.
> 
> Template template = router.attach("/{foo}/{bar}/{baz}/{id}",
> myCustomFinder).getTemplate();
> template.getVariables().put("id", new 
> Variable(Variable.TYPE_URI_ALL));
> 
> Best regards,
> Jerome
> 
> > -Message d'origine-
> > De : Rhett Sutphin [mailto:[EMAIL PROTECTED]
> > Envoyé : lundi 4 février 2008 20:17
> > À : discuss@restlet.tigris.org
> > Objet : Re: template question
> > 
> > Hi,
> > 
> > On Feb 4, 2008, at 12:21 PM, Stephan Koops wrote:
> > > Hello Michael,
> > >> and most importantly:
> > >>
> > >> /a/b/c/1/x/y/z   resulting in foo=a,bar=b,baz=c,id=1/x/y/z
> > >>
> > > I've had the problem with "1/x/y/z" in the JAX-RS
> > extension. Take a
> > > look to the constructor in projekt org.restlet.ext.jaxrs
> > (see trunk
> > > in repository), class org.restlet.ext.jaxrs.impl.PathRegExp. It's 
> > > some weeks ago, that I impemented it, so I can't tell
> every detail
> > > by head. But feel free to ask.
> > 
> > By my reading, this sort of expansion violates the URI Template 
> > specification draft ( 
> > http://bitworking.org/projects/URI-Templates/draft-gregorio-ur
> itemplate-02.txt
> >   ).  See section 3.1:
> > 
> > The value of every non-list variable, and the
> individual values in
> > list variables, must come from ( unreserved / pct-encoded ).
> > 
> > "Unreserved" here is defined by RFC 3986, section 2.3:
> > 
> > unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
> > 
> > It seems like it might be possible to get a result like
> "id=1/x/y/z"  
> > using the listjoin template operator, but I don't know if restlet 
> > supports that.
> > 
> > Rhett
> 
> 
> 
> CONFIDENTIALITY NOTICE
> 
> This e-mail (and any attached files) is confidential and protected by 
> copyright (and other intellectual property rights). If you are not the 
> intended recipient please e-mail the sender and then delete the email 
> and any attached files immediately. Any further use or dissemination 
> is prohibited.
> 
> While MTV Networks Europe has taken steps to ensure that this email 
> and any attachments are virus free, it is your responsibility to 
> ensure that this message and any attachments are virus free and do not 
> affect your systems / data.
> 
> Communicating by email is not 100% secure and carries risks such as 
> delay, data corruption, non-delivery, wrongful interception and 
> unauthorised amendment. If you communicate with us by e-mail, you 
> acknowledge and assume these risks, and you agree to take appropriate 
> measures to minimise these risks when e-mailing us.
> 
> MTV Networks International, MTV Networks UK & Ireland, Greenhouse, 
> Nickelodeon Viacom Consumer Products, VBSi, Viacom Brand Solutions 
> International and Comedy Central are all trading names of MTV Networks 
> Europe.  MTV Networks Europe is a partnership between MTV Networks 
> Europe Inc. and Viacom Networks Europe Inc.  Address for service in 
> Great Britain is UK House, 180 Oxford Street, London W1D 1DS, UK.



CONFIDENTIALITY NOTICE

This e-mail (and any attached files) is confidential and protected by 
copyright (and other intellectual property rights). If you are not the 
intended recipient please e-mail the sender and then delete the email and 
any attached files immediately. Any further use or dissemination is 
prohibited.

While MTV Networks Europe has taken steps to ensure that this email and 
any attachments are virus free, it is your responsibility to ensure that 
this message and any attachments are virus free and do not affect your 
systems / data.

Communicating by email is not 100% secure and carries risks such as delay, 
data corruption, non-delivery, wrongful inter

Re: Evaluating Restlet

2008-02-06 Thread Rob Heittman
You are certainly NOT alone in that feeling.  There are some entertaining
flame wars about the topic (on other lists and blogs) if you search for
'em.  The approach does seem to work surprisingly well to solve certain
problems.  It also breaks badly on certain network configurations, and
places unexpectedly high loads on others.

I would say that if an application can be designed without reliance on the
Comet style, it probably should be -- for broadest compatibility and
greatest simplicity.

Still, people have brought sane use cases forward on the list -- e.g.
pushing discrete updates from sensors to an HTTP-based client over a private
network -- where the style would be a great fit, and it would be awesome if
the Restlet API were flexible enough to support it cleanly when needed.

- R


On 2/6/08, Kyrre Kristiansen <[EMAIL PROTECTED]> wrote:
>
> I know this is probably the best place for this, but
> am I the only one that thinks Comet is pushing the
> limits of HTTP too far (no pun intended)?


RE: AuthenticatedUser [was: Request in checkSecret()]

2008-02-06 Thread Jerome Louvel

Hi Stephan,

Somehow, I didn't get this email before. It doesn't appear in the archives
either, so it was probably lost on the way. Anyway, thanks for forwarding it
again :)
 
> > Yes, I think attributes are the perfect place to put such 
> > information, you can add a user "role" or any other application 
> > specific info about your authenticated user.
>
> I've implemented this feature for the JAX-RS implementation 
> by putting an java.security.Principal into the request attribute
> map. Should I made this available for the Restlet API?
> I would change the Guard, that it set the Principal into the 
> attribute map for key "java.security.Principal" (in the accept() 
> method, if it is ok) and add a method Util.getPrincipal() 
> ( or Guard.getPrincipal()? ) that returns the Principal, or 
> null, if it is not set.

I know that Principal is widely used in Java security APIs, but I'm not
convinced yet that we should explicitly support it in the Guard class. 

Personally, I need more feed-back to move further in this area. We have just
landed a patch to add support for HTTP DIGEST, it required a few changes to
Guard. Now all the logic specific to authentication schemes is delegated to
the Engine. It will now be easy to add pluggable authentication modules.
When we add this feature in 1.2, we should definitely consider the support
for JAAS (JDK's authentication APIs).

I've added two related comments:
http://restlet.tigris.org/issues/show_bug.cgi?id=229

We also have two RFE for integration with third-party solutions:

"Support Acegi"
http://restlet.tigris.org/issues/show_bug.cgi?id=264

"Support jGuard"
http://restlet.tigris.org/issues/show_bug.cgi?id=265

Best regards,
Jerome



Re: Evaluating Restlet

2008-02-06 Thread Kyrre Kristiansen
Hello, everyone. 

I know this is probably the best place for this, but
am I the only one that thinks Comet is pushing the
limits of HTTP too far (no pun intended)? As far as I
can read from the RFC, a client may create a
long-lived connection, issue several requests, but the
server MUST respond to these requests in the order
they're sendt. I'm not trying to give the Comet crew
(that's a cool name, btw) a bad name, but I get the
feeling that doing this type of things in HTTP/1.1 is
against the constraints imposed on the protocol. I'd
absolutely love to get callback-type functionality in
HTTP, but I'm just bothered by the nagging feeling
that it should be done either as a different protocol
or a new version  of the HTTP protocol, since this
type of protocol leverage gives a new set of
challenges that should be seriously looked into. After
all, a lot of the success of HTTP is in its ability to
be simple, but extremely powerful.

Just some thoughts I had to get out somewhere...

Regards,
Kyrre

--- Rob Heittman <[EMAIL PROTECTED]> wrote:

> The thing I'm working on simply involves an
> alternative to
> handle(request,response) that allows the response to
> be delivered to a
> callback object, possibly and probably in another
> thread.  This is
> principally valuable for AJAX style code and
> critical path for the GWT
> support I'm working on.  To a certain degree, we
> actually want a model here
> that looks and feels very familiar to GWT users who
> have worked with GWT-RPC
> and would like to try a RESTful alternative.
> 
> The idea of being able to "pin" a thread is probably
> more applicable to the
> issue of a long-lived request/response cycle (e.g.
> Comet style), and
> probably more valuable across the board, but less
> critical path to what I'm
> doing.
> 
> Both of these asynchronous needs are under active
> research and development,
> and the implementation is probably interrelated
> (synchronous processing can
> probably be expressed in terms of a single callback
> which can probably be
> expressed in terms of chunked asynchronous
> processing) ... the RFE gives
> some code examples for how this might be true.
> 
> Right now I am looking at the penalties and costs of
> thread-safe Request and
> Response objects across the board, a need which must
> be sorted out before
> any of the other async stuff can be safely
> investigated.
> 
> 
> On 2/6/08, António Mota <[EMAIL PROTECTED]> wrote:
> >
> > Hmm, let me try to understand, is there a effort
> going on to include in
> > Restlet some kind of "notification" to
> asynchronous clients based on
> > xmlhhttprequest callbacks and/or Comet-style
> "push" techniques?
> >
> >
> >
> >
> > On 06/02/2008, jbarciela jbarciela
> <[EMAIL PROTECTED]> wrote:
> > >
> > > > Have a look at this RFE and its references:
> > > >
> http://restlet.tigris.org/issues/show_bug.cgi?id=143
>   ...
> > >
> > > Ah, that's a wonderful wonderful compilation of
> articles, so far I've
> > > only read about Jetty's continuations, thanks
> for the link
> > >
> > > > you guessed right
> > >
> > > I have my moments
> > >
> > > Cheers
> > > Jaime
> > >
> >
> >
> >
> > --
> > --
> > Melhores cumprimentos / Beir beannacht / Best
> regards
> >
> > António Manuel dos Santos Mota
> >
> > mobile: +353(0)877718363
> > mail: [EMAIL PROTECTED]
> > skype: amsmota
> > msn: [EMAIL PROTECTED]
> > linkedin: www.linkedin.com/in/amsmota
> >
> 



Kyrre Kristiansen


  ___
Support the World Aids Awareness campaign this month with Yahoo! For Good 
http://uk.promotions.yahoo.com/forgood/


Re: Evaluating Restlet

2008-02-06 Thread Rob Heittman
The thing I'm working on simply involves an alternative to
handle(request,response) that allows the response to be delivered to a
callback object, possibly and probably in another thread.  This is
principally valuable for AJAX style code and critical path for the GWT
support I'm working on.  To a certain degree, we actually want a model here
that looks and feels very familiar to GWT users who have worked with GWT-RPC
and would like to try a RESTful alternative.

The idea of being able to "pin" a thread is probably more applicable to the
issue of a long-lived request/response cycle (e.g. Comet style), and
probably more valuable across the board, but less critical path to what I'm
doing.

Both of these asynchronous needs are under active research and development,
and the implementation is probably interrelated (synchronous processing can
probably be expressed in terms of a single callback which can probably be
expressed in terms of chunked asynchronous processing) ... the RFE gives
some code examples for how this might be true.

Right now I am looking at the penalties and costs of thread-safe Request and
Response objects across the board, a need which must be sorted out before
any of the other async stuff can be safely investigated.


On 2/6/08, António Mota <[EMAIL PROTECTED]> wrote:
>
> Hmm, let me try to understand, is there a effort going on to include in
> Restlet some kind of "notification" to asynchronous clients based on
> xmlhhttprequest callbacks and/or Comet-style "push" techniques?
>
>
>
>
> On 06/02/2008, jbarciela jbarciela <[EMAIL PROTECTED]> wrote:
> >
> > > Have a look at this RFE and its references:
> > > http://restlet.tigris.org/issues/show_bug.cgi?id=143   ...
> >
> > Ah, that's a wonderful wonderful compilation of articles, so far I've
> > only read about Jetty's continuations, thanks for the link
> >
> > > you guessed right
> >
> > I have my moments
> >
> > Cheers
> > Jaime
> >
>
>
>
> --
> --
> Melhores cumprimentos / Beir beannacht / Best regards
>
> António Manuel dos Santos Mota
>
> mobile: +353(0)877718363
> mail: [EMAIL PROTECTED]
> skype: amsmota
> msn: [EMAIL PROTECTED]
> linkedin: www.linkedin.com/in/amsmota
>


RE: RE: template question

2008-02-06 Thread Jerome Louvel

Hi Michael,

Good idea, Stephan Koops also pushed in this direction. 

So, there is now a Variable.TYPE_URI_PATH constant supported in SVN trunk.
It will be part of 1.1 M2!

Best regards,
Jerome  

> -Message d'origine-
> De : Makunas, Michael [mailto:[EMAIL PROTECTED] 
> Envoyé : mardi 5 février 2008 19:10
> À : discuss@restlet.tigris.org
> Objet : RE: RE: template question
> 
> 
> Thanks.  Using Variable.TYPE_URI_ALL works. Though it would 
> be nice to have something like 
> Variable.TYPE_URI_ALL_WITHOUT_QUERY or something like that 
> since {id} now includes the query string. That's not an issue 
> in my case, though, so it works well enough.
> 
> Cheers,
> Michael
> 
> -Original Message-
> From: Jerome Louvel [mailto:[EMAIL PROTECTED] 
> Sent: 05 February 2008 08:25
> To: discuss@restlet.tigris.org
> Subject: RE: template question
> 
> 
> Hi all,
> 
> Michael, if you don't want to introduce redundancy in your 
> URI templates, you can also use a hierarchy of routers, or 
> maybe use String constants to compose the URI templates.
> 
> Concerning your {id} variable, it is possible to make it 
> match any URI character.
> 
> Template template = router.attach("/{foo}/{bar}/{baz}/{id}",
> myCustomFinder).getTemplate();
> template.getVariables().put("id", new 
> Variable(Variable.TYPE_URI_ALL));
> 
> Best regards,
> Jerome  
> 
> > -Message d'origine-
> > De : Rhett Sutphin [mailto:[EMAIL PROTECTED]
> > Envoyé : lundi 4 février 2008 20:17
> > À : discuss@restlet.tigris.org
> > Objet : Re: template question
> > 
> > Hi,
> > 
> > On Feb 4, 2008, at 12:21 PM, Stephan Koops wrote:
> > > Hello Michael,
> > >> and most importantly:
> > >>
> > >> /a/b/c/1/x/y/z   resulting in foo=a,bar=b,baz=c,id=1/x/y/z
> > >>
> > > I've had the problem with "1/x/y/z" in the JAX-RS
> > extension. Take a
> > > look to the constructor in projekt org.restlet.ext.jaxrs
> > (see trunk
> > > in repository), class org.restlet.ext.jaxrs.impl.PathRegExp. It's 
> > > some weeks ago, that I impemented it, so I can't tell 
> every detail 
> > > by head. But feel free to ask.
> > 
> > By my reading, this sort of expansion violates the URI Template 
> > specification draft ( 
> > http://bitworking.org/projects/URI-Templates/draft-gregorio-ur
> itemplate-02.txt 
> >   ).  See section 3.1:
> > 
> > The value of every non-list variable, and the 
> individual values in
> > list variables, must come from ( unreserved / pct-encoded ).
> > 
> > "Unreserved" here is defined by RFC 3986, section 2.3:
> > 
> > unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
> > 
> > It seems like it might be possible to get a result like 
> "id=1/x/y/z"  
> > using the listjoin template operator, but I don't know if restlet 
> > supports that.
> > 
> > Rhett
> 
> 
> 
> CONFIDENTIALITY NOTICE
> 
> This e-mail (and any attached files) is confidential and protected by 
> copyright (and other intellectual property rights). If you 
> are not the 
> intended recipient please e-mail the sender and then delete 
> the email and 
> any attached files immediately. Any further use or dissemination is 
> prohibited.
> 
> While MTV Networks Europe has taken steps to ensure that this 
> email and 
> any attachments are virus free, it is your responsibility to 
> ensure that 
> this message and any attachments are virus free and do not 
> affect your 
> systems / data.
> 
> Communicating by email is not 100% secure and carries risks 
> such as delay, 
> data corruption, non-delivery, wrongful interception and unauthorised 
> amendment. If you communicate with us by e-mail, you acknowledge and 
> assume these risks, and you agree to take appropriate 
> measures to minimise 
> these risks when e-mailing us. 
> 
> MTV Networks International, MTV Networks UK & Ireland, Greenhouse, 
> Nickelodeon Viacom Consumer Products, VBSi, Viacom Brand Solutions 
> International and Comedy Central are all trading names of MTV 
> Networks 
> Europe.  MTV Networks Europe is a partnership between MTV 
> Networks Europe 
> Inc. and Viacom Networks Europe Inc.  Address for service in 
> Great Britain 
> is UK House, 180 Oxford Street, London W1D 1DS, UK.



Re: Evaluating Restlet

2008-02-06 Thread António Mota
Hmm, let me try to understand, is there a effort going on to include in
Restlet some kind of "notification" to asynchronous clients based on
xmlhhttprequest callbacks and/or Comet-style "push" techniques?




On 06/02/2008, jbarciela jbarciela <[EMAIL PROTECTED]> wrote:
>
> > Have a look at this RFE and its references:
> > http://restlet.tigris.org/issues/show_bug.cgi?id=143   ...
>
> Ah, that's a wonderful wonderful compilation of articles, so far I've
> only read about Jetty's continuations, thanks for the link
>
> > you guessed right
>
> I have my moments
>
> Cheers
> Jaime
>



-- 
-- 
Melhores cumprimentos / Beir beannacht / Best regards

António Manuel dos Santos Mota

mobile: +353(0)877718363
mail: [EMAIL PROTECTED]
skype: amsmota
msn: [EMAIL PROTECTED]
linkedin: www.linkedin.com/in/amsmota


Re: Jaxb representation (HELP!)

2008-02-06 Thread Florian Schwarz

Hi dev,

your integration of the JiBX-Maven2-Plugin looks good so far. Please 
send the code of the test case and the JJiBX-Binding that uses the 
JibxRepresentation.


I think, that you have not specified the bindingClass, that should bes used.

Cheers
Flo.


dev dev schrieb:
Finally got every integrated to our maven 2 build. However, we got 
this exception when running  one of our test cases (mvn test 
-Dtest=testjibx). We define the jiBX binding in our pom.xml. What did 
we do wrong?


 
   org.jibx
   maven-jibx-plugin
   1.1.5
   
  src/main/java
  
  *-binding.xml
  
  
 template-binding.xml
  
  true
  
   
   
 compile
 
 bind

   
   


Output 
-

INFO: Exception intercepted
java.io.IOException: Unable to access binding information for class 
java.lang.Class

Make sure the binding has been compiled
at 
org.restlet.ext.jibx.JibxRepresentation.write(JibxRepresentation.java:219)
at 
com.noelios.restlet.http.HttpServerCall.writeResponseBody(HttpServerCall.java:407)
at 
com.noelios.restlet.http.HttpServerCall.sendResponse(HttpServerCall.java:361)
at 
com.noelios.restlet.http.HttpServerConverter.commit(HttpServerConverter.java:152)
at 
com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:95)
at 
com.noelios.restlet.ext.simple.SimpleProtocolHandler.handle(SimpleProtocolHandler.java:67)

at simple.http.Dispatcher.run(Dispatcher.java:83)
at simple.util.process.Daemon.execute(Daemon.java:121)
at simple.util.process.Daemon.run(Daemon.java:106)


On Feb 4, 2008 1:56 PM, dev dev <[EMAIL PROTECTED] 
> wrote:


Thanks much Jerome.


On Feb 2, 2008 9:57 AM, Jerome Louvel <[EMAIL PROTECTED]
> wrote:


Hi dev,

I've just updated the build script to include JiBX and
generate its Maven
artifacts. It will be distributed with 1.1 M2, hopefully next
week.

Best regards,
Jerome

> -Message d'origine-
> De : dev dev [mailto:[EMAIL PROTECTED] ]
> Envoyé : samedi 2 février 2008 03:10
> À : discuss@restlet.tigris.org

> Objet : Re: Jaxb representation (HELP!)
>
> After playing with it a bit, we will go with jibx instead
> (Thanks Florian) mainly  because of  performance and  its
> java-centric XML mapping approach. That said, how come we
> don't see jibx on http://maven.restlet.org/org/restlet/. I do
> see jaxb there.
>
> Thanks
> dev
>
>
> On Jan 27, 2008 10:22 AM, dev dev <[EMAIL PROTECTED]
> wrote:
>
>
>   Great help Florian. We will definitely take a look at
> Jibx representation before considering JAXB.
>
>   Thank you.
>   dev
>
>
>   On Jan 27, 2008 1:17 AM, Florian Schwarz
> <[EMAIL PROTECTED]
> wrote:
>
>
>   Hi dev,
>
>   the usage of JaxbRepresentation is quite simple:
>
>   Java -> XML
>
>   public Representation represent(Variant variant) {
>
>  ...
>  Flight flight = ...
>  JaxbRepresentation jaxbRepOfMyFlight = new
>   JaxbRepresentation(MediaType.TEXT_XML, flight);
>  ...
>  return jaxbRepOfMyFlight
>   }
>
>
>   XML -> Java
>
>   JaxbRepresentation jaxbRep = new
>   JaxbRepresentation(response.getEntity(),
> "com.mycompany.entity.jaxb");
>   try {
>  Flight flight = (Flight) jaxbRep.getObject();
>  } catch (IOException e) {
>  ...
>   }
>
>   where the package com.mycompany.entity.jaxb is
> the JAXB-context-path
>   with the existing Java domain objects
> (eventually created vom xsd).
>
>   If you start from your domain objects and not
> from your xsd, I recommend
>