Back to index

plone3  3.1.7
Classes | Functions | Variables
plone.app.portlets.exportimport.portlets Namespace Reference

Classes

class  Blacklist
class  PropertyPortletAssignmentExportImportHandler
class  PortletsXMLAdapter

Functions

def dummyGetId
def importPortlets
def exportPortlets

Variables

 HAS_BLACKLIST = True

Function Documentation

Definition at line 49 of file portlets.py.

00049 
00050 def dummyGetId():
00051     return ''

Export portlet managers and portlets

Definition at line 709 of file portlets.py.

00709 
00710 def exportPortlets(context):
00711     """Export portlet managers and portlets
00712     """
00713     sm = getSiteManager(context.getSite())
00714     if sm is None or not IComponentRegistry.providedBy(sm):
00715         logger = context.getLogger('portlets')
00716         logger.info("Nothing to export.")
00717         return
00718 
00719     # This code was taken from GenericSetup.utils.import.exportObjects
00720     # and slightly simplified. The main difference is the lookup of a named
00721     # adapter to make it possible to have more than one handler for the same
00722     # object, which in case of a component registry is crucial.
00723     exporter = queryMultiAdapter((sm, context), IBody, name=u'plone.portlets')
00724     if exporter:
00725         filename = '%s%s' % (exporter.name, exporter.suffix)
00726         body = exporter.body
00727         if body is not None:
00728             context.writeDataFile(filename, body, exporter.mime_type)
Import portlet managers and portlets

Definition at line 688 of file portlets.py.

00688 
00689 def importPortlets(context):
00690     """Import portlet managers and portlets
00691     """
00692     sm = getSiteManager(context.getSite())
00693     if sm is None or not IComponentRegistry.providedBy(sm):
00694         logger = context.getLogger('portlets')
00695         logger.info("Can not register components - no site manager found.")
00696         return
00697 
00698     # This code was taken from GenericSetup.utils.import.importObjects
00699     # and slightly simplified. The main difference is the lookup of a named
00700     # adapter to make it possible to have more than one handler for the same
00701     # object, which in case of a component registry is crucial.
00702     importer = queryMultiAdapter((sm, context), IBody, name=u'plone.portlets')
00703     if importer:
00704         filename = '%s%s' % (importer.name, importer.suffix)
00705         body = context.readDataFile(filename)
00706         if body is not None:
00707             importer.filename = filename # for error reporting
00708             importer.body = body

Here is the caller graph for this function:


Variable Documentation

Definition at line 52 of file portlets.py.