Last change
on this file was
1,
checked in by myroslav, 19 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 | ## |
---|
9 | from Products.CMFCore.utils import getToolByName |
---|
10 | from Products.qPloneGoogleSitemaps.utils import applyOperations |
---|
11 | from string import find |
---|
12 | |
---|
13 | if not path: |
---|
14 | path = '/'.join(context.getPhysicalPath()) |
---|
15 | |
---|
16 | catalog = getToolByName(context, 'portal_catalog') |
---|
17 | try: |
---|
18 | props = getToolByName(context, 'portal_properties').googlesitemap_properties |
---|
19 | objects = catalog(path = path, |
---|
20 | portal_type = props.portalTypes, |
---|
21 | review_state = props.states,) |
---|
22 | except AttributeError: |
---|
23 | # We are run without being properly installed, do default processing |
---|
24 | return applyOperations(catalog(path = path, |
---|
25 | review_state = ['published'],), |
---|
26 | []) |
---|
27 | |
---|
28 | blackout_list = props.blackout_list |
---|
29 | return 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.