So I'll just assume people are familiar with how Buzz works... you
have a free-form message, and are able to attach various kinds of
media to your post, such as photos, photo albums, videos, links, etc.
The first challenge was in identifying the actual activity. Given a
short Buzz post with an attached image, that could be interpreted two
ways:
- Joe posted a note, with an attached image
- Joe shared an image, with an attached annotation[0]
This is trickier when you have multiple attached images or videos,
since activities are defined as containing only a single object. For
right now, we're leaning toward the first option, since it avoids the
multiple object problem. But then we still have the problem of how to
identify these attached media objects. Of course, if all you care
about is linking to it, you can simply use:
<link rel="related" type="image/jpeg" href="..." />
But we are wanting to be a bit more expressive, along the lines of the
various activity object types. So the best thing I could come up with
is to express the note as the object of the activity, and to identify
the attachments in a custom element, using the same schema as an
activity object. So you would end up with:
<entry>
<author> ... </author>
<activity:verb> .../post </activity:verb>
<activity:object>
<activity:object-type> .../note </activity:object-type>
...
</activity:object>
<link rel="related" type="image/jpeg" href="foo.jpg" />
<buzz:attachment>
<activity:object-type> .../photo </activity:object-type>
<title>My Photo</title>
<link rel="alternate" type="image/jpeg" href="foo.jpg" />
<link rel="preview" type="image/jpeg" href="foo-thumbnail.jpg" />
</buzz:attachment>
</entry>
So here you have the attached image represented twice. First as a
simple <link> for those consumers that understand Atom (and maybe
Activity Streams). And second, as a buzz:attachment, with all the
richness of an activity:object, such as title and thumbnail image. An
alternate approach would be to include the photo object inside the
note object somehow, but that starts to lead down a slippery slope
that I'm not sure we want to venture toward.
So I guess my first question is, does anyone else have similar use
cases, where you want to provide richer metadata about an object, but
that object is neither the formal object or target of the given
activity? If so, how are you expressing that in Activity Streams, if
at all? Secondly, how does the use of buzz:attachment in the example
above strike people? Should this kind of use case be handled with
custom elements, or do we think there should be a common way to
express this without needing custom elements?
thanks for any thoughts, and would love to discuss this this weekend
if time permits.
-will
In TypePad we just do this by embedding the images in the atom:content,
which means that they get rendered in the correct places inside the
entry but it does mean you need to start scraping the HTML if you want
to pull the images out.
In the TypePad API, which started off looking roughly like a JSON
serialization of activity streams but has deviated over time, we
invented a specialized "image link" construct to deal with the problem
of linking to multiple images while providing multiple representations
of each. This object type is defined here:
http://www.typepad.com/services/apidocs/objecttypes/ImageLink
Now obviously the stuff about URL templates is TypePad-specific, but the
notion of including both the original image URL and the URL of its
preview together is the important thing.
Here's one way you could translate this into Atom:
<link rel="enclosure" href="..." type="image/jpeg"
media:width="..." media:height="...">
<link rel="variant" href="" type="image/jpeg"
media:width="..." media:height="..."
/>
</link>
This remains compatible with the basic Atom enclosures mechanism while
extending it with multiple variants of the same enclosure with different
characteristics. Here I used the AtomMedia extensions to describe the
various sizes available.
Of course, this doesn't represent the image as a full-fidelity Activity
Streams object. For the TypePad API we decided that providing the
information necessary to render the image was most important and
therefore focused on that for the inline representation. However, we do
offer a separate API endpoint where you can get the full object
representations for the images; I'm not sure how you'd translate *that*
into Activity Streams, where generally we've always aspired to stuff
everything into the feed to avoid additional round-trips.
<category scheme="http://schemas.cliqset.com/activity/categories/1.0" term="WeblogEntryPosted" label="WeblogEntry Posted"></category>
--
You received this message because you are subscribed to the Google Groups "Activity Streams" group.
To post to this group, send email to activity...@googlegroups.com.
To unsubscribe from this group, send email to activity-strea...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activity-streams?hl=en.
Yes, that is what the specification says today.
Even if it did not, it seems like your use-case is about objects
embedded inside other objects, so it would probably be more natural to
have them nested inside one another at the XML level.
--
You received this message because you are subscribed to the Google Groups "Activity Streams" group.
To post to this group, send email to activity...@googlegroups.com.
To unsubscribe from this group, send email to activity-strea...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activity-streams?hl=en.
Thanks for putting this together Chris. I like this direction of using child elements of <link rel=”related” …/> for the attachement(s.)
I’ve added the example + screenshots of MySpace’s UX for attaching a photo, link, or video to a status post.
Thanks again—
--Rob