Changeset 2742 in products


Ignore:
Timestamp:
Aug 11, 2010 6:33:43 PM (14 years ago)
Author:
mylan
Message:

#226: Force sitemap search content related to the place, where it added to

Location:
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/commonview.py

    r2169 r2742  
    22from zope.interface import implements, Interface, Attribute 
    33 
     4from Acquisition import aq_inner, aq_parent 
    45from Products.Five import BrowserView 
    56from Products.CMFCore.utils import getToolByName 
    67 
    78from quintagroup.plonegooglesitemaps import qPloneGoogleSitemapsMessageFactory as _ 
    8 from utils import additionalURLs, applyOperations 
     9from quintagroup.plonegooglesitemaps.browser.utils import additionalURLs, applyOperations 
    910 
    1011 
     
    5354        return getToolByName(self.context, 'portal_url').getPortalObject() 
    5455 
     56    @property 
     57    def search_path(self): 
     58        return '/'.join(aq_parent(aq_inner(self.context)).getPhysicalPath()) 
     59 
    5560    def getFilteredObjects(self): 
    5661        """ Return brains 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/mobilesitemapview.py

    r1593 r2742  
    11from DateTime import DateTime 
    2 from commonview import * 
     2from quintagroup.plonegooglesitemaps.browser.commonview import * 
    33 
    44MOBILE_INTERFACES = ['quintagroup.mobileextender.interfaces.IMobile',] 
     
    1515 
    1616    def getFilteredObjects(self): 
    17         path = self.portal.getPhysicalPath() 
    18         portal_types = self.context.getPortalTypes() 
    19         review_states = self.context.getStates() 
    20         return self.portal_catalog(path = path, 
    21                 portal_type = portal_types, 
    22                 review_state = review_states,  
    23                 object_provides = MOBILE_INTERFACES, 
    24                 ) 
     17        return self.portal_catalog( 
     18            path = self.search_path, 
     19            portal_type = self.context.getPortalTypes(), 
     20            review_state = self.context.getStates(), 
     21            object_provides = MOBILE_INTERFACES, 
     22            ) 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/newssitemapview.py

    r2420 r2742  
    11import re 
    22from DateTime import DateTime 
    3 from commonview import * 
    43from zope.component import getMultiAdapter 
    54from plone.memoize.view import memoize 
     5from quintagroup.plonegooglesitemaps.browser.commonview import * 
    66 
    77reTrailingParenthtical = re.compile("\s*\(.*\)\s*", re.S) 
     
    3232 
    3333    def getFilteredObjects(self): 
    34         path = self.portal.getPhysicalPath() 
    35         portal_types = self.context.getPortalTypes() 
    36         review_states = self.context.getStates() 
    3734        min_date = DateTime() - 3 
    38         res = self.portal_catalog(path = path, 
    39                 portal_type = portal_types, 
    40                 review_state = review_states, 
    41                 effective = {"query": min_date, 
    42                              "range": "min" }) 
    43         return res 
     35        return self.portal_catalog( 
     36            path = self.search_path, 
     37            portal_type = self.context.getPortalTypes(), 
     38            review_state = self.context.getStates(), 
     39            effective = {"query": min_date, 
     40                         "range": "min" } 
     41            ) 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/sitemapview.py

    r1593 r2742  
    11from DateTime import DateTime 
    2 from commonview import * 
    3  
     2from quintagroup.plonegooglesitemaps.browser.commonview import * 
    43 
    54class SitemapView(CommonSitemapView): 
     
    1413 
    1514    def getFilteredObjects(self): 
    16         path = self.portal.getPhysicalPath() 
    17         portal_types = self.context.getPortalTypes() 
    18         review_states = self.context.getStates() 
    19         return self.portal_catalog(path = path, 
    20                 portal_type = portal_types, 
    21                 review_state = review_states) 
     15        return self.portal_catalog( 
     16            path = self.search_path, 
     17            portal_type = self.context.getPortalTypes(), 
     18            review_state = self.context.getStates() 
     19            ) 
Note: See TracChangeset for help on using the changeset viewer.