I still like the idea of embedding <link> tags, since there will
likely be other types of content we may want to reference from a given
gadget definition and this covers just about all of them..
> > <link rel="tos" href="http://www.example.com/tos.html/"/><http://www.example.com/tos.html/%E2%80%9D/%3E>
> >
> > >
> >
>
>
--
Paul Lindner ||||| | | | | | | | | |
lin...@inuus.com
Okay, I see it in the xsd.. Is there any other place that this is
documented?
I still like the idea of embedding <link> tags, since there will
likely be other types of content we may want to reference from a given
gadget definition and this covers just about all of them..
> > <link rel="tos" href="http://www.example.com/tos.html/"/><http://www.example.com/tos.html/%E2%80%9D/%3E>
On Wed, Mar 05, 2008 at 03:14:39PM -0800, Kevin Brown wrote:
> I thought this was what the ModulePrefs.Icon element was for, but I could be
> mistaken.
>
> On Wed, Mar 5, 2008 at 3:09 PM, Paul Lindner <plin...@hi5.com> wrote:
>
> > Hi,
> >
> > What's the best way to get application specific favicons?
> >
> > I know that the spec support Activity.Field.STREAM_FAVICON_URL , but I'm
> > interested in getting a default value for the app that could be specified in
> > the gadget spec. This would be used in the front-end UI.
> >
> > My suggestion is that we support some variant of the existing <link> tag
> > and adopt as much of existing html spec as possible:
> >
> > <link rel="icon" href="http://example.com/favicon.ico"
> > type="image/vnd.microsoft.icon">
> > <link rel="apple-touch-icon" href="/myicon.jpg"/>
> >
> > This might also allow for adding TOS to a gadget spec as well:
> >
> >
> > >
> >
>
>
--
Paul Lindner ||||| | | | | | | | | |
lin...@inuus.com
Any suggestions on moving this forward?
> I still like the idea of embedding <link> tags, since there will
> likely be other types of content we may want to reference from a given
> gadget definition and this covers just about all of them..
>
>
> I like this solution in general, but my only concern here is that
> understanding what "rel" means requires a bunch of possible rvalues
> for the server to interpret. It also would have to be elsewhere in
> the spec (ModulePrefs), since trying to extract it from the content
> would be difficult.
How about adding them as child elements of ModulePrefs?
<ModulePrefs>
...
<link .. />
<link ... />
</ModulePrefs
Or a new top level element?
<ModuleLinks>
<link ... />
</ModuleLinks>
As for rel attributes, I just say store their literal values. I
expect that link tags are exposed as a list of items, nothing more,
the container/consumer can pick what it wants to do with each of
these.
Of course this also brings up another point, if one uses the lang
attribute we can localize content without having to do hangman
substitution:
<link rel="tos" lang="en" href="..." />
<link rel="tos" lang="es_ES" href="..." />
etc.
--
Paul Lindner ||||| | | | | | | | | |
lin...@inuus.com
Any suggestions on moving this forward?
How about adding them as child elements of ModulePrefs?
<ModulePrefs>
...
<link .. />
<link ... />
</ModulePrefs
Or a new top level element?
<ModuleLinks>
<link ... />
</ModuleLinks>
As for rel attributes, I just say store their literal values. I
expect that link tags are exposed as a list of items, nothing more,
the container/consumer can pick what it wants to do with each of
these.
Of course this also brings up another point, if one uses the lang
attribute we can localize content without having to do hangman
substitution:
<link rel="tos" lang="en" href="..." />
<link rel="tos" lang="es_ES" href="..." />
Here's our blog post on the topic:
http://www.hi5networks.com/developer/2008/03/add-an-icon-to-your-opensocial.html
> You received this message because you are subscribed to the Google Groups "OpenSocial and Gadgets Specification Discussion" group.
> To post to this group, send email to opensocial-an...@googlegroups.com
> To unsubscribe from this group, send email to opensocial-and-gadg...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
--
Paul Lindner ||||| | | | | | | | | |
lin...@inuus.com
A clarification: My original design was for an Icon element within
ModulePrefs. That's what the canonical spec says too. From your blog
post it seems like you are supporting an icon attribute on
ModulePrefs.
I don't have a strong opinion whether to use <Icon> or the more
general <link> for this, but I think an attribute is inappropriate. An
element is preferrable because it's extensible, for example it allows
for multiple icons in the future (with, e.g., multiple sizes).
Nik
You're correct, our error. We'd like to follow the specification, so
can you provide some examples of the correct usage?
From this XSD:
<xs:element name="Icon">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="mode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="base64"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="type" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
It appears that this is the correct way to implement an Icon tag:
<Icon mode="base64" type="image/gif">
... Base64'd image here
</Icon>
I'd much prefer a link here instead of inlined content..
> I don't have a strong opinion whether to use <Icon> or the more
> general <link> for this, but I think an attribute is inappropriate. An
> element is preferrable because it's extensible, for example it allows
> for multiple icons in the future (with, e.g., multiple sizes).
Okay,
> > Paul Lindner ||||| | | | | | | | | |
> > lin...@inuus.com
<Icon mode="base64" type="image/gif">
... Base64'd image here
</Icon>
Icon mode values: I personally favor "url", as IMHO it's more accurate and there's precedence in <Content type="url"...> for instance.
Icon type values: Agreed that type values should be nailed down. The obvious starting place is all approved MIME types with type="image" as defined by the IANA: http://www.iana.org/assignments/media-types/image/. However, this misses some common usages, particularly those prefixed "x-", eg. "image/x-icon" (many as shown here: http://www.w3schools.com/media/media_mimeref.asp)
Icon localization: Sounds reasonable, though I don't have a strong opinion. Three syntactical options for localizing:
1. Use message bundle hangman substitution eg. __MSG_icon_url__. This is a bit hacky, but uses existing logic paths and syntax.
Pros: Uses existing syntax and infrastructure. Cons: Hacky, overloads message substitution.
2. Add lang/country attributes to <Icon> declarations, making <Icon> repeatable.
Pros: Cleaner, doesn't conflate default value with lang-specific values, can use same lang/country selection algorithm as message bundles. Cons: Forces the issue of repeated Icon tags - problem? Also, repeats Locale-specific information in somewhere that's not MessageBundle specific.
3. Add <Locale> tags as children of <Icon>, eg. <Icon mode="url" type="image/x-icon"><Locale lang="en">http://foo.com/en.ico</Locale></Icon>
Pros: Confuses default value with locale-specific values syntactically, eg. <Icon...>defaultValueHere<Locale lang="en">enSpecificValue</Locale></Icon>.
Of these, #2 sounds cleanest to me.
Icon size: I think we should avoid encoding a default icon size in the spec, to avoid imposing particular layout/sizing requirements on containers and to keep the door open for changing common practice. That said, image resizing doesn't always yield pretty results. To me this suggests new declarative syntax for the size of a given icon, to allow a container the ability to select from the "best" match for the desired size. Eg.
<Icon mode="base64" type="image/x-icon" height="16" width="16">
On Sun, Apr 6, 2008 at 10:05 AM, John Hjelmstad <fa...@google.com> wrote:Icon mode values: I personally favor "url", as IMHO it's more accurate and there's precedence in <Content type="url"...> for instance.
HREF is never really appropriate for anything that isn't present as an html link, so I agree (href is an abbbreviation of "Hypertext Reference"). I think we're already inconsistent with this in the spec right now anyway though.
- <Locale> -- Uses the "messages" attribute, which is more semantically correct, but there's nothing in the name that tells you at first glance that it's supposed to be a url.
- <Preload> -- Uses "href", which really makes no sense, since Preloads are supposed to be pre-fetched http responses.
- <Content> Uses "href" (for type=url gadgets). This is also wrong, because it's not a link.
- <ModulePrefs> -- Labels some attributes as foo_url, and others that are also urls as foo (author_photo and thumbnail are both urls, but how are you supposed to know that without reading the spec?)
In future versions of the spec, we should clean up these inconsistencies.
Icon type values: Agreed that type values should be nailed down. The obvious starting place is all approved MIME types with type="image" as defined by the IANA: http://www.iana.org/assignments/media-types/image/. However, this misses some common usages, particularly those prefixed "x-", eg. "image/x-icon" (many as shown here: http://www.w3schools.com/media/media_mimeref.asp)
That's unnecessary in the same way that adding a type attribute to <script> tags are unnecessary. The server that serves the image will indicate the mime type. There's no reason to stick it in the spec (from a security perspective, you can't trust either anyway and you have to compare the mime type against a the file header to ensure it really is what it claims to be).
The type attribute was originally there to indicate inline files (base64 encoded representation of an image, similar to a data uri, as in "data:image/jpeg;<base64data>"). The history on this one is that this was something requested by the Google Toolbar team. It might be useful to retain this functionality, but that's a separate discussion from the use of mime types for remotely retrieved images. For data uris, the correct way to insert mime type is at the beginning of the data block.
I'd say the appropriate types would be "file" or "inline" if we support the inline stuff at all. Alternatively, we could be really "clever" and just let container types like toolbar to just support data: uris
Icon localization: Sounds reasonable, though I don't have a strong opinion. Three syntactical options for localizing:
1. Use message bundle hangman substitution eg. __MSG_icon_url__. This is a bit hacky, but uses existing logic paths and syntax.
Pros: Uses existing syntax and infrastructure. Cons: Hacky, overloads message substitution.
How does this overload message substitution? This is exactly how message substitution was designed to be used, and how it's currently used in every other context. I dislike the substitution mechanism, personally, but it's what's been supported thus far and it would be inappropriate to diverge for one element.
2. Add lang/country attributes to <Icon> declarations, making <Icon> repeatable.
Pros: Cleaner, doesn't conflate default value with lang-specific values, can use same lang/country selection algorithm as message bundles. Cons: Forces the issue of repeated Icon tags - problem? Also, repeats Locale-specific information in somewhere that's not MessageBundle specific.
3. Add <Locale> tags as children of <Icon>, eg. <Icon mode="url" type="image/x-icon"><Locale lang="en">http://foo.com/en.ico</Locale></Icon>
Pros: Confuses default value with locale-specific values syntactically, eg. <Icon...>defaultValueHere<Locale lang="en">enSpecificValue</Locale></Icon>.
Of these, #2 sounds cleanest to me.
And it's completely inconsistent with the rest of the spec. Sounds like a potential idea for a new schema, but in the current spec it would make implementation more difficult for containers while confusing developers with the inconsistency.
Makes sense. So you're saying that the type value provides no useful hint in the case of inline data? Or would you suggest deprecating type overall?
And it's completely inconsistent with the rest of the spec. Sounds like a potential idea for a new schema, but in the current spec it would make implementation more difficult for containers while confusing developers with the inconsistency.
Inconsistent in what way? In that the syntax isn't already present? :)
This is the first example I have seen of how the data should be
formatted and I was not aware that the type would be included as you
have indicated. Is this documented anywhere? Do developers know
about this? Have any developers implemented it anywhere?
The only information I have gotten on this so far has been from the
XSD and from this thread. I couldn't find any information in the
Google OpenSocial documentation and I am wondering if developers are
confused or if it is just me.
There is a discussion going on over here:
http://groups.google.com/group/opensocial-and-gadgets-spec/browse_frm/thread/c146cb26feb86885#
Which wants to add a general "link" type to the module prefs. This
link type would have a rel and href param.
Brian from myspace - is this what you were looking for? Do you want to
comment over on the other thread? Or is this discussion taking us
somewhere entirely new?
Thanks for holding my hand :)
- Cassie
As with help/support links, I'll defer to the majority on the exact syntax.
All we need is a way to programmatically fetch a favicon.ico url.