Back to index

plone3  3.1.7
Functions
Marshall.Extensions.export Namespace Reference

Functions

def export

Function Documentation

Definition at line 3 of file export.py.

00003 
00004 def export(self):
00005     ct = getToolByName(self, 'portal_catalog')
00006     ut = getToolByName(self, 'portal_url')
00007     mt = getToolByName(self, 'marshaller_registry')
00008     paths = []
00009     for pt in ('News Item', 'Link', 'Document', 'Image', 'File'):
00010         for r in ct(portal_type=pt):
00011             paths.append(ut.getRelativeUrl(r.getObject()))
00012 
00013     response = self.REQUEST.RESPONSE
00014     response.setHeader('content-type', 'application/octet-stream')
00015     response.setHeader('content-disposition', 'attachment; filename=export.zip')
00016     data = mt.export(self, paths).read()
00017     response.setHeader('content-length', len(data))
00018     return response.write(data)

Here is the call graph for this function:

Here is the caller graph for this function: