Changeset 3507 in products


Ignore:
Timestamp:
Aug 21, 2012 11:44:47 AM (7 years ago)
Author:
potar
Message:

rewrote code (compatibility with Plone3.0)

Location:
quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/handlers.py

    r3501 r3507  
    44from Products.DCWorkflow.interfaces import IAfterTransitionEvent 
    55from Acquisition import aq_parent 
    6 from plone.app.layout.navigation.defaultpage import isDefaultPage 
    76 
    8 from quintagroup.plonegooglesitemaps.utils import ping_google 
     7from quintagroup.plonegooglesitemaps.utils import ping_google, isDefaultPage 
    98 
    109 
     
    3837    def reindex(obj): 
    3938        container = aq_parent(obj) 
    40         if isDefaultPage(container, obj): 
     39        if isDefaultPage(obj): 
    4140            container.reindexObject(['sitemap_date']) 
    4241            reindex(container) 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/utils.py

    r3501 r3507  
    55from Globals import DevelopmentMode 
    66#from OFS.ObjectManager import BadRequestException 
     7from Products.CMFCore.utils import getToolByName 
    78 
    89from quintagroup.plonegooglesitemaps import config 
     
    2930 
    3031 
     32def getDefaultPage(obj): 
     33    """ Method gets default page for object (folderish) """ 
     34    plone_tool = getToolByName(obj, 'plone_utils') 
     35    return plone_tool.getDefaultPage(obj) 
     36 
     37 
     38def isDefaultPage(obj): 
     39    """ If object is default page then return True""" 
     40    plone_tool = getToolByName(obj, 'plone_utils') 
     41    return plone_tool.isDefaultPage(obj) 
     42 
     43 
    3144def dateTime(obj): 
    3245    """ Method gets modification date """ 
Note: See TracChangeset for help on using the changeset viewer.