r28 - 08 May 2007 - 10:54:25 - BryanStearnsYou are here: OSAF >  Projects Web  >  ChandlerHome > ObsoleteChandlerInformation > ParcelFramework > ParcelLoading

Parcel Loading Mechanism

Chandler now supports loading parcels from an external directory in addition to the default "internal" parcels directory. If you set the PARCELPATH environment variable to point to a directory (make sure it is an absolute path), all parcel subdirectories of PARCELPATH will be loaded after the default parcels.

(For information on how parcels work, see ParcelManager.)

Inside a parcel, if you ever need to know your parcel's absolute file system path, use "self.model.path".

This feature was added for a few reasons:

  • It makes it easier for third-party developers, who can now keep their parcel code wherever they want
  • It let's us move parcels around without having to change any paths in the code
  • Eventually, end users sharing a single Chandler installation will be able to add their own parcels without affecting the other users

-- MorgenSagen - 18 Jul 2003

Loading your account info from a parcel

Create a ~/parcels/personal/ directory, and create a file named _ _ init _ _.py inside it, using the following as an example:

import application.schema as schema
from osaf.pim.mail import IMAPAccount, IMAPFolder, POPAccount, SMTPAccount,EmailAddress
from osaf.sharing import WebDAVAccount
from osaf.framework import password
from osaf.framework.twisted import waitForDeferred
def installParcel(parcel, oldVersion=None):
    pim_ns = schema.ns('osaf.pim', parcel)
    sharing_ns = schema.ns('osaf.sharing', parcel)
    dav = WebDAVAccount.update(parcel, 'ExampleDAVAccount',
        title=u'Example Sharing',
        password=password.Password.update(parcel, 'ExampleDAVAccount password'),
        references=[sharing_ns.currentSharingAccount] # Make this account default
    myEmailAddress = EmailAddress.update(parcel, 'ExampleEmailAddress',
        title=u'Example Email Address',
        fullName=u'Example Name',
    smtp = mySMTPAccount = SMTPAccount.update(parcel, 'ExampleSMTPAccount',
        title=u'Example SMTP Account',
        password=password.Password.update(parcel, 'ExampleSMTPAccount password'),
        references=[pim_ns.currentOutgoingAccount] # Make this account default
    imap = IMAPAccount.update(parcel, 'ExampleIMAPAccount',
        title=u'Example IMAP Account',
        password=password.Password.update(parcel, 'ExampleIMAPAccount password'),
        references=[pim_ns.currentIncomingAccount] # Make this account default
    # Uncomment the following lines if you've already created "Chandler folders"
    # for this IMAP account, and want mail/events/tasks read from them
    #IMAPFolder(itsView=parcel.itsView, displayName = u"Chandler Tasks",
               #folderName  = u"Chandler Tasks", folderType  = "TASK",
               #parentAccount = imap)
    #IMAPFolder(itsView=parcel.itsView, displayName = u"Chandler Mail",
               #folderName  = u"Chandler Mail", folderType  = "MAIL",
               #parentAccount = imap)
    #IMAPFolder(itsView=parcel.itsView, displayName = u"Chandler Events",
               #folderName  = u"Chandler Events", folderType  = "EVENT",
               #parentAccount = imap)
    # Uncomment the following lines if you want to load additional 
    # certificates from a .pem file:
    #from osaf.framework.certstore.data import loadCerts

Set your PARCELPATH environment variable to ~/parcels and run Chandler.

PageType DevDocPage
MaintainedBy MorgenSagen
PageStatus Work in progress -- this page is still being drafted?
Trash.CommentsWelcome2 Feel free to contribute comments?
toggleopenShow attachmentstogglecloseHide attachments
Topic attachments
I Attachment Action Size Date Who Comment
xml example-parcel.xml manage 1.7 K 31 Mar 2006 - 00:58 MorgenSagen Updated to reflect new namespaces (based on python package)
elsepem certs.pem manage 7.2 K 31 Mar 2006 - 00:58 HeikkiToivonen OSAF server certificates
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r28 < r27 < r26 < r25 < r24 | More topic actions
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.