Package osaf :: Package pim :: Module items :: Class ContentItem
[hide private]
[frames] | no frames]

Class ContentItem

source code

             object --+                    
                      |                    
chandlerdb.item.c.CItem --+                
                          |                
  repository.item.Item.Item --+            
                              |            
        application.schema.Item --+        
                                  |        
               reminders.Remindable --+    
                                      |    
                      triage.Triageable --+
                                          |
                                         ContentItem
Known Subclasses:
mail.AccountBase, contacts.Contact, contacts.ContactName, mail.EmailAddress, mail.EmailAddresses, mail.IMAPFolder, mail.MIMEBase, collections.ContentCollection, notes.Note, Group, Principal, Project, calendar.Recurrence.RecurrenceRule, calendar.Recurrence.RecurrenceRuleSet, calendar.Calendar.Location, calendar.Calendar.RecurrencePattern

Content Item

Content Item is the abstract super-kind for things like Contacts, Calendar Events, Tasks, Mail Messages, and Notes. Content Items are user-level items, which a user might file, categorize, share, and delete.

Examples:

Nested Classes [hide private]

Inherited from application.schema.Item: __metaclass__

Instance Methods [hide private]
 
getByline(self) source code
 
__str__(self)
str(x)
source code
 
__unicode__(self) source code
 
InitOutgoingAttributes(self)
Init any attributes on ourself that are appropriate for a new outgoing item.
source code
 
ExportItemData(self, clipboardHandler) source code
 
onItemDelete(self, view, deferring) source code
 
addToCollection(self, collection)
Add self to the given collection.
source code
 
removeFromCollection(self, collection)
Remove self from the given collection.
source code
 
_prepareToRemoveFromCollection(self, collection)
If the collection is a mine collection and the item doesn't exist in any other 'mine' collections, manually add it to 'all' to keep the item 'mine'.
source code
 
getMembershipItem(self)
Get the item that should be used to test for membership tests i.e.
source code
 
changeEditState(self, modType=Modification.edited, who=<Locale: en_US>, when=<Locale: en_US>) source code
 
getEmailAddress(self, nameOrAddressString)
Lookup or create an EmailAddress based on the supplied string.
source code
 
getCurrentMeEmailAddress(self)
Lookup or create a current "me" EmailAddress.
source code
 
getMyModifiedByAddress(self)
Get an EmailAddress that represents the local user, for storing in lastModifiedBy after a local change.
source code
 
_updateCommonAttribute(self, attributeName, sourceAttributeName, collectorMethodName, args=())
Mechanism for coordinating updates to a common-display field (like displayWho and displayDate, but not displayName for now).
source code
 
addDisplayWhos(self, whos) source code
 
updateDisplayWho(self, op, attr) source code
 
addDisplayDates(self, dates, now)
Subclasses will override this to add relevant dates to this list; each should be a tuple, (priority, dateTimeValue, 'attributeName').
source code
 
updateDisplayDate(self, op, attr) source code
 
onCreatedOrLastModifiedChanged(self, op, attr) source code
 
onModificationChange(self, op, name) source code
 
onErrorChanged(self, op, attr) source code
 
getBasedAttributes(self, attribute)
Determine the schema attributes that affect this attribute (which might be a Calculated attribute)
source code
 
isAttributeModifiable(self, attribute)
Determine if an item's attribute is modifiable based on the shares it's in
source code
 
osaf.pim.Stamp.onStampTypesChanged(item, op, attrName) source code
 
osaf.sharing.shares.SharedItem.onConflictingStatesChange(item, op, attrName) source code

Inherited from triage.Triageable: copyTriageStatusFrom, purgeSectionTriageStatus, reminderFired, resetAutoTriageOnDateChange, setTriageStatus, triageState

Inherited from reminders.Remindable: getUserReminder, getUserReminderTime, onRemindersChanged, setUserReminderTime

Inherited from application.schema.Item: __init__

Inherited from repository.item.Item.Item: _repr_, addFreeValue, addValue, check, clone, copy, delete, dir, find, findPath, findUUID, getACL, getAttributeValue, getFirstChild, getFreeValue, getItemChild, getItemCloud, getLastChild, getNextChild, getPreviousChild, getValue, getVersion, hasAttributeAspect, hasChild, hasChildren, hasKey, hasValue, hashItem, isAttributeDirty, isItemOf, isRemote, iterAttributeNames, iterAttributeValues, iterChildren, iterChildrenKeys, mixinKinds, move, placeChild, printItem, refCount, removeACL, removeAttributeValue, removeFreeValue, removeValue, rename, setACL, setAttributeValue, setFreeValue, setPinned, setValue, unloadItem, unwatchCollection, unwatchItem, unwatchKind, walk, watchCollection, watchItem, watchKind

Inherited from chandlerdb.item.c.CItem: __delattr__, __getattribute__, __getitem__, __new__, __repr__, __setattr__, getAttributeAspect, getDirty, getLocalAttributeValue, hasLocalAttributeValue, hasTrueAttributeValue, isDeferred, isDeferring, isDeferringOrDeleting, isDeleted, isDeleting, isDirty, isLive, isMutating, isMutatingOrDeleting, isNew, isPinned, isSchema, isStale, isWatched, setDirty

Inherited from object: __hash__, __reduce__, __reduce_ex__

Class Methods [hide private]

Inherited from application.schema.Item: getDefaultParent, getKind, iterItems

Static Methods [hide private]

Inherited from triage.Triageable: makeTriageStatusChangedTime

Class Variables [hide private]
  isProxy = True
  displayName = <Descriptor displayName of <class 'osaf.pim.item...
  body = <Descriptor body of <class 'osaf.pim.items.ContentItem'>>
  creator = <Descriptor creator of <class 'osaf.pim.items.Conten...
  modifiedFlags = <Descriptor modifiedFlags of <class 'osaf.pim....
  lastModified = <Descriptor lastModified of <class 'osaf.pim.it...
  lastModification = <Descriptor lastModification of <class 'osa...
  BYLINE_FORMATS = {Modification.edited: (u'Edited by %(user)s o...
  error = <Descriptor error of <class 'osaf.pim.items.ContentIte...
  importance = <Descriptor importance of <class 'osaf.pim.items....
  mine = <Descriptor mine of <class 'osaf.pim.items.ContentItem'>>
  private = <Descriptor private of <class 'osaf.pim.items.Conten...
  read = <Descriptor read of <class 'osaf.pim.items.ContentItem'>>
  needsReply = <Descriptor needsReply of <class 'osaf.pim.items....
  createdOn = <Descriptor createdOn of <class 'osaf.pim.items.Co...
  excludedBy = <Descriptor excludedBy of <class 'osaf.pim.items....
  appearsIn = <Descriptor appearsIn of <class 'osaf.pim.items.Co...
  displayDate = <Descriptor displayDate of <class 'osaf.pim.item...
  displayDateSource = <Descriptor displayDateSource of <class 'o...
  displayWho = <Descriptor displayWho of <class 'osaf.pim.items....
  displayWhoSource = <Descriptor displayWhoSource of <class 'osa...
  __after_change__ = {'onCreatedOrLastModifiedChanged': [<Descri...
  __all_ivs__ = [('createdOn', <function <lambda> at 0xa9b5c64c>...
  __iv_functions__ = {'createdOn': <function <lambda> at 0xa9b5c...
  __kind_clouds__ = {'copying': <application.schema.Cloud instan...

Inherited from triage.Triageable: doAutoTriageOnDateChange

Inherited from reminders.Remindable: reminders

Inherited from application.schema.Item: __default_path__, __setup__

Inherited from chandlerdb.item.c.CItem: ADIRTY, CDIRTY, CONTAINER, CORESCHEMA, DEFERRED, DEFERRING, DELETED, DELETING, DIRTY, FDIRTY, IDXMONITOR, KDIRTY, MERGED, MUTATING, NDIRTY, NEW, NODIRTY, PINNED, P_WATCHED, RAW, RDIRTY, SAVEMASK, SCHEMA, STALE, SYSMONITOR, SYSMONONLY, TOINDEX, T_WATCHED, VDIRTY, VRDIRTY, WATCHED, WITHSCHEMA

Instance Variables [hide private]
  lastModifiedBy = <Descriptor lastModifiedBy of <class 'osaf.pi...
ACCESSORS
Properties [hide private]
  byline
  osaf.communicationstatus.CommunicationStatus.status

Inherited from triage.Triageable: sectionTriageStatus, triageStatus, triageStatusChanged

Inherited from reminders.Remindable: userReminderTime

Inherited from chandlerdb.item.c.CItem: c, itsKind, itsName, itsParent, itsPath, itsRef, itsRefs, itsRoot, itsStatus, itsUUID, itsValues, itsVersion, itsView

Inherited from object: __class__

Method Details [hide private]

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

InitOutgoingAttributes(self)

source code 
Init any attributes on ourself that are appropriate for a new outgoing item.
Overrides: reminders.Remindable.InitOutgoingAttributes

onItemDelete(self, view, deferring)

source code 
Overrides: reminders.Remindable.onItemDelete

addToCollection(self, collection)

source code 

Add self to the given collection.

For most items, just call collection.add(self), but for recurring events, this method is intercepted by a proxy and buffered while the user selects from various possible meanings for adding a recurring event to a collection.

removeFromCollection(self, collection)

source code 

Remove self from the given collection.

For most items, just call collection.remove(self), but for recurring events, this method is intercepted by a proxy and buffered while the user selects from various possible meanings for removing a recurring event from a collection.

The special mine collection behavior that removed items should remain in the Dashboard is implemented here.

_prepareToRemoveFromCollection(self, collection)

source code 

If the collection is a mine collection and the item doesn't exist in any other 'mine' collections, manually add it to 'all' to keep the item 'mine'.

We don't want to do this blindly though, or all's inclusions will get unnecessarily full.

We also don't want to remove collection from mine.sources. That will cause a notification storm as items temporarily leave and re-enter being 'mine'.

getMembershipItem(self)

source code 

Get the item that should be used to test for membership tests i.e. if item in collection: should be if item.getMembershipItem() in collection

For most items, this is just itself, but for recurring events, this method is intercepted by a proxy.

changeEditState(self, modType=Modification.edited, who=<Locale: en_US>, when=<Locale: en_US>)

source code 
Parameters:
  • modType (Modification) - What kind of modification you are making. Used to set the value of self.lastModification.
  • who (EmailAddress) - May be None, which is interpreted as an anonymous user (e.g. a "drive-by" sharing user). Used to set the value of {self.lastModifiedBy}.
  • when (datetime) - The date&time of this change. Used to set the value of self.lastModified. The default, None, sets the

getEmailAddress(self, nameOrAddressString)

source code 

  Lookup or create an EmailAddress based
on the supplied string.
This method is here for convenient access, so users
don't need to import Mail.

getCurrentMeEmailAddress(self)

source code 
Lookup or create a current "me" EmailAddress. This method is here for convenient access, so users don't need to import Mail.

addDisplayDates(self, dates, now)

source code 
Subclasses will override this to add relevant dates to this list; each should be a tuple, (priority, dateTimeValue, 'attributeName').
Overrides: reminders.Remindable.addDisplayDates
(inherited documentation)

onCreatedOrLastModifiedChanged(self, op, attr)

source code 
Decorators:
  • @schema.observer(modifiedFlags, lastModified, createdOn)

onModificationChange(self, op, name)

source code 
Decorators:
  • @schema.observer(modifiedFlags, lastModification, lastModifiedBy, read)

onErrorChanged(self, op, attr)

source code 
Decorators:
  • @schema.observer(error)

Class Variable Details [hide private]

displayName

Value:
<Descriptor displayName of <class 'osaf.pim.items.ContentItem'>>

creator

Value:
<Descriptor creator of <class 'osaf.pim.items.ContentItem'>>

modifiedFlags

Value:
<Descriptor modifiedFlags of <class 'osaf.pim.items.ContentItem'>>

lastModified

Value:
<Descriptor lastModified of <class 'osaf.pim.items.ContentItem'>>

lastModification

Value:
<Descriptor lastModification of <class 'osaf.pim.items.ContentItem'>>

BYLINE_FORMATS

Value:
{Modification.edited: (u'Edited by %(user)s on %(date)s %(tz)s',
                       u'Edited on %(date)s %(tz)s'),
 Modification.queued: (u'Queued by %(user)s on %(date)s %(tz)s',
                       u'Queued on %(date)s %(tz)s'),
 Modification.sent: (u'Sent by %(user)s on %(date)s %(tz)s',
                     u'Sent on %(date)s %(tz)s'),
 Modification.updated: (u'Updated by %(user)s on %(date)s %(tz)s',
                        u'Updated on %(date)s %(tz)s'),
...

error

Value:
<Descriptor error of <class 'osaf.pim.items.ContentItem'>>

importance

Value:
<Descriptor importance of <class 'osaf.pim.items.ContentItem'>>

private

Value:
<Descriptor private of <class 'osaf.pim.items.ContentItem'>>

needsReply

Value:
<Descriptor needsReply of <class 'osaf.pim.items.ContentItem'>>

createdOn

Value:
<Descriptor createdOn of <class 'osaf.pim.items.ContentItem'>>

excludedBy

Value:
<Descriptor excludedBy of <class 'osaf.pim.items.ContentItem'>>

appearsIn

Value:
<Descriptor appearsIn of <class 'osaf.pim.items.ContentItem'>>

displayDate

Value:
<Descriptor displayDate of <class 'osaf.pim.items.ContentItem'>>

displayDateSource

Value:
<Descriptor displayDateSource of <class 'osaf.pim.items.ContentItem'>>

displayWho

Value:
<Descriptor displayWho of <class 'osaf.pim.items.ContentItem'>>

displayWhoSource

Value:
<Descriptor displayWhoSource of <class 'osaf.pim.items.ContentItem'>>

__after_change__

Value:
{'onCreatedOrLastModifiedChanged': [<Descriptor modifiedFlags of <clas\
s 'osaf.pim.items.ContentItem'>>,
                                    <Descriptor lastModified of <class\
 'osaf.pim.items.ContentItem'>>,
                                    <Descriptor createdOn of <class 'o\
saf.pim.items.ContentItem'>>],
 'onErrorChanged': [<Descriptor error of <class 'osaf.pim.items.Conten\
tItem'>>],
...

__all_ivs__

Value:
[('createdOn', <function <lambda> at 0xa9b5c64c>),
 ('_triageStatusChanged', <function <lambda> at 0xa9b5c25c>)]

__iv_functions__

Value:
{'createdOn': <function <lambda> at 0xa9b5c64c>}

__kind_clouds__

Value:
{'copying': <application.schema.Cloud instance at 0xa9b6572c>,
 'sharing': <application.schema.Cloud instance at 0xa9b6574c>}

Instance Variable Details [hide private]

lastModifiedBy

ACCESSORS

Accessors for Content Item attributes
Value:
<Descriptor lastModifiedBy of <class 'osaf.pim.items.ContentItem'>>

Property Details [hide private]

byline

Get Method:
osaf.pim.items.ContentItem.getByline(self)
Set Method:
<Locale: en_US>
Delete Method:
<Locale: en_US>

osaf.communicationstatus.CommunicationStatus.status

Get Method:
unreachable.newFn(item, *args)
Set Method:
<Locale: en_US>
Delete Method:
<Locale: en_US>