RE: Restlet "Directory" suggestion

2008-11-26 Thread Cliff Binstock
Jerome,

Inline ...

> Thanks for the good feed-back on Directory.
> 
> 1) Could you give more information/pointers? What do you want to transform
> with XSLT, the directory listing?

Yes, the directory listing.  While quite obtuse, in Tomcat there is a
built-in XML directory listing to which you can apply a stylesheet.  Perhaps
you could automatically return different variants?

> 3) You could add a Guard filter in front of your Directory that would deal
> with that, unless the authorization is based on the actual file. Could you
> detail your use case a bit more?

The basic guard isn't friendly enough.  If I have users 'John', 'Fred', and
'Alice', I'd like to have /user/John; /user/Fred; /user/Alice.  Each person
has access only to their own directory (or perhaps some other complex
authorization like groups).

Cliff



Re: ServletServlet example

2008-11-26 Thread Mark Rosenthal

Beautiful!

Thanks Thierry.

Thierry Boileau wrote:

Hello all,

I've mistakenly updated the DNS for the restlet.net domain... It 
should be up to date in a few minutes or hours.


Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


I think you can get it here:

http://restlet.tigris.org/source/browse/restlet/trunk/modules/org.restlet.example/src/org/restlet/example/dist/testServlet.zip 



Does the FAQ need to be updated, or should that be a valid 
repository?  The root, http://www.restlet.net, appears to be an 
unconfigured apache2 server.


On Tue, Nov 25, 2008 at 5:37 PM, Mark Rosenthal <[EMAIL PROTECTED] 
> wrote:


When I try to download the sample sources,

http://www.restlet.net/source/browse/restlet/trunk/modules/org.restlet.example/src/org/restlet/example/dist/testServlet.zip, 


referenced on the Restlet 1.1 - User FAQ page, I get the following
not found message:

The requested URL

/source/browse/restlet/trunk/modules/org.restlet.example/src/org/restlet/example/dist/testServlet.zip 


was not found on this server.

Does anyone know if it has moved, and if so, where?

Thanks in advance.







Re: No available xxx connector supports the required protocols

2008-11-26 Thread Raif S. Naffah
salut Jerome,

On Thursday 27 November 2008 01:43:31 am Jerome Louvel wrote:
> Hi all,
>
> My opinion is that we shouldn't blindly copy the parameters from a
> Component to an Application. This is important for security purpose and
> to properly isolate applications hosted in the same component.

that's fine as long as IMO it's consistent across the different 
configuration mechanisms.  there probably are/will be cases where one would 
want to share some parameters between Applications in a Component.

as a side-note, i see in the Component schema a "parameter" element in 
the "ComponentType" type.  where can i find more documentation about this 
element?


> In your case, you should make sure that your custom Component manually
> copies the required parameters to the Application(s) that really need
> them. To pass parameters to an application, you should do that in your
> Component subclass:
>
> // Prepare the application context
> Context appContext = getContext().createChildContext();
> appContext.getParameters().add(getContext().getParameters().getFirst("myP
>ara m1"));
> appContext.getParameters().add(getContext().getParameters().getFirst("myP
>ara m2"));
>
> // Attach the application
> MyApplication myApp = new MyApplication(appContext);
> getDefaultHost().attach("/myApp", myApp);

what's the difference between programmatically doing this versus a mechanism 
that would allow me to do the same through a configuration file?  one thing 
i can think of would be more flexibility (in terms of object's type) of the 
parameter value.

one easy way to allow this could be to add a sequence of "init-param" 
(or "context-param") elements of type "ParameterType" to the "AttachType".


> Hope this helps.

it sure does help me get further in understanding the API.  thank you and 
Thierry for your help.  btw. the more i get to know the toolkit the more i 
like how you guys have designed it!  in time i hope i'll be able to 
contribute to the code.


> Best regards,
> Jérôme Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
>
> -Message d'origine-
> De : Thierry Boileau [mailto:[EMAIL PROTECTED]
> Envoyé : mercredi 26 novembre 2008 10:54
> À : Raif S. Naffah; discuss@restlet.tigris.org
> Objet : Re: No available xxx connector supports the required protocols
>
> Hello Raif,
>
> at this time, servlet parameters are only copied into the application's
> context when using the "org.restlet.application" parameter in the
> "web.xml" file...
> I'm looking for a way to transmit them to the attached restlets when
> using the "restlet.xml" file.
>
> Best regards,
> Thierry Boileau
> --
> Restlet ~ Core developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
> > salut Thierry,
> >
> > thank you muchly for spending so much time on this :-)  really
> > appreciate it.
> >
> >
> > i installed your test application and ran it and it worked ok.  but
> > since
>
> it
>
> > does not reflect the environment i described in my initial post, i
> > started
> >
> > changing the configuration to resemble my setup.  it was enough to
> > configure the application through a restlet.xml file for the parameters
> > to
> >
> > return null.  of course i could have mis-configured the application but
> > if
> >
> > that was the case i would've expected to receive some message or an
> > exception not the resource page itself.
> >
> > i'm attaching the modified web.xml and the new restlet.xml that
> > reproduce the problem --start the webapp and in your browser goto
> > http://localhost:8080/RestletTestServlet/ the page returned shows:
> >
> > contextParam=null initParam=null
> >
> > On Monday 24 November 2008 09:14:31 pm Thierry Boileau wrote:
> >> 
> >> 
> >> 
> >>>> http-equiv="Content-Type"> 
> >> 
> >> Hello Raif,
> >> 
> >> I send you a sample Eclipse project that works correctly for me (with
> >> last Restlet snapshot).
> >> http://www.noelios.com/";>The application is not based on
> >> customized Component and ServerServlet. In this case, parameters are
> >> directly copied from the Servlet context to the Application
> >> context. In addition the default behaviour of the ServerServlet
> >> class is to copy parameters also into the context of the
> >> Component.
> >> 
> >> 
> >>  >>  type="cite">
> >>   
> >> Finally, I succeed in getting parameter value as
> >> follow: getContext().getParameters().getFirstValue("myParamName");
> >> 
> >>   
> >>   well i tried with both 1.1.0 and 1.1.1 jars
> >> unsuccessfully.  i also tried introspecting the context from a Filter
> >> but again without success.
> >>
> >> the User Guide (at the end of section 2.12.2.1 Handling of context)
> >> seems to justify why i'm not able to get hold of an init-param:
> >> "Another consequence is that parameters or attributes are not copied
> >> from the component to the application by the default implementation of
> >> the Con

Re: No available xxx connector supports the required protocols

2008-11-26 Thread Raif S. Naffah
salut Thierry,

On Wednesday 26 November 2008 08:54:29 pm Thierry Boileau wrote:
> Hello Raif,
>
> at this time, servlet parameters are only copied into the application's
> context when using the "org.restlet.application" parameter in the
> "web.xml" file...

noted.


> I'm looking for a way to transmit them to the attached restlets when
> using the "restlet.xml" file.

good news.  this way configuring an Application will be consistent across 
the different mechanisms.


> Best regards,
> Thierry Boileau
> --
> Restlet ~ Core developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
> > salut Thierry,
> >
> > thank you muchly for spending so much time on this :-)  really
> > appreciate it.
> >
> >
> > i installed your test application and ran it and it worked ok.  but
> > since it does not reflect the environment i described in my initial
> > post, i started changing the configuration to resemble my setup.  it
> > was enough to configure the application through a restlet.xml file for
> > the parameters to return null.  of course i could have mis-configured
> > the application but if that was the case i would've expected to receive
> > some message or an exception not the resource page itself.
> >
> > i'm attaching the modified web.xml and the new restlet.xml that
> > reproduce the problem --start the webapp and in your browser goto
> > http://localhost:8080/RestletTestServlet/ the page returned shows:
> >
> > contextParam=null initParam=null
> >
> > On Monday 24 November 2008 09:14:31 pm Thierry Boileau wrote:
> >> 
> >> 
> >> 
> >>>> http-equiv="Content-Type"> 
> >> 
> >> Hello Raif,
> >> 
> >> I send you a sample Eclipse project that works correctly for me (with
> >> last Restlet snapshot).
> >> http://www.noelios.com/";>The application is not based on
> >> customized Component and ServerServlet. In this case, parameters are
> >> directly copied from the Servlet context to the Application
> >> context. In addition the default behaviour of the ServerServlet
> >> class is to copy parameters also into the context of the
> >> Component.
> >> 
> >> 
> >>  >>  type="cite">
> >>   
> >> Finally, I succeed in getting parameter value as
> >> follow: getContext().getParameters().getFirstValue("myParamName");
> >> 
> >>   
> >>   well i tried with both 1.1.0 and 1.1.1 jars
> >> unsuccessfully.  i also tried introspecting the context from a Filter
> >> but again without success.
> >>
> >> the User Guide (at the end of section 2.12.2.1 Handling of context)
> >> seems to justify why i'm not able to get hold of an init-param:
> >> "Another consequence is that parameters or attributes are not copied
> >> from the component to the application by the default implementation of
> >> the Context#createChildContext() method which is typically used to
> >> prepare the Application's context based on the parent Component's
> >> context."
> >>
> >> am i mis-interpreting this paragraph, or simply confusing Component
> >> with ServerServlet?
> >>   
> >> 
> >> Yes, you just made the confusion
> >> between Component and ServerServlet.
> >> 
> >>  >>  type="cite">
> >>   
> >> Could you provide a sample test case?
> >> 
> >>   
> >>   let me know what is needed and i can zip and
> >> email you (off the list may be) the files.
> >>   
> >> 
> >> Generally the source code (with
> >> configuration files) is sufficient. Could you try the sample code and
> >> tells us if it works for you?
> >> 
> >> 
> >> Best regards,
> >> Thierry Boileau
> >> --
> >> 
> >> Restlet ~ Core developer ~  >>
> >> href="http://www.restlet.org/";>http://www.restlet.org >>> Noelios Technologies ~ Co-founder ~  >>  style="color: rgb(0, 64, 128);"> >> href="http://www.noelios.com/";>http://www.noelios.com >>> 
> >> 
> >
> > cheers;
> > rsn



-- 
cheers;
rsn


signature.asc
Description: This is a digitally signed message part.


Re: Posting a form with a file

2008-11-26 Thread Jérémy Bogatirsky
I respond to myself :-)
I'm going to use a classic FormPanel in GWT to send the file. Restlet
in server-side should be able to understand it, I mean it's designed
to.
I'll let you know !
Jérémy

2008/11/26 Jérémy Bogatirsky <[EMAIL PROTECTED]>:
> Thanks Thierry for responding.
>
> The fact the feature is planned is a good news.
> Meantime, my solution is working, so I can continue this way.
>
> Is this mailing list the right place to discuss about Restlet-GWT ?
> Nevertheless I put my question : I would like to translate my client
> side of the previous problem (2 post calls to send a form and a file)
> in Restlet-GWT. I managed to send the form with the (key, value)
> pairs, but I have no idea on how to send the file (JsonRepresentation
> ?). Does anyone have ane idea ?!
>
> I could have open a new thread to discuss this point but it's related
> to the previous one so...
>
> Regards,
> Jérémy
>
>
> 2008/11/26 Thierry Boileau <[EMAIL PROTECTED]>:
>> Hello  Jérémy,
>>
>> At this time, this feature is not supported as shown by these RFE wich is
>> planned to be delivered in the upcoming 1.2M1:
>> http://restlet.tigris.org/issues/show_bug.cgi?id=71
>>
>> Best regards,
>> Thierry Boileau
>> --
>> Restlet ~ Core developer ~ http://www.restlet.org
>> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>>>
>>> Hi all (my first post),
>>>
>>> my question is concerning file upload within a form. I'm currenlty
>>> using Restlet 1.1.1.
>>> I have both client and server developed with Restlet.
>>>
>>> I'd like to make a post call, sending 2 (key, value) pairs and a file.
>>> I success this by making 2 post calls, one for the 2 (key, value)
>>> pairs, simply using a Form and its WebRepresentation, and one for the
>>> file, using a FileRepresenation (with a
>>> MediaType.APPLICATION_OCTECT_STREAM, as my file could be a binary one
>>> or a text one -it's a certificat-). That's works.
>>>
>>> My question : is it possible to make only 1 post call including the 2
>>> (key, value) pairs and the file (which can be binary or plain text) ?
>>>
>>> Thanks in advance and sorry if my english isn't so clear :)
>>>
>>> Regards,
>>> Jérémy
>>>
>>
>


Re: Posting a form with a file

2008-11-26 Thread Jérémy Bogatirsky
Thanks Thierry for responding.

The fact the feature is planned is a good news.
Meantime, my solution is working, so I can continue this way.

Is this mailing list the right place to discuss about Restlet-GWT ?
Nevertheless I put my question : I would like to translate my client
side of the previous problem (2 post calls to send a form and a file)
in Restlet-GWT. I managed to send the form with the (key, value)
pairs, but I have no idea on how to send the file (JsonRepresentation
?). Does anyone have ane idea ?!

I could have open a new thread to discuss this point but it's related
to the previous one so...

Regards,
Jérémy


2008/11/26 Thierry Boileau <[EMAIL PROTECTED]>:
> Hello  Jérémy,
>
> At this time, this feature is not supported as shown by these RFE wich is
> planned to be delivered in the upcoming 1.2M1:
> http://restlet.tigris.org/issues/show_bug.cgi?id=71
>
> Best regards,
> Thierry Boileau
> --
> Restlet ~ Core developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>>
>> Hi all (my first post),
>>
>> my question is concerning file upload within a form. I'm currenlty
>> using Restlet 1.1.1.
>> I have both client and server developed with Restlet.
>>
>> I'd like to make a post call, sending 2 (key, value) pairs and a file.
>> I success this by making 2 post calls, one for the 2 (key, value)
>> pairs, simply using a Form and its WebRepresentation, and one for the
>> file, using a FileRepresenation (with a
>> MediaType.APPLICATION_OCTECT_STREAM, as my file could be a binary one
>> or a text one -it's a certificat-). That's works.
>>
>> My question : is it possible to make only 1 post call including the 2
>> (key, value) pairs and the file (which can be binary or plain text) ?
>>
>> Thanks in advance and sorry if my english isn't so clear :)
>>
>> Regards,
>> Jérémy
>>
>


Re: Posting a form with a file

2008-11-26 Thread Thierry Boileau

Hello  Jérémy,

At this time, this feature is not supported as shown by these RFE wich 
is planned to be delivered in the upcoming 1.2M1: 
http://restlet.tigris.org/issues/show_bug.cgi?id=71


Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com

Hi all (my first post),

my question is concerning file upload within a form. I'm currenlty
using Restlet 1.1.1.
I have both client and server developed with Restlet.

I'd like to make a post call, sending 2 (key, value) pairs and a file.
I success this by making 2 post calls, one for the 2 (key, value)
pairs, simply using a Form and its WebRepresentation, and one for the
file, using a FileRepresenation (with a
MediaType.APPLICATION_OCTECT_STREAM, as my file could be a binary one
or a text one -it's a certificat-). That's works.

My question : is it possible to make only 1 post call including the 2
(key, value) pairs and the file (which can be binary or plain text) ?

Thanks in advance and sorry if my english isn't so clear :)

Regards,
Jérémy
  


Posting a form with a file

2008-11-26 Thread Jérémy Bogatirsky
Hi all (my first post),

my question is concerning file upload within a form. I'm currenlty
using Restlet 1.1.1.
I have both client and server developed with Restlet.

I'd like to make a post call, sending 2 (key, value) pairs and a file.
I success this by making 2 post calls, one for the 2 (key, value)
pairs, simply using a Form and its WebRepresentation, and one for the
file, using a FileRepresenation (with a
MediaType.APPLICATION_OCTECT_STREAM, as my file could be a binary one
or a text one -it's a certificat-). That's works.

My question : is it possible to make only 1 post call including the 2
(key, value) pairs and the file (which can be binary or plain text) ?

Thanks in advance and sorry if my english isn't so clear :)

Regards,
Jérémy


RE: Getting the Client address from request

2008-11-26 Thread Jerome Louvel
Hi all,
 
I agree with John regarding the current API : we should refactor. So, I've 
entered a RFE:
 
"Add Request#getForwardedAddresses() method"
http://restlet.tigris.org/issues/show_bug.cgi?id=668
 
Tamas, if you are interested in working on a patch, that would be cool!
 
Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~   
http://www.restlet.org
Noelios Technologies ~ Co-founder ~   
http://www.noelios.com
 

  _  

De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Tamás Cservenák
Envoyé : samedi 22 novembre 2008 17:15
À : discuss@restlet.tigris.org
Objet : Re: Getting the Client address from request


Hi there, 

yes, i must agree with you. 

(and follows a monologue :)

But the problem is with those companies/users/people, that their ITs guys -- 
for some reason, even today in 2009 -- are not accepting the fact that fronting 
a Jetty (or any other _modern_ Servlet Container) with a httpd + mod_proxy is 
just an overhead (not to mention that it kills Jetty's advanced connection 
pooling). Ok, there are situations where you want to have some sort of 
integration with some existing vhosts, etc. 

I'm just saying that people chooses "too easy and almost automatically" to 
front Java Server Container with mod_proxy, even if they don't have to (so, 
excluding the really justified cases). Simply because they were doing it before 
6 years.

Personally, OSes has many other advanced tools (like iptables and forwarding 
port 80 to higher one, and avoiding the need for running java as root, etc), 
that makes httpd used for only one Java app a nonsense. Again, let's exclude 
the _justified_ cases of using mod_proxy.

Luckily, in this case the IP address is taking part in logs and feeds only, so 
they are not vital or security related at all (but they could be). It is simply 
annoying to always have "127.0.0.1" in them, instead of "real" IP.


Thanks,
~t~


On Fri, Nov 21, 2008 at 6:54 PM, John D. Mitchell <[EMAIL PROTECTED]> wrote:


On Friday 2008.11.21, at 02:35 , Tamás Cservenák wrote:
[...] 


Thanks for the tip. That means, that the Application must be aware that it is 
fronted by mod_proxy? Is there some possibility (or even theoretical chance) to 
have some kind of "fallback" mechanism? Will look into restlet sources today...



Well, yes and no.

I don't know of any guaranteed, general way to know that it's a proxy and not 
an original client -- that's a large rabbit hole.

One hack would be to change the getAddresses() code can do the underlying call 
to InetAddress.getLocalHost().getHostAddress() and only if it fails or returns 
localhost then try the extraction of "X-Forwarded-For:" and only if that fails 
too then return localhost.  This handles the dominant case, such as yours, 
where there's a fronting proxy on the local machine.


However, I think this entire approach of having getAddresses() hide the reality 
of X-Forwarded-For: from the applications is actually a bad idea.  Different 
applications and/or in different deployment environments do really need to 
understand the difference between the upstream client, whether or not an 
X-Forwarded-For: exists or not, and can decide for itself whether or not it 
needs the information out of X-Forwarded-For: header (and how much to trust 
that information).

So, I'd move the X-Forwarded-For: stuff out of getAddresses() and into a 
getForwardedAddresses().  Then all applications can do what's correct for them.

Take care,
John






-- 
Thanks,
~t~



RE: Atom Extension: which RFC draft/version?

2008-11-26 Thread Jerome Louvel

FYI, I've reopened this issue:

"Complete initial Atom support"
http://restlet.tigris.org/issues/show_bug.cgi?id=72 

Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Jerome Louvel 
Envoyé : mercredi 26 novembre 2008 16:00
À : discuss@restlet.tigris.org
Objet : RE: Atom Extension: which RFC draft/version?


Hi Thom,

According to our issue tracker, we should have already been APP 1.0
compliant. Let's try to fix the remaining issue for Restlet 1.2.

If you could help us with patches or at a detailed report that would be
great!

Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Thom Nelson [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 25 novembre 2008 23:29
À : discuss@restlet.tigris.org
Objet : Atom Extension: which RFC draft/version?

Hi all,

I was starting to code a set of Resource classes which implement the 
Atom Publishing Protocol, and wanted to use the org.restlet.atom.ext 
extension, but it looks like this implements an older version.  For 
example, the Collection class still uses the "member-type" element of 
app:collection, which hasn't existed since draft 8.  Here are links to 
the latest version (RFC 5023) as well as the older drafts: 
http://bitworking.org/projects/atom/

I'll be glad to help out implementing the latest version of the spec if 
needed.

Thanks,

Thom



RE: Atom Extension: which RFC draft/version?

2008-11-26 Thread Jerome Louvel

Hi Thom,

According to our issue tracker, we should have already been APP 1.0
compliant. Let's try to fix the remaining issue for Restlet 1.2.

If you could help us with patches or at a detailed report that would be
great!

Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Thom Nelson [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 25 novembre 2008 23:29
À : discuss@restlet.tigris.org
Objet : Atom Extension: which RFC draft/version?

Hi all,

I was starting to code a set of Resource classes which implement the 
Atom Publishing Protocol, and wanted to use the org.restlet.atom.ext 
extension, but it looks like this implements an older version.  For 
example, the Collection class still uses the "member-type" element of 
app:collection, which hasn't existed since draft 8.  Here are links to 
the latest version (RFC 5023) as well as the older drafts: 
http://bitworking.org/projects/atom/

I'll be glad to help out implementing the latest version of the spec if 
needed.

Thanks,

Thom



RE: No available xxx connector supports the required protocols

2008-11-26 Thread Jerome Louvel

Hi all,

My opinion is that we shouldn't blindly copy the parameters from a Component
to an Application. This is important for security purpose and to properly
isolate applications hosted in the same component.

In your case, you should make sure that your custom Component manually
copies the required parameters to the Application(s) that really need them.
To pass parameters to an application, you should do that in your Component
subclass:

// Prepare the application context
Context appContext = getContext().createChildContext();
appContext.getParameters().add(getContext().getParameters().getFirst("myPara
m1"));
appContext.getParameters().add(getContext().getParameters().getFirst("myPara
m2"));

// Attach the application
MyApplication myApp = new MyApplication(appContext);
getDefaultHost().attach("/myApp", myApp);

Hope this helps.

Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Thierry Boileau [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 26 novembre 2008 10:54
À : Raif S. Naffah; discuss@restlet.tigris.org
Objet : Re: No available xxx connector supports the required protocols

Hello Raif,

at this time, servlet parameters are only copied into the application's 
context when using the "org.restlet.application" parameter in the 
"web.xml" file...
I'm looking for a way to transmit them to the attached restlets when 
using the "restlet.xml" file.

Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com
> salut Thierry,
>
> thank you muchly for spending so much time on this :-)  really appreciate 
> it.
>
>
> i installed your test application and ran it and it worked ok.  but since
it 
> does not reflect the environment i described in my initial post, i started

> changing the configuration to resemble my setup.  it was enough to 
> configure the application through a restlet.xml file for the parameters to

> return null.  of course i could have mis-configured the application but if

> that was the case i would've expected to receive some message or an 
> exception not the resource page itself.
>
> i'm attaching the modified web.xml and the new restlet.xml that reproduce 
> the problem --start the webapp and in your browser goto 
> http://localhost:8080/RestletTestServlet/ the page returned shows:
>
> contextParam=null initParam=null
>
>
> On Monday 24 November 2008 09:14:31 pm Thierry Boileau wrote:
>   
>> 
>> 
>> 
>>   
>> 
>> 
>> Hello Raif,
>> 
>> I send you a sample Eclipse project that works correctly for me (with
>> last Restlet snapshot).
>> http://www.noelios.com/";>The application is not based on
>> customized Component and ServerServlet. In this case, parameters are
>> directly copied from the Servlet context to the Application context.
>> In addition the default behaviour of the ServerServlet class is to copy
>> parameters also into the context of the Component.>  style="font-family: Tahoma,arial,sans-serif; font-size: 10pt;">>  style="font-family: Tahoma,arial,sans-serif; font-size:
>> 10px;">
>> 
>> 
>> >  type="cite">
>>   
>> Finally, I succeed in getting parameter value as follow:
>> getContext().getParameters().getFirstValue("myParamName");
>> 
>>   
>>   well i tried with both 1.1.0 and 1.1.1 jars
>> unsuccessfully.  i also tried introspecting the context from a Filter but
>> again without success.
>>
>> the User Guide (at the end of section 2.12.2.1 Handling of context) seems
>> to justify why i'm not able to get hold of an init-param: "Another
>> consequence is that parameters or attributes are not copied from the
>> component to the application by the default implementation of the
>> Context#createChildContext() method which is typically used to prepare
>> the Application's context based on the parent Component's context."
>>
>> am i mis-interpreting this paragraph, or simply confusing Component with
>> ServerServlet?
>>   
>> 
>> Yes, you just made the confusion between
>> Component and ServerServlet.
>> 
>> >  type="cite">
>>   
>> Could you provide a sample test case?
>> 
>>   
>>   let me know what is needed and i can zip and email
>> you (off the list may be) the files.
>>   
>> 
>> Generally the source code (with
>> configuration files) is sufficient. Could you try the sample code and
>> tells us if it works for you?
>> 
>> 
>> Best regards,
>> Thierry Boileau
>> --
>> 
>> Restlet ~ Core developer ~ >
>> href="http://www.restlet.org/";>http://www.restlet.org> r> Noelios Technologies ~ Co-founder ~ >  style="color: rgb(0, 64, 128);">> href="http://www.noelios.com/";>http://www.noelios.com> span> 
>> 
>> 
>
>
> cheers;
> rsn
>   



Re: Guard suggestion

2008-11-26 Thread Bruno Harbulot

Hi Jerome and Remi,

I think, in the context of wider refactorisation of authentication and 
authorisation, that authentication should provided a Principal when a 
client has been authenticated (and perhaps a default guest principal 
when no one has, like jGuard does, but that's a different matter).
Then, when authorise should take that Principal and choose 
whether-or-not to authorise depending on that value. The case you 
describe seems to correspond to a null/guest value, which is fine.


Best wishes,

Bruno.


Jerome Louvel wrote:
 
Hi Rémi,
 
Thanks, I've added your use case as a comment in the RFE.
 
Best regards,

Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org 

Noelios Technologies ~ Co-founder ~ http://www.noelios.com 




*De :* Rémi Dewitte [mailto:[EMAIL PROTECTED]
*Envoyé :* lundi 24 novembre 2008 14:35
*À :* discuss@restlet.tigris.org
*Objet :* Re: Guard suggestion

Hello,

For example you have an application where you want to display various 
informations with different levels of information.
There is an interface to manage rules for authorizations. One of the 
rule could be to authorize all users to access the resource or only 
authorized or only specific users, etc.


It is up to the authorize method to trigger 401 responses...

Rémi

On Tue, Nov 18, 2008 at 09:34, Jerome Louvel <[EMAIL PROTECTED] 
> wrote:


Hi Rémi,
 
I have added your suggestion to the RFE mentioned by Stephan:
 
"Refactor authentication and authorization"

http://restlet.tigris.org/issues/show_bug.cgi?id=505
 
Do you have examples in mind where it would be nice to authorize

unauthenticated client requests ?
 
Best regards,

Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org

Noelios Technologies ~ Co-founder ~ http://www.noelios.com



*De :* [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] ] *De la
part de* Rémi Dewitte
*Envoyé :* vendredi 14 novembre 2008 23:27
*À :* discuss@restlet.tigris.org 
*Objet :* Re: Guard suggestion

It would also let the autorize() method to decide whether
AuthenticationMissing forbids the response or not.

For a resource, authorized clients might have more details for example.

Rémi

On Fri, Nov 14, 2008 at 21:17, Stephan Koops <[EMAIL PROTECTED]
> wrote:

Hi Rémi,

You mean, that a client can authorize himself, but it is not
required? I think this is a good ideas. For browser applications
I don't now, if browsers could work with this.

The authentication should be reworked in the near future (I
don't know te current timetable for this). If your proposal is
missing then, throw it into the discussion again.

best regards
 Stephan

Rémi Dewitte schrieb:

Hello all,

Let me make a suggestion about the Guard class.

It would allow the authorize method to make a decision even
if no authentication is present.

Why not adding an authorizeMissing attribute and change
handling of AUTHENTICATION_MISSING in doHandle method
from
   challenge(response, false);
to
   if(isAuthorizeMissing() && authorize(request)){
   accept(request, response);
   }else{
   challenge(response, false);
   }

Cheers,
Rémi







RE: Guard suggestion

2008-11-26 Thread Jerome Louvel
 
Hi Rémi,
 
Thanks, I've added your use case as a comment in the RFE.
 
Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~   
http://www.restlet.org
Noelios Technologies ~ Co-founder ~   
http://www.noelios.com

  _  

De : Rémi Dewitte [mailto:[EMAIL PROTECTED] 
Envoyé : lundi 24 novembre 2008 14:35
À : discuss@restlet.tigris.org
Objet : Re: Guard suggestion


Hello,

For example you have an application where you want to display various 
informations with different levels of information.
There is an interface to manage rules for authorizations. One of the rule could 
be to authorize all users to access the resource or only authorized or only 
specific users, etc.

It is up to the authorize method to trigger 401 responses...

Rémi


On Tue, Nov 18, 2008 at 09:34, Jerome Louvel <[EMAIL PROTECTED]> wrote:


Hi Rémi,
 
I have added your suggestion to the RFE mentioned by Stephan:
 
"Refactor authentication and authorization"
http://restlet.tigris.org/issues/show_bug.cgi?id=505
 
Do you have examples in mind where it would be nice to authorize 
unauthenticated client requests ?
 


Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~   
http://www.restlet.org
Noelios Technologies ~ Co-founder ~   
http://www.noelios.com

  _  

De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Rémi Dewitte
Envoyé : vendredi 14 novembre 2008 23:27
À : discuss@restlet.tigris.org
Objet : Re: Guard suggestion


It would also let the autorize() method to decide whether AuthenticationMissing 
forbids the response or not.

For a resource, authorized clients might have more details for example.

Rémi


On Fri, Nov 14, 2008 at 21:17, Stephan Koops <[EMAIL PROTECTED]> wrote:


Hi Rémi,

You mean, that a client can authorize himself, but it is not required? I think 
this is a good ideas. For browser applications I don't now, if browsers could 
work with this.

The authentication should be reworked in the near future (I don't know te 
current timetable for this). If your proposal is missing then, throw it into 
the discussion again.

best regards
 Stephan

Rémi Dewitte schrieb: 


Hello all,

Let me make a suggestion about the Guard class.

It would allow the authorize method to make a decision even if no 
authentication is present.

Why not adding an authorizeMissing attribute and change handling of 
AUTHENTICATION_MISSING in doHandle method
from
   challenge(response, false);
to
   if(isAuthorizeMissing() && authorize(request)){
   accept(request, response);
   }else{
   challenge(response, false);
   }

Cheers,
Rémi






RE: What is missing from Restlet?

2008-11-26 Thread Jerome Louvel

Hi Nagarajan,

This is exactly what the Restlet book is aiming at:
http://book.restlet.org/

We have just been too busy recently to make enough progress. Our current goal 
is a publication for the release of Restlet 1.2.

The User Guide should also be complete with simple sample code for FreeMarker 
and Velocity:
http://wiki.restlet.org/docs_1.1/13-restlet/28-restlet.html

Documentation contributions are welcome!

Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Gan123 [mailto:[EMAIL PROTECTED] 
Envoyé : lundi 24 novembre 2008 14:15
À : discuss@restlet.tigris.org
Objet : RE: What is missing from Restlet?


Provide more examples in the documentation, like developing a web
application, developing cache based system, working with velocity or free
marker template language... etc. it will certainly help new starters to
learn REST way of developing applications with restlet. 

Thanks in advance.

jlouvel wrote:
> 
> 
> Hi all,
> 
> JSecurity seems like a nice library to consider integration with. I've
> entered a RFE:
> 
> "Add support for JSecurity"
> http://restlet.tigris.org/issues/show_bug.cgi?id=658
> 
> Best regards,
> Jérôme Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
> 
> 
> -Message d'origine-
> De : news [mailto:[EMAIL PROTECTED] De la part de Jeff Ramsdale
> Envoyé : samedi 15 novembre 2008 18:29
> À : discuss@restlet.tigris.org
> Objet : Re: What is missing from Restlet?
> 
> Thanks for all the info! I'll definitely look into it...
> 
> -jeff
> 
> Tamás Cservenák wrote:
>> Hi there,
>> 
>> as integration i meant making those two (restlet + jsecurity) to play
>> together. But in fact, we are using out-of-the-box (slightly
>> nexus-ified) JSecurity Servlet filters, thus our Restlet Application
>> is completely unaware of being protected (unless resources where we
>> use it explicitly).
>> 
>> The "integration" is more Plexus + JSecurity way, and also we
>> integrated Plexus + Restlet, thus all major stuff is simply a Plexus
>> Component (something like spring managed bean).
>> 
>> All our related code is in our Spice OSS SVN (that makes our life
>> spicey):
>> http://svn.sonatype.org/spice/trunk/
>> 
>> In short:
>> plexus-restlet-bridge -- is the restlet + plexus integration
>> plexus-jsecurity-realms -- are various JSecurity Realm implementations
>> (allowing us to do a lot of magic, ie. using LDAP for auth/authz and
>> if failing, falling back to "local" XML for example, it is great for
>> transitions)
>> 
>> JSecurity is very flexible piece of software, and almost all you have
>> to do is implement a Realm to hook it in into whatever you want. It is
>> not an aggressive library, that is clearly proved by Nexus already:
>> you can simply "envelope" a web application (in this case a Restlet
>> Application that is run in ServletServer) into JSecurity with their
>> SerlvetFilters almost without any changes (the simplest/static
>> solution would need some web.xml tweaking and that's all!).
>> 
>> You can grep some info from here too:
>> https://docs.sonatype.com/display/NX/Nexus+Security+FAQ
>> 
>> Hope helps,
>> ~t~
> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/What-is-missing-from-Restlet--tp1449523p1572018.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.



RE: Restlet "Directory" suggestion

2008-11-26 Thread Jerome Louvel

Cliff,

Thanks for the good feed-back on Directory.

1) Could you give more information/pointers? What do you want to transform
with XSLT, the directory listing?

2) Good point. I've entered a RFE for this:

"Directory listing should support XHTML"
http://restlet.tigris.org/issues/show_bug.cgi?id=667

If you could provide a patch, that would be welcome.

3) You could add a Guard filter in front of your Directory that would deal
with that, unless the authorization is based on the actual file. Could you
detail your use case a bit more?

4) We have two pending RFEs for WebDAV in Restlet 1.2

"Add minimal support for WebDAV in Directory"
http://restlet.tigris.org/issues/show_bug.cgi?id=346

"Add full WebDAV extension"
http://restlet.tigris.org/issues/show_bug.cgi?id=519

However, we will have to start from scratch (+ contributions by Restlet
community) as we don't want to introduce a dependency on Tomcat for this
feature.

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 : Cliff Binstock [mailto:[EMAIL PROTECTED] 
Envoye : mardi 25 novembre 2008 18:16
A : discuss@restlet.tigris.org
Objet : Restlet "Directory" suggestion

Thierry, et al,

I have been working with the "Directory" class, and running into
limitations.  I realized that because I am also running Tomcat, the built-in
webdav met my needs.  However--and because you were asking for
suggestions--I realized that the Directory class could easily be improved:

1) Allow for stylesheets, see Tomcat's WebdavServlet setup (localXsltFile,
and globalXsltFile).  Note that a URI (instead of a path) would be even
better.

2) Have the default representation return XHTML (instead of the current
nonX HTML).  This would allow a programmatic caller to read the list as XML
(a request from one of my users).

3) Add a simple authorization hook, or at least clearly describe how to
authorize access to certain directories.  Note that even in Tomcat, I had to
go digging through the code to figure out how to subclass.

4) Add full webdav capability.  Given that WebdavServlet is Apache
License--and not very big--it seems that you could easily support full
webdav out of the box.

Cliff Binstock
Coyote Reporting



RE: Usurping Directory

2008-11-26 Thread Jerome Louvel
Hi again,
 
To customize the display of the directory listing, you should simply
override the following methods in Directory:
public List getIndexVariants(ReferenceList indexContent)
public Representation getIndexRepresentation(Variant variant, ReferenceList
indexContent)

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~  
http://www.restlet.org
Noelios Technologies ~ Co-founder ~  
http://www.noelios.com
 
 
  _  

De : Cliff Binstock [mailto:[EMAIL PROTECTED] 
Envoye : samedi 22 novembre 2008 01:37
A : discuss@restlet.tigris.org
Objet : RE: Usurping Directory



As an upgrade (Restlet request!), looking through the source code it seems
that the simplest thing would be if I could insert my own ReferenceList
implementation.  Perhaps you could have a #setReferenceList option which
would take my own (sub-)class.  Not only could I change the HREF, but it
would be great to put in my own HTML representation anyway, with style,
logo, etc.

Cliff

  _  

From: Cliff Binstock [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 21, 2008 2:54 PM
To: discuss@restlet.tigris.org
Subject: Usurping Directory

 

I would like to modify the standard Directory to return something different
than "the" file when a file is encountered.  For example, peruse a directory
structure (default behavior), but when you get to the "bottom" (an actual
file), then return a report based on that file, instead of the file itself.

 

It appears that I need a custom "DirectoryResource" which is attached to a
"Directory" via #setTargetClass.   I have the following questions:

 

1.  Setting the target class doesn't seem to be invoking the resource 

2.  I'm not sure what I would need to override to have custom behavior:
#getVariants? 

3.  Is there a better way to approach the problem? 

 

 

Thanks in advance,

 

Cliff

 



RE: Usurping Directory

2008-11-26 Thread Jerome Louvel
Hi Cliff,
 
In Restlet 1.1, the method you need to override in Directory to provide your
own DirectoryResource subclass is findTarget(). 
 
However, I've just made some refactoring in SVN trunk (future Restlet 1.2)
to allow you to specify a DirectoryResource subclass by just setting it as
the target class of your Directory. It works fine and simplifies the code. 
 
Then, by default the DirectoryResource returns the representation
immediately when declaring the list of variants. It doesn't need to override
the "represent(Variant)" method which by default returns the variant if it
is an instance of Representation.
 
However, nothing prevents you from overriding "represent(Variant)" to expose
a different representation for your files. To get access to the actual file,
just cast the Variant to FileRepresentation. Make just you test the class
before casting as if your Directory doesn't use the FILE connector or
returns a representation of a directory it will fail.
 
Hope this helps!
 
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~  
http://www.restlet.org
Noelios Technologies ~ Co-founder ~  
http://www.noelios.com
 
  _  

De : Cliff Binstock [mailto:[EMAIL PROTECTED] 
Envoye : vendredi 21 novembre 2008 23:54
A : discuss@restlet.tigris.org
Objet : Usurping Directory



I would like to modify the standard Directory to return something different
than "the" file when a file is encountered.  For example, peruse a directory
structure (default behavior), but when you get to the "bottom" (an actual
file), then return a report based on that file, instead of the file itself.

 

It appears that I need a custom "DirectoryResource" which is attached to a
"Directory" via #setTargetClass.   I have the following questions:

 

1.  Setting the target class doesn't seem to be invoking the resource 

2.  I'm not sure what I would need to override to have custom behavior:
#getVariants? 

3.  Is there a better way to approach the problem? 

 

 

Thanks in advance,

 

Cliff

 



RE: Restlet MVC

2008-11-26 Thread Jerome Louvel

Hi Avi,

Full agreement with Rob as well!

I have updated the FAQ as you suggested and reworded the rest of the entry for 
conciseness and to match the Restlet 1.1 API:
http://www.restlet.org/documentation/1.1/faq#10

Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Avi Flax [mailto:[EMAIL PROTECTED] 
Envoyé : vendredi 21 novembre 2008 19:21
À : discuss@restlet.tigris.org
Objet : Re: Restlet MVC

On Fri, Nov 21, 2008 at 09:44, Tim Peierls <[EMAIL PROTECTED]> wrote:

> Maybe the first line of that FAQ answer should be modified to avoid the word 
> "implementation", e.g., "There is a rough correspondence between the MVC 
> pattern [cite?] and the Restlet framework:"

I think we can just change the word "implementing" to "following". But
I like the sentence you've proposed; I think we could just add that to
the answer, as the first sentence, like so:

"There is only a rough correspondence between the http://en.wikipedia.org/wiki/Model-view-controller";>MVC
pattern and the Restlet framework; some http://n2.nabble.com/Restlet-MVC-tp1560691p1561792.html";>debate
exists as to whether it should be employed at all. For those who wish
to follow the MVC pattern with Restlet, here is the basic
proposition:"

How's that?

Jerome, maybe it's time to move the FAQ to the Wiki so it can be more
readily edited!



Re: No available xxx connector supports the required protocols

2008-11-26 Thread Thierry Boileau

Hello Raif,

at this time, servlet parameters are only copied into the application's 
context when using the "org.restlet.application" parameter in the 
"web.xml" file...
I'm looking for a way to transmit them to the attached restlets when 
using the "restlet.xml" file.


Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com

salut Thierry,

thank you muchly for spending so much time on this :-)  really appreciate 
it.



i installed your test application and ran it and it worked ok.  but since it 
does not reflect the environment i described in my initial post, i started 
changing the configuration to resemble my setup.  it was enough to 
configure the application through a restlet.xml file for the parameters to 
return null.  of course i could have mis-configured the application but if 
that was the case i would've expected to receive some message or an 
exception not the resource page itself.


i'm attaching the modified web.xml and the new restlet.xml that reproduce 
the problem --start the webapp and in your browser goto 
http://localhost:8080/RestletTestServlet/ the page returned shows:


contextParam=null initParam=null


On Monday 24 November 2008 09:14:31 pm Thierry Boileau wrote:
  




  


Hello Raif,

I send you a sample Eclipse project that works correctly for me (with
last Restlet snapshot).
http://www.noelios.com/";>The application is not based on
customized Component and ServerServlet. In this case, parameters are
directly copied from the Servlet context to the Application context.
In addition the default behaviour of the ServerServlet class is to copy
parameters also into the context of the Component.



  
Finally, I succeed in getting parameter value as follow:
getContext().getParameters().getFirstValue("myParamName");

  
  well i tried with both 1.1.0 and 1.1.1 jars
unsuccessfully.  i also tried introspecting the context from a Filter but
again without success.

the User Guide (at the end of section 2.12.2.1 Handling of context) seems
to justify why i'm not able to get hold of an init-param: "Another
consequence is that parameters or attributes are not copied from the
component to the application by the default implementation of the
Context#createChildContext() method which is typically used to prepare
the Application's context based on the parent Component's context."

am i mis-interpreting this paragraph, or simply confusing Component with
ServerServlet?
  

Yes, you just made the confusion between
Component and ServerServlet.


  
Could you provide a sample test case?

  
  let me know what is needed and i can zip and email
you (off the list may be) the files.
  

Generally the source code (with
configuration files) is sufficient. Could you try the sample code and
tells us if it works for you?


Best regards,
Thierry Boileau
--

Restlet ~ Core developer ~ http://www.restlet.org/";>http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com/";>http://www.noelios.com 





cheers;
rsn
  


Re: ServletServlet example

2008-11-26 Thread Thierry Boileau

Hello all,

I've mistakenly updated the DNS for the restlet.net domain... It should 
be up to date in a few minutes or hours.


Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


I think you can get it here:

http://restlet.tigris.org/source/browse/restlet/trunk/modules/org.restlet.example/src/org/restlet/example/dist/testServlet.zip

Does the FAQ need to be updated, or should that be a valid 
repository?  The root, http://www.restlet.net, appears to be an 
unconfigured apache2 server.


On Tue, Nov 25, 2008 at 5:37 PM, Mark Rosenthal <[EMAIL PROTECTED] 
> wrote:


When I try to download the sample sources,

http://www.restlet.net/source/browse/restlet/trunk/modules/org.restlet.example/src/org/restlet/example/dist/testServlet.zip,
referenced on the Restlet 1.1 - User FAQ page, I get the following
not found message:

The requested URL

/source/browse/restlet/trunk/modules/org.restlet.example/src/org/restlet/example/dist/testServlet.zip
was not found on this server.

Does anyone know if it has moved, and if so, where?

Thanks in advance.