Ignore:
Timestamp:
Aug 22, 2012 10:22:22 AM (8 years ago)
Author:
potar
Message:

Merged sitemap_date branch into trunk

Location:
quintagroup.plonegooglesitemaps/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/trunk

    • Property svn:mergeinfo
      •  

        old new  
        33/quintagroup.plonegooglesitemaps/branches/migratioin_product:2826-2839 
        44/quintagroup.plonegooglesitemaps/branches/plone4:2549-2553 
         5/quintagroup.plonegooglesitemaps/branches/sitemap_date:3481-3509 
        56/quintagroup.plonegooglesitemaps/branches/test_refactoring:2527-2536 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/handlers.py

    r3163 r3510  
    33#from quintagroup.plonegooglesitemaps.events import AfterTransitionEvent 
    44from Products.DCWorkflow.interfaces import IAfterTransitionEvent 
    5 from quintagroup.plonegooglesitemaps.utils import ping_google 
     5from Acquisition import aq_parent 
     6 
     7from quintagroup.plonegooglesitemaps.utils import ping_google, isDefaultPage 
    68 
    79 
     
    2325        obj_ptype = object.portal_type 
    2426        for sm in sitemaps: 
    25             if wftrans_name in sm.getPingTransitions() \ 
    26                and obj_ptype in sm.getPortalTypes(): 
     27            if wftrans_name in sm.getPingTransitions() and \ 
     28                   obj_ptype in sm.getPortalTypes(): 
    2729                ping_google(plone_home, sm.id) 
    2830    return 0 
     31 
     32 
     33def reindexParentObjects(obj, event): 
     34    """   Method reindexes folderish objects according 
     35        to modification date from default object 
     36    """ 
     37    def reindex(obj): 
     38        container = aq_parent(obj) 
     39        if isDefaultPage(obj): 
     40            container.reindexObject(['sitemap_date']) 
     41            reindex(container) 
     42 
     43    reindex(obj) 
Note: See TracChangeset for help on using the changeset viewer.