Exemple #1
0
 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
Exemple #2
0
 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
            )
Exemple #4
0
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)
Exemple #5
0
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)
Exemple #6
0
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)
Exemple #7
0
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)
Exemple #8
0
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)
Exemple #9
0
 def _mustPreserve(self):
     return [
         x for x in self.context.objectItems()
         if ISetupTool.providedBy(x[1])
     ]
Exemple #10
0
 def _purgeObjects(self):
     for obj_id, obj in self.context.objectItems():
         if ISetupTool.providedBy(obj):
             continue
         self.context._delObject(obj_id)
Exemple #11
0
 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])]
Exemple #13
0
 def _purgeObjects(self):
     for obj_id, obj in self.context.objectItems():
         if ISetupTool.providedBy(obj):
             continue
         self.context._delObject(obj_id)
Exemple #14
0
 def _exportSimpleNode(self):
     """Export the object as a DOM node.
     """
     if ISetupTool.providedBy(self.context):
         return None
     return self._getObjectNode('object', False)