PreCache NetInjector Documentation Center : PreCache NetInjector Application Development

Common Cases, Subscription — C

   







Retrieving discretionary attributes

— retrieving discretionary attribute values


In accessing the data for a discretionary attribute, we relied on the publisher's definition of the attribute. By filtering on that specific value, our subscriber could retrieve the content of notifications matching her criteria.

We can also enhance the subscription so that the proxy retrieves the values assigned to the discretionary attribute.

PC_evn_get_discretionary_attr(notification,
"Interest",&interest,&typecode,&size);

PC_evn_get_discretionary_attr adds the value of the discretionary attribute Interest to the subscription. The value of this attribute has already been set by the publisher as Country Music. ( Common Cases, Publication — C)

So as to call PC_evn_get_discretionary_attr, we add the statement above to a new callback function, notify2.

When the proxy creates the new subscription, including the filter for the discretionary attribute Interest, PC_evn_subscribe_with_exp invokes notify2.

PC_evn_subscribe_with_exp(
p,"Sample.Chat",
"Interest == \"Country Music\"Music\"",
notify2,strdup("Country music fans"),
PC_NULL, &hSubscription3);

Our new subscriber definition enables the subscriber to retrieve content more tightly coupled to her interests.