There is definitely some scope for cleanup in the Shindig code with regard
to how we handle filters and sorts. The REST/RPC spec are clearer on how
this should be done and the cruftiness in the Shindig code is mostly a
remnant of how poorly filtering was defined in the original JS API.
ALL - I think is redundant and can probably be eliminated. If the rest call
is
/people/{guid}/@friends
the only reason to support an @all pre-canned filter is if the container
applied a different filter by default which would be pretty odd. The client
side JS is free to do so of course.
HAS_APP - Im not sure there are any good examples of how this should be
mapped in the spec but I would think something like
/people/{guid}/@[EMAIL PROTECTED]&filterOp=equals&[EMAIL PROTECTED]
would be the most general formulation. Containers are free to make this the
default filter behavior if none is specified
IS_FRIENDS_WITH - There was recent discussion of this on the spec list and
it was broadly agreed that this would become
/people/{guid}/[EMAIL PROTECTED]&filterOp=equals&filterValue={guid}
where @friends in this context is a virtual filed on the initial set of
resolved people prior to filtering
TOP_FRIENDS - This is either a sort or a group but again modeling it as a
filter seems odd.
Given that we are now branched we have to live with the somewhat awkward
mapping we have today. As for what containers need to support I think
containers are'nt required to implement anything other than the ALL_FILTER
with paging and silently ignore the other ones. The spec isn't particularly
clear on this point.
On Thu, Dec 4, 2008 at 8:44 PM, Henning P. Schmiedehausen <
[EMAIL PROTECTED]> wrote:
> Hi,
>
> according to the current 0.8.1 spec, the container only supports
> filtering by "ALL", "HAS_APP", "IS_FRIENDS_WITH" and
> "TOP_FRIENDS". However, the code allows setting of a FilterOperation
> on CollectionOptions, which supports contains, equals, startsWith and
> present.
>
> How are these used by Shindig? It seems that the 0.8.1 spec things
> translate to
>
> options.setFilterOperation(PersonService.FilterOperation.equals);
> options.setFilterValue(PersonService.ALL_FILTER);
>
> for all friends and similar using TOP_FRIENDS_FILTER, HAS_APP_FILTER,
> ALL_FILTER and IS_WITH_FRIENDS_FILTER
> [That should probably be IS_FRIENDS_WITH_FILTER.]
>
> When are the other FilterOperations used and must our backend support
> these in 0.8.1 ?
>
> Ciao
> Henning
>
>
> --
> Henning P. Schmiedehausen - Palo Alto, California, U.S.A.
> [EMAIL PROTECTED] "We're Germans and we use Unix.
> [EMAIL PROTECTED] That's a combination of two demographic groups
> known to have no sense of humour whatsoever."
> -- Hanno Mueller, de.comp.os.unix.programming
>