def FindTrashCollection(view): """ this is a really ugly hack - basically we have to iterate through all ItemCollections until we find the right one when the special collections stop being copied into the soup, this will just look like: return schema.ns("osaf.app", view).trash """ for collection in ItemCollection.iterItems(view): if IsTrashCollection(collection): return collection assert False, "No Trash 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 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