Example #1
0
 def export(self, export_context, subdir, root=False):
     """ See IFilesystemExporter.
     """
     FolderishExporterImporter.export(self, export_context, subdir, root)
     template = PageTemplateResource("xml/%s" % self._FILENAME, globals()).__of__(self.context)
     export_context.writeDataFile(
         "%s/criteria.xml" % self.context.getId(), template(info=self._getExportInfo()), "text/xml", subdir
     )
Example #2
0
 def export(self, export_context, subdir, root=False):
     """ See IFilesystemExporter.
     """
     FolderishExporterImporter.export(self, export_context, subdir, root)
     template = PageTemplateResource('xml/%s' % self._FILENAME,
                                     globals()).__of__(self.context)
     export_context.writeDataFile('%s/criteria.xml' % self.context.getId(),
                                  template(info=self._getExportInfo()),
                                  'text/xml',
                                  subdir,
                                 )
Example #3
0
 def listExportableItems(self):
     """ See IFilesystemExporter.
     """
     criteria_metatypes = self.context._criteria_metatype_ids()
     return [
         x for x in FolderishExporterImporter.listExportableItems(self) if x[1].meta_type not in criteria_metatypes
     ]
Example #4
0
    def import_(self, import_context, subdir, root=False):
        """ See IFilesystemImporter
        """
        FolderishExporterImporter.import_(self, import_context, subdir, root)

        self.encoding = import_context.getEncoding()

        if import_context.shouldPurge():
            self._purgeContext()

        data = import_context.readDataFile("%s/criteria.xml" % self.context.getId(), subdir)

        if data is not None:
            dom = parseString(data)
            root = dom.firstChild
            assert root.tagName == self._ROOT_TAGNAME
            self._updateFromDOM(root)
Example #5
0
 def listExportableItems(self):
     """ See IFilesystemExporter.
     """
     criteria_metatypes = self.context._criteria_metatype_ids()
     return [
         x for x in FolderishExporterImporter.listExportableItems(self)
         if x[1].meta_type not in criteria_metatypes
     ]
Example #6
0
    def import_(self, import_context, subdir, root=False):
        """ See IFilesystemImporter
        """
        FolderishExporterImporter.import_(self, import_context, subdir, root)

        self.encoding = import_context.getEncoding()

        if import_context.shouldPurge():
            self._purgeContext()

        data = import_context.readDataFile(
            '%s/criteria.xml' % self.context.getId(), subdir)

        if data is not None:
            dom = parseString(data)
            root = dom.firstChild
            assert root.tagName == self._ROOT_TAGNAME
            self._updateFromDOM(root)
 def import_(self, import_context, subdir, root=False):
     """ See IFilesystemImporter.
     """
     FolderishExporterImporter.import_(self, import_context, subdir, root)
 def export(self, export_context, subdir, root=False):
     """ See IFilesystemExporter.
     """
     FolderishExporterImporter.export(self, export_context, subdir, root)
Example #9
0
 def import_(self, import_context, subdir, root=False):
     """ See IFilesystemImporter.
     """
     FolderishExporterImporter.import_(self, import_context, subdir, root)
Example #10
0
 def export(self, export_context, subdir, root=False):
     """ See IFilesystemExporter.
     """
     FolderishExporterImporter.export(self, export_context, subdir, root)
Example #11
0
 def _mustPreserve(self):
     context = self.context
     keepers = FolderishExporterImporter._mustPreserve(self)
     keepers.extend(context.objectItems(context._criteria_metatype_ids()))
     return keepers