예제 #1
0
 def _catalogRefs(self, aq, uc=None, rc=None):
     annotations = self._getReferenceAnnotations()
     if annotations:
         if not uc:
             uc = getToolByName(aq, config.UID_CATALOG)
         if not rc:
             rc = getToolByName(aq, config.REFERENCE_CATALOG)
         for ref in annotations.objectValues():
             url = getRelURL(uc, ref.getPhysicalPath())
             uc.catalog_object(ref, url)
             rc.catalog_object(ref, url)
             ref._catalogRefs(uc, uc, rc)
예제 #2
0
 def _uncatalogRefs(self, aq, uc=None, rc=None):
     annotations = self._getReferenceAnnotations()
     if annotations:
         if not uc:
             uc = getToolByName(self, config.UID_CATALOG)
         if not rc:
             rc = getToolByName(self, config.REFERENCE_CATALOG)
         for ref in annotations.objectValues():
             url = getRelURL(uc, ref.getPhysicalPath())
             # XXX This is an ugly workaround. This method shouldn't be
             # called twice for an object in the first place, so we don't
             # have to check if it is still cataloged. 
             uc_rid = uc.getrid(url)
             if uc_rid is not None:
                 uc.uncatalog_object(url)
             rc_rid = rc.getrid(url)
             if rc_rid is not None:
                 rc.uncatalog_object(url)
예제 #3
0
 def _uncatalogRefs(self, aq, uc=None, rc=None):
     if isFactoryContained(self):
         return
     annotations = self._getReferenceAnnotations()
     if annotations:
         if not uc:
             uc = getToolByName(self, config.UID_CATALOG)
         if not rc:
             rc = getToolByName(self, config.REFERENCE_CATALOG)
         for ref in annotations.objectValues():
             url = getRelURL(uc, ref.getPhysicalPath())
             # XXX This is an ugly workaround. This method shouldn't be
             # called twice for an object in the first place, so we don't
             # have to check if it is still cataloged.
             uc_rid = uc.getrid(url)
             if uc_rid is not None:
                 uc.uncatalog_object(url)
             rc_rid = rc.getrid(url)
             if rc_rid is not None:
                 rc.uncatalog_object(url)
예제 #4
0
 def _getURL(self):
     # the url used as the relative path based uid in the catalogs
     return getRelURL(self, self.getPhysicalPath())