Index: /quintagroup.plonegooglesitemaps/trunk/README.txt
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/README.txt	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/README.txt	(revision 3510)
@@ -2,6 +2,6 @@
 ============
 
-Plone Google Sitemaps product allows Plone websites to get better visibility for Google search engine
-by providing it with complete listing of URLs to website content.
+Plone Google Sitemaps product allows Plone websites to get better visibility on Google search engine
+by providing it with a complete listing of content URLs to website.
 
 .. figure:: http://quintagroup.com/services/plone-development/products/google-sitemaps/plone-google-sitemaps.png
@@ -15,13 +15,12 @@
 
 * ``Content Sitemap`` - is a regular list of pages on your website. Creating and submitting such a Sitemap 
-  lets Google know about all the pages on your Plone web site, including URLs that may not be discoverable
+  lets Google know about all the pages on your Plone website, including URLs that may not be discoverable
   by Google's normal crawling process.
-* ``Mobile Sitemap`` - is a specific type of Sitemap, that indexes all site URLs that serve content for 
-  mobile devices.
+* ``Mobile Sitemap`` - is a specific type of Sitemap, that indexes all site URLs that serve mobile-oriented content.
 * ``News Sitemap`` - is different from regular Sitemaps, since it is specific to Google News only.
-  It uses the Sitemap protocol, with additional News-specific tags, defined by Google. The package brings 
-  additional Google Sitempas tab to News Item content type for defining NewsSitemap-specific meta tags. 
+  It uses the Sitemap protocol, with additional News-specific tags, defined by Google. The package brings protocol with 
+  additional Google Sitemaps tab to News Item content type for defining NewsSitemap-specific meta tags. 
 
-Different Sitemap types index their own content and do not depend on other Sitemaps.
+Different Sitemap types index their own content and do not depend on other Sitemaps. 
 
 Usage
@@ -39,16 +38,16 @@
 =========
 
-If you UPGRADE older version of quintagroup.plonegooglesitemaps package to newer:
----------------------------------------------------------------------------------
+If you UPGRADE an older version of quintagroup.plonegooglesitemaps package to a newer one:
+------------------------------------------------------------------------------------------
 
-* In your zope instance configuration or buildout - replace old package version with a new one.
+* In your zope instance configuration or buildout replace old package version with a new one.
 * Run plone instance and reinstall package with Quickinstaller tool ("Add-on Products" in plone control panel).
 
-If your MIGRATE from Products.qPloneGoogleSitemaps to quintagroup.plonegooglesitemaps:
---------------------------------------------------------------------------------------
+If you MIGRATE from Products.qPloneGoogleSitemaps to quintagroup.plonegooglesitemaps:
+-------------------------------------------------------------------------------------
     
-* Add to new plone instance/buildout both qPloneGoogleSitemaps product and last version quintagroup.plonegooglesitemaps package.
+* Add to a new Plone instance/buildout both qPloneGoogleSitemaps product and last version quintagroup.plonegooglesitemaps package.
 * Copy Data.fs from old Plone instance to new one.
-* Start your new zope instance/buildout.
+* Start your new Zope instance/buildout.
 
 The following steps are performed in the plone instance:
Index: /quintagroup.plonegooglesitemaps/trunk/docs/HISTORY.txt
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/docs/HISTORY.txt	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/docs/HISTORY.txt	(revision 3510)
@@ -2,12 +2,22 @@
 =========
 
-1.7.1 - unreleased
+1.8.0 (2012-08-22)
 ------------------
 
+* Updated modification date in Sitemaps for folderish objects which have
+  default pages.
+  Sitemap types have their own index (sitemap_date) 
+  which helps to generate Sitemaps without default pages. 
+  Index contains the last modification date from this object or  
+  from default page. As а result you will not see default pages 
+  in sitemap types.
+  [potar]
+* Added tests for index (sitemap_date), updated tests.
+  [potar]
 * Added deleting (button) the verification file
   [potar]
-
 * Updated view quintagroup.plonegooglesitemaps (tabs)
   [potar]
+  
 
 1.7.0 (2011-10-28)
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/Extensions/Install.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/Extensions/Install.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/Extensions/Install.py	(revision 3510)
@@ -20,5 +20,5 @@
         step = None
         profile_id = 'quintagroup.plonegooglesitemaps:default'
-        steps_to_run = [s['id'] for s in \
+        steps_to_run = [s['id'] for s in
                         ps.listUpgrades(profile_id, show_old=False)]
         for step_id in steps_to_run:
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/__init__.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/__init__.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/__init__.py	(revision 3510)
@@ -50,3 +50,3 @@
                     permission=config.ADD_PERMISSIONS[atype.portal_type],
                     extra_constructors=(constructor,),
-                   ).initialize(context)
+                    ).initialize(context)
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/commonview.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/commonview.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/commonview.py	(revision 3510)
@@ -110,5 +110,6 @@
             fname = fspec and fspec.pop() or "id"
             fengine = queryMultiAdapter((self.context, self.request),
-                          interface=IBlackoutFilter, name=fname)
+                                        interface=IBlackoutFilter,
+                                        name=fname)
             if fengine:
                 objects = list(fengine.filterOut(objects, fargs))
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/configletview.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/configletview.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/configletview.py	(revision 3510)
@@ -25,9 +25,9 @@
     """
 
-    sitemaps = Attribute("Returns mapping of sitemap's type to list of " \
+    sitemaps = Attribute("Returns mapping of sitemap's type to list of "
                          "appropriate objects")
-    hasContentSM = Attribute("Returns boolean about existance of content " \
+    hasContentSM = Attribute("Returns boolean about existance of content "
                              "sitemap")
-    hasMobileSM = Attribute("Returns boolean about existance of mobile " \
+    hasMobileSM = Attribute("Returns boolean about existance of mobile "
                             "sitemap")
     hasNewsSM = Attribute("Returns boolean about existance of news sitemap")
@@ -73,5 +73,5 @@
         self.pps = queryMultiAdapter((self.context, self.request),
                                      name="plone_portal_state")
-        self.sitemaps = [i.getObject() for i in \
+        self.sitemaps = [i.getObject() for i in
                          self.tools.catalog()(portal_type='Sitemap')]
 
@@ -97,7 +97,7 @@
             smlist = sitemaps.setdefault(sm.getSitemapType(), [])
             smlist.append({'url': sm.absolute_url(), 'id': sm.id})
+
         sitemaps['all'] = sitemaps.setdefault('content', []) + \
-                          sitemaps.setdefault('mobile', []) + \
-                          sitemaps.setdefault('news', [])
+            sitemaps.setdefault('mobile', []) + sitemaps.setdefault('news', [])
         return sitemaps
 
@@ -128,5 +128,5 @@
                 'sm_size': size and splitNum(size) or '',
                 'sm_entries': entries and splitNum(entries) or '',
-               }
+                }
 
     def getSitemapData(self, ob):
@@ -150,6 +150,6 @@
         portal.manage_delObjects([self.request.id, ])
         self.request.RESPONSE.redirect(
-                                urlparse.urljoin(self.context.absolute_url,
-                                'prefs_gsm_verification'))
+            urlparse.urljoin(self.context.absolute_url,
+                             'prefs_gsm_verification'))
 
     def getVerificationFiles(self):
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/mobilesitemapview.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/mobilesitemapview.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/mobilesitemapview.py	(revision 3510)
@@ -13,5 +13,6 @@
 
     additional_maps = (
-        ('modification_date', lambda x: DateTime(x.ModificationDate).HTML4()),
+        ('modification_date',
+         lambda x: x.sitemap_date or DateTime(x.ModificationDate).HTML4()),
     )
 
@@ -22,3 +23,4 @@
             review_state=self.context.getStates(),
             object_provides=MOBILE_INTERFACES,
-            )
+            is_default_page=False,
+        )
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/newssitemapview.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/newssitemapview.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/newssitemapview.py	(revision 3510)
@@ -21,14 +21,14 @@
 
         return (
-            ('publication_date', lambda x: x.Date and \
-                                 formatDate(x.Date) or ""),
+            ('publication_date',
+             lambda x: x.Date and formatDate(x.Date) or ""),
             ('keywords', lambda x: x.Subject and ', '.join(x.Subject) or ""),
             ('title', lambda x: x.Title or x.getId or x.id),
-            ('name', lambda x: x.Title and \
-                     reTrailingParenthtical.sub("", x.Title) or ""),
+            ('name', lambda x: x.Title and
+                reTrailingParenthtical.sub("", x.Title) or ""),
             ('language', lambda x: x.Language or self.default_language()),
             ('access', lambda x: x.gsm_access or ""),
-            ('genres', lambda x: x.gsm_genres and \
-                       ", ".join(x.gsm_genres) or ""),
+            ('genres', lambda x: x.gsm_genres and
+                ", ".join(x.gsm_genres) or ""),
             ('stock', lambda x: x.gsm_stock or ""),
         )
@@ -47,4 +47,5 @@
             review_state=self.context.getStates(),
             effective={"query": min_date,
-                       "range": "min"}
-            )
+                       "range": "min"},
+            is_default_page=False
+        )
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/sitemapview.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/sitemapview.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/sitemapview.py	(revision 3510)
@@ -11,5 +11,6 @@
 
     additional_maps = (
-        ('modification_date', lambda x: DateTime(x.ModificationDate).HTML4()),
+        ('modification_date',
+         lambda x: x.sitemap_date or DateTime(x.ModificationDate).HTML4()),
     )
 
@@ -18,4 +19,5 @@
             path=self.search_path,
             portal_type=self.context.getPortalTypes(),
-            review_state=self.context.getStates()
-            )
+            review_state=self.context.getStates(),
+            is_default_page=False
+        )
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/configure.zcml
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/configure.zcml	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/configure.zcml	(revision 3510)
@@ -29,4 +29,11 @@
     </class>
 
+    <adapter name="sitemap_date" factory=".indexers.sitemap_date" />
+
+    <subscriber
+        for="zope.interface.Interface
+             Products.Archetypes.interfaces.IObjectEditedEvent"
+        handler=".handlers.reindexParentObjects" /> 
+
     <!-- Register default filters -->
     <adapter
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/content/newsextender.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/content/newsextender.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/content/newsextender.py	(revision 3510)
@@ -22,5 +22,5 @@
 
 access_lst = ["Subscription", "Registration"]
-genres_lst = ["PressRelease", "Satire", "Blog", "OpEd", "Opinion", \
+genres_lst = ["PressRelease", "Satire", "Blog", "OpEd", "Opinion",
               "UserGenerated"]
 
@@ -31,7 +31,8 @@
 
     fields = [
-        ExtendableStringField("gsm_access",
+        ExtendableStringField(
+            "gsm_access",
             accessor="gsm_access",
-            vocabulary=DisplayList(zip(["", ] + access_lst, \
+            vocabulary=DisplayList(zip(["", ] + access_lst,
                                    ["Open access", ] + access_lst)),
             default="",
@@ -39,10 +40,11 @@
             widget=SelectionWidget(
                 label="Access",
-                description="Specifies whether an article is available to " \
-                    "all readers (in case of the emtpy field, or only to " \
+                description="Specifies whether an article is available to "
+                    "all readers (in case of the emtpy field, or only to "
                     "those with a free or paid membership to your site.",
                 format="radio"),
         ),
-        ExtendableLinesField("gsm_genres",
+        ExtendableLinesField(
+            "gsm_genres",
             accessor="gsm_genres",
             vocabulary=DisplayList(zip(genres_lst, genres_lst)),
@@ -51,11 +53,12 @@
             widget=MultiSelectionWidget(
                 label="Genres",
-                description="Select one or more properties for an article, " \
-                    "namely, whether it is a press release, a blog post, an " \
-                    "opinion, an op-ed piece, user-generated content, " \
-                    "or satire.",
+                description="Select one or more properties for an article, "
+                            "namely, whether it is a press release, "
+                            "a blog post, an opinion, an op-ed piece, "
+                            "user-generated content, or satire.",
                 format="checkbox"),
         ),
-        ExtendableStringField("gsm_stock",
+        ExtendableStringField(
+            "gsm_stock",
             accessor="gsm_stock",
             default="",
@@ -63,11 +66,11 @@
             widget=StringWidget(
                 label="Stock Tickers",
-                description="A comma-separated list of up to 5 stock tickers "\
-                    "of the companies, mutual funds, or other financial " \
-                    "entities that are the main subject of the article. " \
-                    "Relevant primarily for business articles. Each ticker " \
-                    "must be prefixed by the name of its stock exchange, " \
-                    "and must match its entry in Google Finance. " \
-                    "For example, \"NASDAQ:AMAT\" (but not \"NASD:AMAT\"), " \
+                description="A comma-separated list of up to 5 stock tickers "
+                    "of the companies, mutual funds, or other financial "
+                    "entities that are the main subject of the article. "
+                    "Relevant primarily for business articles. Each ticker "
+                    "must be prefixed by the name of its stock exchange, "
+                    "and must match its entry in Google Finance. "
+                    "For example, \"NASDAQ:AMAT\" (but not \"NASD:AMAT\"), "
                     "or \"BOM:500325\" (but not \"BOM:RIL\").",
                 size=70),
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/content/sitemap.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/content/sitemap.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/content/sitemap.py	(revision 3510)
@@ -52,5 +52,5 @@
         widget=atapi.MultiSelectionWidget(
             label=_(u"Review status"),
-            description=_(u"You may include items in sitemap depend of " \
+            description=_(u"You may include items in sitemap depend of "
                           u"their review state."),
         ),
@@ -65,10 +65,10 @@
             label=_(u"Blackout entries"),
             description=_(
-                u"Objects which match filter condition will be excluded " \
-                u"from the sitemap.Every record should follow the spec: " \
-                u"[<filter name>:]<filter arguments>. By default there are " \
-                u"\"id\" and \"path\" filters (\"id\" used if filter name " \
-                u"not specified). There is possibility to add new filters. " \
-                u"Look into README.txt of the " \
+                u"Objects which match filter condition will be excluded "
+                u"from the sitemap.Every record should follow the spec: "
+                u"[<filter name>:]<filter arguments>. By default there are "
+                u"\"id\" and \"path\" filters (\"id\" used if filter name "
+                u"not specified). There is possibility to add new filters. "
+                u"Look into README.txt of the "
                 u"quintagroup.plonegooglesitemaps package."),
         ),
@@ -82,13 +82,13 @@
         widget=atapi.LinesWidget(
             label=_(u"URL processing Regular Expressions"),
-            description=_(u"Provide regular expressions (in Perl syntax), " \
-                          u"one per line to be applied to URLs before " \
-                          u"including them into Sitemap. Example 1: " \
-                          u"\"s/\/index_html//\" will remove /index_html " \
-                          u"from URLs representing default documents. " \
-                          u"Example 2: " \
-                          u"\"s/[you_site\/internal\/path]/[domain]/\" will " \
-                          u"fix URLs in the sitemap in case they are " \
-                          u"generated on the basis of your site internal" \
+            description=_(u"Provide regular expressions (in Perl syntax), "
+                          u"one per line to be applied to URLs before "
+                          u"including them into Sitemap. Example 1: "
+                          u"\"s/\/index_html//\" will remove /index_html "
+                          u"from URLs representing default documents. "
+                          u"Example 2: "
+                          u"\"s/[you_site\/internal\/path]/[domain]/\" will "
+                          u"fix URLs in the sitemap in case they are "
+                          u"generated on the basis of your site internal"
                           u"path rather than your site domain URL. "),
         ),
@@ -103,5 +103,5 @@
         widget=atapi.LinesWidget(
             label=_(u"Additional URLs"),
-            description=_(u"Define additional URLs that are not objects and " \
+            description=_(u"Define additional URLs that are not objects and "
                           u"that should be included in sitemap."),
         ),
@@ -115,5 +115,5 @@
         widget=atapi.MultiSelectionWidget(
             label=_(u"Pinging workflow transitions"),
-            description=_(u"Select workflow transitions for pinging " \
+            description=_(u"Select workflow transitions for pinging "
                           u"google on."),
         ),
@@ -170,7 +170,8 @@
             for wf_tr in wf.transitions.values():
                 if wf_tr.after_script_name in AVAILABLE_WF_SCRIPTS:
-                    wf_trans.append(("%s#%s" % (wf_id, wf_tr.id),
-                        "%s : %s (%s)" % (wf_id, wf_tr.id, \
-                                          wf_tr.title_or_id())))
+                    wf_trans.append(
+                        ("%s#%s" % (wf_id, wf_tr.id),
+                         "%s : %s (%s)" % (wf_id, wf_tr.id,
+                                           wf_tr.title_or_id())))
         return atapi.DisplayList(wf_trans)
 
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/events.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/events.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/events.py	(revision 3510)
@@ -12,5 +12,5 @@
         implements(ITransitionEvent)
 
-        def __init__(self, obj, workflow, old_state, new_state, transition, \
+        def __init__(self, obj, workflow, old_state, new_state, transition,
                      status, kwargs):
             ObjectEvent.__init__(self, obj)
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/filters.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/filters.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/filters.py	(revision 3510)
@@ -34,5 +34,6 @@
             # absolute path filter
             portal_id = queryMultiAdapter((self.context, self.request),
-                         name=u"plone_portal_state").portal().getId()
+                                          name=u"plone_portal_state"
+                                          ).portal().getId()
             test_path = '/' + portal_id + fargs
         elif fargs.startswith("./"):
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/filters.txt
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/filters.txt	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/filters.txt	(revision 3510)
@@ -157,5 +157,5 @@
     >>> reloc = re.compile("<loc>%s([^\<]*)</loc>" % self.portal.absolute_url(), re.S)
 
-Test if all 4 documents and default front-page are in the sitemap without filters.
+Test if all 4 documents are in the sitemap without filters.
 
     >>> no_filters_res = reloc.findall(no_filters_content)
@@ -166,5 +166,4 @@
     /doc1
     /doc2
-    /front-page
 
 
@@ -172,5 +171,5 @@
 =================
 
-Go to the sitemap edit form and add "doc1" and "front-page" lines with "id:" 
+Go to the sitemap edit form and add "doc1" line with "id:" 
 prefix to the "Blackout entries" field.
 
@@ -179,10 +178,9 @@
     >>> filtercontrol.value = """
     ...     id:doc1
-    ...     id:front-page
     ... """
     >>> browser.getControl("Save").click()
     >>> id_filter_content = browser.contents
 
-"doc1" and "front-page" documents should now be excluded from the
+"doc1" document should now be excluded from the
 sitemap.
 
@@ -197,6 +195,6 @@
 ===================
 
-Suppose we want to exclude "front_page" from portal root and "doc2"
-document, located in test_user_1_ home folder, but leave "doc2" 
+Suppose we want to exclude "doc2" document, 
+located in test_user_1_ home folder, but leave "doc2" 
 untouched in portal root with all other objects.
 
@@ -205,10 +203,9 @@
     >>> filtercontrol.value = """
     ...    path:/Members/test_user_1_/doc2
-    ...    path:/front-page
     ... """
     >>> browser.getControl("Save").click()
     >>> path_filter_content = browser.contents
 
-"/Members/test_user_1_/doc2" and "/front_page" objects should
+"/Members/test_user_1_/doc2" object should
 be excluded from the sitemap.
 
@@ -227,6 +224,6 @@
 filter name prefix is specified (e.g. old-fashion filters)?"
 
-Go to the sitemap edit form and add "doc1" and "front-page"
-lines without any filter name prefix to the "Blackout entries" 
+Go to the sitemap edit form and add "doc1" line
+without any filter name prefix to the "Blackout entries" 
 field.
 
@@ -235,11 +232,10 @@
     >>> filtercontrol.value = """
     ...     doc1
-    ...     front-page
     ... """
     >>> browser.getControl("Save").click()
     >>> default_filter_content = browser.contents
 
-"id" filter must be used as default filter. So, all "doc1" and
-"front-page" objects should be excluded from the sitemap.
+"id" filter must be used as default filter. So, "doc1"
+object should be excluded from the sitemap.
 
     >>> default_filter_res = reloc.findall(default_filter_content)
@@ -337,3 +333,2 @@
     /Members/test_user_1_/doc2
     /doc2
-    /front-page
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/handlers.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/handlers.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/handlers.py	(revision 3510)
@@ -3,5 +3,7 @@
 #from quintagroup.plonegooglesitemaps.events import AfterTransitionEvent
 from Products.DCWorkflow.interfaces import IAfterTransitionEvent
-from quintagroup.plonegooglesitemaps.utils import ping_google
+from Acquisition import aq_parent
+
+from quintagroup.plonegooglesitemaps.utils import ping_google, isDefaultPage
 
 
@@ -23,6 +25,19 @@
         obj_ptype = object.portal_type
         for sm in sitemaps:
-            if wftrans_name in sm.getPingTransitions() \
-               and obj_ptype in sm.getPortalTypes():
+            if wftrans_name in sm.getPingTransitions() and \
+                    obj_ptype in sm.getPortalTypes():
                 ping_google(plone_home, sm.id)
     return 0
+
+
+def reindexParentObjects(obj, event):
+    """   Method reindexes folderish objects according
+        to modification date from default object
+    """
+    def reindex(obj):
+        container = aq_parent(obj)
+        if isDefaultPage(obj):
+            container.reindexObject(['sitemap_date'])
+            reindex(container)
+
+    reindex(obj)
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/indexers.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/indexers.py	(revision 3510)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/indexers.py	(revision 3510)
@@ -0,0 +1,64 @@
+from zope.interface import Interface
+
+from quintagroup.plonegooglesitemaps.utils import dateTime, getDefaultPage
+
+#BBB: for compatibility with older plone versions
+# (Plone 3.0, Plone 3.1, Plone3.2)
+try:
+    import plone.indexer
+    indexer = plone.indexer.indexer
+    IS_NEW = True
+except ImportError:
+    IS_NEW = False
+
+    class IDummyInterface:
+        pass
+
+    class indexer:
+
+        def __init__(self, *interfaces):
+            self.interfaces = IDummyInterface,
+
+        def __call__(self, callable):
+            callable.__component_adapts__ = self.interfaces
+            callable.__implemented__ = Interface
+            return callable
+
+
+@indexer(Interface)
+def sitemap_date(obj, **kwargs):
+    """ Method gets date for sitemap """
+
+    def lastModificationDate(folderish_date, default_page):
+        """  Method compares date (folderish object)
+            with another date (default_page) and returns the last
+        """
+
+        # get modification date
+        child_mdate = dateTime(default_page)
+
+        if folderish_date > child_mdate:
+            last_date = folderish_date
+        else:
+            last_date = child_mdate
+
+        child = getDefaultPage(default_page)
+        if not child:
+            return last_date
+
+        return lastModificationDate(last_date,
+                                    default_page[child])
+
+    default_page = getDefaultPage(obj)
+    # get modification date
+    date = dateTime(obj)
+    if default_page:
+        date = lastModificationDate(date, getattr(obj, default_page))
+
+    return date.HTML4()
+
+#BBB: for compatibility with older plone versions
+# (Plone 3.0, Plone 3.1, Plone3.2)
+if not IS_NEW:
+    from Products.CMFPlone.CatalogTool import registerIndexableAttribute
+    registerIndexableAttribute('sitemap_date', sitemap_date)
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/default/catalog.xml
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/default/catalog.xml	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/default/catalog.xml	(revision 3510)
@@ -1,4 +1,8 @@
 <?xml version="1.0"?>
 <object name="portal_catalog" meta_type="Plone Catalog Tool">
+ <index name="sitemap_date" meta_type="FieldIndex">
+   <indexed_attr value="sitemap_date"/>
+ </index>
+ <column value="sitemap_date"/>
  <column value="canonical_link" update="True" />
  <column value="Language" update="True" />
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/setuphandlers.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/setuphandlers.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/setuphandlers.py	(revision 3510)
@@ -31,7 +31,9 @@
             name = registration.name
             lsm.unregisterAdapter(factory=factory,
-                required=required, provided=provided, name=name)
+                                  required=required,
+                                  provided=provided,
+                                  name=name)
             unregistered.append(str(required))
-    logger.info("Unregistered news schema extender adapters for: %s" \
+    logger.info("Unregistered news schema extender adapters for: %s"
                 % unregistered)
 
@@ -87,5 +89,5 @@
     if old_product in configlet_ids:
         controlpanel.unregisterConfiglet(old_product)
-        logger.info("Unregistered '%s' configlet from "\
+        logger.info("Unregistered '%s' configlet from "
                     "portal_controlpanel tool." % old_product)
     # Remove qPloneGoogleSitemaps skin layer
@@ -94,5 +96,5 @@
         paths = [l.strip() for l in skin_paths if not l == old_product]
         if len(paths) < len(skin_paths):
-            logger.info("Removed '%s' from '%s' skin." \
+            logger.info("Removed '%s' from '%s' skin."
                         % (old_product, skinName))
         skins.addSkinSelection(skinName, ','.join(paths))
@@ -103,5 +105,5 @@
     if smaps:
         logger.info(msg + "Process %s sitemaps." % (
-                [sm.getPath() for sm in smaps]))
+                    [sm.getPath() for sm in smaps]))
         fields = ['id', 'sitemapType', 'portalTypes', 'states',
                   'blackout_list', 'reg_exp', 'urls', 'pingTransitions']
@@ -127,5 +129,5 @@
     catalog = getToolByName(site, 'portal_catalog')
     smaps = catalog(portal_type="Sitemap")
-    old_smb = [smb for smb in smaps \
+    old_smb = [smb for smb in smaps
                if 'qPloneGoogleSitemaps' in str(smb.getObject().__class__)]
     return old_smb
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testBlackoutList.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testBlackoutList.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testBlackoutList.py	(revision 3510)
@@ -16,13 +16,13 @@
     def testDefaultId(self):
         idfilter = queryMultiAdapter((self.portal, self.app.REQUEST),
-                       IBlackoutFilter, name="id")
+                                     IBlackoutFilter, name="id")
         self.assertTrue(idfilter is not None,
-            "Not registered default 'id' IBlackoutFilter")
+                        "Not registered default 'id' IBlackoutFilter")
 
     def testDefaultPath(self):
         pathfilter = queryMultiAdapter((self.portal, self.app.REQUEST),
-                         IBlackoutFilter, name="path")
+                                       IBlackoutFilter, name="path")
         self.assertTrue(pathfilter is not None,
-            "Not registered default 'path' IBlackoutFilter")
+                        "Not registered default 'path' IBlackoutFilter")
 
 
@@ -59,11 +59,12 @@
         catpaths, filtered = self.getPreparedLists("id", "doc1")
         self.assertTrue(type(filtered) in [ListType, TupleType],
-            'Object type, returned by filteredOut method of "id" filter '\
-            'not list nor tuple')
+                        'Object type, returned by filteredOut method'
+                        ' of "id" filter '
+                        'not list nor tuple')
         excluded = ["/%s/doc1" % self.portal.absolute_url(1),
                     "/%s/doc1" % self.folder.absolute_url(1)]
         self.assertTrue(
             set(catpaths) - set(filtered) == set(excluded),
-            'Wrong filtered-out by "id" filter:\nsrc %s\nres %s\nexcluded %s' \
+            'Wrong filtered-out by "id" filter:\nsrc %s\nres %s\nexcluded %s'
             % (catpaths, filtered, excluded))
 
@@ -71,10 +72,11 @@
         catpaths, filtered = self.getPreparedLists("path", "/doc1")
         self.assertTrue(type(filtered) in [ListType, TupleType],
-            'Object type, returned by filteredOut method of "path" filter '\
-            'not list nor tuple')
+                        'Object type, returned by filteredOut method'
+                        ' of "path" filter '
+                        'not list nor tuple')
         excluded = ["/%s/doc1" % self.portal.absolute_url(1)]
         self.assertTrue(
             set(catpaths) - set(filtered) == set(excluded),
-            'Wrong filtered-out by "path" filter:\nsrc %s\nres %s\nexcluded ' \
+            'Wrong filtered-out by "path" filter:\nsrc %s\nres %s\nexcluded '
             '%s' % (catpaths, filtered, excluded))
 
@@ -84,10 +86,11 @@
         catpaths, filtered = self.getPreparedLists("path", "./doc1")
         self.assertTrue(type(filtered) in [ListType, TupleType],
-            'Object type, returned by filteredOut method of "path" utility '\
-            'not list nor tuple')
+                        'Object type, returned by filteredOut method'
+                        ' of "path" utility '
+                        'not list nor tuple')
         excluded = ["/%s/doc1" % self.folder.absolute_url(1)]
         self.assertTrue(
             set(catpaths) - set(filtered) == set(excluded),
-            'Wrong filtered-out by "path" filter:\nsrc %s\nres %s\nexcluded ' \
+            'Wrong filtered-out by "path" filter:\nsrc %s\nres %s\nexcluded '
             '%s' % (catpaths, filtered, excluded))
 
@@ -109,16 +112,20 @@
     def testGetNamedFilterUtility(self):
         catpaths, filtered = self.getPreparedLists("path:/doc1", "/plone/doc1")
-        excluded = ["%s/doc1" % self.portal.absolute_url()]
+        excluded = ["%s/doc1" % self.portal.absolute_url(),
+                    "%s/front-page" % self.portal.absolute_url()]
         self.assertTrue(set(catpaths) - set(filtered) == set(excluded),
-            'Wrong filtered-out by "id" filter:\nsrc %s\nres %s\nexcluded %s' \
-            % (catpaths, filtered, excluded))
+                        'Wrong filtered-out by'
+                        ' "id" filter:\nsrc %s\nres %s\nexcluded %s'
+                        % (catpaths, filtered, excluded))
 
     def testDefaultFilterUtility(self):
         catpaths, filtered = self.getPreparedLists("id:doc1", "doc1")
         excluded = ["%s/doc1" % self.portal.absolute_url(),
+                    "%s/front-page" % self.portal.absolute_url(),
                     "%s/doc1" % self.folder.absolute_url()]
         self.assertTrue(set(catpaths) - set(filtered) == set(excluded),
-            'Wrong filtered-out by "id" filter:\nsrc %s\nres %s\nexcluded %s' \
-            % (catpaths, filtered, excluded))
+                        'Wrong filtered-out by "id" '
+                        'filter:\nsrc %s\nres %s\nexcluded %s'
+                        % (catpaths, filtered, excluded))
         # Now check is output of unnamed filter samed to named one.
         self.sm.edit(blackout_list=["doc1", ])
@@ -126,6 +133,8 @@
         map(lambda l: l.sort(), (filtered, filtered_dflt))
         self.assertTrue(filtered == filtered_dflt,
-            'Output of named "id" filter is not same to unnamed one:\n' \
-            'id-named: %s\nunnamed: %s' % (filtered, filtered_dflt))
+                        'Output of named "id" filter '
+                        'is not same to unnamed one:\n'
+                        'id-named: %s\nunnamed: %s'
+                        % (filtered, filtered_dflt))
 
     # def testGetCorrectFilterName(self):
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testConfiglet.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testConfiglet.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testConfiglet.py	(revision 3510)
@@ -32,6 +32,6 @@
 
     def testAddContentSitemap(self):
-        resp = self.submitForm(
-                   {'form.button.AddContent': "Add Content Sitemap"})
+        resp = self.submitForm({'form.button.AddContent':
+                                "Add Content Sitemap"})
         self.assertEqual(resp.getStatus() / 100, 3)
         sm_edit = "sitemap.xml/edit"
@@ -41,5 +41,5 @@
         #self.portal["sitemap.xml"].setPortalTypes(("Documents",))
         newform = self.publish(self.settingsURL, basic=self.auth).getBody()
-        self.assertEqual('href="http://nohost/plone/sitemap.xml/edit"' in \
+        self.assertEqual('href="http://nohost/plone/sitemap.xml/edit"' in
                          newform, True)
         self.assertEqual("form.button.AddContent" in newform, False)
@@ -54,5 +54,5 @@
         #self.portal["news-sitemap.xml"].setPortalTypes(("News Item",))
         newform = self.publish(self.settingsURL, basic=self.auth).getBody()
-        self.assertEqual('href="http://nohost/plone/news-sitemap.xml/edit"' \
+        self.assertEqual('href="http://nohost/plone/news-sitemap.xml/edit"'
                          in newform, True)
         self.assertEqual("form.button.AddNews" in newform, False)
@@ -67,5 +67,5 @@
         #self.portal["mobile-sitemap.xml"].setPortalTypes(("Documents",))
         newform = self.publish(self.settingsURL, basic=self.auth).getBody()
-        self.assertEqual('href="http://nohost/plone/mobile-sitemap.xml/edit"' \
+        self.assertEqual('href="http://nohost/plone/mobile-sitemap.xml/edit"'
                          in newform, True)
         self.assertEqual("form.button.AddMobile" in newform, False)
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testGoogleSitemaps.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testGoogleSitemaps.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testGoogleSitemaps.py	(revision 3510)
@@ -89,5 +89,5 @@
                           '/prefs_gsm_verification'
         verif_config = self.publish(verifyConfigUrl, self.auth).getBody()
-        rexp_input_acitve = re.compile('<input\s+name="verification_file"' \
+        rexp_input_acitve = re.compile('<input\s+name="verification_file"'
                                        '\s+([^>]*)>', re.I | re.S)
         rexp_button_acitve = re.compile(
@@ -101,5 +101,5 @@
 
         self.assert_(input_acitve and not 'disabled' in input_acitve.groups(1))
-        self.assert_(button_acitve and not 'disabled' in \
+        self.assert_(button_acitve and not 'disabled' in
                      button_acitve.groups(1))
         self.assert_(not delete_button)
@@ -143,13 +143,19 @@
 
             self.assertEqual(response.getStatus(), 200)
-            self.assert_(fname in \
-                 self.gsm_props.getProperty('verification_filenames', []),
-                 self.gsm_props.getProperty('verification_filenames', []))
+            self.assert_(fname in
+                         self.gsm_props.getProperty('verification_filenames',
+                                                    []),
+                         self.gsm_props.getProperty('verification_filenames',
+                                                    []))
             fnames.append(fname)
 
-        self.assertEqual(len([1 for vf in fnames \
-            if vf in \
-                self.gsm_props.getProperty('verification_filenames', [])]), 2,
-                self.gsm_props.getProperty('verification_filenames', []))
+        self.assertEqual(len([1 for vf in fnames
+                         if
+                         vf
+                         in
+                         self.gsm_props.getProperty('verification_filenames',
+                                                    [])]), 2,
+                         self.gsm_props.getProperty('verification_filenames',
+                                                    []))
 
 
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testInstallation.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testInstallation.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testInstallation.py	(revision 3510)
@@ -15,13 +15,13 @@
         pt = self.portal.portal_types
         self.assert_('Sitemap' in pt.objectIds(),
-            'No "Sitemap" type after installation')
+                     'No "Sitemap" type after installation')
         #Test views
         views = pt.getTypeInfo('Sitemap').view_methods
         self.assert_('sitemap.xml' in views,
-            'No "sitemap.xml" view for Sitemap type')
+                     'No "sitemap.xml" view for Sitemap type')
         self.assert_('mobile-sitemap.xml' in views,
-            'No "mobile-sitemap.xml" view for Sitemap type')
+                     'No "mobile-sitemap.xml" view for Sitemap type')
         self.assert_('news-sitemap.xml' in views,
-            'No "news-sitemap.xml" view for Sitemap type')
+                     'No "news-sitemap.xml" view for Sitemap type')
 
     def testGSMProperties(self):
@@ -29,32 +29,39 @@
 
         # Test types_not_searched
-        self.assert_("Sitemap" in \
-            pp['site_properties'].getProperty('types_not_searched'),
-            'No "Sitemap" added to types not searched on installation')
+        self.assert_("Sitemap" in
+                     pp['site_properties'].getProperty('types_not_searched'),
+                     'No "Sitemap" added to types not searched '
+                     'on installation')
         # Test metaTypesNotToList
-        self.assert_("Sitemap" in \
-            pp['navtree_properties'].getProperty('metaTypesNotToList'),
-            'No "Sitemap" added to types not to list on installation')
+        self.assert_("Sitemap" in
+                     pp['navtree_properties'].
+                     getProperty('metaTypesNotToList'),
+                     'No "Sitemap" added to types not to '
+                     'list on installation')
 
         # Test 'googlesitemap_properties'
         self.assert_('googlesitemap_properties' in pp.objectIds(),
-            'No "googlesitemap_properties" after installation')
+                     'No "googlesitemap_properties" after installation')
         qsmprops = pp['googlesitemap_properties']
         self.assert_(qsmprops.hasProperty('verification_filenames'),
-            'No "verification_filenames" property added on installation')
+                     'No "verification_filenames" property added on '
+                     'installation')
 
     def testSkins(self):
         ps = self.portal.portal_skins
         self.assert_('plonegooglesitemaps' in ps.objectIds(),
-            'No "plonegooglesitemaps" skin layer in portal_skins')
-        self.assert_('plonegooglesitemaps' in \
+                     'No "plonegooglesitemaps" skin '
+                     'layer in portal_skins')
+        self.assert_('plonegooglesitemaps' in
                      ps.getSkinPath(ps.getDefaultSkin()),
-            'No "plonegooglesitemaps" skin layer in default skin')
+                     'No "plonegooglesitemaps" skin layer '
+                     'in default skin')
 
     def testConfiglet(self):
         cp = self.portal.portal_controlpanel
-        self.assert_([1 for ai in cp.listActionInfos() \
-                      if ai['id'] == 'GoogleSitemaps'],
-            'No "GoogleSitemaps" configlet added to plone control panel')
+        self.assert_([1 for ai in cp.listActionInfos()
+                     if ai['id'] == 'GoogleSitemaps'],
+                     'No "GoogleSitemaps" configlet '
+                     'added to plone control panel')
 
     def testNewsSchemaExtenderRegistered(self):
@@ -62,8 +69,9 @@
         news = self.portal.invokeFactory("News Item", id="test_news")
         news = getattr(self.portal, "test_news")
-        self.assertNotEqual(lsm.queryAdapter(
-                news, interface=ISchemaExtender,
-                name="quintagroup.plonegooglesitemaps.newssitemapextender"),
-            None)
+        adapter = "quintagroup.plonegooglesitemaps.newssitemapextender"
+        self.assertNotEqual(lsm.queryAdapter(news,
+                                             interface=ISchemaExtender,
+                                             name=adapter),
+                            None)
 
     def testUpdateCatalog(self):
@@ -135,5 +143,5 @@
         news = getattr(self.portal, "test_news")
         self.assertEqual(lsm.queryAdapter(news, interface=ISchemaExtender),
-            None)
+                         None)
 
     def testConfigletUninstall(self):
@@ -142,7 +150,8 @@
             True, '%s is already installed' % PRODUCT)
         configTool = self.portal.portal_controlpanel
-        self.assertEqual('GoogleSitemaps' in [a.getId() for a in \
-                                              configTool.listActions()], False,
-            'Configlet found after uninstallation')
+        self.assertEqual('GoogleSitemaps' in [a.getId() for a in
+                                              configTool.listActions()],
+                         False,
+                         'Configlet found after uninstallation')
 
     def test_browserlayer_uninstall(self):
@@ -152,5 +161,6 @@
         from plone.browserlayer import utils
         self.assertEqual(IGoogleSitemapsLayer in utils.registered_layers(),
-            False, "Still registered 'IGoogleSitemapsLayer' browser layer")
+                         False, "Still registered 'IGoogleSitemapsLayer' "
+                         "browser layer")
 
 
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testMobileSitemaps.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testMobileSitemaps.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testMobileSitemaps.py	(revision 3510)
@@ -40,5 +40,5 @@
     def reParse(self):
         # Parse mobile sitemap
-        self.sitemap = self.publish("/" + self.portal.absolute_url(1) + \
+        self.sitemap = self.publish("/" + self.portal.absolute_url(1) +
                                     "/mobile-sitemap.xml",
                                     "%s:%s" % (portal_owner,
@@ -64,11 +64,11 @@
 
     def test_lastmod(self):
-        md = [f for k, f in \
-              mobilesitemapview.MobileSitemapView.additional_maps \
+        md = [f for k, f in
+              mobilesitemapview.MobileSitemapView.additional_maps
               if k == 'modification_date'][0]
         bmobile = self.portal.portal_catalog(id="my_mobile")[0]
         self.assert_("lastmod" in self.start.keys())
-        self.assert_(md(bmobile) in self.data, "Wrong 'modified date':" \
-                     " must be '%s', but exist: '%s'" \
+        self.assert_(md(bmobile) in self.data, "Wrong 'modified date':"
+                     " must be '%s', but exist: '%s'"
                      % (md(bmobile), self.data))
 
@@ -85,5 +85,5 @@
         self.default_layout = mobile_sm.getProperty('layout', "")
         self.mobile_view = queryMultiAdapter((mobile_sm, self.portal.REQUEST),
-                               name=self.default_layout)
+                                             name=self.default_layout)
 
     def testLayout(self):
@@ -100,5 +100,5 @@
     def testAdditionalMaps(self):
         self.assert_(hasattr(self.mobile_view, "additional_maps"))
-        self.assert_([1 for k, f in self.mobile_view.additional_maps \
+        self.assert_([1 for k, f in self.mobile_view.additional_maps
                       if k == "modification_date"])
 
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testNewsSitemaps.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testNewsSitemaps.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testNewsSitemaps.py	(revision 3510)
@@ -47,5 +47,5 @@
     def reParse(self):
         # Parse news sitemap
-        self.sitemap = self.publish("/" + self.portal.absolute_url(1) + \
+        self.sitemap = self.publish("/" + self.portal.absolute_url(1) +
                                     "/news-sitemaps",
                                     "%s:%s" % (portal_owner,
@@ -149,5 +149,5 @@
     def reParse(self):
         # Parse news sitemap
-        self.sitemap = self.publish("/" + self.portal.absolute_url(1) + \
+        self.sitemap = self.publish("/" + self.portal.absolute_url(1) +
                                     "/news-sitemaps",
                                     "%s:%s" % (portal_owner, default_password)
@@ -213,13 +213,14 @@
         # Now register SchemaExtender adapter and
         # check if it present in Local SiteManger only
+        adapter = "quintagroup.plonegooglesitemaps.newssitemapextender"
         self.assertNotEqual(localsm, globalsm)
         self.assertNotEqual(localsm.queryAdapter(
-                self.my_news, ISchemaExtender,
-                name="quintagroup.plonegooglesitemaps.newssitemapextender"),
-            None)
+                            self.my_news, ISchemaExtender,
+                            name=adapter),
+                            None)
         self.assertEqual(globalsm.queryAdapter(
-                self.my_news, ISchemaExtender,
-                name="quintagroup.plonegooglesitemaps.newssitemapextender"),
-            None)
+                         self.my_news, ISchemaExtender,
+                         name=adapter),
+                         None)
 
 
@@ -270,7 +271,7 @@
         self.assert_(INewsSitemapProvider.providedBy(self.taggable_news))
         schema = self.taggable_news.Schema().keys()
-        self.assert_("gsm_access" in schema, "no 'gsm_access' in schema: %s" \
+        self.assert_("gsm_access" in schema, "no 'gsm_access' in schema: %s"
                      % schema)
-        self.assert_("testField" in schema, "no 'testField' in schema: %s" \
+        self.assert_("testField" in schema, "no 'testField' in schema: %s"
                      % schema)
 
@@ -306,5 +307,5 @@
                 func(self.brain)
             except Exception, e:
-                self.fail("Wrong processing 'Missing' value for '%s': %s" \
+                self.fail("Wrong processing 'Missing' value for '%s': %s"
                           % (n, str(e)))
 
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testPinging.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testPinging.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testPinging.py	(revision 3510)
@@ -11,7 +11,8 @@
     def afterSetUp(self):
         super(TestPinging, self).afterSetUp()
-        self.workflow.setChainForPortalTypes(
-                pt_names=('News Item', 'Document'),
-                chain="simple_publication_workflow")
+        workflow = "simple_publication_workflow"
+        self.workflow.setChainForPortalTypes(pt_names=('News Item',
+                                                       'Document'),
+                                             chain=workflow)
         gsm_properties = 'googlesitemap_properties'
         self.gsm_props = self.portal.portal_properties[gsm_properties]
@@ -43,8 +44,8 @@
             sys.stdout = back_out
 
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.contentSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.contentSM.id, data))
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.newsSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.newsSM.id, data))
@@ -60,8 +61,8 @@
             sys.stdout = back_out
 
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.newsSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.newsSM.id, data))
-        self.assert_(not 'Pinged %s sitemap to Google' \
+        self.assert_(not 'Pinged %s sitemap to Google'
                      % self.contentSM.absolute_url() in data,
                      "Pinged %s on news: '%s'" % (self.contentSM.id, data))
@@ -82,8 +83,8 @@
             sys.stdout = back_out
 
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.contentSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.contentSM.id, data))
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.newsSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.newsSM.id, data))
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSecurity.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSecurity.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSecurity.py	(revision 3510)
@@ -14,5 +14,5 @@
 
     def getview(self, vpath):
-        return self.publish("/" + self.portal.absolute_url(1) + \
+        return self.publish("/" + self.portal.absolute_url(1) +
                             "/" + vpath, self.auth)
 
@@ -44,5 +44,8 @@
         super(TestSecurityConfigletNotManager, self).afterSetUp()
         self.auth = "mem:mem"
-        self.portal.portal_membership.addMember('mem', 'mem', ('Member',), [])
+        self.portal.portal_membership.addMember('mem',
+                                                'mem',
+                                                ('Member',),
+                                                [])
 
     def testConfigOverview(self):
@@ -59,9 +62,8 @@
 
 
-SM_TYPES = {
-  "content": {"id": "sitemap.xml", "types": ("Document",)},
-  "news": {"id": "news-sitemap.xml", "types": ("News Item",)},
-  "mobile": {"id": "mobile-sitemap.xml", "types": ("Document",)},
-}
+SM_TYPES = {"content": {"id": "sitemap.xml", "types": ("Document",)},
+            "news": {"id": "news-sitemap.xml", "types": ("News Item",)},
+            "mobile": {"id": "mobile-sitemap.xml", "types": ("Document",)},
+            }
 from DateTime import DateTime
 
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSitemaps.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSitemaps.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSitemaps.py	(revision 3510)
@@ -52,5 +52,5 @@
 
     def testAutoSetLayout(self):
-        response = self.publish('/%s/createObject?type_name=Sitemap' \
+        response = self.publish('/%s/createObject?type_name=Sitemap'
                                 % self.portal.absolute_url(1), basic=self.auth)
         location = response.getHeader('location')
@@ -87,5 +87,5 @@
         wftrans = self.contentSM.getWorkflowTransitions()
         self.assertEqual(isinstance(wftrans, atapi.DisplayList), True)
-        self.assertEqual("simple_publication_workflow#publish" in \
+        self.assertEqual("simple_publication_workflow#publish" in
                          wftrans.keys(), True)
 
@@ -95,6 +95,7 @@
         self.contentSM.edit(blackout_list=bolist)
         value = self.contentSM.getBlackout_list()
-        self.assertTrue(value == expect, "Blackout list was not cleaned "\
-             "up from whitespaces: %s" % str(value))
+        self.assertTrue(value == expect, "Blackout list was not cleaned "
+                                         "up from whitespaces: %s"
+                                         % str(value))
 
 
@@ -179,6 +180,8 @@
     def afterSetUp(self):
         super(TestPinging, self).afterSetUp()
+        workflow = "simple_publication_workflow"
         self.workflow.setChainForPortalTypes(pt_names=('News Item',
-                 'Document'), chain="simple_publication_workflow")
+                                                       'Document'),
+                                             chain=workflow)
         gsm_properties = 'googlesitemap_properties'
         self.gsm_props = self.portal.portal_properties[gsm_properties]
@@ -210,8 +213,8 @@
             sys.stdout = back_out
 
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.contentSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.contentSM.id, data))
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.newsSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.newsSM.id, data))
@@ -227,8 +230,8 @@
             sys.stdout = back_out
 
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.newsSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.newsSM.id, data))
-        self.assert_(not 'Pinged %s sitemap to Google' \
+        self.assert_(not 'Pinged %s sitemap to Google'
                      % self.contentSM.absolute_url() in data,
                      "Pinged %s on news: '%s'" % (self.contentSM.id, data))
@@ -249,8 +252,8 @@
             sys.stdout = back_out
 
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.contentSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.contentSM.id, data))
-        self.assert_('Pinged %s sitemap to Google' \
+        self.assert_('Pinged %s sitemap to Google'
                      % self.newsSM.absolute_url() in data,
                      "Not pinged %s: '%s'" % (self.newsSM.id, data))
@@ -285,5 +288,5 @@
         filtered = SitemapView(self.sm, TestRequest()).getFilteredObjects()
         self.assertEqual(map(lambda x: x.getPath(), filtered),
-                        [self.inner_path, ])
+                         [self.inner_path, ])
 
     def testNewsSitemap(self):
@@ -302,4 +305,70 @@
 
 
+class TestSitemapDate(TestCase):
+    """ Method dedicated to test index (sitemap_date) in portal_catalog
+    """
+    def afterSetUp(self):
+        super(TestSitemapDate, self).afterSetUp()
+
+        from time import sleep
+
+        # sequence is important for testing
+        # ("test-folder1", "test-folder2", "index_html")
+        self.folder1 = _createObjectByType("Folder", self.portal,
+                                           id="test-folder1")
+
+        # create objects with different sitemap_date
+        sleep(1)
+        self.folder2 = _createObjectByType("Folder", self.folder1,
+                                           id="test-folder2")
+        sleep(1)
+        self.page = _createObjectByType("Document", self.folder2,
+                                        id="index_html")
+
+    def getCatalogSitemapDate(self, obj):
+        """ Method gets sitemap_date from portal_catalog """
+        return self.portal.portal_catalog(id=obj.id)[0].sitemap_date
+
+    def getIndexerSitemapDate(self, obj):
+        """  Method gets modification date from
+            function sitemap_date (indexer)
+        """
+        from quintagroup.plonegooglesitemaps.indexers import sitemap_date
+
+        modification_date = sitemap_date(obj)
+        # you have had to use '__call__' since Plone 3.3
+        if callable(modification_date):
+            modification_date = modification_date()
+        return modification_date
+
+    def testReindexParentObjects(self):
+        """ Method tests handler (reindexParentObjects) """
+        from quintagroup.plonegooglesitemaps.handlers \
+            import reindexParentObjects
+
+        # set default page
+        self.folder2.setDefaultPage("index_html")
+        reindexParentObjects(self.page, None)
+
+        self.assertEqual(self.getCatalogSitemapDate(self.page),
+                         self.getCatalogSitemapDate(self.folder2))
+        self.assertNotEqual(self.getCatalogSitemapDate(self.page),
+                            self.getCatalogSitemapDate(self.folder1))
+
+        # set default page
+        self.folder1.setDefaultPage("test-folder2")
+        reindexParentObjects(self.folder2, None)
+        self.assertEqual(self.getCatalogSitemapDate(self.page),
+                         self.getCatalogSitemapDate(self.folder1))
+
+    def testSitemapDateIndexer(self):
+        """ Method tests index (sitemap_date) """
+        last_date = self.getCatalogSitemapDate(self.folder1)
+        self.assertEqual(last_date, self.getIndexerSitemapDate(self.folder1))
+        self.folder1.setDefaultPage("test-folder2")
+        self.assertNotEqual(last_date,
+                            self.getIndexerSitemapDate(self.folder1))
+
+
 def test_suite():
     suite = unittest.TestSuite()
@@ -308,4 +377,5 @@
     suite.addTest(unittest.makeSuite(TestPinging))
     suite.addTest(unittest.makeSuite(TestContextSearch))
+    suite.addTest(unittest.makeSuite(TestSitemapDate))
     return suite
 
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testUpgrade.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testUpgrade.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testUpgrade.py	(revision 3510)
@@ -42,7 +42,7 @@
         # Test registered upgrade profiles
         pids = [i['id'] for i in self.setup.listProfileInfo()]
-        self.assertEqual("quintagroup.plonegooglesitemaps:upgrade_1_0_to_1_1" \
+        self.assertEqual("quintagroup.plonegooglesitemaps:upgrade_1_0_to_1_1"
                          in pids, True)
-        self.assertEqual("quintagroup.plonegooglesitemaps:upgrade_1_1_to_1_2" \
+        self.assertEqual("quintagroup.plonegooglesitemaps:upgrade_1_1_to_1_2"
                          in pids, True)
 
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/test_doctest.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/test_doctest.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/test_doctest.py	(revision 3510)
@@ -28,6 +28,6 @@
             test_class=DocTestCase, globs=globals(),
             optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
-                       # | doctest.REPORT_ONLY_FIRST_FAILURE |
-        ])
+        # | doctest.REPORT_ONLY_FIRST_FAILURE |
+    ])
 
 if __name__ == '__main__':
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/upgrades.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/upgrades.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/upgrades.py	(revision 3510)
@@ -18,13 +18,11 @@
     portal = purl.getPortalObject()
     allCTTypes = types.listContentTypes()
-    obj_metatypes = [m.content_meta_type for m in types.objectValues() \
+    obj_metatypes = [m.content_meta_type for m in types.objectValues()
                      if m.getId() in allCTTypes]
     convertor = CanonicalConvertor(portal_url=purl())
-    portal.ZopeFindAndApply(
-                            portal,
+    portal.ZopeFindAndApply(portal,
                             obj_metatypes=','.join(obj_metatypes),
                             apply_func=renameProperty,
-                            search_sub=1,
-                            )
+                            search_sub=1,)
     print convertor.getLogs()
 
Index: /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/utils.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/utils.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/utils.py	(revision 3510)
@@ -1,7 +1,9 @@
 from urllib2 import urlopen
-from urllib  import quote as urlquote
+from urllib import quote as urlquote
+from DateTime import DateTime
 
 from Globals import DevelopmentMode
 #from OFS.ObjectManager import BadRequestException
+from Products.CMFCore.utils import getToolByName
 
 from quintagroup.plonegooglesitemaps import config
@@ -20,5 +22,5 @@
     sitemap_url = urlquote(resurl)
 
-    g = urlopen('http://www.google.com/webmasters/tools/ping?sitemap=' + \
+    g = urlopen('http://www.google.com/webmasters/tools/ping?sitemap=' +
                 sitemap_url)
     g.read()
@@ -26,2 +28,19 @@
 
     return 0
+
+
+def getDefaultPage(obj):
+    """ Method gets default page for object (folderish) """
+    plone_tool = getToolByName(obj, 'plone_utils')
+    return plone_tool.getDefaultPage(obj)
+
+
+def isDefaultPage(obj):
+    """ If object is default page then return True"""
+    plone_tool = getToolByName(obj, 'plone_utils')
+    return plone_tool.isDefaultPage(obj)
+
+
+def dateTime(obj):
+    """ Method gets modification date """
+    return DateTime(obj.ModificationDate())
Index: /quintagroup.plonegooglesitemaps/trunk/setup.py
===================================================================
--- /quintagroup.plonegooglesitemaps/trunk/setup.py	(revision 3509)
+++ /quintagroup.plonegooglesitemaps/trunk/setup.py	(revision 3510)
@@ -3,5 +3,5 @@
 import os
 
-version = '1.7.1'
+version = '1.8.0'
 
 tests_require = ['zope.testing',
@@ -10,18 +10,18 @@
 setup(name='quintagroup.plonegooglesitemaps',
       version=version,
-      description="Allows Plone websites to get better visibility for " \
+      description="Allows Plone websites to get better visibility for "
                   "Google search engine",
       long_description=open("README.txt").read() + "\n" +
-                       open(os.path.join("docs", "HISTORY.txt")).read(),
+           open(os.path.join("docs", "HISTORY.txt")).read(),
       # Get more strings from
       # http://pypi.python.org/pypi?%3Aaction=list_classifiers
       classifiers=[
-        "Framework :: Plone",
-        "Programming Language :: Python",
-        ],
+          "Framework :: Plone",
+          "Programming Language :: Python",
+      ],
       keywords='plone google sitemap quintagroup search engine',
       author='Quintagroup',
       author_email='info@quintagroup.com',
-      url='http://svn.quintagroup.com/products/' \
+      url='http://svn.quintagroup.com/products/'
           'quintagroup.plonegooglesitemaps',
       license='GPL',
