gadgets.util.hasFeature(feature) says whether gadgets support a feature.
Proposing adding gadgets.util.getFeatureParam(feature, key) to get a specific property of feature support on a given container. Two known use cases are activity stream title length, maximum people to return from newFetchPeopleRequest()
Or maybe getFeatureCapabilities?
>
> >
> >
> >
> >
>
>
>
> --
> ~Kevin
>
>
> >
>
er - getFeatureParameters() may be what is needed. Possibly feature providers / containers can provide default parameters that aren't configurable.
getFeatureParameters('opensocial')['ActivityTemplate.MaxLength'] or similar (with enums).
EvanOn Fri, Apr 18, 2008 at 6:16 PM, Kevin Brown <et...@google.com> wrote:~KevinOn Fri, Apr 18, 2008 at 12:19 PM, Evan Gilbert <uid...@google.com> wrote:gadgets.util.hasFeature(feature) says whether gadgets support a feature.
Proposing adding gadgets.util.getFeatureParam(feature, key) to get a specific property of feature support on a given container. Two known use cases are activity stream title length, maximum people to return from newFetchPeopleRequest()
This would be confusing because of the existence of getFeatureParameters, which returns the <Param> elements from the <Require> / <Optional> elements. http://code.google.com/apis/gadgets/docs/reference/gadgets.util.html#getFeatureParameters
The idea is good, but the name should probably be something else (getFeatureSetting maybe? I don't know).
--
We already do this in other places anyway, so it's probably irrelevant
now. It would just be key/ value pairs anyway.
Would it make sense to add this functionality to the opensocial.Environment instead of a function called getFeatureParameters? I’d also be happy with both, but make the opensocial.Environment a ‘convenience’ mechanism to call the getFeatureParameters method.
It seems that we are really asking the container for limits on sizes of various things. Besides Arne’s proposal, could we do something like this:
Proposal:
Add a new Field to opensocial.Environment named Limits.
Field Summary:
<static> object APPDATA_MAX: A number indicating the total space the container makes available for appData.
<static> object APPDATA_REMAINING: A number indicating how much appData space is left for the current user/application.
<static> object MAX_NETWORKDISTANCE: A number indicating the maximum network distance supported by the container.
<static> object PERSON_MAX_RESULTS_COUNT: A number indicating the maximum number of opensocial.Person objects that can be retrieved in a collection.
<static> object PERSON_DEFAULT_RESULTS_COUNT: A number indicating the default number of opensocial.Person objects retrieved in a collection.
<static> object ACTIVITY_MAX_RESULTS_COUNT: A number indicating the maximum number of opensocial.Activity objects that can be retrieved in a collection.
<static> object ACTIVITY _DEFAULT_RESULTS_COUNT: A number indicating the default number of opensocial.Activity objects retrieved in a collection.
<static> object COLLECTION_MAX_RESULTS_COUNT: A number indicating the maximum number of opensocial objects that can be retrieved in a collection that is not specifically named in the opensocial.Environment.
<static> object COLLECTION_DEFAULT_RESULTS_COUNT: A number indicating the default number of opensocial objects retrieved in a collection that is not specifically named.
… (others as we come up with them)
|
Scott Seely |
architect |
email sse...@myspace.com |
---------- Forwarded message ----------
From: "Arne Roomann-Kurrik (Google)" <api.kur...@google.com>
Date: Apr 24, 3:58 pm
Subject: Proposal: getFeatureParam() or equivalent
To: OpenSocial and Gadgets Specification Discussion
My comments around getFeatureParameters are largely around the notion of looking for less verbose syntax, nothing more.
Anyhow, you asked for an example.
var maxFriendsPerGet = opensocial.Environment.Limits.PersonMaxResultsCount;
This is more terse than
var maxFriendsPerGet = gadgets.util.getFeatureParameters('opensocial')[opensocial.Environment.Limits.PERSON_MAX_RESULTS_COUNT];
and given the discussion around enums earlier this week, we could argue that the previous line is really just:
var maxFriendsPerGet = gadgets.util.getFeatureParameters('opensocial')['PERSON_MAX_RESULTS_COUNT'];
At the end of the day, I care more about getting the limits discoverability into the spec. Also, consistent syntax is important. If this is something with broad applicability to other gadgets features, then I probably prefer something like the gadgets.util.getFeatureParameters syntax. That syntax is just an interpretation of what I think was proposed in April—correct me if this is wrong.
My comments around getFeatureParameters are largely around the notion of looking for less verbose syntax, nothing more.
Anyhow, you asked for an example.
var maxFriendsPerGet = opensocial.Environment.Limits.PersonMaxResultsCount;
This is more terse than
var maxFriendsPerGet = gadgets.util.getFeatureParameters('opensocial')[opensocial.Environment.Limits.PERSON_MAX_RESULTS_COUNT];
and given the discussion around enums earlier this week, we could argue that the previous line is really just:
var maxFriendsPerGet = gadgets.util.getFeatureParameters('opensocial')['PERSON_MAX_RESULTS_COUNT'];
I would argue against adding more capability querying mechanisms in favor of refining (and/or eliminating) the existing ones. This gets very confusing for developers if they have to query one API to determine that something is supported, another API to determine the maximum value for something, and then the resulting objects to determine what capabilities that they have.