Commit 826c3185 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_prototype: Add export for business package

parent 3775faeb
...@@ -266,7 +266,7 @@ class TemplateTool (BaseTool): ...@@ -266,7 +266,7 @@ class TemplateTool (BaseTool):
return REQUEST.RESPONSE.redirect( ret_url ) return REQUEST.RESPONSE.redirect( ret_url )
security.declareProtected( 'Import/Export objects', 'export' ) security.declareProtected( 'Import/Export objects', 'export' )
def export(self, business_template, REQUEST=None, RESPONSE=None): def export(self, business_template, REQUEST=None, RESPONSE=None, isPackage=False):
""" """
Export the Business Template as a bt5 file and offer the user to Export the Business Template as a bt5 file and offer the user to
download it. download it.
...@@ -275,8 +275,12 @@ class TemplateTool (BaseTool): ...@@ -275,8 +275,12 @@ class TemplateTool (BaseTool):
try: try:
if RESPONSE is not None: if RESPONSE is not None:
RESPONSE.setHeader('Content-type','tar/x-gzip') RESPONSE.setHeader('Content-type','tar/x-gzip')
if not isPackage:
RESPONSE.setHeader('Content-Disposition', 'inline;filename=%s-%s.bt5' RESPONSE.setHeader('Content-Disposition', 'inline;filename=%s-%s.bt5'
% (business_template.getTitle(), business_template.getVersion())) % (business_template.getTitle(), business_template.getVersion()))
else:
RESPONSE.setHeader('Content-Disposition', 'inline;filename=%s.bp5'
% business_template.getTitle())
return export_string.getvalue() return export_string.getvalue()
finally: finally:
export_string.close() export_string.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment