I see.  Thank you.

Mark

On Oct 3, 2008, at 4:34 AM, Jerome Louvel wrote:


Hi Mark,

In a Resource, the actual methods using getVariants() are:

1) handleGet() which needs to computer the preferred variant for content
negotiation.

2) handlePut() which needs the preferred variant for condition PUTs.

3) getPreferredVariant() used by handleGet() and handlePut().

When the content negotiation is disabled, the logic above can also get
manually the first variant in the list.

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 : Mark Petrovic [mailto:[EMAIL PROTECTED]
Envoye : jeudi 2 octobre 2008 17:54
A : [email protected]
Objet : On the use of adding Variants to a Resource

Good day.

The FirstResource reference app makes it clear that a Resource can
have Variants added to it, and that entity variants can be tested in
the event of the GET, POST, etc, received operations.  But it doesn't
make clear why, in a Resource's constructor, those Resource's Variants
are actually set or for whose consumption.  In other words, in what
scenarios beyond setting a new Variant in the Resource constructor are
the results of getVariants() used by an application?

Thanks.


Reply via email to