[Commits] (morgen) Getting ready to hook up to webdav publishing.
The "Share collection" menu
commits at osafoundation.org
commits at osafoundation.org
Mon Aug 23 12:32:40 PDT 2004
Commit by: morgen
Modified files:
chandler/parcels/osaf/framework/sharing/Sharing.py 1.1 1.2
chandler/parcels/osaf/views/main/Main.py 1.39 1.40
Log message:
Getting ready to hook up to webdav publishing. The "Share collection" menu
item now prompts for a list of invitees. I need to coordinate this with
Stuart and Brian.
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/Sharing.py.diff?r1=text&tr1=1.1&r2=text&tr2=1.2
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/Main.py.diff?r1=text&tr1=1.39&r2=text&tr2=1.40
Index: chandler/parcels/osaf/framework/sharing/Sharing.py
diff -u chandler/parcels/osaf/framework/sharing/Sharing.py:1.1 chandler/parcels/osaf/framework/sharing/Sharing.py:1.2
--- chandler/parcels/osaf/framework/sharing/Sharing.py:1.1 Mon Aug 23 11:58:39 2004
+++ chandler/parcels/osaf/framework/sharing/Sharing.py Mon Aug 23 12:32:38 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.1 $"
-__date__ = "$Date: 2004/08/23 18:58:39 $"
+__version__ = "$Revision: 1.2 $"
+__date__ = "$Date: 2004/08/23 19:32:38 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -38,6 +38,17 @@
event.Post({'collection':collection})
Globals.repository.commit()
+def publishWebDavCollection(collection):
+ """ Given a collection, tell the webdav subsystem to publish it, and
+ return the url for it. """
+ return ""
+
+def sendInvites(addresses, url):
+ """ Tell the email subsystem to send a sharing invite to the given
+ addresses. """
+ for address in addresses:
+ print address
+
def announceSharingUrl(url):
""" Call this method to announce that an inbound sharing invitation has
arrived. """
@@ -49,8 +60,19 @@
""" Display a dialog box prompting the user for a webdav url to
subscribe to. """
- url = application.dialogs.Util.promptUser( \
+ url = application.dialogs.Util.promptUser( \
Globals.wxApplication.mainFrame, "Subscribe to Collection...",
"Collection URL:", "http://code-bear.com/dav/test_item_collection")
if url is not None:
subscribeToWebDavCollection(url)
+
+def manualPublishCollection(collection):
+ print 'Share collection "%s"' % collection.displayName
+ addresses = application.dialogs.Util.promptUser( \
+ Globals.wxApplication.mainFrame, "Publish Collection...",
+ "Email address to send invites: (comma separated)", "")
+ url = publishWebDavCollection(collection)
+ if addresses is not None:
+ addresses = addresses.split(",")
+ sendInvites(addresses, url)
+
Index: chandler/parcels/osaf/views/main/Main.py
diff -u chandler/parcels/osaf/views/main/Main.py:1.39 chandler/parcels/osaf/views/main/Main.py:1.40
--- chandler/parcels/osaf/views/main/Main.py:1.39 Mon Aug 23 11:59:08 2004
+++ chandler/parcels/osaf/views/main/Main.py Mon Aug 23 12:32:39 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.39 $"
-__date__ = "$Date: 2004/08/23 18:59:08 $"
+__version__ = "$Revision: 1.40 $"
+__date__ = "$Date: 2004/08/23 19:32:39 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -215,13 +215,10 @@
return selectionContents
def onShareCollectionEvent (self, notification):
- """
- Stub for Lisa - Share the collection selected
- in the sidebar.
- """
+ # Triggered from "Test | Share collection..."
collection = self.getSidebarSelectedCollection ()
- if collection:
- print 'Share collection "%s"' % collection.displayName
+ if collection is not None:
+ osaf.framework.sharing.Sharing.manualPublishCollection(collection)
def onShareCollectionEventUpdateUI (self, notification):
"""
More information about the Commits
mailing list