vendor/CMF/1.6.3/CMFCore

view exportimport/catalog.py @ 0:587011552858

import CMF 1.6.3
author bdelbosc
date Mon, 23 Apr 2007 13:58:01 +0000
parents
children
line source
1 ##############################################################################
2 #
3 # Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
4 #
5 # This software is subject to the provisions of the Zope Public License,
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
10 # FOR A PARTICULAR PURPOSE.
11 #
12 ##############################################################################
13 """Catalog tool setup handlers.
15 $Id$
16 """
18 from Products.GenericSetup.utils import exportObjects
19 from Products.GenericSetup.utils import importObjects
21 from Products.CMFCore.utils import getToolByName
24 def importCatalogTool(context):
25 """Import catalog tool.
26 """
27 site = context.getSite()
28 tool = getToolByName(site, 'portal_catalog')
30 importObjects(tool, '', context)
32 def exportCatalogTool(context):
33 """Export catalog tool.
34 """
35 site = context.getSite()
36 tool = getToolByName(site, 'portal_catalog', None)
37 if tool is None:
38 logger = context.getLogger('catalog')
39 logger.info('Nothing to export.')
40 return
42 exportObjects(tool, '', context)