README: Change to personal parcel.xml (was Re: [Dev] ContentModel, Calendar, Contacts, etc. reorganization/flattening)

Morgen Sagen morgen at osafoundation.org
Thu Jul 28 15:26:09 PDT 2005


On Jul 28, 2005, at 9:39 AM, Phillip J. Eby wrote:
>
> Sometimes, however, a parcel just needs to *refer* to an item by a  
> well-known name, even though the item itself is anonymous.  For  
> example, the "me" contact, the "current" account, and so on.  In  
> these cases, a parcel will create a Reference whose ``item``  
> attribute points to the actual item in the soup, while the  
> Reference itself lives in the parcel.  Reference objects will  
> therefore be used in place of CurrentPointer objects, and the  
> inverse relationship of ``item`` will be ``references``.  This  
> means that any personal parcels that now define a ``currentItemOf``  
> will need to be changed to use ``references`` instead.  There will  
> be a separate posting to announce this change when it happens,  
> which will give more details.

I have just migrated ContentModel.CurrentPointer to Parcel.Reference,  
done away with osaf.current completely, and populated osaf.app with a  
few Reference instances, including currentWebDAVAccount and  
currentMailAccount.

So the new way to access the "current" WebDAVAccount, for example is to:

app = schema.ns('osaf.view', view)
account = app.currentWebDAVAccount.item

...or to set a new current account would be:

app.currentWebDAVAccount.item = account

I've changed all the code that made use of the old CurrentPointers,  
however, if you have a personal parcel.xml which includes accounts  
that you want to be default, you need to change your parcel.xml in  
the following ways:

Instead of...

    xmlns:current="parcel:osaf.current"

...it should now be...

    xmlns:app="parcel:osaf.app"


And where you had...

    <currentPointerOf itemref="current:MailAccount" />

...that should now be...

    <references itemref="app:currentMailAccount" />

I've updated the wiki page with an example personal parcel.xml file:

    http://wiki.osafoundation.org/bin/view/Projects/ParcelLoading





More information about the Dev mailing list