equal
deleted
inserted
replaced
84 """Index object into a registered catalog""" |
84 """Index object into a registered catalog""" |
85 if request is None: |
85 if request is None: |
86 request = request_utils.getRequest() |
86 request = request_utils.getRequest() |
87 intids = getIntIdUtility('', request, context) |
87 intids = getIntIdUtility('', request, context) |
88 if intids is not None: |
88 if intids is not None: |
89 catalog = queryCatalog(catalog_name, context) |
89 if ICatalog.providedBy(catalog_name): |
|
90 catalog = catalog_name |
|
91 else: |
|
92 catalog = queryCatalog(catalog_name, context) |
90 if catalog is not None: |
93 if catalog is not None: |
91 id = intids.register(object) |
94 id = intids.register(object) |
92 if index_name: |
95 if index_name: |
93 catalog[index_name].index_doc(id, object) |
96 catalog[index_name].index_doc(id, object) |
94 else: |
97 else: |
101 """Remove object from a registered catalog""" |
104 """Remove object from a registered catalog""" |
102 if request is None: |
105 if request is None: |
103 request = request_utils.getRequest() |
106 request = request_utils.getRequest() |
104 id = getObjectId(object, '', request, context) |
107 id = getObjectId(object, '', request, context) |
105 if id is not None: |
108 if id is not None: |
106 catalog = queryCatalog(catalog_name, context) |
109 if ICatalog.providedBy(catalog_name): |
|
110 catalog = catalog_name |
|
111 else: |
|
112 catalog = queryCatalog(catalog_name, context) |
107 if catalog is not None: |
113 if catalog is not None: |
108 if index_name: |
114 if index_name: |
109 catalog[index_name].unindex_doc(id) |
115 catalog[index_name].unindex_doc(id) |
110 else: |
116 else: |
111 catalog.unindex_doc(id) |
117 catalog.unindex_doc(id) |