def listExportableItems(self): """ See IFilesystemExporter. """ exportable = self.context.objectItems() exportable = [x for x in exportable if not ISetupTool.providedBy(x[1])] exportable = [x + (IFilesystemExporter(x[1], None),) for x in exportable] return exportable
def listExportableItems(self): """ See IFilesystemExporter. """ exportable = self.context.objectItems() exportable = [x for x in exportable if not ISetupTool.providedBy(x[1])] exportable = [ x + (IFilesystemExporter(x[1], None), ) for x in exportable ] return exportable
def loadMigrationProfile(context, profile, steps=_marker): if not ISetupTool.providedBy(context): context = getToolByName(context, "portal_setup") if steps is _marker: context.runAllImportStepsFromProfile(profile, purge_old=False) else: for step in steps: context.runImportStepFromProfile( profile, step, run_dependencies=False, purge_old=False )
def loadMigrationProfile(context, profile, steps=_marker): if not ISetupTool.providedBy(context): context = getToolByName(context, 'portal_setup') if steps is _marker: context.runAllImportStepsFromProfile(profile, purge_old=False) else: for step in steps: context.runImportStepFromProfile(profile, step, run_dependencies=False, purge_old=False)
def exportSite(context): """Export site configuration. """ site = context.getSite() exporter = queryMultiAdapter((site, context), IBody) if exporter: body = exporter.body if body is not None: context.writeDataFile(_PATH+'.xml', body, exporter.mime_type) for sub in site.objectValues(): if ISetupTool.providedBy(sub): continue exportObjects(sub, _PATH+'/', context)
def importSite(context): """Import site configuration. """ site = context.getSite() importer = queryMultiAdapter((site, context), IBody) if importer: body = context.readDataFile(_PATH+'.xml') if body is not None: importer.body = body for sub in site.objectValues(): if ISetupTool.providedBy(sub): continue importObjects(sub, _PATH+'/', context)
def exportSite(context): """Export site configuration. """ site = context.getSite() exporter = queryMultiAdapter((site, context), IBody) if exporter: body = exporter.body if body is not None: context.writeDataFile(_PATH + '.xml', body, exporter.mime_type) for sub in site.objectValues(): if ISetupTool.providedBy(sub): continue exportObjects(sub, _PATH + '/', context)
def importSite(context): """Import site configuration. """ site = context.getSite() importer = queryMultiAdapter((site, context), IBody) if importer: body = context.readDataFile(_PATH + '.xml') if body is not None: importer.body = body for sub in site.objectValues(): if ISetupTool.providedBy(sub): continue importObjects(sub, _PATH + '/', context)
def _mustPreserve(self): return [ x for x in self.context.objectItems() if ISetupTool.providedBy(x[1]) ]
def _purgeObjects(self): for obj_id, obj in self.context.objectItems(): if ISetupTool.providedBy(obj): continue self.context._delObject(obj_id)
def _exportSimpleNode(self): """Export the object as a DOM node. """ if ISetupTool.providedBy(self.context): return None return self._getObjectNode('object', False)
def _mustPreserve(self): return [x for x in self.context.objectItems() if ISetupTool.providedBy(x[1])]