def getById( self, id ): """returns an object from the index which id corresponds to the one which is specified. """ if id not in self.__allowedIdxs: raise MaKaCError( _("Unknown index: %s")%id) Idx = self._getIdx() if id in Idx: return Idx[id] else: if id=="email": Idx[str(id)] = EmailIndex() elif id=="name": Idx[str(id)] = NameIndex() elif id=="surName": Idx[str(id)] = SurNameIndex() elif id=="organisation": Idx[str(id)] = OrganisationIndex() elif id=="status": Idx[str(id)] = StatusIndex() elif id=="group": Idx[str(id)] = GroupIndex() elif id=="calendar": Idx[str(id)] = CalendarIndex() elif id=="category": Idx[str(id)] = CategoryIndex() elif id=="categoryDate": Idx[str(id)] = CategoryDayIndex() elif id=="categoryDateAll": Idx[str(id)] = CategoryDayIndex(visibility=False) elif id=="categoryName": Idx[str(id)] = TextIndex() elif id=="conferenceTitle": Idx[str(id)] = TextIndex() elif id=="pendingSubmitters": Idx[str(id)] = PendingSubmittersIndex() elif id=="pendingConfSubmitters": Idx[str(id)] = PendingConfSubmittersIndex() elif id=="pendingSubmittersTasks": Idx[str(id)] = PendingSubmittersTasksIndex() elif id=="pendingConfSubmittersTasks": Idx[str(id)] = PendingConfSubmittersTasksIndex() elif id=="pendingConfManagers": Idx[str(id)] = PendingConfManagersIndex() elif id=="pendingConfManagersTasks": Idx[str(id)] = PendingConfManagersTasksIndex() elif id=="pendingManagers": Idx[str(id)] = PendingManagersIndex() elif id=="pendingManagersTasks": Idx[str(id)] = PendingManagersTasksIndex() elif id=="pendingCoordinators": Idx[str(id)] = PendingManagersIndex() elif id=="pendingCoordinatorsTasks": Idx[str(id)] = PendingManagersTasksIndex() else: extension_point("indexHolderProvider", Idx, id) return Idx[str(id)]
def _iterIndexes(cls): for t in cls._indexMap.iteritems(): yield t # ask plugins for their indexes for lcomp in extension_point('catalogIndexProvider'): for t in lcomp: yield t
def _get_idx_class(cls, index_name): if index_name in cls._indexMap: return cls._indexMap[index_name] else: # ask plugins for their indexes for lcomp in extension_point('catalogIndexProvider'): for t in lcomp: if index_name in t: return t[1] return None
def _buildRegister(self): """ Static mapping attributes for plugin implementations in register. Append lines to add further implementations. """ self._registeredImplementations = dict((key, value) for (key, value) in extension_point("getPluginImplementation"))