Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
    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))
Ejemplo n.º 3
0
    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))
Ejemplo n.º 4
0
    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
Ejemplo n.º 5
0
 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
Ejemplo n.º 6
0
 def onManageSidebarCollectionEventUpdateUI (self, event):
     collection = self.getSidebarSelectedCollection ()
     event.arguments['Enable'] = collection is not None and (Sharing.isShared(collection))
Ejemplo n.º 7
0
 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
Ejemplo n.º 8
0
 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
Ejemplo n.º 9
0
 def onManageSidebarCollectionEventUpdateUI(self, event):
     collection = self.getSidebarSelectedCollection()
     event.arguments["Enable"] = collection is not None and (Sharing.isShared(collection))