Receiving notifications about changes to items
March 8th, 2006 by Andi VajdaTo support the requirements of Chandler, the repository had to implement a richer set of notifications than what was originally offered with attribute monitors.
Common to all kinds of repository notification, a method on a subscribing
item is invoked when changes take place in an item. The subscriber may be
notified immediately after the change happened or the notification may be
queued for later delivery. The subscription may be persisted in the
repository and eventually exist in all repository views or may be kept
transient in a view until that view is closed.
The use cases below describe the various kinds of repository notifications
and how to set them up. There is overlap between them, read on
carefully. Collection item notifications are based off some of these use
cases and are described last.
- How to receive a notification when an attribute of a given name
changes on any item.
This is done with href="http://blogs.osafoundation.org/chandlerdb/2005/02/using_attribute.html">attribute
monitors.- a monitor is always a persistent subscription
- monitor methods are always invoked immediately after a monitored
attribute changes in the view of the subscriber items - monitor methods are not invoked during view refresh
- How to receive a notification when a given item changes
A item is said to change when one or several of its attribute values are
changed, added or removed, or when its kind changes during item creation,
stamping or deletion. This style of notification is setup with the
watchItemAPI.- an item watcher may be persistent by calling
watchItemon the
subscriber:
subscriber.watchItem(item, methodName) - an item watcher may be kept transient to a view by calling
watchItemon the view instead:
subscriber.itsView.watchItem(subscriber, item, methodName) - an item watcher method is invoked immediately after an item changed in the
view of the subscriber items - an item watcher method is invoked during view refresh when a watched item is
refreshed to changes the occurred earlier in other views
The method name passed to
watchItemmust correspond to a
method defined on the subscriber item’s implementation class:def watchedItemChanged(self, op, item, names): # self is the subscriber item # op is one of 'set', 'remove' or 'refresh' # 'set' means that an attribute value was set # 'remove' means that an attribute value removed # 'refresh' means that the item was changed because the view refreshed # item is the uuid of the item that changed # names is a tuple naming all the attributes that changed # it normally contains one name except when op is 'refresh' # if the item's kind changed, then it also contains 'itsKind' ... - an item watcher may be persistent by calling
- How to receive a notification when any item of a given kind is created,
deleted or stamped.
This style of notification is setup with the
watchKindAPI.- a kind watcher may be persistent by calling
watchKindon the
subscriber:
subscriber.watchKind(kind, methodName) - a kind watcher may be kept transient to a view by calling
watchKindon the view instead:
subscriber.itsView.watchKind(subscriber, kind, methodName) - a kind watcher method is invoked immediately after any item’s watched kind
changed in the view of the subscriber items - a kind watcher method is not invoked during view refresh
The method name passed to
watchKindmust correspond to a
method defined on the subscriber item’s implementation class:def watchedKindChanged(self, op, kind, item): # self is the subscriber item # op is one of 'add' or 'remove' # 'add' means that the item is now of that kind (or a subkind thereof) # 'remove' means that the item is no longer of that kind # item is the item or the uuid of the item that changed ... - a kind watcher may be persistent by calling
- How to receive a notification when any item is added to or removed from
an href="http://blogs.osafoundation.org/chandlerdb/2005/07/abstract_sets_o.html">abstract
set or a bi-directional ref collection.
This style of notification is setup with the
watchCollectionAPI.- a collection watcher may be persistent by calling
watchCollectionon the subscriber:
subscriber.watchCollection(item, attribute, methodName) - a collection watcher may be kept transient to a view by calling
watchCollectionon the view instead:
subscriber.itsView.watchCollection(subscriber, item, attribute,
methodName) - a collection watcher method is invoked immediately after any item’s
watched collection changed in the view of the subscriber items - a collection watcher method is invoked during view refresh
The method name passed to
watchCollectionmust correspond to a
method defined on the subscriber item’s implementation class:def watchedCollectionChanged(self, op, item, attribute, other): # self is the subscriber item # op is one of 'add', 'remove', 'refresh' or 'changed' # item is the item or the uuid of the item that owns # the collection that changed # attribute is the name of the attribute that contains the collection # value that changed. # other is the item or the uuid of the item that was added to, removed # from, refreshed or otherwise changed while it belonged to the collection ... - a collection watcher may be persistent by calling
- How to receive a notification when any item is added to or removed from
a Collection item or when an item belonging to a Collection item is
changed
This style of notification is setup with the
notificationQueueSubscribeAPI.- a collection item subscription may be persistent by calling
notificationQueueSubscribeon the collection item:
collection.notificationQueueSubscribe(subscriber) - a collection item subscription may be kept transient to a view by calling
notificationQueueSubscribeon the view instead:
collection.itsView.notificationQueueSubscribe(subscriber) - collection item notifications are queued and are dispatched during view
refresh or whenview.dispatchNotifications()is called
explicitely.
A href="http://blogs.osafoundation.org/chandlerdb/2006/03/collections_ite.html">collection
item notification subscriber must implement a method called
onCollectionNotification:def onCollectionNotification(self, op, collection, attribute, other): # self is the subscriber item # op is one of 'add', 'remove', 'refresh' or 'changed' # collection is the collection item that changed # attribute is the name of the attribute that contains the collection # value that changed. # other is the item or the uuid of the item that was added to, removed # from, refreshed or otherwise changed while it belonged to the collection ... - a collection item subscription may be persistent by calling
free viagra
buy viagra online
generic viagra
how does viagra work
cheap viagra
buy viagra
buy viagra online inurl
viagra 6 free samples
viagra online
viagra for women
viagra side effects
female viagra
natural viagra
online viagra
cheapest viagra prices
herbal viagra
alternative to viagra
buy generic viagra
purchase viagra online
free viagra without prescription
viagra attorneys
free viagra samples before buying
buy generic viagra cheap
viagra uk
generic viagra online
try viagra for free
generic viagra from india
fda approves viagra
free viagra sample
what is better viagra or levitra
discount generic viagra online
viagra cialis levitra
viagra dosage
viagra cheap
viagra on line
best price for viagra
free sample pack of viagra
viagra generic
viagra without prescription
discount viagra
gay viagra
mail order viagra
viagra inurl
generic viagra online paypal
generic viagra overnight
generic viagra online pharmacy
generic viagra uk
buy cheap viagra online uk
suppliers of viagra
how long does viagra last
viagra sex
generic viagra soft tabs
generic viagra 100mg
buy viagra onli
generic viagra online without prescription
viagra energy drink
cheapest uk supplier viagra
viagra cialis
generic viagra safe
viagra professional
viagra sales
viagra free trial pack
viagra lawyers
over the counter viagra
best price for generic viagra
viagra jokes
buying viagra
viagra samples
viagra sample
cialis
generic cialis
cheapest cialis
buy cialis online
buying generic cialis
cialis for order
what are the side effects of cialis
buy generic cialis
what is the generic name for cialis
cheap cialis
cialis online
buy cialis
cialis side effects
how long does cialis last
cialis forum
cialis lawyer ohio
cialis attorneys
cialis attorney columbus
cialis injury lawyer ohio
cialis injury attorney ohio
cialis injury lawyer columbus
prices cialis
cialis lawyers
viagra cialis levitra
cialis lawyer columbus
online generic cialis
daily cialis
cialis injury attorney columbus
cialis attorney ohio
cialis cost
cialis professional
cialis super active
how does cialis work
what does cialis look like
cialis drug
viagra cialis
cialis to buy new zealand
cialis without prescription
free cialis
cialis soft tabs
discount cialis
cialis generic
generic cialis from india
cheap cialis sale online
cialis daily
cialis reviews
cialis generico
how can i take cialis
cheap cialis si
cialis vs viagra
levitra
generic levitra
levitra attorneys
what is better viagra or levitra
viagra cialis levitra
levitra side effects
buy levitra
levitra online
levitra dangers
how does levitra work
levitra lawyers
what is the difference between levitra and viagra
levitra versus viagra
which works better viagra or levitra
buy levitra and overnight shipping
levitra vs viagra
canidan pharmacies levitra
how long does levitra last
viagra cialis levitra
levitra acheter
comprare levitra
levitra ohne rezept
levitra 20mg
levitra senza ricetta
cheapest generic levitra
levitra compra
cheap levitra
levitra overnight
levitra generika
levitra kaufen

