コード例 #1
0
ファイル: Referenceable.py プロジェクト: vedantc98/Plone-test
 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
ファイル: Referenceable.py プロジェクト: dtgit/dtedu
 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
ファイル: Referenceable.py プロジェクト: vedantc98/Plone-test
 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
ファイル: Referenceable.py プロジェクト: vedantc98/Plone-test
 def _getURL(self):
     # the url used as the relative path based uid in the catalogs
     return getRelURL(self, self.getPhysicalPath())