Back to index

plone3  3.1.7
Classes | Functions | Variables
CMFCore.exportimport.properties Namespace Reference

Classes

class  PropertiesXMLAdapter

Functions

def importSiteProperties
def exportSiteProperties

Variables

string _FILENAME = 'properties.xml'

Function Documentation

Export site properties as an XML file.

Definition at line 88 of file properties.py.

00088 
00089 def exportSiteProperties(context):
00090     """ Export site properties as an XML file.
00091     """
00092     site = context.getSite()
00093     logger = context.getLogger('properties')
00094 
00095     exporter = queryMultiAdapter((site, context), IBody)
00096     if exporter is None:
00097         logger.warning('Export adapter missing.')
00098         return
00099 
00100     context.writeDataFile(_FILENAME, exporter.body, exporter.mime_type)

Here is the caller graph for this function:

Import site properties from an XML file.

Definition at line 70 of file properties.py.

00070 
00071 def importSiteProperties(context):
00072     """ Import site properties from an XML file.
00073     """
00074     site = context.getSite()
00075     logger = context.getLogger('properties')
00076 
00077     body = context.readDataFile(_FILENAME)
00078     if body is None:
00079         logger.info('Nothing to import.')
00080         return
00081 
00082     importer = queryMultiAdapter((site, context), IBody)
00083     if importer is None:
00084         logger.warning('Import adapter missing.')
00085         return
00086 
00087     importer.body = body

Here is the caller graph for this function:


Variable Documentation

string CMFCore.exportimport.properties._FILENAME = 'properties.xml'

Definition at line 28 of file properties.py.