Re: Re: Restlet 2.0 M3 released

2011-03-25 Thread Marc Lerma
There is a wonderful free gift waiting for you!
http://www.salontshirts.com/salontshirts/catalog/coupons/bestsellers.html




2009/6/17, Jerome Louvel :
> Hello Rémi,
>
>
>
> Thanks as always for your feed-back.
>
>
>
> Do you think that your issue regarding the media type returned is a bug from
> our conneg algorithm? What is the Java class that your annotated method
> returns? Do you have an annotation value?
>
>
>
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Lead developer ~  
> http://www.restlet.org
> Noelios Technologies ~ Co-founder ~  
> http://www.noelios.com
>
>
>
>
>
>
>
>
>
> De : remidewi...@gmail.com [mailto:remidewi...@gmail.com] De la part de Rémi
> Dewitte
> Envoyé : mercredi 17 juin 2009 16:18
> À : discuss@restlet.tigris.org
> Objet : Re: Restlet 2.0 M3 released
>
>
>
> Hello,
>
> I had an issue with the new scoring algorithm and jQuery and FF because some
> of my resources were returning not the same mime type as it used to.
>
> Returning application/xhtml+xml causes a document node instead of a div DOM
> element to be created in FF. And an JS error while trying an append.
>
> Otherwise everthing is going smoothly !
> Thanks,
> Rémi
>
> On Tue, Jun 16, 2009 at 23:31, Tal Liron 
> wrote:
>
> Oops! That's what I meant! (not VariantInfo)
>
>
> Rob Heittman wrote:
>
>> And 4. that new RepresentationInfo thing is pure nitroglycerine.
>>
>> Thanks for validating trunk, Tal, I had to hold off on some port
>> attempts on my end due to the 406 problem ... I'll give it another whirl.
>>
>> On Tue, Jun 16, 2009 at 2:30 PM, Tal Liron
>
>> mailto:tal.li...@threecrickets.com>> wrote:
>>
>> 1. Routing: Routing seems to be being reworked. I'm not sure how
>> it will
>> look for the final release as of yet, but the RFEs point to some very
>> useful abilities.
>> 2. High-level HTTP: ServerResource is a revolution in this regard.
>> Annotations will allow a very concise way of defining the rules for
>> negotiation. And the advent VariantInfo class (with the getInfo
>> methods)
>> can really improve performance for negotiation. (I'm think there
>> should
>> be a tutorial to show this in action.)
>> 3. Representation: The advent of the ConverterService makes it easy to
>> handle transformations across the entire application/service.
>>
>
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447
> 
> &dsMessageId=2362613
>
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2362910

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


getting the button from a Form

2009-07-15 Thread Marc Lerma
hello everyone, 

In my application, I need to get the id of a form button  when managing a POST 
call on a given resource.

this is my form i'm posting to my resource:


Name:

Password:






and I'm getting it as follows:

@Post 
public Representation sendForm(Representation entity) {


Form form = new Form(entity);   

//get the names of the form fields
Set  names = form.getNames();
   
...
}

I'm being able to get all the field names but the button one, and I definitely 
need it. is there any means by which I can get the button name 
('submitButton')???


thanks in advance!

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


RE: Confusion with filter

2009-06-12 Thread Marc Lerma
I'm also confused about the use of filters. I'm trying to apply a security 
filter in order to check whether the user is authenticated before accessing the 
resources, but it seems to me that it's never being applied. I've tried to 
debug the code and the filter is never called before handling a resource. 

Here is the code:


@Override
public synchronized Restlet createRoot() {



//Crea un router en el cual se registran las URIs y los recursos 
asociados a cada una

Router router = new Router(getContext());

router.attachDefault(RESTLoginResource.class);
router.attach("/login", RESTLoginResource.class);
router.attach("/{userName}", UserResource.class);
 

Filter securityFilter = new Filter(getContext()){
  public int beforeHandle(Request request, Response response){
  
  SessionManager sm =
  
com.isoco.iwf.webapp.common.Application.getSingleInstance().getSessionManager();
  
if(sm.getLogged(BaseResource.getHttpServletRequest(request))!=null){
log.info("User is authenticated");
return Filter.CONTINUE;
}
else
{
log.info("user must be authenticated ");
return Filter.STOP;
}



  }
};

securityFilter.setNext(router);

return router;
}


shouldn't the filter be executed before getting to each registered resource ? 


thanks for your help!

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


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

2009-06-09 Thread Marc Lerma
Hi Jerome, 

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

It fails here in the following sentence: 

 if (httpCall instanceof ServletCall)  

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


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

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

any ideas?

thank you!

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


RE: Restlet 2.0 M3 released

2009-06-09 Thread Marc Lerma
Hi there, 

I'm totally new to Restlet and to REST architecture, so perhaps I still have a 
fuzzy idea of what it's all about. For the moment, I'm being totally amazed by 
what I've read that can be done with restlet. 

Well, let's get to the point. I've downloaded the latest release (Restlet 2.0 
M3) of Restlet, but now I'm getting a bit confused since I cannot be sure that 
everything will work fine. I was checking the API Docs and found out that the 
Post annotation, for instance, is not complete : 
http://www.restlet.org/documentation/2.0/api/ . Does it prevent me from doing 
POST calls to a Resource ? is it equivalent to the 'protected Representation 
post(Representation entity)  throws ResourceException {' method?  

Sorry for this newbie question.

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