On 10/7/2009 11:16 AM, Brian Cully wrote:
On 2-Oct-2009, at 02:46, Brett Zamir wrote:
While attributes are being added to <item/>, would there also be some
way to add meta-data about the node to the event as well, e.g.,
pubsub#num_subscribers (the number of subscribers to the node) or
pubsub#title (human-readable node name)? I know it can be retrieved
separately, but this seems it could be useful to be able to get back
together...
No. If you want that kind of information you should put it in your
item payload or, as you mention, retrieve it separately where it can
be subjected to additional access restrictions. Do you really want all
your subscribers to know how many subscriptions are on a node?
I had suggested that there could be a (list-multi) item available in
subscription options which could determine which meta-data would be
delivered, so not every subscriber would need to get this information.
However, for our client application, yes, we very much do want to know
how many subscriptions are on a node. And I don't think it makes sense
for something which is clearly meta-data unrelated to the individual
item being published to be required to be within the payload. However, I
do agree node information does not semantically make sense on <item/>
either--thus my proposal for adding an optional <node/> element in the
notification which could contain that information (though I should have
suggested it as an immediate child of <message/> since it is not exactly
part of the event, nor certainly part of "items" or "item").
Retrieving the meta-data manually would be extremely cumbersome if
subscribers' clients had to make a separate meta-data request upon each
notification in order to ensure the meta-data for the node was fresh.
Some meta-data like pubsub#creation_date could be stored just once (thus
my suggestion to deliver such meta-data in a successful subscription
response), but meta-data like #num_subscribers will vary with time.
And why on earth should an item push node meta-data?
It's meta-data related to the state of things during the notification
rather than being a part of <items/> (thus my suggestion for it to be
added directly inside <message/> (or <iq/> if one is using this new
option for notifications)).
What would happen if you subscribe to a collection?
I was thinking it would be for the responsible leaf node, but I could
see advantages for adding separate meta-data for the collection node.
Brett