source: products/qPloneGoogleSitemaps/tags/0.4.10/skins/qPloneGoogleSitemaps/searchForGoogleSitemapObjects.py

Last change on this file was 1, checked in by myroslav, 18 years ago

Building directory structure

File size: 1.1 KB
Line 
1## Script (Python) "searchForGoogleSitemapObjects"
2##bind container=
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=path=None
8##
9from Products.CMFCore.utils import getToolByName
10from Products.qPloneGoogleSitemaps.utils import applyOperations
11from string import find
12
13if not path:
14    path = '/'.join(context.getPhysicalPath())
15
16catalog = getToolByName(context, 'portal_catalog')
17try:
18    props = getToolByName(context, 'portal_properties').googlesitemap_properties
19    objects = catalog(path = path,
20                portal_type = props.portalTypes,
21                review_state = props.states,
22                )
23except AttributeError:
24    # We are run without being properly installed, do default processing
25    return applyOperations(catalog(path = path,
26                                   review_state = ['published'],
27                                  ),[])
28
29blackout_list = props.blackout_list
30return applyOperations([ob for ob in objects if not(ob.getId in blackout_list)],
31                    props.getProperty('reg_exp'))
Note: See TracBrowser for help on using the repository browser.