Changeset 1855 in products
- Timestamp:
- Mar 5, 2010 4:15:24 PM (14 years ago)
- Location:
- quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/adapters.py
r1816 r1855 6 6 7 7 from Acquisition import aq_inner 8 from OFS.interfaces import IPropertyManager 8 9 from Products.CMFCore.utils import getToolByName 9 10 … … 75 76 76 77 def __init__(self, context): 77 self.context = context78 self.context = aq_inner(context) 78 79 79 80 def canonical_path(self): … … 81 82 82 83 # Calculate canonical path from qSEO_canonical property 83 prop = aq_inner(self.context).getProperty('qSEO_canonical', None) 84 if prop is not None: 85 return prop[len(purl()):] 86 84 if IPropertyManager.providedBy(self.context): 85 prop = self.context.getProperty('qSEO_canonical', None) 86 if prop is not None: 87 return prop[len(purl()):] 88 87 89 # Fallback for canonical path calculation 88 90 return '/'+'/'.join(purl.getRelativeContentPath(self.context)) -
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/adapters.zcml
r1853 r1855 15 15 /> 16 16 17 <!-- really adapter depends on both interfaces18 *IPropertyManager* AND *ITreversable*19 Actually only IFolder directly implements20 both, but IItem not.21 -->22 <adapter23 for="OFS.interfaces.IFolder"24 provides=".interfaces.ISEOCanonicalPath"25 factory=".adapters.canonicalPathAdapter"26 />27 17 28 18 <adapter 29 for="OFS.interfaces.I Item"19 for="OFS.interfaces.ITraversable" 30 20 provides=".interfaces.ISEOCanonicalPath" 31 21 factory=".adapters.canonicalPathAdapter"
Note: See TracChangeset
for help on using the changeset viewer.