[Commits] (lisa) This checkin makes Note the super-Kind of event, task and email, closer to what we intend the user's model to be. It also moves Note to the main content model package, thus making the notes package unneeded.

commits at osafoundation.org commits at osafoundation.org
Tue Jul 6 14:27:36 PDT 2004


Commit by: lisa
Modified files:
chandler/parcels/osaf/contentmodel/ContentModel.py 1.16 1.17
chandler/parcels/osaf/contentmodel/parcel.xml 1.36 1.37
chandler/parcels/osaf/contentmodel/calendar/parcel.xml 1.28 1.29
chandler/parcels/osaf/contentmodel/mail/parcel.xml 1.28 1.29
chandler/parcels/osaf/contentmodel/notes/__init__.py 1.1 None
chandler/parcels/osaf/contentmodel/notes/parcel.xml 1.13 None
chandler/parcels/osaf/contentmodel/tasks/parcel.xml 1.18 1.19
chandler/parcels/osaf/contentmodel/tests/GenerateItems.py 1.12 1.13
chandler/parcels/osaf/contentmodel/tests/TestNotes.py 1.11 1.12

Log message:
This checkin makes Note the super-Kind of event, task and email, closer to what we intend the user's model to be.  It also moves Note to the main content model package, thus making the notes package unneeded.

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/ContentModel.py.diff?r1=text&tr1=1.16&r2=text&tr2=1.17
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/parcel.xml.diff?r1=text&tr1=1.36&r2=text&tr2=1.37
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/calendar/parcel.xml.diff?r1=text&tr1=1.28&r2=text&tr2=1.29
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/mail/parcel.xml.diff?r1=text&tr1=1.28&r2=text&tr2=1.29
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/notes/__init__.py.diff?r1=text&tr1=1.1&r2=text&tr2=None
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/notes/parcel.xml.diff?r1=text&tr1=1.13&r2=text&tr2=None
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/tasks/parcel.xml.diff?r1=text&tr1=1.18&r2=text&tr2=1.19
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/tests/GenerateItems.py.diff?r1=text&tr1=1.12&r2=text&tr2=1.13
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/tests/TestNotes.py.diff?r1=text&tr1=1.11&r2=text&tr2=1.12

Index: chandler/parcels/osaf/contentmodel/tests/TestNotes.py
diff -u chandler/parcels/osaf/contentmodel/tests/TestNotes.py:1.11 chandler/parcels/osaf/contentmodel/tests/TestNotes.py:1.12
--- chandler/parcels/osaf/contentmodel/tests/TestNotes.py:1.11	Thu Jun 24 17:23:56 2004
+++ chandler/parcels/osaf/contentmodel/tests/TestNotes.py	Tue Jul  6 14:27:34 2004
@@ -2,15 +2,16 @@
 Unit tests for notes parcel
 """
 
-__revision__  = "$Revision: 1.11 $"
-__date__      = "$Date: 2004/06/25 00:23:56 $"
+__revision__  = "$Revision: 1.12 $"
+__date__      = "$Date: 2004/07/06 21:27:34 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
 import unittest, os
 
 import osaf.contentmodel.tests.TestContentModel as TestContentModel
-import osaf.contentmodel.notes.Notes as Notes
+import osaf.contentmodel.Notes as Notes
+import osaf.contentmodel.ContentModel as ContentModel
 
 import mx.DateTime as DateTime
 
@@ -23,7 +24,7 @@
     def testNotes(self):
         """ Simple test for creating instances of note related kinds """
 
-        self.loadParcel("http://osafoundation.org/parcels/osaf/contentmodel/notes")
+        self.loadParcel("http://osafoundation.org/parcels/osaf/contentmodel")
 
         def _verifyNote(note):
             self.assertEqual(note.displayName, "sample note")
@@ -34,11 +35,11 @@
             reader.close()
 
         # Test the globals
-        notesPath = Path('//parcels/osaf/contentmodel/notes')
+        notesPath = Path('//parcels/osaf/contentmodel')
 
-        self.assertEqual(Notes.NotesParcel.getNoteKind(),
+        self.assertEqual(ContentModel.ContentModel.getNoteKind(),
                          self.rep.find(Path(notesPath, 'Note')))
-        self.assertEqual(Notes.NotesParcel.getConversationKind(),
+        self.assertEqual(ContentModel.ContentModel.getConversationKind(),
                          self.rep.find(Path(notesPath, 'Conversation')))
 
         # Construct sample items
@@ -46,9 +47,9 @@
         conversationItem = Notes.Conversation("conversationItem")
 
         # Double check kinds
-        self.assertEqual(noteItem.itsKind, Notes.NotesParcel.getNoteKind())
+        self.assertEqual(noteItem.itsKind, ContentModel.ContentModel.getNoteKind())
         self.assertEqual(conversationItem.itsKind,
-                         Notes.NotesParcel.getConversationKind())
+                         ContentModel.ContentModel.getConversationKind())
 
         # Literal properties
         noteItem.displayName = "sample note"

Index: chandler/parcels/osaf/contentmodel/ContentModel.py
diff -u chandler/parcels/osaf/contentmodel/ContentModel.py:1.16 chandler/parcels/osaf/contentmodel/ContentModel.py:1.17
--- chandler/parcels/osaf/contentmodel/ContentModel.py:1.16	Fri Jul  2 18:10:47 2004
+++ chandler/parcels/osaf/contentmodel/ContentModel.py	Tue Jul  6 14:27:32 2004
@@ -1,8 +1,8 @@
 """ Classes used for contentmodel parcel and kinds.
 """
 
-__revision__  = "$Revision: 1.16 $"
-__date__      = "$Date: 2004/07/03 01:10:47 $"
+__revision__  = "$Revision: 1.17 $"
+__date__      = "$Date: 2004/07/06 21:27:32 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -17,6 +17,8 @@
     contentItemKindID = None
     projectKindID = None
     groupKindID = None
+    noteKindID = None
+    conversationKindID = None
 
     # The parcel knows the UUID for the parent, once the parcel is loaded
     contentItemParentID = None
@@ -27,6 +29,8 @@
         ContentModel.contentItemKindID = self['ContentItem'].itsUUID
         ContentModel.projectKindID = self['Project'].itsUUID
         ContentModel.groupKindID = self['Group'].itsUUID
+        ContentModel.noteKindID = self['Note'].itsUUID
+        ContentModel.conversationKindID = self['Conversation'].itsUUID
 
     def onItemLoad(self):
         super(ContentModel, self).onItemLoad()
@@ -69,6 +73,18 @@
         return Globals.repository[cls.groupKindID]
 
     getGroupKind = classmethod(getGroupKind)
+    
+    def getNoteKind(cls):
+        assert cls.noteKindID, "ContentModel parcel not yet loaded"
+        return Globals.repository[cls.noteKindID]
+    
+    getNoteKind = classmethod(getNoteKind)
+    
+    def getConversationKind(cls):
+        assert cls.conversationKindID, "ContentModel parcel not yet loaded"
+        return Globals.repository[cls.conversationKindID]
+    
+    getConversationKind = classmethod(getConversationKind)
 
 class ContentItem(Item.Item):
     def __init__(self, name=None, parent=None, kind=None):

Index: chandler/parcels/osaf/contentmodel/mail/parcel.xml
diff -u chandler/parcels/osaf/contentmodel/mail/parcel.xml:1.28 chandler/parcels/osaf/contentmodel/mail/parcel.xml:1.29
--- chandler/parcels/osaf/contentmodel/mail/parcel.xml:1.28	Fri Jul  2 18:10:47 2004
+++ chandler/parcels/osaf/contentmodel/mail/parcel.xml	Tue Jul  6 14:27:33 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.28 $ -->
-<!-- $Date: 2004/07/03 01:10:47 $ -->
+<!-- $Revision: 1.29 $ -->
+<!-- $Date: 2004/07/06 21:27:33 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -383,7 +383,7 @@
     <description>A Mail Message represents any sort of email message, sent or received.</description>
     <issues>We need another attribute. A boolean attribute to indicate whether this message was an incoming message or outgoing message. (I suspect that we won't want to derive whether something was in or out.  If we base it on headers, the headers could potentially be forged. -Ducky)</issues>
     <issues>We probably don't want to have both 'hasBeenRead' and 'status'.</issues>
-    <superKinds itemref="content:ContentItem"/>
+    <superKinds itemref="content:Note"/>
     <displayAttribute itemref="mail:subject"/>
     <attributes itemref="mail:subject"/>
     <attributes itemref="mail:sentTo"/>

Index: chandler/parcels/osaf/contentmodel/tests/GenerateItems.py
diff -u chandler/parcels/osaf/contentmodel/tests/GenerateItems.py:1.12 chandler/parcels/osaf/contentmodel/tests/GenerateItems.py:1.13
--- chandler/parcels/osaf/contentmodel/tests/GenerateItems.py:1.12	Thu Jul  1 00:34:11 2004
+++ chandler/parcels/osaf/contentmodel/tests/GenerateItems.py	Tue Jul  6 14:27:34 2004
@@ -2,8 +2,8 @@
 Generate sample items: calendar, contacts, etc.
 """
 
-__revision__  = "$Revision: 1.12 $"
-__date__      = "$Date: 2004/07/01 07:34:11 $"
+__revision__  = "$Revision: 1.13 $"
+__date__      = "$Date: 2004/07/06 21:27:34 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -14,7 +14,7 @@
 import osaf.contentmodel.calendar.Calendar as Calendar
 import osaf.contentmodel.contacts.Contacts as Contacts
 import osaf.contentmodel.mail.Mail as Mail
-import osaf.contentmodel.notes.Notes as Notes
+import osaf.contentmodel.Notes as Notes
 
 HEADLINES = ["Dinner", "Lunch", "Meeting", "Movie", "Games"]
 

Index: chandler/parcels/osaf/contentmodel/calendar/parcel.xml
diff -u chandler/parcels/osaf/contentmodel/calendar/parcel.xml:1.28 chandler/parcels/osaf/contentmodel/calendar/parcel.xml:1.29
--- chandler/parcels/osaf/contentmodel/calendar/parcel.xml:1.28	Tue Jun 29 13:02:23 2004
+++ chandler/parcels/osaf/contentmodel/calendar/parcel.xml	Tue Jul  6 14:27:32 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.28 $ -->
-<!-- $Date: 2004/06/29 20:02:23 $ -->
+<!-- $Revision: 1.29 $ -->
+<!-- $Date: 2004/07/06 21:27:32 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -68,7 +68,9 @@
   <!-- Calendar Event Attributes -->
   <Enumeration itsName="TimeTransparencyEnum">
     <displayName>Time Transparency</displayName>
-    <issues>The iCalendar values for Time Transparency are slightly different. We should consider making our values match the iCalendar ones, or be a superset of them.  Mitch suggested that a 'cancelled' value would be a useful extension.</issues>
+    <issues>The iCalendar values for Time Transparency are slightly different. We should 
+        consider making our values match the iCalendar ones, or be a superset of them.  
+        Mitch suggested that a 'cancelled' value would be a useful extension.</issues>
     <values>busy</values>
     <values>free</values>
     <values>tentative</values>
@@ -133,7 +135,7 @@
     <issues>Calendar Event should maybe have a 'Timezone' attribute.</issues>
     <issues>Do we want to have 'Duration' as a derived attribute on Calendar Event? </issues>
     <issues>Do we want to have a Boolean 'AllDay' attribute, to indicate that an event is an all day event? Or should we instead have the 'startTime' and 'endTime' attributes be 'RelativeDateTime' instead of 'DateTime', so that they can store all day values like '14 June 2004' as well as specific time values like '4:05pm 14 June 2004'?</issues>
-    <superKinds itemref="content:ContentItem"/>
+    <superKinds itemref="content:Note"/>
 
     <attributes itemref="cal:startTime"/>
     <attributes itemref="cal:location"/>

Index: chandler/parcels/osaf/contentmodel/tasks/parcel.xml
diff -u chandler/parcels/osaf/contentmodel/tasks/parcel.xml:1.18 chandler/parcels/osaf/contentmodel/tasks/parcel.xml:1.19
--- chandler/parcels/osaf/contentmodel/tasks/parcel.xml:1.18	Fri Jul  2 18:10:48 2004
+++ chandler/parcels/osaf/contentmodel/tasks/parcel.xml	Tue Jul  6 14:27:34 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.18 $ -->
-<!-- $Date: 2004/07/03 01:10:48 $ -->
+<!-- $Revision: 1.19 $ -->
+<!-- $Date: 2004/07/06 21:27:34 $ -->
 <!-- Copyright (c) 2004 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -104,7 +104,7 @@
     <displayName>Task</displayName>
     <issues>Do we want to support the idea of tasks having sub-tasks? If so, then we need to add attributes for 'superTask' and 'subTasks'.</issues>
     <issues>Task should maybe have a 'Timezone' attribute.</issues>
-    <superKinds itemref="content:ContentItem"/>
+    <superKinds itemref="content:Note"/>
 
     <attributes itemref="cal:recurrence"/>
     <attributes itemref="cal:reminders"/>

Index: chandler/parcels/osaf/contentmodel/parcel.xml
diff -u chandler/parcels/osaf/contentmodel/parcel.xml:1.36 chandler/parcels/osaf/contentmodel/parcel.xml:1.37
--- chandler/parcels/osaf/contentmodel/parcel.xml:1.36	Fri Jul  2 18:10:47 2004
+++ chandler/parcels/osaf/contentmodel/parcel.xml	Tue Jul  6 14:27:32 2004
@@ -1,15 +1,14 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
 <!-- Parcel manifest for Pim Schema -->
-<!-- $Revision: 1.36 $ -->
-<!-- $Date: 2004/07/03 01:10:47 $ -->
+<!-- $Revision: 1.37 $ -->
+<!-- $Date: 2004/07/06 21:27:32 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
 <core:Parcel describes="//parcels/osaf/contentmodel"
              itsName="contentmodel"
              xmlns:core="http://osafoundation.org/parcels/core"
-             xmlns:notes="http://osafoundation.org/parcels/osaf/contentmodel/notes"
              xmlns:contact="http://osafoundation.org/parcels/osaf/contentmodel/contacts"
              xmlns:blocks="http://osafoundation.org/parcels/osaf/framework/blocks"
              xmlns:events="http://osafoundation.org/parcels/osaf/framework/notifications/schema"
@@ -75,13 +74,88 @@
     <core:attributes itemref="contact:creator"/>
     <core:attributes itemref="core:Parcel/createdOn"/>
     <core:attributes itemref="core:Parcel/modifiedOn"/>
-    <core:attributes itemref="notes:attachedNotes"/>
-    <core:attributes itemref="notes:conversations"/>
+    <core:attributes itemref="conversations"/>
 
     <core:classes key="python">osaf.contentmodel.ContentModel.ContentItem</core:classes>
   </core:Kind>
 
+  <!-- Note -->
+
+  <core:Kind itsName="Note">
+    <core:displayName>Note</core:displayName>
+    <core:superKinds itemref="ContentItem"/>
+    <core:classes key="python">osaf.contentmodel.Notes.Note</core:classes>
+  </core:Kind>
+  
+  <!-- Conversation -->
+
+  <core:Attribute itsName="conversations">
+    <core:displayName>Conversations</core:displayName>
+    <core:description>Conversations about this content item.</core:description>
+    <core:issues>deletePolicy should be cascade</core:issues>
+    <core:cardinality>list</core:cardinality>
+    <core:type itemref="Conversation"/>
+    <core:inverseAttribute itemref="subjectItem"/>
+  </core:Attribute>
+
+  <core:Attribute itsName="subjectItem">
+    <core:displayName>Subject Item</core:displayName>
+    <core:description>If this Conversation is a free-standing independent item, 
+        then this attribute will be empty. If this Conversation is contained in 
+        some other item, then this attribute will point to that item.</core:description>
+    <core:required>False</core:required>
+    <core:type itemref="ContentItem"/>
+    <core:inverseAttribute itemref="conversations"/>
+  </core:Attribute>
+
+  <core:Attribute itsName="conversationLines">
+    <core:displayName>Conversation Lines</core:displayName>
+    <core:description>The list of lines of dialog in this conversation.</core:description>
+    <core:issues>deletePolicy should be cascade</core:issues>
+    <core:cardinality>list</core:cardinality>
+    <core:type itemref="ConversationLine"/>
+    <core:inverseAttribute itemref="containedInConversation"/>
+  </core:Attribute>
+
+  <core:Kind itsName="Conversation">
+    <core:displayName>Conversation</core:displayName>
+    <core:superKinds itemref="ContentItem"/>
+    <core:attributes itemref="subjectItem"/>
+    <core:attributes itemref="conversationLines"/>
+    <core:classes key="python">osaf.contentmodel.Notes.Conversation</core:classes>
+  </core:Kind>
+  
+  <core:Attribute itsName="line">
+    <core:displayName>Line</core:displayName>
+    <core:description>A line of text in a conversation, such as "okay, let's meet at 5:00".</core:description>
+    <core:type itemref="core:String"/>
+  </core:Attribute>
+
+  <core:Attribute itsName="timestamp">
+    <core:displayName>Timestamp</core:displayName>
+    <core:type itemref="core:DateTime"/>
+  </core:Attribute>
+
+  <core:Attribute itsName="containedInConversation">
+    <core:displayName>Contained in Conversation</core:displayName>
+    <core:description>The Conversation that this line is a part of.</core:description>
+    <core:required>True</core:required>
+    <core:type itemref="Conversation"/>
+    <core:inverseAttribute itemref="conversationLines"/>
+  </core:Attribute>
+
+  <core:Kind itsName="ConversationLine">
+    <core:superKinds itemref="core:Item"/>
+    <core:displayName>Conversation Line</core:displayName>
+    <core:issues>Perhaps for performance reasons we should implement 'ConversationLine' 
+        as a struct rather than a first-class Kind.</core:issues>
+    <core:attributes itemref="line"/>
+    <core:attributes itemref="timestamp"/>
+    <core:attributes itemref="containedInConversation"/>
+  </core:Kind>
+  
 <!-- Project -->
+
   <core:Attribute itsName="parentProject">
     <core:displayName>Parent Project</core:displayName>
     <core:description>Projects can be organized into hierarchies. Each project can have one parent.</core:description>



More information about the Commits mailing list