def sharedWebDAVCollections (self): # return the list of all the shared collections # @@@DLD - use new query, once it can handle method calls, or when our item.isShared # attribute is correctly set. UseNewQuery = False if UseNewQuery: qString = u"for i in '//parcels/osaf/pim/ItemCollection' where len (i.sharedURL) > 0" collQuery = Query.Query (self.itsView.repository, qString) collQuery.recursive = False collections = list(collQuery) else: collections = [ coll for coll in ItemCollection.iterItems(self.itsView) if Sharing.isShared(coll) ] return collections
def onShareSidebarCollectionEventUpdateUI(self, event): """ Update the menu to reflect the selected collection name """ collection = self.getSidebarSelectedCollection() if collection is not None: sidebar = Block.findBlockByName("Sidebar") if sidebar.filterKind is None: filterKindPath = [] else: filterKindPath = [str(sidebar.filterKind.itsPath)] collName = Sharing.getFilteredCollectionDisplayName(collection, filterKindPath) menuTitle = _('Share "%s"...') % collName else: menuTitle = _("Share a collection...") event.arguments["Text"] = menuTitle event.arguments["Enable"] = collection is not None and (not Sharing.isShared(collection))
def onShareSidebarCollectionEventUpdateUI (self, event): """ Update the menu to reflect the selected collection name """ collection = self.getSidebarSelectedCollection () if collection is not None: sidebar = Block.findBlockByName("Sidebar") if sidebar.filterKind is None: filterKindPath = [] else: filterKindPath = [str(sidebar.filterKind.itsPath)] collName = Sharing.getFilteredCollectionDisplayName(collection, filterKindPath) menuTitle = _('Share "%s"...') % collName else: menuTitle = _('Share a collection...') event.arguments ['Text'] = menuTitle event.arguments['Enable'] = collection is not None and (not Sharing.isShared(collection))
def onSyncCollectionEventUpdateUI(self, event): """ Update the menu to reflect the selected collection name """ collection = self.getSidebarSelectedCollection() if collection is not None: sidebar = Block.findBlockByName("Sidebar") if sidebar.filterKind is None: filterKindPath = [] else: filterKindPath = [str(sidebar.filterKind.itsPath)] collName = Sharing.getFilteredCollectionDisplayName(collection, filterKindPath) menuTitle = _('Sync "%s"') % collName if Sharing.isShared(collection): event.arguments["Enable"] = True else: event.arguments["Enable"] = False else: event.arguments["Enable"] = False menuTitle = _("Sync a collection") event.arguments["Text"] = menuTitle
def onUnpublishSidebarCollectionEventUpdateUI(self, event): collection = self.getSidebarSelectedCollection () if collection is not None: share = Sharing.getShare(collection) sharedByMe = Sharing.isSharedByMe(share) event.arguments['Enable'] = collection is not None and Sharing.isShared(collection) and sharedByMe
def onManageSidebarCollectionEventUpdateUI (self, event): collection = self.getSidebarSelectedCollection () event.arguments['Enable'] = collection is not None and (Sharing.isShared(collection))
def sharedWebDAVCollections(self): # return the list of all the shared collections # @@@DLD - use new query, once it can handle method calls, or when our item.isShared # attribute is correctly set. UseNewQuery = False if UseNewQuery: qString = u"for i in '//parcels/osaf/pim/ItemCollection' where len (i.sharedURL) > 0" collQuery = Query.Query(self.itsView.repository, qString) collQuery.recursive = False collections = list(collQuery) else: collections = [coll for coll in ItemCollection.iterItems(self.itsView) if Sharing.isShared(coll)] return collections
def onUnpublishSidebarCollectionEventUpdateUI(self, event): collection = self.getSidebarSelectedCollection() if collection is not None: share = Sharing.getShare(collection) sharedByMe = Sharing.isSharedByMe(share) event.arguments["Enable"] = collection is not None and Sharing.isShared(collection) and sharedByMe
def onManageSidebarCollectionEventUpdateUI(self, event): collection = self.getSidebarSelectedCollection() event.arguments["Enable"] = collection is not None and (Sharing.isShared(collection))