Beispiel #1
0
def indexDocSubscriber(event):
    app = ISchoolToolApplication(None, None)
    if app is None:
        return
    obj = removeSecurityProxy(event.object)
    util = getUtility(IIntIds, context=app)
    obj_id = util.getId(obj)
    catalogs = ICatalogs(app)
    for entry in catalogs.values():
        entry.catalog.index_doc(obj_id, obj)
Beispiel #2
0
def indexDocSubscriber(event):
    app = ISchoolToolApplication(None, None)
    if app is None:
        return
    obj = removeSecurityProxy(event.object)
    util = getUtility(IIntIds, context=app)
    obj_id = util.getId(obj)
    catalogs = ICatalogs(app)
    for entry in catalogs.values():
        entry.catalog.index_doc(obj_id, obj)
Beispiel #3
0
def reindexDocSubscriber(event):
    app = ISchoolToolApplication(None, None)
    if app is None:
        return
    obj = removeSecurityProxy(event.object)
    util = queryUtility(IIntIds, context=app)
    if util is None:
        return
    obj_id = util.queryId(obj)
    if obj_id is None:
        return
    catalogs = ICatalogs(app)
    if obj is catalogs:
        return
    for entry in catalogs.values():
        entry.catalog.index_doc(obj_id, obj)
Beispiel #4
0
def reindexDocSubscriber(event):
    app = ISchoolToolApplication(None, None)
    if app is None:
        return
    obj = removeSecurityProxy(event.object)
    util = queryUtility(IIntIds, context=app)
    if util is None:
        return
    obj_id = util.queryId(obj)
    if obj_id is None:
        return
    catalogs = ICatalogs(app)
    if obj is catalogs:
        return
    for entry in catalogs.values():
        entry.catalog.index_doc(obj_id, obj)
Beispiel #5
0
    def __call__(self):
        app = ISchoolToolApplication(None)
        catalogs = ICatalogs(app)
        key = self.key()
        version = self.getVersion()

        if key in catalogs:
            if catalogs[key].version == version:
                catalogs[key].expired = False
            else:
                del catalogs[key]

        if key not in catalogs:
            catalog = self.createCatalog()
            catalogs[key] = VersionedCatalog(catalog, version)
            # XXX: if setIndexes throw, delete the catalog and rethrow
            self.setIndexes(catalog)
Beispiel #6
0
 def __call__(self):
     catalogs = ICatalogs(self.app)
     for entry in catalogs.values():
         entry.expired = True
Beispiel #7
0
 def __call__(self):
     catalogs = ICatalogs(self.app)
     for key in list(catalogs):
         if catalogs[key].expired:
             del catalogs[key]
Beispiel #8
0
 def __call__(self):
     catalogs = ICatalogs(self.app)
     for entry in catalogs.values():
         entry.expired = True