Back to index

plone3  3.1.7
Classes | Functions | Variables
CMFPlone.exportimport.propertiestool Namespace Reference

Classes

class  SimpleItemWithPropertiesXMLAdapter
class  PlonePropertiesToolXMLAdapter

Functions

def importPloneProperties
def exportPloneProperties

Variables

string _FILENAME = 'propertiestool.xml'
tuple insert_before = child.getAttribute('insert-before')
 Original _initObjects code: meta_type = str(child.getAttribute('meta_type')) for mt_info in Products.meta_types: if mt_info['name'] == meta_type: parent._setObject(obj_id, mt_info['instance'](obj_id)) break else: raise ValueError('unknown meta_type \'s\'' % obj_id)
tuple position = parent.getObjectPosition(insert_before)
tuple insert_after = child.getAttribute('insert-after')
tuple obj = getattr(self.context, obj_id)
tuple importer = zapi.queryMultiAdapter((obj, self.environ), INode)

Detailed Description

Plone Properties tool setup handlers.

$Id:$

Function Documentation

Export plone properties tool.

Definition at line 40 of file propertiestool.py.

00040 
00041 def exportPloneProperties(context):
00042     """ Export plone properties tool.
00043     """
00044     site = context.getSite()
00045     logger = context.getLogger('propertiestool')
00046     ptool = getToolByName(site, 'portal_properties', None)
00047     if ptool is None:
00048         logger.info('Nothing to export.')
00049         return
00050 
00051     exporter = zapi.queryMultiAdapter((ptool, context), IBody)
00052     #IBody(ptool)
00053     if exporter is None:
00054         logger.warning('Export adapter missing.')
00055         return
00056 
00057     context.writeDataFile(_FILENAME, exporter.body, exporter.mime_type)
00058     logger.info('Properties tool exported.')

Here is the call graph for this function:

Import plone properties tool.

Definition at line 20 of file propertiestool.py.

00020 
00021 def importPloneProperties(context):
00022     """ Import plone properties tool.
00023     """
00024     site = context.getSite()
00025     logger = context.getLogger('propertiestool')
00026     ptool = getToolByName(site, 'portal_properties')
00027 
00028     body = context.readDataFile(_FILENAME)
00029     if body is None:
00030         logger.info('Nothing to import.')
00031         return
00032 
00033     importer = zapi.queryMultiAdapter((ptool, context), IBody)
00034     if importer is None:
00035         logger.warning('Import adapter missing.')
00036         return
00037 
00038     importer.body = body
00039     logger.info('Properties tool imported.')

Here is the call graph for this function:


Variable Documentation

string CMFPlone.exportimport.propertiestool._FILENAME = 'propertiestool.xml'

Definition at line 18 of file propertiestool.py.

tuple CMFPlone.exportimport.propertiestool.importer = zapi.queryMultiAdapter((obj, self.environ), INode)

Definition at line 152 of file propertiestool.py.

tuple CMFPlone.exportimport.propertiestool.insert_after = child.getAttribute('insert-after')

Definition at line 141 of file propertiestool.py.

tuple CMFPlone.exportimport.propertiestool.insert_before = child.getAttribute('insert-before')

Original _initObjects code: meta_type = str(child.getAttribute('meta_type')) for mt_info in Products.meta_types: if mt_info['name'] == meta_type: parent._setObject(obj_id, mt_info['instance'](obj_id)) break else: raise ValueError('unknown meta_type \'s\'' % obj_id)

Definition at line 131 of file propertiestool.py.

tuple CMFPlone.exportimport.propertiestool.obj = getattr(self.context, obj_id)

Definition at line 151 of file propertiestool.py.

Definition at line 136 of file propertiestool.py.