[Commits] (morgen) Since we now can specify empty lists for initialValues in parcel.xml, the

commits at osafoundation.org commits at osafoundation.org
Fri Aug 20 09:44:55 PDT 2004


Commit by: morgen
Modified files:
chandler/parcels/osaf/contentmodel/parcel.xml 1.54 1.55
chandler/parcels/osaf/framework/blocks/Block.py 1.61 1.62
chandler/parcels/osaf/framework/blocks/parcel.xml 1.107 1.108
chandler/parcels/osaf/views/main/Main.py 1.36 1.37

Log message:
Since we now can specify empty lists for initialValues in parcel.xml, the
two attribute initializations in Block __init__() are no longer needed.
Also, the "Subscribe to collection" dialog now calls the webdav code and
adds a new view to the sidebar although that view is broken (so don't try
it unless you are helping to debug it).


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/parcel.xml.diff?r1=text&tr1=1.54&r2=text&tr2=1.55
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/Block.py.diff?r1=text&tr1=1.61&r2=text&tr2=1.62
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/parcel.xml.diff?r1=text&tr1=1.107&r2=text&tr2=1.108
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/Main.py.diff?r1=text&tr1=1.36&r2=text&tr2=1.37

Index: chandler/parcels/osaf/framework/blocks/Block.py
diff -u chandler/parcels/osaf/framework/blocks/Block.py:1.61 chandler/parcels/osaf/framework/blocks/Block.py:1.62
--- chandler/parcels/osaf/framework/blocks/Block.py:1.61	Sat Aug 14 17:03:06 2004
+++ chandler/parcels/osaf/framework/blocks/Block.py	Fri Aug 20 09:44:52 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.61 $"
-__date__ = "$Date: 2004/08/15 00:03:06 $"
+__version__ = "$Revision: 1.62 $"
+__date__ = "$Date: 2004/08/20 16:44:52 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -14,14 +14,6 @@
 class Block(Item):
     def __init__(self, *arguments, **keywords):
         super (Block, self).__init__ (*arguments, **keywords)
-        """
-          We currently have to initialize this data here because of
-        limitations of our repository/XML parcel. We should fix
-        these limitations so we can initialize them in the parcel
-        XML -- DJA
-        """
-        self.childrenBlocks = []
-        self.styles = []
 
     def Post (self, event, args):
         """
@@ -208,14 +200,25 @@
     def onModifyContentsEvent(self, notification):
         event = notification.event
         operation = event.operation
+
+        # 'collection' is an item collection that we want our new view
+        # to contain
+        collection = notification.data.get('collection', None)
+
+        # we'll put the copies in //userdata
+        userdata = Globals.repository.findPath('//userdata')
+
         for item in event.items:
             if event.copyItems:
-                item = item.copy (None, #NewName
-                                  Globals.repository.findPath('//userdata')) #parent
+                item = item.copy(parent=userdata, cloudAlias='default')
+                if collection is not None:
+                    print "I am setting collection to", collection
+                    collection.displayName = "XYZZY"
+                    item.contents = collection
                 """
                   Hack to work around Stuarts bug #1568 -- DJA
                 """
-                item.contents._ItemCollection__refresh()               
+                item.contents._ItemCollection__refresh()
             if operation == 'toggle':
                 try:
                     index = self.contents.index (item)

Index: chandler/parcels/osaf/contentmodel/parcel.xml
diff -u chandler/parcels/osaf/contentmodel/parcel.xml:1.54 chandler/parcels/osaf/contentmodel/parcel.xml:1.55
--- chandler/parcels/osaf/contentmodel/parcel.xml:1.54	Thu Aug 19 13:45:47 2004
+++ chandler/parcels/osaf/contentmodel/parcel.xml	Fri Aug 20 09:44:51 2004
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
 <!-- Parcel manifest for Pim Schema -->
-<!-- $Revision: 1.54 $ -->
-<!-- $Date: 2004/08/19 20:45:47 $ -->
+<!-- $Revision: 1.55 $ -->
+<!-- $Date: 2004/08/20 16:44:51 $ -->
 <!-- Copyright (c) 2003-2004 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -422,7 +422,7 @@
   </core:Attribute>
 
   <core:Kind itsName="ItemCollection">
-    <core:superKinds itemref="core:Item"/>
+    <core:superKinds itemref="ContentItem"/>
     <core:displayName>Item Collection</core:displayName>
     <core:attributes itemref="collectionOwner"/>
 

Index: chandler/parcels/osaf/views/main/Main.py
diff -u chandler/parcels/osaf/views/main/Main.py:1.36 chandler/parcels/osaf/views/main/Main.py:1.37
--- chandler/parcels/osaf/views/main/Main.py:1.36	Thu Aug 19 14:16:35 2004
+++ chandler/parcels/osaf/views/main/Main.py	Fri Aug 20 09:44:53 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.36 $"
-__date__ = "$Date: 2004/08/19 21:16:35 $"
+__version__ = "$Revision: 1.37 $"
+__date__ = "$Date: 2004/08/20 16:44:53 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -20,6 +20,8 @@
 import repository.util.UUID as UUID
 import osaf.framework.webdav.Dav
 
+EVENTS = "http://osafoundation.org/parcels/osaf/framework/blocks/Events"
+
 class MainView(View):
     """
       Main Chandler view contains event handlers for Chandler
@@ -59,7 +61,10 @@
          Globals.wxApplication.mainFrame, "Subscribe to Collection...",
          "Collection URL:", "http://webdav.osafoundation.org/")
         if url is not None:
-            item = osaf.framework.webdav.Dav.DAV(url).get( )
+            collection = osaf.framework.webdav.Dav.DAV(url).get( )
+            event = Globals.parcelManager.lookup(EVENTS,
+             "NewItemCollectionItem")
+            event.Post({'collection':collection})
             Globals.repository.commit()
 
     def onEditAccountPreferencesEvent (self, notification):

Index: chandler/parcels/osaf/framework/blocks/parcel.xml
diff -u chandler/parcels/osaf/framework/blocks/parcel.xml:1.107 chandler/parcels/osaf/framework/blocks/parcel.xml:1.108
--- chandler/parcels/osaf/framework/blocks/parcel.xml:1.107	Sat Aug 14 17:03:06 2004
+++ chandler/parcels/osaf/framework/blocks/parcel.xml	Fri Aug 20 09:44:52 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.107 $ -->
-<!-- $Date: 2004/08/15 00:03:06 $ -->
+<!-- $Revision: 1.108 $ -->
+<!-- $Date: 2004/08/20 16:44:52 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -311,12 +311,14 @@
       <copyPolicy value="cascade"/>
       <inverseAttribute itemref="docSchema:Block/parentBlock"/>
       <required>True</required>
+      <initialValue />
     </Attribute>
 
     <Attribute itsName="styles">
       <type itemref="docSchema:Style"/>
       <cardinality>list</cardinality>
       <inverseAttribute itemref="docSchema:Style/usedInBlocks"/>
+      <initialValue />
     </Attribute>
 
     <Attribute itsName="isShown">



More information about the Commits mailing list