Previous notes
Notes on Clouds API
How to get an item's cloud with current API, roughly extracted from unit tests:
mailMessageItem = Mail.MailMessage("mailMessageItem")
parcelManager = Parcel.getManager(repository, path, etc etc)
namespace = "http://foobar/namespace"
cloud = parcelManager.lookup(parcelNamespace, "MailMessageMixin/Cloud")
items = cloud.getItems(mailMessageItem)
Of course our unit test framework has abstracted some of this away, but that's not the right place to make it simpler. Since we already have the mailMesasgeItem and need it to get the cloud anyway, we can use that to know which repository etc, and avoid going through the Parcel.Manager lookup method. The interface could be used like this:
mailMessageItem = Mail.MailMessage("mailMessageItem")
cloud = mailMessageItem.getCloud("Cloud")
items = cloud.getItems(mailMessageItem)
Or even simpler:
mailMessageItem = Mail.MailMessage("mailMessageItem")
items = mailMessageItem.getItemsInCloud("Cloud")
This would imply methods being added to Item to either get one of the Item's clouds, or all of the things in one of the Item's clouds.
--
LisaDusseault - 28 Jul 2004