Index: /quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/indexers.py
===================================================================
--- /quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/indexers.py	(revision 3503)
+++ /quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/indexers.py	(revision 3504)
@@ -1,3 +1,2 @@
-from plone.indexer import indexer
 from plone.app.layout.navigation.defaultpage import getDefaultPage
 
@@ -6,7 +5,28 @@
 from quintagroup.plonegooglesitemaps.utils import dateTime
 
+#BBB: for compatibility with older plone versions
+# (Plone 3.0, Plone 3.1, Plone3.2)
+try:
+    from plone.indexer import 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):
+def sitemap_date(obj, **kwargs):
     """ Method gets date for sitemap """
 
@@ -20,5 +40,5 @@
 
         if folderish_date > child_mdate:
-            last_date = folderish_date 
+            last_date = folderish_date
         else:
             last_date = child_mdate
@@ -38,2 +58,8 @@
 
     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/branches/sitemap_date/quintagroup/plonegooglesitemaps/tests/testSitemaps.py
===================================================================
--- /quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/tests/testSitemaps.py	(revision 3503)
+++ /quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/tests/testSitemaps.py	(revision 3504)
@@ -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):
@@ -318,45 +321,52 @@
         sleep(1)
         self.folder2 = _createObjectByType("Folder", self.folder1,
-                                            id="test-folder2")
+                                           id="test-folder2")
         sleep(1)
         self.page = _createObjectByType("Document", self.folder2,
                                         id="index_html")
 
-    def getSitemapDate(self, obj):
-        """ Method get sitemap_date from portal_portal """
+    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
+        from quintagroup.plonegooglesitemaps.handlers \
+            import reindexParentObjects
+
         # set default page
         self.folder2.setDefaultPage("index_html")
         reindexParentObjects(self.page, None)
 
-        self.assertEqual(self.getSitemapDate(self.page),
-                         self.getSitemapDate(self.folder2))
-        self.assertNotEqual(self.getSitemapDate(self.page),
-                            self.getSitemapDate(self.folder1))
+        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.getSitemapDate(self.page),
-                         self.getSitemapDate(self.folder1))
-
-    def testSitemapIndex(self):
+        self.assertEqual(self.getCatalogSitemapDate(self.page),
+                         self.getCatalogSitemapDate(self.folder1))
+
+    def testSitemapDateIndexer(self):
         """ Method tests index (sitemap_date) """
-        from quintagroup.plonegooglesitemaps.indexers import sitemap_date
-
-        last_date = self.getSitemapDate(self.folder1)
-        sitemap_func = sitemap_date(self.folder1)
-        self.assertEqual(last_date,
-                         sitemap_func())
-
-        # set default page
+        last_date = self.getCatalogSitemapDate(self.folder1)
+        self.assertEqual(last_date, self.getIndexerSitemapDate(self.folder1))
         self.folder1.setDefaultPage("test-folder2")
         self.assertNotEqual(last_date,
-                            sitemap_func())
+                            self.getIndexerSitemapDate(self.folder1))
 
 
