- Timestamp:
- 10/18/09 21:40:10 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
plone4bio.biosql/trunk/src/plone4bio/biosql/content/root.py
r88 r112 11 11 from Products.CMFCore.permissions import View 12 12 from Products.CMFCore.interfaces import IFolderish 13 from Products.CMFCore.utils import getToolByName 14 from Products.CMFPlone.utils import base_hasattr 15 from Products.CMFPlone.utils import safe_callable 13 16 from zope.app.container.interfaces import IContainer 14 17 from plone.app.content.interfaces import INameFromTitle … … 49 52 # isPrincipiaFolderish = True # already on Container 50 53 dsn = FieldProperty(IBioSQLRoot['dsn']) 54 seqrecord_key = FieldProperty(IBioSQLRoot['seqrecord_key']) 51 55 _v_dbserver = None 56 57 # see CMFPlone/CatalogTool.py 58 def refreshCatalog(self, clear=1): 59 def indexObject(obj, path): 60 if (base_hasattr(obj, 'indexObject') and 61 safe_callable(obj.indexObject)): 62 try: 63 obj.indexObject() 64 except TypeError: 65 # Catalogs have 'indexObject' as well, but they 66 # take different args, and will fail 67 pass 68 for database in self.values(): 69 database.invalidateCache() 70 portal_catalog = getToolByName(self, 'portal_catalog') 71 for obj in portal_catalog.searchResults(path=self.absolute_url_path()): 72 portal_catalog.uncatalog_object(obj.getPath()) 73 portal_catalog.ZopeFindAndApply(self, search_sub=True, apply_func=indexObject) 74 75 def __getattr__(self, name): 76 if self.has_key(name): 77 return self[name] 78 else: 79 raise AttributeError, name 52 80 53 81 security.declareProtected(View, "getBioSQLRoot")
