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

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

Building directory structure

File size: 1.0 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,)
22except AttributeError:
23    # We are run without being properly installed, do default processing
24    return applyOperations(catalog(path = path,
25                                   review_state = ['published'],),
26                                   [])
27
28blackout_list = props.blackout_list
29return applyOperations([ob for ob in objects if (ob.getId not in blackout_list)],
30                    props.getProperty('reg_exp'))
Note: See TracBrowser for help on using the repository browser.