#from Products.CMFCore.utils import getToolByName #from zope.app import zapi #from Products.GenericSetup.interfaces import INode #import Products def _importNode(self, node): """Import the object from the DOM node. """ #import pdb;pdb.set_trace() if self.environ.shouldPurge(): self._purgeProperties() self._purgeObjects() self._purgeIndexes() self._purgeColumns() columns = [] for col in self._extractColumns()._get_childNodes(): columns.append(col.attributes.items()[0][1]) #print "cols: ",columns inds = {} for ind in self._extractIndexes()._get_childNodes(): inds[ind.attributes.items()[1][1]] = ind.attributes.items()[0][1] #print ind.attributes.items() #print "indexes: ", inds na = node.attributes.items() not_found = True if na[0][1] == "CMF Catalog": not_found = False #print na[1][1] for ch in node._get_childNodes(): if ch.nodeName in ('index',): cha = ch.attributes.items() iname = cha[1][1] itype = cha[0][1] if iname in inds.keys() and inds[iname] == itype: continue elif ch.nodeName in ('column',): cha = ch.attributes.items() iname = cha[0][1] if iname in columns: continue else: continue not_found = True if not_found: #self._initProperties(node) #self._initObjects(node) #self._initIndexes(node) #self._initColumns(node) self._refreshCatalog() self._logger.info("Catalog tool imported.") from Products.CPSCore.exportimport.catalog import CatalogToolXMLAdapter CatalogToolXMLAdapter._importNode = _importNode