Changeset 2615
- Timestamp:
- 09/28/08 23:41:03 (3 years ago)
- Files:
-
- trunk/Extensions/Install.py (modified) (3 diffs)
- trunk/Resources.py (modified) (1 diff)
- trunk/version.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Extensions/Install.py
r2605 r2615 311 311 if o: 312 312 o.reindexObject() 313 o.reindexSecondaryCatalogs() 313 314 u+=1 315 print >>out, 'u', 314 316 print 'u', 315 317 else: 316 318 #u+=1 # force transaction commits even if nothing is done, flushes latest objects from memory 319 print >>out, '.', 317 320 print '.', 318 321 if u==200: … … 330 333 print '**** Commiting transaction & finishing, c=%s ****' % str(c) 331 334 transaction.get().commit() 335 336 337 332 338 333 339 … … 1027 1033 #updateArchetypes(self, ['Piece'], start=5000, end=9000, out=out) 1028 1034 #reindexObjects(self, ['MultimediaMaterial'], start=0, end=3000, out=out) 1029 fixHistoryOrder(self, ['MultimediaMaterial'], start=0, end=3000, out=out) 1035 #reindexObjects(self, ['ExerciseMaterial', 'PresentationMaterial', 'PILOTMaterial'], start=0, end=3000, out=out) 1036 #reindexObjects(self, ['GroupBlog', 'MemberFolder'], start=0, end=5000, out=out) 1037 reindexObjects(self, ['Tool', 'Activity'], start=0, end=5000, out=out) 1038 #fixHistoryOrder(self, ['MultimediaMaterial'], start=0, end=3000, out=out) 1030 1039 1031 1040 trunk/Resources.py
r2614 r2615 251 251 self.initializeLayers(item, container) 252 252 253 254 security.declareProtected(MODIFY_CONTENT, 'reindexSecondaryCatalogs') 255 def reindexSecondaryCatalogs(self): 256 """ Update reference catalog and uid catalog """ 257 # method to catalog all references recursively 258 item=self 259 def catalogRefs(item, uc, rc): 260 if hasattr(item, '_getReferenceAnnotations'): 261 annotations = item._getReferenceAnnotations() 262 else: 263 return 264 if annotations: 265 for ref in annotations.objectValues(): 266 url = str(getRelURL(uc, ref.getPhysicalPath())) 267 ZCatalog.catalog_object(uc, ref, url) 268 ZCatalog.catalog_object(rc, ref, url) 269 catalogRefs(ref, uc, rc) 270 271 # from Referenceable manage_afterAdd: 272 # these add indexes to uid_catalog and reference_catalog 273 rc = getToolByName(self, 'reference_catalog') 274 uc = getToolByName(self, 'uid_catalog') 275 self._register(reference_manager=rc) 276 # path needs to be fixed to str, sometimes it is unicode and this results a CatalogError 277 url = str(getRelURL(self, item.getPhysicalPath())) 278 ZCatalog.catalog_object(uc, item, url) 279 ZCatalog.catalog_object(rc, item, url) 280 catalogRefs(item, uc, rc) 281 253 282 254 283 trunk/version.txt
r2610 r2615 1 2.5 1 2.5.1 2 2
